CN112000358B - Upgrading method of charging pile and intelligent charging pile - Google Patents
- ️Fri May 03 2024
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The application provides an upgrading method of a charging pile. It should be noted that the upgrading method of the charging pile provided by the application is applied to any kind of charging pile.
In addition, the upgrade method of the charging pile provided by the application does not limit the execution main body. Optionally, the execution main body of the upgrade method of the charging pile provided by the application can be an intelligent charging pile. Specifically, the execution body may specifically be a charging pile controller in the intelligent charging pile. And the charging pile controller comprises a control chip and a Flash memory. The Flash memory comprises a Bootloader area, a Backup area (Backup area), an application area (App area) and a Keyword area (Keyword area).
As shown in fig. 1, in an embodiment of the present application, the method for upgrading a charging pile includes the following steps S100 to S500:
And S100, when the application program runs, checking the current version number of the charging pile and the latest version number of the charging pile stored on the server, and judging whether the charging pile needs to be upgraded or not.
And S200, if the charging pile is confirmed to need upgrading, an upgrading start message is sent to the server.
S300, receiving the data to be upgraded sent by the server frame by frame. And further writing the data to be upgraded into a backup area of the Flash memory frame by frame.
S400, writing the data to be upgraded in the backup area of the Flash memory into the application area of the Flash memory frame by frame, and sending an upgrade completion message to the server.
S500, starting an application program by calling data in the application area.
Specifically, the execution main body of the step S100 to the step S500 is a charging pile, specifically a charging pile controller in the charging pile. The charging pile can be in communication connection with an intelligent cabin of the electric automobile through Bluetooth, and the intelligent cabin of the electric automobile is in communication connection with the server through a 4G/5G network. All messages and data sent to the server by the charging pile are transmitted to the intelligent cabin of the electric automobile in a Bluetooth communication mode, and the intelligent cabin of the electric automobile is transmitted to the server through a 4G/5G network. Otherwise, all messages and data sent by the server to the charging pile are also the same. The data is transmitted in a transparent transmission mode without changing the content of the data.
In this embodiment, the charging pile controller of the charging pile automatically and sequentially executes the checking of the version number of the charging pile, receives the data to be upgraded transmitted from the server frame by frame, and writes the data into the application area of the Flash memory of the charging pile controller, and finally completes the whole automatic upgrading step, so that the automatic upgrading device does not need manpower maintenance, is fast and convenient to upgrade, and does not have the situation of upgrading errors.
In an embodiment of the present application, in the step S200, before the upgrade start message is sent to the server, the step S200 further includes the following steps S210 to S230:
s210, resetting the current time value recorded by the window time calculator to 0.
Specifically, the window time calculator is set to monitor the length of time of the entire upgrade process. If the upgrade time is too long, the normal running process of the vehicle is disturbed. The step resets the current time value to 0, i.e. starts to count the upgrade.
S220, erasing the data in the backup area and creating the current transmission frame number.
Specifically, the current transmission frame number is the frame number of the frame data to be currently transmitted. For stability of data transmission, the server splits the upgrade data into individual frame data, and sends the individual frame data to the charging pile (of course, the upgrade data is firstly transmitted to the charging pile through the intelligent cabin of the electric vehicle, and then the upgrade data is transmitted to the charging pile through the intelligent cabin, and once the data or message transmission forms of the server and the charging pile are all the rule, the rule is omitted.
Thus, creating the current transmission frame number is advantageous in that it facilitates the server and the charging pile to know which frame data is currently required to be transmitted, and which frame data is being transmitted.
The Flash memory of the charging pile controller is provided with an application area, and an application area upgrading module is arranged in the application area. In this step, the application area upgrade module erases the data in the backup area and creates the current transmission frame number.
S230, giving an initial transmission frame number value to the current transmission frame number.
Specifically, the initial transmission frame number value may be 0. The initial transmission frame number value may be 1. To conform to programming habits of a computer language, the initial transmission frame number value is typically set to 0.
And sending an upgrade starting message at the charging pile controller, and transmitting the upgrade starting message to the server through the electric automobile. After the server receives the upgrade start message, the server performs identity verification on the application area upgrade module of the charging pile, and judges whether the identity verification is passed or not. The application area upgrading module is an upgrading module arranged in the application area.
If the identity verification is passed, the server determines that the application area upgrading module has upgrading authority, and the server sends data to be upgraded to the charging pile frame by frame. If the authentication is not passed, the server terminates the subsequent steps.
In this embodiment, the current time value recorded by the window time calculator is reset, so that the upgrade time of the whole upgrade process can be monitored. By setting the current transmission frame number and the initial transmission frame number value, the server and the charging pile are beneficial to know which frame data is required to be transmitted currently and which frame data is being transmitted.
In an embodiment of the present application, the steps include the following steps S310 to S370:
s310, a data transmission request of frame data corresponding to the current transmission frame number is transmitted to the server.
Specifically, it has been mentioned that the initial transmission frame number may be 0 or 1. For convenience of description, in the present embodiment and the subsequent embodiments, the initial transmission frame number value is set to 1, and description will not be repeated. For example, if the initial transmission frame number is 1, i.e., the current transmission frame number is 1, the application area upgrade module transmits a data transmission request of the 1 st frame data to the server.
S320, receiving the frame data corresponding to the current transmission frame number, performing CRC16 check on the frame data corresponding to the current transmission frame number, and judging whether the frame data corresponding to the current transmission frame number passes the CRC16 check.
Specifically, in the embodiment in which the initial transmission frame number is 1, after receiving the data transmission request of the 1 st frame data, the server may split the upgrade data into individual frame data. Further, the server transmits the 1 st frame data to the charging pile. The application area upgrading module receives the 1 st frame data and performs CRC16 check on the 1 st frame data.
And S331, if the frame data corresponding to the current transmission frame number passes the CRC16 check, writing the frame data corresponding to the current transmission frame number into the backup area.
Specifically, in the embodiment with the initial transmission frame number 1, the application area upgrade module writes the 1 st frame data into the backup area.
S340, after the writing of the frame data corresponding to the current transmission frame number is completed, the frame data corresponding to the current transmission frame number written in the backup area is read. Further, it is compared whether or not the frame data corresponding to the current transmission frame number, which has been written in the backup area, and the frame data corresponding to the current transmission frame number received from the server are identical.
Specifically, this step is to prevent the frame data from being written in error, or from being wrong in the writing process.
S351, if the frame data corresponding to the current transmission frame number is consistent with the current transmission frame number, the frame data is successfully written, and whether the current transmission frame number is equal to the maximum transmission frame number is further judged.
Specifically, when splitting the upgrade data into a plurality of frame data, the server automatically numbers the plurality of frame data, for example, 1,2,3. E.g. the maximum transmission frame number is 10 out of all frame data, then a total of 10 frame data is represented.
The step S300 further includes:
if the two are inconsistent, it is determined that the writing of the frame data corresponding to the current transmission frame number fails, and the frame data needs to be rewritten, and the step S220 is returned.
And S361, if the current transmission frame number is equal to the maximum transmission frame number, determining that the data to be upgraded is completely written, and performing integrity detection on all the written data in the backup area.
Specifically, if the current transmission frame number is equal to the maximum transmission frame number, the current transmission frame number is the last frame data, and all the data to be updated are completely written. Further, integrity checking is performed on all data written in the backup area.
And S370, after the integrity detection of all the written data in the backup area is qualified, executing the following step S400.
Specifically, when it is determined that the frame data writing corresponding to the current transmission frame number is successful, the entire step S300 ends, and the subsequent step S400 is performed.
In this embodiment, for the frame data corresponding to the current transmission frame number, by checking before writing the data and checking after writing the data, it is ensured that each frame data can be correctly written into the backup area. After all frame data are written, the integrity detection is carried out on the whole written data in the backup area, so that the integrity detection is carried out on the whole frame data.
In an embodiment of the present application, after the step S351, the step 300 further includes the following steps S362 to S383:
s362, if the current transmission frame number is not equal to the maximum frame number, determining that the data to be upgraded is not completely written. Further, the current time value recorded by the window time calculator is read.
Specifically, if the current transmission frame number is not equal to the maximum transmission frame number, it indicates that the currently transmitted frame data is not the last frame data, and all the data to be updated are not completely written, so that the next frame data needs to be written.
At this time, due to the limitation of the upgrade time, the current time value recorded by the window time calculator is read at this time to determine whether the upgrade is overtime.
S381, judging whether the current time value is smaller than a preset time threshold.
Specifically, the application area upgrade module is provided with a preset time threshold. The preset time threshold may be three times the total time of data transmission. For example, the data transmission speed of the frame data is 10K/S, the total size of all frame data is 1M, then it takes approximately 5 minutes for transmission to be completed, and then the preset time threshold is set to 15 minutes.
The purpose of this step S381 is to determine if the upgrade has timed out.
And S382, if the current time value is smaller than the preset time threshold value, adding 1 to the value of the current transmission frame number, returning to the step S310, and continuing to receive the next frame data.
Specifically, for example, if the current time value is 1 minute and is less than the preset time threshold value for 15 minutes, it indicates that there is no timeout, the value of the current transmission frame number is added by 1, and the step S310 is returned to continue to receive the next frame data. The value of the current transmission frame number is here increased by 1 in order to enable orderly transmission of frame data in 1,2,3,4,5.
For example, the current transmission frame number is 1, and then the next frame data is the 2 nd frame data.
S383, if the current time value is greater than or equal to the preset time threshold, determining that the data transmission is overtime, sending an upgrade failure message to the server, and executing the step S500.
Specifically, the foregoing also mentions that if the data transmission is overtime, the charging pile controller directly terminates the subsequent upgrading process and directly starts the application program, so as to avoid interference to the normal running process of the vehicle.
In this embodiment, when all frame data are not completely written, after one frame data is written into the backup area, the next frame data is sequentially transmitted by adding 1 to the value of the current transmission frame number. In addition, the interference to the normal running process of the vehicle is avoided through the monitoring of the upgrading time.
In an embodiment of the present application, the step 361 includes the following steps S361 to S361a to S361e:
S361a, dividing all data in the backup area into a first portion and a second portion. The first portion is the last 4 bytes of all data in the backup area. The second portion is the data remaining from the last 4 bytes.
S361b, reading the data of the second part, and performing CRC32 check on the data of the second part to obtain an integrity check value.
And S361c, reading the data of the first part, comparing the data of the first part with the integrity check value, and judging whether the data of the first part is consistent with the integrity check value.
And S361d, if the data of the first part is consistent with the integrity check value, determining that the integrity detection of all the written data in the backup area is qualified, and executing the step S370.
S361e, if the data of the first portion and the integrity check value are not consistent, returning to the step S220.
Specifically, steps S361a to S361e are one way of detecting the integrity of the data.
The embodiment can realize accurate data integrity detection on all data of the backup area.
In an embodiment of the present application, in the step S370, before the step S400 is performed, the step S370 further includes the following steps S371 to S378:
S371, erasing all data of the key word area of the Flash memory.
Specifically, after the integrity check of all the data written in the backup area is qualified, the key writing process of steps S371 to S378 needs to be performed before the step S400 is performed.
S372, a preset first identification character is selected, and the first identification character is written in the first address of the keyword area.
Specifically, the first identification character needs to be preset. The first identification character may be 0xA55A. The first identification character may not be represented by simple data, such as 0x 0000 or 0xFFFF.
S373, the written first identification character is read, and whether the written first identification character is consistent with the preset first identification character is judged.
Specifically, the step is consistent with the function of consistency check after writing of the frame data, so as to judge whether the first identification character has a wrong writing.
S374, if the written first identification character is inconsistent with the preset first identification character, determining that the first identification character is not successfully written, and returning to the step S371.
Specifically, if they are inconsistent, it indicates that the first identification character may be wrongly written, and the procedure returns to step S371 for overwriting.
S375, if the written first identification character is consistent with the preset first identification character, determining that the first identification character is successfully written, and resetting the charging pile controller.
Specifically, if the first identification characters are consistent, the first identification characters are indicated to be free from writing errors, and the charging pile controller is reset.
S376, the application program is started from the Bootloader area, detects the keywords in the keyword area, and judges whether the keywords in the keyword area are the first identifiers.
Specifically, the Bootloader area is started by retrieving data in the Bootloader area of the Flash memory to detect keywords in the keyword area. The data in the Bootloader area refers to the program code burned in the Bootloader area, and when the data is called, a detection program can be triggered to detect whether the keyword in the keyword area is the first identifier. The function of this step is to detect whether the first identifier is present after resetting the charging pile controller.
And S377, if the keyword in the keyword area is the first identifier, executing the following step S400.
Specifically, if the keyword in the keyword area is the first identifier, indicating that the first identifier exists, the following step S400 is executed.
S378, if the keyword in the keyword area is not the first identifier, the step S500 is executed.
Specifically, if the keyword in the keyword area is not the first identifier, it indicates that the first identifier does not exist, and the application program may be directly started.
In this embodiment, the first identifier is written in the key word area of the Flash memory, so that the update of the frame data in the backup area is recorded.
In an embodiment of the present application, in the step S375, before resetting the charging pile controller, the step S375 further includes the following steps S375a to S375c:
s375a, acquiring the charging state of the current charging pile, and judging whether the charging pile is in the charging state.
And S375b, if the charging pile is not in a charging state, executing a step of resetting the charging pile controller.
And S375c, if the charging pile is in a charging state, returning to the step S375a until the charging is finished.
Specifically, after the frame data has been written in the backup area, in the non-charging mode, a reset of the charging pile controller can be requested, and the subsequent step S400 is performed.
In this embodiment, by this way, the charging pile can normally charge the electric vehicle when the backup area writes frame data in asynchronous operation, and the charging pile cannot be charged when the updated backup area writes frame data without disturbing the normal charging operation of the charging pile, i.e. when the application program is updated in step S400.
In an embodiment of the present application, the step S400 includes the following steps S410 to S470:
and S410, erasing all data of the application area, and creating a current migration frame number.
S420, giving an initial transmission frame number value to the current migration frame number.
Specifically, in the present embodiment, steps S410 to S470 are the process of writing all frame data in the backup area into the application area, and the execution subject is the control chip. To make the distinction, a "current migration frame number" is created. Since the frame data of the backup area is copied to the application area, all the migration frame numbers are equal in value to all the transmission frame numbers. The principles of steps S410 to S420 are the same as those of steps S220 to S230, and are not repeated here.
S430, reading frame data corresponding to the current migration frame number in the backup area, and writing the frame data corresponding to the current migration frame number into the application area.
S440, after the frame data corresponding to the current migration frame number is written, the written frame data corresponding to the current migration frame number in the application area is read. Further, it is compared whether the frame data corresponding to the current migration frame number, which has been written in the application area, and the frame data corresponding to the current migration frame number, which has been read from the backup area, are identical.
S451, if the two frame data are consistent, the frame data corresponding to the current migration frame number is determined to be successfully written, and whether the current migration frame number is equal to the maximum migration frame number is further determined.
S461, if the current migration frame number is equal to the maximum migration frame number, determining that all data in the backup area has been written into the application area. Further, integrity detection is performed on all data written in the application area.
S470, after the integrity detection of all the written data in the application area is qualified, executing the following step S500.
Specifically, the principles of steps S430 to S470 are the same as those of steps S331 to S370, except that the execution bodies of steps S331 to S370 are application area upgrade modules, and the execution bodies of steps S430 to S470 are control chips, which are not described herein.
In the step S461, the specific detection method for detecting the integrity of all the written data in the application area is consistent with the specific detection method for detecting the integrity of all the written data in the backup area in the steps S361a to S361e, or the last 4 bytes of all the data in the application area are taken first, the remaining data except the last 4 bytes are subjected to CRC32 calculation to obtain a check value, and the last 4 bytes are compared with the check value, if the two are consistent, it is indicated that all the written data in the application area has the integrity.
In this embodiment, for the frame data corresponding to the current migration frame number, by checking before writing the data and checking after writing the data, it is ensured that each frame data can be correctly written into the backup area. After all frame data are written, the integrity detection is carried out on the whole written data in the backup area, so that the integrity detection is carried out on the whole frame data.
In an embodiment of the present application, the step S400 further includes the following steps S462 to S483:
S462, if the current migration frame number is not equal to the maximum migration frame number, determining that all data of the backup area are not written into the application area, and reading the current time value recorded by the window time calculator.
S481, judging whether the current time value is smaller than the preset time threshold.
And S482, if the current time value is smaller than the preset time threshold value, adding 1 to the value of the current migration frame number, returning to the step S430, and continuing to read the next frame data.
And S483, if the current time value is greater than or equal to the preset time threshold, determining that the data transmission is overtime, sending an upgrade failure message to the server, and executing the step S500.
Specifically, the principles of steps S462 to S483 are identical to those of steps S362 to S383, and will not be described here.
In this embodiment, when all frame data are not completely written, after one frame data is written into the application area, the next frame data is sequentially transmitted by adding 1 to the value of the current migration frame number. In addition, the interference to the normal running process of the vehicle is avoided through the monitoring of the upgrading time.
In an embodiment of the present application, in the step S470, before the step S500 is performed, the step S470 further includes the following steps S471 to S473:
And S471, erasing all data of the key word area.
Specifically, it has been mentioned in the foregoing that the keyword stored in the keyword area should be the first identification character. In this step, the first identification character is erased.
S472, selecting a preset second identification character, writing the second identification character into the first address of the keyword area, and resetting the charging pile controller.
In particular, the second identification character may be represented by simple data, such as 0x0000 or 0xFFFF.
S473, the application program is started from the Bootloader area, detects the keywords in the keyword area, and judges whether the keywords in the keyword area are the first identifiers. .
And S474, if the keyword in the keyword area is the first identifier, returning to the step S471 to rewrite the second identification character.
Specifically, if the keyword in the keyword area is the first identifier, it indicates that the writing of the second identifier fails, and the step S471 is returned, where the second identifier is rewritten by the erasing keyword.
S475, if the keyword in the keyword area is not the first identifier, executing the following step S500.
Specifically, if the key is the second identifier, indicating that the upgrade has been completed, the application may be run, and the subsequent step S500 is performed.
The purpose of writing the second identifier in the key area is to erase the first identifier and to distinguish the written key from the first identifier.
Furthermore, in some special cases, the keywords in the keyword area may not be either the first identifier or the second identifier, but other identifiers, such as when the charging stake was just shipped or restored to a factory setting. At this time, as long as the keyword in the keyword area is not the first identifier, the subsequent step S500 may be directly performed to start the application.
In this embodiment, the second identifier is written in the key word area of the Flash memory, so that the update work of the frame data of the application area is recorded.
As shown in fig. 2, the present application also provides an intelligent charging stake 10.
In one embodiment of the present application, the smart charging post 10 includes a charging post controller 110 and a bluetooth communication module 120.
The charging pile controller 110 is configured to perform the method for upgrading the charging pile mentioned in any one of the foregoing embodiments. The bluetooth communication module 120 is in communication connection with the charging pile controller 110, and the bluetooth communication module 120 is used for communication connection with external devices or terminals.
The charging pile controller 110 includes a control chip 111 and a Flash memory 112. The Flash memory 112 includes a Bootloader area 112a, a backup area 112b, an application area 112c, and a keyword area 112d.
Specifically, the Bootloader area 112a, the backup area 112b, the application area 112c, and the key area 112d allocate respective storage space sizes according to a predetermined allocation rule. The storage spaces of the backup area 112b and the application area 112c are consistent, because all data of the backup area 112b is written into the application area 112c during the upgrade process of the charging pile, thereby avoiding data loss.
Alternatively, bootloader area 112a may allocate 50K of storage space, and backup area 112b and application area 112c may each match 1M of storage space. The key field 112d may match a 1K memory space. The memory space of the key area 112d is minimal because the key area 112d only needs to be written with an identifier, and does not occupy a large memory space.
The application further provides a remote upgrading system of the charging pile.
As shown in fig. 3, in an embodiment of the present application, the remote upgrade system for charging piles includes the intelligent charging piles 10, the electric vehicles 20 and the server 30 as mentioned in the previous embodiment.
Specifically, the vehicle-mounted system of the electric vehicle 20 is provided with a bluetooth communication module. The bluetooth communication module of the electric vehicle 20 and the bluetooth communication module 120 of the intelligent charging post 10 are in communication connection based on a bluetooth communication protocol.
The electric automobile 20 and the server 30 are both provided with a 4G/5G network communication module, and the electric automobile 20 and the server 30 are connected through the 4G/5G network communication module.
In this embodiment, the remote upgrading system of the charging pile effectively avoids the influence of unstable signals, interruption of remote signals, movement of the electric vehicle and the like when the remote automatic upgrading of the charging pile is remote, and avoids the situation that the online upgrading is unsuccessful and the intelligent charging pile 10 cannot work normally.
The technical features of the above embodiments may be combined arbitrarily, and the steps of the method are not limited to the execution sequence, so that all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description of the present specification.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.