Firmware downloading method based on multi-pile environment, charging pile and readable storage medium
By determining the download main node in the charging pile and using the LAN to download firmware, the problem of limited firmware download speed of the charging pile is solved, and a more efficient download process is achieved, which improves the overall download speed and resource utilization efficiency.
Patent Information
- Application Number
- CN202411331442.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-20
AI Technical Summary
The firmware download speed of existing charging piles is limited by the bandwidth of the download server, which is difficult to meet the needs of users.
A download main node is determined among multiple charging piles. The main node downloads the firmware upgrade package from the download server and generates a seed file. Other charging piles download the firmware upgrade package from the main node through the local area network to avoid occupying the bandwidth of the download server.
It improves the speed and efficiency of firmware download of charging piles, improves the overall download speed, and effectively utilizes the local area network resources inside the site.
Smart Images

Figure CN119166181A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of charging piles, and in particular to a firmware download method based on a multi-pile environment, a charging pile, and a readable storage medium. Background Art
[0002] As the new energy market continues to expand, new energy technologies are also developing rapidly. As one of the charging infrastructures, charging piles need to continuously upgrade their firmware to meet users' various needs for charging piles.
[0003] In the prior art, charging piles in a station need to download firmware update resources from a download server. However, due to cost considerations, the bandwidth of the download server is usually set relatively small, which makes it difficult to meet the download requests of all charging piles, resulting in limited firmware download speed for the charging piles. Summary of the invention
[0004] The embodiments of the present application aim to provide a firmware download method, a charging pile and a readable storage medium based on a multi-pile environment, so as to solve the technical problem of limited firmware download speed of the charging pile in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a firmware download method based on a multi-stake environment, comprising:
[0006] Determine one of the plurality of charging piles as a download master node, and determine the remaining charging piles as non-master nodes;
[0007] Control the download master node to download the firmware upgrade package;
[0008] The download master node generates a seed file according to the firmware upgrade package and broadcasts seed ready information;
[0009] The non-master node obtains the seed file in response to the seed ready information and downloads the firmware upgrade package according to the seed file.
[0010] Optionally, determining one of the plurality of charging piles as a download master node includes:
[0011] In response to the firmware download information sent by the system, each of the charging piles generates a campaign score according to a preset scoring rule and the charging pile information;
[0012] Each of the charging posts broadcasts campaign information including the campaign score;
[0013] In response to the campaign information, the charging pile with the highest campaign score is determined as the download master node.
[0014] Optionally, the charging pile responds to the campaign information and determines that the charging pile with the highest campaign score is the download master node, including:
[0015] Receive the campaign information broadcast by other charging stations;
[0016] Determine whether the campaign scores of other charging piles are higher than the campaign score of the charging pile;
[0017] If yes, the charging pile is determined as a non-master node;
[0018] If not, wait and continue to accept the campaign scores sent by other charging stations;
[0019] In response to the waiting time exceeding the preset winning threshold, the charging pile is determined to be the downloading master node and the winning information is broadcasted, and the other charging piles are determined to be non-master nodes in response to the winning information.
[0020] Optionally, before each charging pile generates a campaign score according to a preset scoring rule and the charging pile information in response to the firmware download information sent by the system, the method further includes:
[0021] Determine whether there is a seed file corresponding to the firmware upgrade package in a local area network including multiple charging piles;
[0022] If so, each charging pile directly obtains the seed file and downloads the firmware upgrade package according to the seed file;
[0023] If not present, each charging pile generates a campaign score according to preset scoring rules and charging pile information.
[0024] Optionally, controlling the download master node to download the firmware upgrade package includes:
[0025] Determine whether the data volume of the downloaded firmware package is greater than a preset value;
[0026] If it is greater than, the download master node determines at least one of the non-master nodes as a download assistant node according to the campaign score, and the download master node and the download assistant node jointly download the firmware upgrade package;
[0027] If it is less, the download master node downloads the firmware upgrade package alone.
[0028] Optionally, the downloading master node and the downloading assistant node jointly downloading the firmware upgrade package includes:
[0029] The download master node generates block information according to the summary information of the firmware upgrade package;
[0030] Allocate download tasks to the download master node and the download assistant node according to the block information;
[0031] The download master node and the download assistant node jointly download the firmware upgrade package according to the download task.
[0032] Optionally, the non-master node, in response to the seed ready information, obtaining a seed file and downloading the firmware upgrade package according to the seed file comprises:
[0033] The non-master node obtains the seed file in response to the seed ready information;
[0034] Determine, according to the seed file, the charging pile having the firmware upgrade package as the target charging pile;
[0035] The non-master node downloads the firmware upgrade package from the target charging pile.
[0036] Optionally, after the non-master node downloads the firmware upgrade package from the target charging pile, the method further includes:
[0037] The non-main node generates a seed file according to the firmware upgrade package;
[0038] The non-master node broadcasts sign-in information, where the sign-in information includes the seed file.
[0039] In a second aspect, an embodiment of the present application further provides a charging pile, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the charging pile implements the method described in the first aspect.
[0040] In a third aspect, an embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method described in the first aspect.
[0041] The embodiments of the present application can achieve the following technical effects: by determining one as the download master node among multiple charging piles, and then having the master node download the firmware upgrade package and then seed it, other charging piles can download the firmware update package within the multi-charging pile environment after obtaining the seed file. In this process, only the download master node downloads the firmware upgrade package from the download server, and the remaining charging piles do not need to occupy the bandwidth of the download server, thereby improving the download speed as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A schematic diagram of an application scenario of a firmware download method based on a multi-stake environment provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of a firmware download method based on a multi-stake environment provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of a seed file and a firmware upgrade package provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of a scenario for downloading a firmware upgrade package provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of a method flow for determining a download master node provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of a charging pile election downloading master node provided in an embodiment of the present application;
[0049] Figure 7 A schematic diagram of a process flow of a method for downloading a firmware upgrade package from a master node provided in an embodiment of the present application;
[0050] Figure 8 An interactive diagram of downloading a firmware upgrade package provided in an embodiment of the present application;
[0051] Fig. 9 A flowchart of a method for a non-master node to download a firmware upgrade package provided in an embodiment of the present application;
[0052] Fig.10 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0054] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0055] First, the application scenario of the firmware download method based on a multi-stake environment provided by an embodiment of the present application is introduced.
[0056] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of a firmware download method based on a multi-pile environment provided in an embodiment of the present application. The scenario includes multiple charging piles 10 and a download server 20. The charging pile 10 can establish a communication connection with the download server 20 to download a firmware upgrade package from the download server 20, thereby updating the firmware of the charging pile 10.
[0057] The charging pile 10 is used to provide power to other electrical equipment such as new energy vehicles. Different charging piles 10 are connected through the local area network communication within the station, so that different charging piles 10 can easily and quickly transmit information to each other through the local area network. All charging piles 10 communicate with the external download server 20 through the unified gateway of the station, and the charging pile 10 can request the download server 20 to download the firmware upgrade package through the gateway.
[0058] The firmware upgrade package is used to upgrade the firmware version built into the charging pile 10. Firmware is defined as a driver program stored inside the charging pile. The charging pile 10 uses the firmware to perform actions according to set standards to achieve its assigned functions. Specifically in the embodiment, the firmware can be a program written in an EPROM (erasable programmable read-only memory) or an EEPROM (electrically erasable programmable read-only memory). When the firmware in the charging pile 10 is upgraded and updated, the charging pile 10 can perform new or optimized actions according to the upgraded firmware to meet the user's functional requirements for the charging pile.
[0059] The download server 20 is used to provide the firmware upgrade package to the charging pile 10 for download. Specifically, the data transmission between the download server 20 and the charging pile 10 is realized through the HTTP protocol or the FTP protocol. It can be understood that the server 20 here can be a physical server or a logical server virtualized by multiple physical servers. The server 20 can also be a server group composed of multiple servers that can communicate with each other, and each functional module can be distributed on each server in the server group.
[0060] Based on the charging pile 10 in the application scenario introduced above, the firmware download method based on a multi-pile environment provided in an embodiment of the present application is described below.
[0061] See also Figure 2 , Figure 2 A schematic diagram of a firmware download method based on a multi-stake environment provided in an embodiment of the present application specifically includes the following steps:
[0062] S21. Determine one charging pile as a download master node among multiple charging piles, and determine the remaining charging piles as non-master nodes.
[0063] In this step, the download master node communicates with the download server through the gateway of the station to download the firmware upgrade package from the download server and perform the initial first seeding of the firmware upgrade package. Specifically, each charging pile selects the download master node through election. Compared with the non-master node, the download master node has relatively good communication quality. Therefore, the master node downloads the firmware upgrade package from the download server on behalf of all charging piles in the station, and then other charging piles obtain the seed file from the master node through the local area network inside the station to download the firmware upgrade package. During the download process, for the download server, it only needs to provide the download resources of the firmware upgrade package to one charging pile (i.e., the download master node) to relieve the bandwidth pressure; on the other hand, for all charging piles, the local area network resources inside the station can be fully utilized, so that the idle local area network bandwidth is effectively utilized.
[0064] In this step, the non-master node is relatively determined after the charging pile elects the master node, that is, the charging piles that have not successfully elected the download master node are determined as non-master nodes. Specifically, the non-master node needs to wait for the download master node to download the firmware upgrade package and seed it, then obtain the seed file and then download the firmware upgrade package according to the seed file. After downloading the firmware upgrade package, the non-master node can also seed accordingly to provide download resources for the firmware upgrade package for other non-master nodes that have not yet downloaded, thereby further improving the download rate and the utilization efficiency of the local area network as a whole. In some embodiments, if the master node temporarily loses its communication capability, a new charging pile can be selected from the remaining non-master nodes as the download master node for functional replacement, that is, the download master node is not fixed.
[0065] In this step, the download master node and the non-master node are mainly determined by election. Specifically, the election method is mainly to compare the election scores between charging piles, and the election scores are determined according to the preset election rules to ensure that the election scores of the charging piles can more objectively reflect the external communication capabilities of the charging piles, so that the elected download master nodes have better download speed and download stability. More specific election rules are described in detail later and will not be introduced here.
[0066] S22, controlling the download master node to download the firmware upgrade package.
[0067] In this step, the download master node first establishes a communication connection with the download server, and then transmits the firmware upgrade package through the FTP or HTTP protocol. Specifically, another server such as an ACMP server or an OCPP server first sends a firmware update instruction to the charging pile station, and the charging pile station determines the download master node in response to the instruction, and then the download master node requests the download server to download the firmware upgrade package.
[0068] In this step, the firmware upgrade package is an update package for upgrading the charging pile firmware. It can be a full package or an incremental package, and there is no limitation on this. The firmware upgrade package producer puts the firmware upgrade package into the download server and notifies the station to download it through the server. Specifically, the firmware upgrade package includes summary information, which records some basic attributes of the firmware upgrade package. The download master node first downloads the summary information of the firmware upgrade package to determine whether the corresponding firmware upgrade package already exists in the local station. If so, the download process is terminated; otherwise, the download continues. In this way, it is easy to determine whether the firmware upgrade package needs to be downloaded through the summary information, avoiding traffic waste and storage redundancy of local files.
[0069] In this step, the firmware upgrade package is usually completed by the download master node alone, but in some embodiments, the firmware upgrade package, such as the full package, has a relatively large data volume, and the download efficiency of the download master node alone is low. In this case, the download master node can divide the firmware upgrade package into blocks, and call on several assisting download nodes to assign download tasks and jointly download the firmware upgrade package, thereby improving the download efficiency. The specific process is described in detail later and will not be introduced here.
[0070] S23. The download master node generates a seed file according to the firmware upgrade package and broadcasts seed-ready information.
[0071] In this step, the seed file is a file that stores metadata of each part of the firmware upgrade package and is used to index the main body data of each part of the firmware upgrade package. For example, the firmware upgrade package can be divided into several blocks, and the size of each block is one of 256, 512, and 1024KB. The seed file records the storage location of each block. For example, if the firmware upgrade package includes blocks A, B, C, and D, the corresponding blocks A, B, C, and D can be found in the download master node according to the seed file. Please refer to Figure 3 , Figure 3A schematic diagram of a seed file and a firmware upgrade package provided for an embodiment of the present application. If blocks A, B, C, and D are also stored in other non-master nodes A, B, C, and D, then other non-master nodes can also find blocks A, B, C, and D on non-master node A based on the seed file, and find blocks A, B, C, and D on non-master node B, and so on.
[0072] In this step, the seed-ready information is used to notify other non-master nodes so that they know the seed files owned by the master node and their corresponding firmware upgrade packages. When the firmware upgrade package is downloaded and the seed file is generated, the master node broadcasts the seed-ready information, and the remaining non-master nodes request the seed file from the download master node and download the firmware upgrade package based on the seed file. It should be noted that when the non-master node completes the download of the firmware upgrade package, it will report to the master node and add the resource information it owns to the seed file, so that other non-master nodes can download the firmware update package from themselves, share the download load, and increase the download rate.
[0073] S24. The non-master node obtains the seed file in response to the seed ready information and downloads the firmware upgrade package according to the seed file.
[0074] In this step, the non-master node obtains the seed file from the master node, obtains the storage status of each block information from the seed file, and then downloads the corresponding block from the corresponding node according to the storage status of each block. When all blocks are downloaded, the blocks are assembled to obtain the firmware upgrade package. For example, please refer to Figure 4 , Figure 4 A schematic diagram of a scenario for downloading a firmware upgrade package provided in an embodiment of the present application. Non-master node E obtains a seed file from download master node A, and determines based on the seed file that the firmware update package includes blocks A, B, C, and D, and in addition to download master node A, non-master nodes B, C, and D all have resources for the firmware update package. Then, based on the preset download rules, E obtains block A from A, and simultaneously obtains block B from B, block C from C, and block D from D, and finally obtains a complete firmware upgrade package. Similarly, for other subsequent non-master nodes that need to download firmware upgrade packages, the more nodes that point to the resources of the firmware upgrade package in the seed file, the more balanced the distribution of the download burden, and the higher the overall download speed.
[0075] It can be understood that after any non-master node completes downloading, it needs to add information that it has the firmware upgrade package in the seed file so that other non-master nodes can know this information, so that they can download the firmware upgrade package from themselves, improving the efficiency of LAN use. Therefore, every time a non-master node completes downloading, it needs to broadcast the signing information to the master node so that it can update the seed file.
[0076] In summary, the embodiment of the present application determines one as the download master node among multiple charging piles, and then the master node downloads the firmware upgrade package and then seeds it. After other charging piles obtain the seed file, they can download the firmware update package within the multi-charging pile environment. In this process, only the download master node downloads the firmware upgrade package from the download server, and the remaining charging piles do not need to occupy the bandwidth of the download server, thereby improving the download speed as a whole.
[0077] The following describes a method for determining a download master node in an embodiment of the present application.
[0078] See also Figure 5 , Figure 5 A schematic flow chart of a method for determining a download master node provided in an embodiment of the present application specifically includes the following steps:
[0079] S51 . In response to the firmware download information sent by the system, each charging pile generates a campaign score according to a preset scoring rule and the charging pile information.
[0080] S52: Each charging pile broadcasts campaign information including campaign scores.
[0081] S53: In response to the election information, determine the charging pile with the highest election score as the download master node.
[0082] In step S51, the system is a server outside the charging pile station, which is used to send firmware download information to inform the charging piles in the station that the firmware upgrade package can be downloaded. After the charging pile receives the firmware download information, a campaign score is generated. The influencing factors of the campaign score can be agreed upon by the scoring rules set in advance. For example, the items of the campaign score include the number of exit nodes of the charging pile, the quality of the network signal, the network type (for example, ETH / WIFI is preferred in the flow saving mode), the charging status of the pile, and the network location, etc. It can also be agreed that when the downloading master node is abnormally disconnected or powered off, other assisting downloading nodes will directly succeed the downloading master node. The weight of each campaign scoring item can be determined by a technician in this field according to the actual situation, and there is no limitation on this. Since all charging piles are subject to the same scoring rules, a relatively objective score is performed in combination with the charging pile's own information, so that the selected charging pile is more suitable for the function of external communication.
[0083] In step S52, after the charging pile generates the campaign score, it packages the campaign score with its own device ID and other information and broadcasts it, while receiving the campaign information broadcasted by other charging piles. Each charging pile can obtain multiple campaign information including its own to compare the campaign scores contained therein.
[0084] In step S53, determining the download master node specifically includes the following steps:
[0085] S531, receiving campaign information broadcasted by other charging piles;
[0086] S532, determining whether the election score of other charging piles is higher than the election score of the charging pile;
[0087] S533: If yes, determine the charging pile as a non-master node;
[0088] S534, if not, wait and continue to receive election information sent by other charging piles;
[0089] S535: In response to the waiting time exceeding the preset winning threshold, the charging pile is determined to be the downloading master node and broadcasts the winning information, and other charging piles are determined to be non-master nodes in response to the winning information.
[0090] See also Figure 6 , Figure 6 A schematic diagram of a charging pile election downloading master node provided in an embodiment of the present application. Specifically in the embodiment, when the charging pile receives the election information sent by other charging piles and compares their election scores with their own election scores, if their own election scores are lower, they can directly determine themselves as non-master nodes. If the charging pile receives the election information sent by other charging piles within a period of time, and the election scores of these charging piles are all lower than their own election scores, then after waiting for a certain winning threshold time (the time can be freely set), it announces itself as the downloading master node and broadcasts the winning information to the outside. After receiving the winning information, the other charging piles stop comparing the election scores and are automatically configured as non-master nodes. That is, all charging piles compare the election scores with each other, and the charging piles with lagging election scores set themselves as non-master nodes, while the charging piles with higher election scores keep leading and continue to receive election information until no new election information is received for a period of time, which means that the charging pile is already ahead of most other charging piles. As long as one of all the charging piles broadcasts the winning information, after determining the downloading master node, the remaining charging piles receiving the winning information will set themselves as non-master nodes.
[0091] In some embodiments, after the system sends the firmware download information, before the charging pile competes for the download master node, the charging pile also needs to determine whether there is a seed file corresponding to the firmware upgrade package in the local area network of the station. For example, if the system has sent download information for the same firmware upgrade package multiple times, the charging piles in the station only need to use the firmware upgrade package downloaded for the first time. When the firmware upgrade package is downloaded for the first time, the seed file of the firmware upgrade package has been stored in the local area network of the station, and all charging piles can directly download the firmware upgrade package based on the seed file without the need to compete for the download master node. If the seed file does not exist in the local area network, the charging pile continues to compete for the download master node, so that the determined download master node can make a seed file for use by other non-master nodes.
[0092] The following describes a method for determining to download a firmware upgrade package in an embodiment of the present application.
[0093] See also Figure 7 , Figure 7 A flowchart of a method for controlling a download master node to download a firmware upgrade package provided in an embodiment of the present application specifically includes the following steps:
[0094] S71, determining whether the data volume of the downloaded firmware package is greater than a preset value;
[0095] S72: If it is greater than, the download master node determines at least one non-master node as a download assistant node according to the election score, and the download master node and the download assistant node jointly download the firmware upgrade package;
[0096] S73. If it is less than, the download master node downloads the firmware upgrade package alone.
[0097] In step S71, if the data size of the firmware upgrade package is greater than a preset value, such as 10Mb, the efficiency of using the download master node to download the firmware upgrade package alone may be insufficient, and multiple download nodes are required to jointly download the firmware upgrade package, and the process proceeds to step S72. On the contrary, if the data size of the firmware upgrade package is less than the preset value, the efficiency of using the download master node to directly download the firmware upgrade package is relatively higher.
[0098] In step S72, the download assisting node is determined by the download master node according to the election score, and the size of the firmware upgrade package is divided into blocks, and the number of download assisting nodes is determined according to the block information generated after the block division. For example, the number of download assisting nodes is 3, the firmware upgrade package is 20Mb, and each 512Kb is a block. For details, please refer to Figure 8 , Figure 8 The interactive diagram of downloading a firmware upgrade package provided in an embodiment of the present application, the process of downloading the firmware upgrade package by the downloading master node and the downloading assisting node together includes:
[0099] S721. The download master node generates block information according to the summary information of the firmware upgrade package.
[0100] S722. Allocate download tasks to the download master node and the download assistant node according to the block information.
[0101] S723, the download master node and the download assistant node jointly download the firmware upgrade package according to the download task.
[0102] In step S721, when the download server supports block downloading, the download master node can divide the firmware upgrade package into several block files according to the summary information and generate block information. The block files can be restored together into the firmware upgrade package, and the block information is used to indicate the data of the corresponding firmware upgrade package. Specifically, the block information includes information such as task identification, block header, block address, and block size.
[0103] In step S722, the download master node generates download tasks according to the block information and distributes the download tasks, wherein some block information is downloaded by the download master node, and the remaining block information is downloaded by other download assistant nodes. For example, the firmware upgrade package includes five block information, A, B, C, D, and E. The download master node distributes the download tasks of block information A, B, and C to itself, and distributes the download tasks of block information D and E to the download assistant nodes.
[0104] In step S723, after the download task is assigned, the download master node and the download assisting node download together according to their assigned download tasks. During the download process, the assisting downloading node continuously reports the download speed and download progress to the download master node so that the download master node can optimize the allocation of download tasks. Whenever the assisting downloading node completes a block file, the download master node can assign a new download task to the assisting downloading node. At the same time, the download master node reads the block file and verifies its integrity to avoid the subsequent inability to use the firmware upgrade package due to damage or loss of the block file. Specifically in the embodiment, the MD5 algorithm can be used to verify the integrity of the file.
[0105] In some embodiments, if the download assisting node fails to download the block files or the download assisting node is disconnected (for example, it is disconnected from the downloading master node for more than 30 seconds), the downloading master node can kick out the download assisting node and decide whether to add a new download assisting node based on the download status of the firmware upgrade package. If the downloading master node is offline for more than a certain period of time (for example, the downloading master node is disconnected from the download server for more than 60 seconds), the downloading master node can be re-elected. If all downloading nodes in the site are disconnected, the download fails.
[0106] The following describes a method for a non-master node to download a firmware upgrade package in an embodiment of the present application.
[0107] See also Fig. 9 , Fig. 9 A flowchart of a method for a non-master node to download a firmware upgrade package provided in an embodiment of the present application specifically includes the following steps:
[0108] S91. In response to the seed ready information, obtain a seed file.
[0109] S92. Determine, according to the seed file, a charging pile having a firmware upgrade package as a target charging pile.
[0110] S93. Download the firmware upgrade package from the target charging pile.
[0111] In step S91, after the download master node generates the seed file, it broadcasts the seed-ready information. After receiving the seed-ready information, the non-master node downloads the seed file from the download master node.
[0112] In step S92, the seed file records the ID of the charging pile that has the firmware upgrade package. The non-master node determines the charging pile as the target charging pile based on the charging pile ID recorded in the seed file, and then requests the target charging pile to transmit the firmware upgrade package.
[0113] In step S93, there are usually multiple target charging piles, and the non-master node obtains different block files from different target charging piles at the same time according to certain rules, thereby improving the download speed of the non-master node. It can be understood that the more charging piles with firmware upgrade packages in the station, the faster the download speed of the non-master node.
[0114] In some embodiments, after downloading the firmware upgrade package, the following steps are also included:
[0115] S94. The non-master node generates a seed file according to the firmware upgrade package.
[0116] S95. Broadcast the sign-in information, where the sign-in information includes the seed file.
[0117] In step S94, after the non-master node downloads the firmware upgrade package, it generates a seed file so that when other non-master nodes need to download the firmware upgrade package, they can find themselves through the seed file to obtain more download sources, thereby improving the download speed of other non-master nodes. In some embodiments, if the computing resource usage of the charging pile of the non-master node is too high, the upload speed of the firmware upgrade package is limited or the generation of the seed file is stopped directly. In some other embodiments, when the charging pile is charging, the charging pile suspends the generation of the seed file.
[0118] In step S95, after the non-master node generates the seed file, it sends the sign-in information. The sign-in information is used to inform other non-master nodes that the non-master node has the resources of the firmware upgrade package and can download the firmware upgrade package from the non-master node. The sign-in information can be sent multiple times, for example, broadcast once per minute.
[0119] In summary, in the embodiment of the present application, among multiple charging piles, the charging pile with the best comprehensive communication capability is determined as the download master node through an election method, and then the master node divides the firmware upgrade package into blocks and sends them to other download assisting nodes for joint download, and then generates a seed file for the downloaded firmware upgrade package, so that other charging piles can download the firmware update package through the seed file within the multi-charging pile environment, effectively utilizing the LAN resources within the station, saving the bandwidth resources of the download server, and improving the download efficiency of the firmware upgrade package as a whole.
[0120] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0121] The present application also provides a charging pile, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the charging pile implements a firmware download method. Fig.10 , Fig.10 Schematic diagram of electronic device architecture provided in one embodiment of the present application. The electronic device 100 can be used as a charging pile in the above embodiment, and includes one or more processors 101 and a memory 102. The memory 102 is connected to one or more processors 101, for example, connected to the processor 101 via a bus. The processor 101 and the memory 102 can be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0122] The memory 102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the firmware download method based on a multi-stake environment in the embodiment of the present disclosure. The processor 101 implements the functions of the firmware download method based on a multi-stake environment provided by the above method embodiment by running the non-volatile software programs, instructions and modules stored in the memory 102.
[0123] The memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 102 may optionally include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the processor 101 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0124] The program instructions / modules are stored in the memory 102 , and when executed by the one or more processors 101 , the firmware download method based on a multi-stub environment in any of the above method embodiments is executed.
[0125] The present disclosure also provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors, such as Fig.10 A processor 101 in the embodiment may enable the one or more processors to execute the firmware downloading method based on a multi-stub environment in any of the above method embodiments.
[0126] The embodiment of the present disclosure also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any one of the firmware download methods based on a multi-stub environment.
[0127] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Under the concept of the present disclosure, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present disclosure as described above, which are not provided in detail for the sake of simplicity. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A firmware download method based on a multi-stake environment, It is characterized in that include: Determine one of the plurality of charging piles as a download master node, and determine the remaining charging piles as non-master nodes; Control the download master node to download the firmware upgrade package; The download master node generates a seed file according to the firmware upgrade package and broadcasts seed ready information; The non-master node obtains the seed file in response to the seed ready information and downloads the firmware upgrade package according to the seed file.
2. The method according to claim 1, It is characterized in that The step of determining one of the plurality of charging piles as a download master node comprises: In response to the firmware download information sent by the system, each of the charging piles generates a campaign score according to a preset scoring rule and the charging pile information; Each of the charging posts broadcasts campaign information including the campaign score; In response to the campaign information, the charging pile with the highest campaign score is determined as the download master node.
3. The method according to claim 2, It is characterized in that In response to the campaign information, determining the charging pile with the highest campaign score as the download master node includes: Receive the campaign information broadcast by other charging stations; Determine whether the campaign scores of other charging piles are higher than the campaign score of the charging pile; If yes, the charging pile is determined as a non-master node; If not, wait and continue to receive campaign information sent by other charging stations; In response to the waiting time exceeding the preset winning threshold, the charging pile is determined to be the downloading master node and the winning information is broadcasted, and the other charging piles are determined to be non-master nodes in response to the winning information.
4. The method according to claim 2, It is characterized in that Before each charging pile generates a campaign score according to a preset scoring rule and the charging pile information in response to the firmware download information sent by the system, the method further includes: Determine whether there is a seed file corresponding to the firmware upgrade package in a local area network including multiple charging piles; If so, each of the charging posts directly obtains the seed file and downloads the firmware upgrade package according to the seed file; If not present, each charging pile generates a campaign score according to preset scoring rules and charging pile information.
5. The method according to claim 2, It is characterized in that The controlling the download master node to download the firmware upgrade package comprises: Determine whether the data volume of the firmware upgrade package is greater than a preset value; If it is greater than, the download master node determines at least one of the non-master nodes as a download assistant node according to the campaign score, and the download master node and the download assistant node jointly download the firmware upgrade package; If it is less, the download master node downloads the firmware upgrade package alone.
6. The method according to claim 5, It is characterized in that The downloading master node and the downloading assistant node jointly downloading the firmware upgrade package includes: The download master node generates block information according to the summary information of the firmware upgrade package; Allocate download tasks to the download master node and the download assistant node according to the block information; The download master node and the download assistant node jointly download the firmware upgrade package according to the download task.
7. The method according to any one of claims 1 to 6, It is characterized in that The non-master node, in response to the seed ready information, obtains the seed file and downloads the firmware upgrade package according to the seed file, including: The non-master node obtains the seed file in response to the seed ready information; Determine, according to the seed file, the charging pile having the firmware upgrade package as the target charging pile; The non-master node downloads the firmware upgrade package from the target charging pile.
8. The method according to claim 7, It is characterized in that After the non-master node downloads the firmware upgrade package from the target charging pile, the method further includes: The non-main node generates a seed file according to the firmware upgrade package; The non-master node broadcasts sign-in information, where the sign-in information includes the seed file.
9. A charging pile, It is characterized in that It comprises a memory and a processor, the memory is connected to the processor, the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the charging pile implements the method as described in any one of claims 1 to 8.
10. A readable storage medium, It is characterized in that The readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 8.
