Firmware upgrading method and device for PLC (Programmable Logic Controller) equipment

By dividing multiple PLC devices into groups according to firmware version information and broadcasting corresponding upgrade firmware files, the problem of low firmware upgrade efficiency in the existing technology is solved, and a more efficient firmware upgrade process is achieved.

CN119861941APending Publication Date: 2025-04-22BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311361624.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art is not efficient when upgrading firmware to multiple PLC devices, especially when the equipment is in large orders of magnitude, the total time required for upgrading is longer.

Method used

By receiving the remote online upgrade request sent by the client, multiple PLC devices are divided into packets based on the firmware version information, the upgrade firmware file corresponding to each packet is obtained, and broadcast to the corresponding PLC devices to complete the firmware upgrade.

Benefits of technology

Through packet and broadcast upgrade technology, the efficiency of firmware upgrade of PLC equipment is significantly improved, especially when the number of devices is large, reducing the total time required for upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119861941A_ABST
    Figure CN119861941A_ABST
Patent Text Reader

Abstract

The invention provides a firmware upgrading method and device for PLC (Programmable Logic Controller) equipment. The method comprises the following steps: receiving a remote online upgrading request which is sent by a client and aims at a plurality of pieces of PLC equipment accessing a PLC gateway; dividing the plurality of PLC devices into at least one PLC device group based on firmware version information in the remote online upgrading request; the firmware version information of the PLC devices contained in any PLC device group in the at least one PLC device group is the same; respectively acquiring at least one upgrade firmware file corresponding to the firmware version of the at least one PLC equipment group from the server, and broadcasting the acquired at least one upgrade firmware file, each PLC device in the plurality of PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which the PLC device belongs from the at least one upgrade firmware file, and firmware upgrade is completed. According to the method and the device, broadcast upgrading can be carried out on the PLC equipment, and the firmware upgrading efficiency of the PLC equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a firmware upgrade method, device, electronic device, and machine-readable storage medium for a PLC device. Background Art

[0002] OTA (Over-The-Air) is a technology that remotely updates and manages devices through wireless transmission.

[0003] PLC (Power Line Communication) is a technology that uses power lines as a transmission medium for communication. This technology can be applied in a variety of application scenarios, such as smart home scenarios, smart transportation, smart grids, etc.

[0004] A PLC device refers to an electronic device that uses a power line as a transmission medium for communication. In the current technology, since the firmware of multiple electronic devices is upgraded, it is necessary to perform the firmware upgrade operation on the multiple electronic devices in a sequential order. If the number of electronic devices is large, the efficiency of firmware upgrade for the multiple electronic devices is not high. Summary of the invention

[0005] The present disclosure provides a method for upgrading the firmware of a PLC device, the method comprising:

[0006] Receive a remote online upgrade request for multiple PLC devices connected to a PLC gateway sent by a client; wherein the remote online upgrade request includes firmware version information of the PLC device to be upgraded;

[0007] The plurality of PLC devices are divided into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same;

[0008] At least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group is obtained from the server, and the at least one upgrade firmware file obtained is broadcast, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade.

[0009] Optionally, before respectively obtaining at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcasting the at least one upgrade firmware file obtained, so that each PLC device in the multiple PLC devices obtains a target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade, the method further includes:

[0010] The grouping information of the at least one PLC device group is broadcasted, so that each PLC device in the plurality of PLC devices determines the PLC device group to which it belongs based on the grouping information.

[0011] Optionally, the firmware version information includes a device type and a firmware version of the PLC device.

[0012] Optionally, before dividing the plurality of PLC devices into at least one PLC device group based on the firmware version information, the method further includes:

[0013] From the plurality of PLC devices, determining whether the number of PLC devices with consistent firmware version information is greater than a preset threshold;

[0014] If the number of target PLC devices with consistent firmware version information is greater than a preset threshold, the multiple PLC devices are further divided into at least one PLC device group based on the firmware version information.

[0015] Optionally, the preset threshold comprises an optimal threshold value in which the total duration of unicast upgrade of each PLC device among the multiple PLC devices is less than the duration of broadcast upgrade of the multiple PLC devices.

[0016] Optionally, the method further comprises:

[0017] If the number of target PLC devices with consistent firmware version information is not greater than a preset threshold, an upgrade firmware file corresponding to the firmware version of the target PLC device is obtained from the server and sent to the target PLC device by unicast, so that the target PLC device completes the firmware upgrade based on the upgrade firmware file.

[0018] Optionally, respectively obtaining at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcasting the obtained at least one upgrade firmware file, so that each PLC device in the multiple PLC devices obtains a target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade, including:

[0019] Obtain from the server at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group;

[0020] The upgrade firmware file is fragmented and the fragmented upgrade firmware file is broadcasted, so that each PLC device among the multiple PLC devices obtains the fragmented target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file and completes the firmware upgrade.

[0021] Optionally, the PLC device is an Internet of Things device equipped with PLC firmware;

[0022] Optionally, the Internet of Things device is a smart home device.

[0023] Optionally, before performing segmentation processing on the upgrade firmware file and broadcasting the segmented upgrade firmware file, the method further includes:

[0024] Signing the upgrade firmware file;

[0025] The upgrade firmware file is processed in segments, and the upgraded firmware file after the segment processing is broadcasted, including:

[0026] The signed upgrade firmware file is fragmented, and the signed upgrade firmware file after the fragmentation is broadcast, so that each PLC device among the multiple PLC devices can restore the acquired target upgrade firmware file fragments, obtain the signed target upgrade firmware file and verify the signature.

[0027] The present disclosure also provides a firmware upgrade device for a PLC device, the device comprising:

[0028] A receiving module, used to receive a remote online upgrade request sent by a client for multiple PLC devices connected to the PLC gateway; wherein the remote online upgrade request includes firmware version information of the PLC device to be upgraded;

[0029] A division module, configured to divide the plurality of PLC devices into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same;

[0030] A broadcast module is used to obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcast the at least one upgrade firmware file obtained, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade.

[0031] The present disclosure also provides an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

[0032] The memory stores machine-readable instructions, and the processor executes the firmware upgrade method of the PLC device by calling the machine-readable instructions.

[0033] The present disclosure also provides a machine-readable storage medium, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the firmware upgrade method of the PLC device is implemented.

[0034] The technical solution provided by the present disclosure may at least include the following beneficial effects:

[0035] Through the above embodiments, a remote online upgrade request for multiple PLC devices connected to a PLC gateway sent by a client can be received, and based on the firmware version information contained in the remote online upgrade request, the multiple PLC devices to be upgraded can be divided into at least one PLC device group, wherein the firmware version information of the PLC devices contained in any one of the at least one PLC device group is the same; at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group can be obtained from the server and broadcast, so that each of the multiple PLC devices can obtain the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and complete the firmware upgrade. Therefore, when there are a large number of PLC devices to be upgraded, the PLC devices are grouped and then broadcast and upgraded, which improves the efficiency of the firmware upgrade of the PLC devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a system architecture diagram of a firmware upgrade method for a PLC device shown in an exemplary embodiment.

[0037] Figure 2 It is a flowchart of a firmware upgrade method of a PLC device shown in an exemplary embodiment.

[0038] Figure 3It is a flowchart of another method for upgrading firmware of a PLC device according to an exemplary embodiment.

[0039] Figure 4 It is a hardware structure diagram of an electronic device where a firmware upgrade device of a PLC device is located, showing an exemplary embodiment.

[0040] Figure 5 It is a block diagram of a firmware upgrade device for a PLC device shown in an exemplary embodiment. DETAILED DESCRIPTION

[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0042] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this disclosure. In some other embodiments, the steps included in the method may be more or less than those described in this disclosure. In addition, a single step described in this disclosure may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this disclosure may also be combined into a single step for description in other embodiments.

[0043] OTA (Over-The-Air) is a technology that remotely updates and manages devices through wireless transmission. It is mainly used in various smart devices and systems, such as smartphones, vehicle electronic systems, IoT devices, etc. Through OTA technology, users can send upgraded firmware files to devices through wireless networks after the device is deployed to update, fix bugs, improve functions, or add new features.

[0044] PLC (Power Line Communication) is a technology that uses power lines as a transmission medium for communication. It transmits data and signals by injecting high-frequency carrier signals into the power lines. Since existing power lines can be used for communication without laying additional communication lines, this technology can be applied in a variety of application scenarios, such as smart home scenarios, smart transportation, smart grids, etc.

[0045] A PLC device refers to an electronic device that uses power lines as a transmission medium for communication. In current technology, to upgrade the firmware of an electronic device, the gateway usually needs to obtain the upgrade firmware file corresponding to the electronic device from the server and send it to the electronic device in a unicast form through the PLC link. If the firmware of multiple electronic devices needs to be upgraded, the firmware upgrade operation needs to be performed on the multiple electronic devices in order.

[0046] For example, if the firmware of electronic device_1, electronic device_2 and electronic device_3 needs to be upgraded, it is necessary to first obtain the upgrade firmware file corresponding to the electronic device_1 from the server, and send it to the electronic device_1 in a unicast form through the PLC link; then obtain the upgrade firmware file corresponding to the electronic device_2 from the server, and send it to the electronic device_2 in a unicast form through the PLC link; finally, obtain the upgrade firmware file corresponding to the electronic device_3 from the server, and send it to the electronic device_3 in a unicast form through the PLC link.

[0047] It can be seen that if the number of electronic devices is large, the total time required to perform firmware upgrades on the electronic devices is long, and the efficiency of the firmware upgrade is not high.

[0048] The following describes the firmware upgrade method for PLC devices provided by the present disclosure through specific embodiments and in combination with specific application scenarios. The method improves the efficiency of firmware upgrade by broadcasting and upgrading multiple PLC devices to be upgraded after grouping them.

[0049] During implementation, a remote online upgrade request for multiple PLC devices connected to a PLC gateway may be received from a client; wherein the remote online upgrade request may include firmware version information of the PLC device to be upgraded;

[0050] Further, the plurality of PLC devices may be divided into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same;

[0051] Furthermore, at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group can be obtained from the server, and the at least one upgrade firmware file obtained can be broadcast, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file and completes the firmware upgrade.

[0052] Through the above embodiments, a remote online upgrade request for multiple PLC devices connected to a PLC gateway sent by a client can be received, and based on the firmware version information contained in the remote online upgrade request, the multiple PLC devices to be upgraded can be divided into at least one PLC device group, wherein the firmware version information of the PLC devices contained in any one of the at least one PLC device group is the same; at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group can be obtained from the server and broadcast, so that each of the multiple PLC devices can obtain the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and complete the firmware upgrade. Therefore, when there are a large number of PLC devices to be upgraded, the PLC devices are grouped and then broadcast and upgraded, which improves the efficiency of the firmware upgrade of the PLC devices.

[0053] The present disclosure is described below through specific embodiments and in combination with specific application scenarios.

[0054] See also Figure 1 , Figure 1 FIG. 1 is an architecture diagram of a method for upgrading the firmware of a PLC device, as shown in an exemplary embodiment. Figure 1 As shown, the method can be executed by a PLC gateway, and the PLC gateway can be connected to multiple PLC devices to be upgraded. The PLC gateway can receive a remote online upgrade request for the above-mentioned multiple PLC devices to be upgraded sent by a client. The PLC gateway can divide the multiple PLC devices into at least one PLC device group based on the firmware version information in the remote online upgrade request, and can obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and can broadcast it to the above-mentioned multiple PLC devices to be upgraded, so that the multiple PLC devices to be upgraded obtain the target upgrade firmware file corresponding to the PLC device group to which they belong from the at least one upgrade firmware file, and complete the firmware upgrade.

[0055] See also Figure 2 , Figure 2 It is a flowchart of a firmware upgrade method of a PLC device shown in an exemplary embodiment.

[0056] The above method can be applied to a PLC gateway, and the PLC gateway can be connected to multiple PLC devices to be upgraded.

[0057] like Figure 2 As shown, the above PLC gateway can perform the following steps:

[0058] Step 202: receiving a remote online upgrade request for a plurality of PLC devices connected to a PLC gateway sent by a client; wherein the remote online upgrade request includes firmware version information of the PLC devices to be upgraded.

[0059] The PLC gateway may receive a remote online upgrade request initiated by a user through a client for multiple PLC devices connected to the PLC gateway, wherein the remote online upgrade request may be an OTA remote online upgrade request.

[0060] The above-mentioned remote online upgrade request includes the firmware version information of the PLC device to be upgraded, which may refer to that the remote online upgrade request includes the firmware version information of the PLC device, or may refer to parsing the remote online upgrade request, and the firmware version information of the PLC device to be upgraded may be obtained based on the parsing result.

[0061] For example, the PLC gateway can be connected to PLC device _1, PLC device _2, PLC device _3, PLC device _4 and PLC device _5. The PLC gateway can receive the remote online upgrade request _1 for PLC device _1, the remote online upgrade request _2 for PLC device _2 and the remote online upgrade request _3 for PLC device _3 sent by the client within a preset time period; wherein, by parsing the remote online upgrade request _1, the firmware version information _1 of PLC device _1 can be obtained, by parsing the remote online upgrade request _2, the firmware version information _2 of PLC device _2 can be obtained, and by parsing the remote online upgrade request _3, the firmware version information _3 of PLC device _3 can be obtained.

[0062] In one embodiment shown, the PLC gateway may also cache the received remote online upgrade request in a cache database.

[0063] For example, the PLC gateway may cache the remote online upgrade requests of the multiple PLC devices received within a preset time period in a cache database, so as to facilitate subsequent batch processing of the remote online upgrade requests of the multiple PLC devices.

[0064] In this way, the remote online upgrade requests of the multiple PLC devices can be processed in batches, thereby improving the efficiency of the firmware upgrade.

[0065] In one embodiment shown, the PLC device may be an Internet of Things device equipped with PLC firmware.

[0066] Based on the installed PLC firmware, the IoT device can be connected to the power transmission network and can be interconnected with other IoT devices through the power transmission network.

[0067] For example, any one of the above-mentioned multiple IoT devices may be equipped with PLC firmware, and may be interconnected with other IoT devices in the multiple IoT devices based on the PLC firmware.

[0068] In one embodiment shown, the IoT device may be a smart home device.

[0069] The method for performing firmware upgrade on the IoT device can be applied to a smart home scenario, and the IoT device can be a smart home device in the smart home scenario.

[0070] For example, the IoT device may be a smart curtain, a smart refrigerator, a smart air conditioner, a smart fan, etc.

[0071] In one embodiment shown, the firmware version information may include a device type and a firmware version of the PLC device.

[0072] Since different PLC devices require different upgrade firmware files for firmware upgrade, subsequently grouping multiple PLC devices according to the firmware version information can facilitate the multiple PLC devices to receive corresponding upgrade firmware files based on the grouping information.

[0073] There is a corresponding relationship between the upgrade firmware file that the PLC device needs to receive and the device type and current firmware version of the PLC device. Therefore, the firmware version information may include the device type and firmware version of the PLC device.

[0074] For example, the PLC gateway can receive a remote online upgrade request _1 for PLC device _1, a remote online upgrade request _2 for PLC device _2, and a remote online upgrade request _3 for PLC device _3 sent by the client within a preset time period; wherein, by parsing the remote online upgrade request _1, the firmware version information _1 of the PLC device _1 can be obtained, by parsing the remote online upgrade request _2, the firmware version information _2 of the PLC device _2 can be obtained, and by parsing the remote online upgrade request _3, the firmware version information _3 of the PLC device _3 can be obtained; the firmware version information _1 of the PLC device _1 can include device type _1 and firmware version _1, the firmware version information _2 of the PLC device _2 can include device type _1 and firmware version _2, and the firmware version information _3 of the PLC device _3 can include device type _3 and firmware version _3.

[0075] Step 204: divide the plurality of PLC devices into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same.

[0076] It should be noted that the firmware version information referred to in this disclosure is the same, which may mean that the device type and firmware version of the PLC device are completely consistent, or it may mean that the device type of the PLC device is consistent and there is a compatibility relationship between the firmware versions.

[0077] For example, the PLC gateway may receive a remote online upgrade request _1 for PLC device _1, a remote online upgrade request _2 for PLC device _2, a remote online upgrade request _3 for PLC device _3, and a remote online upgrade request _4 for PLC device _4; wherein the firmware version information _1 of PLC device _1 may include device type _1 and firmware version _1, the firmware version information _2 of PLC device _2 may include device type _1 and firmware version _2, the firmware version information _3 of PLC device _3 may include device type _3 and firmware version _3, and the firmware version information _4 of PLC device _4 may include device type _3 and firmware version _3; wherein there may be a compatible relationship between firmware version _1 and firmware version _2. Based on the firmware version information, PLC device _1 and PLC device _2 may be grouped together, and PLC device _3 and PLC device _4 may be grouped together.

[0078] In one embodiment shown, before grouping the above-mentioned PLC devices, the above-mentioned PLC gateway can also determine from the above-mentioned multiple PLC devices whether the number of PLC devices with consistent firmware version information is greater than a preset threshold; if the number of target PLC devices with consistent firmware version information is greater than the preset threshold, the above-mentioned multiple PLC devices can be further divided into at least one PLC device group based on the above-mentioned firmware version information.

[0079] For firmware upgrade of PLC devices, the firmware upgrade can be performed in the form of unicast or broadcast. Since the total time required for firmware upgrade via unicast is different from the time required for firmware upgrade via broadcast, it can be determined whether broadcast upgrade is needed for the PLC device based on the number of PLC devices actually grouped together.

[0080] Specifically, before grouping PLC devices, it is necessary to determine whether the firmware version information is consistent and whether the number of PLC devices to be grouped is greater than a preset threshold. If it is determined that the number of PLC devices with consistent firmware version information is greater than the preset threshold, the PLC devices can be grouped together and the PLC devices with consistent firmware version information can be broadcast upgraded.

[0081] The present disclosure does not limit the setting value of the preset threshold. For example, the preset threshold can be 6 or 7.

[0082] In an illustrated embodiment, the preset threshold may include an optimal threshold value in which the total duration of unicast upgrade of each of the multiple PLC devices is less than the duration of broadcast upgrade of the multiple PLC devices.

[0083] If it is determined that the firmware version information is consistent, the number of PLC devices grouped together is the optimal threshold, that is, the total time required for unicast upgrades of the multiple PLC devices grouped together is less than the time required for broadcast upgrades of the multiple PLC devices grouped together.

[0084] For example, the optimal threshold value may be 7, the firmware version information is consistent, the number of PLC devices grouped into one group may be 6, the duration of unicast upgrade of each of the multiple PLC devices may be 1 second, and the duration of broadcast upgrade of the multiple PLC devices may be 7 seconds, then it can be determined that the total duration of unicast upgrade of the multiple PLC devices is 6 seconds, which is less than the duration of broadcast upgrade of the multiple PLC devices. In this case, each of the multiple PLC devices may be unicast upgraded separately.

[0085] In this way, the corresponding firmware upgrade method can be selected based on the actual situation, thereby improving the efficiency of PLC device firmware upgrade.

[0086] In one embodiment shown, if the number of target PLC devices with consistent firmware version information is not greater than a preset threshold, an upgrade firmware file corresponding to the firmware version of the target PLC device can be obtained from the server and can be sent to the target PLC device by unicast, so that the target PLC device completes the firmware upgrade based on the upgrade firmware file.

[0087] If the number of target PLC devices with consistent firmware version information is not greater than a preset threshold, the PLC gateway may perform a unicast upgrade on the target PLC device.

[0088] For example, the target PLC devices grouped together may be target PLC device_1, target PLC device_2 and target PLC device_3. The number of target PLC devices may be 3. If the number does not reach a preset threshold, an upgrade firmware file corresponding to the firmware version of the above target PLC devices may be obtained from the server and sent to the target PLC device_1, target PLC device_2 and target PLC device_3 by unicast, so that the three target PLC devices may perform firmware upgrades based on the corresponding upgrade firmware files.

[0089] In this way, it is possible to determine whether to perform unicast upgrade on the target PLC device based on the actual number of target PLC devices grouped into one group, thereby improving the efficiency of firmware upgrade.

[0090] Step 206, respectively obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcast the at least one upgrade firmware file obtained, so that each PLC device among the multiple PLC devices obtains the corresponding target upgrade firmware file from the at least one upgrade firmware file and the PLC device group to which it belongs, and completes the firmware upgrade.

[0091] For PLC devices that have been grouped, firmware upgrades can be performed through broadcasting.

[0092] For example, the at least one PLC device grouping may include PLC device grouping_1, PLC device grouping_2 and PLC device grouping_3, wherein the firmware version of PLC device grouping_1 may correspond to upgrade firmware file_1, the firmware version of PLC device grouping_2 may correspond to upgrade firmware file_2, and the firmware version of PLC device grouping_3 may correspond to upgrade firmware file_3; the PLC gateway may broadcast the three upgrade firmware files so that each of the multiple PLC devices may obtain the target upgrade firmware file corresponding to the PLC device group to which it belongs from the three upgrade firmware files, and complete subsequent firmware upgrades based on the obtained target upgrade firmware file.

[0093] In this way, when there are a large number of PLC devices to be upgraded, the PLC devices can be grouped and then upgraded by broadcast, thereby improving the efficiency of firmware upgrade of the PLC devices.

[0094] In one embodiment shown, the PLC gateway obtains at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and before broadcasting the at least one upgrade firmware file obtained, it can first broadcast the grouping information of the at least one PLC device group, so that each PLC device among the multiple PLC devices can determine the PLC device group to which it belongs based on the grouping information.

[0095] Since the above-mentioned multiple PLC devices need to obtain the target upgrade firmware file corresponding to the PLC device group to which they belong from the broadcasted multiple upgrade firmware files, before that, the grouping information of at least one of the above-mentioned PLC device groups can be broadcast first, so that each PLC device among the multiple PLC devices can determine the PLC device group to which it belongs.

[0096] For example, the at least one PLC device group may include PLC device group_1, PLC device group_2 and PLC device group_3. The PLC gateway may generate group information corresponding to the at least one PLC device group and broadcast the group information. Each of the multiple PLC devices may determine the PLC device group to which it belongs based on the received group information.

[0097] The present disclosure does not limit the specific content of the grouping information. For example, the grouping information may include a device name and a firmware identifier, and may also include other information that can be used by the PLC device to determine the PLC device group to which it belongs.

[0098] Specifically, the at least one PLC device grouping may include PLC device grouping_1 and PLC device grouping_2. The PLC gateway may generate grouping information related to PLC device grouping_1 and PLC device grouping_2. The grouping information may include the device name of PLC device grouping_1 and the corresponding firmware identifier_1, and the device name of PLC device grouping_2 and the corresponding firmware identifier_2. When receiving the grouping information, PLC device_1 among the multiple PLC devices may query that its device name is included in the device name of PLC device grouping_1, and therefore may determine that the group to which it belongs is PLC device group_1, and may record the firmware identifier corresponding to the PLC device group_1 as firmware identifier_1, so that the corresponding upgrade firmware file may be received based on the firmware identifier_1 in the future.

[0099] The present disclosure does not limit the correspondence between the grouping information and the at least one PLC device grouping. For example, the grouping information may include grouping information_1 corresponding to PLC device grouping_1, grouping information_2 corresponding to PLC device grouping_2, and grouping information_3 corresponding to PLC device grouping_3. The three grouping information may be broadcasted separately, or the grouping information of the three PLC device groups may be included in one high-load message and broadcasted together.

[0100] It should be noted that when the PLC device determines the PLC device group to which it belongs, it can return response information corresponding to the group information to the PLC gateway, so that the PLC gateway can determine whether the group information needs to be rebroadcast based on the response information.

[0101] In this way, it can be ensured that the PLC device receives the corresponding upgrade firmware file, thereby improving the efficiency of firmware upgrade.

[0102] In one embodiment shown, the PLC gateway can obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and can segment the upgrade firmware file, and broadcast the segmented upgrade firmware file, so that each of the multiple PLC devices can obtain the segmented target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and complete the firmware upgrade.

[0103] In the case of unstable network, the PLC device may be interrupted in the process of receiving the entire upgrade firmware file, resulting in reception failure. Therefore, the upgrade firmware file can be segmented and then broadcast. Even if the PLC device fails to receive the upgrade firmware file segment, subsequent retransmissions only need to retransmit the part of the upgrade firmware file segment that failed to be received, thereby improving the efficiency of the PLC device in receiving the upgrade firmware file.

[0104] For example, at least one upgrade firmware file to be broadcast may include upgrade firmware file_1, upgrade firmware file_2, and upgrade firmware file_3. The three upgrade firmware files may be segmented separately and the segmented upgrade firmware file segments may be broadcast; the PLC device may cache the received upgrade firmware file segments.

[0105] It should be noted that the PLC gateway can also number the upgrade firmware file segments, so that the PLC device can return the number of the upgrade firmware file segment that failed to be received to the PLC gateway, and the PLC gateway can retransmit based on the number. If the number of retransmissions reaches a preset threshold, the PLC device can be removed from the PLC device group to which it belongs, and the PLC device can be unicast upgraded later.

[0106] In this way, the efficiency of the PLC device receiving the upgrade firmware file can be improved.

[0107] In one embodiment shown, the PLC gateway can sign the upgrade firmware file; and can segment the signed upgrade firmware file, and broadcast the segmented and signed upgrade firmware file, so that each of the multiple PLC devices can restore the acquired target upgrade firmware file segment, obtain the target upgrade firmware file carrying the signature, and verify the signature.

[0108] In order to ensure that the received upgrade firmware file does not contain abnormal information, each of the above-mentioned PLC devices can verify the signature of the acquired target upgrade firmware file.

[0109] Specifically, each upgrade firmware file segment may carry less signature information, and when the upgrade firmware file segment is restored by the PLC device, a complete signature is obtained and verified.

[0110] For example, the PLC gateway can sign the complete upgrade firmware file before the slice processing, and slice the signed upgrade firmware file, and then broadcast the sliced ​​upgrade firmware file slices carrying partial signatures. In this case, the PLC device can restore the acquired target upgrade firmware file slices to obtain the target upgrade firmware file with the complete signature, and can verify the signature based on the complete signature when receiving the verification request sent by the PLC gateway.

[0111] In this way, the security of firmware upgrades of PLC devices can be improved.

[0112] In one embodiment shown, the PLC gateway may also receive a response message returned by the PLC device indicating successful signature verification, and send an end message to the PLC device whose signature verification succeeded, to instruct the PLC device to upgrade based on the received upgrade firmware file.

[0113] For example, the PLC gateway may receive a response message _1 returned by the PLC device _1 indicating successful signature verification, and send an end message to the PLC device whose signature verification succeeded to instruct the PLC device to restart, and at the same time, upgrade based on the received upgrade firmware file.

[0114] In this way, the PLC device can be upgraded when it receives instructions, thereby improving the security of firmware upgrades.

[0115] In one embodiment shown, the PLC gateway may also receive a response message including the latest firmware version returned by the PLC device, and may determine whether the PLC device is successfully upgraded based on the response message.

[0116] After the PLC device completes the restart, it can send a response message containing the latest firmware version to the PLC gateway. The PLC gateway can compare the latest firmware version with the cached firmware version of the PLC device to determine whether the latest firmware version is the same as the cached firmware version. If the latest firmware version is the same as the cached firmware version, it indicates that the firmware upgrade of the PLC device has failed, and the PLC device can be unicast upgraded. If the latest firmware version is different from the cached firmware version, it indicates that the firmware upgrade of the PLC device is successful.

[0117] In this way, it can be ensured that the firmware of each PLC device is successfully upgraded.

[0118] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present disclosure, the following takes firmware upgrades for three PLC devices to be upgraded as an example, combined with the following examples: Figure 3 The flowchart of the firmware upgrade method of the PLC device shown illustrates the embodiment of the present disclosure.

[0119] See also Figure 3 , Figure 3 It is a flowchart of another method for upgrading the firmware of a PLC device shown in an exemplary embodiment. The PLC gateway can access the PLC device _1, PLC device _2 and PLC device _3 to be upgraded, and the PLC gateway can receive the remote online upgrade request _1 for the PLC device _1, the remote online upgrade request _2 for the PLC device _2 and the remote online upgrade request _3 for the PLC device _3 sent by the client within a preset time, and can cache the three remote online upgrade requests in a cache database; wherein, by parsing the remote online upgrade request _1, the firmware version information _1 of the PLC device _1 can be obtained, by parsing the remote online upgrade request _2, the firmware version information _2 of the PLC device _2 can be obtained, and by parsing the remote online upgrade request _3, the firmware version information _3 of the PLC device _3 can be obtained; the firmware version information _1 can include the device type _1 and the firmware version _1, the firmware version information _2 can include the device type _1 and the firmware version _2, and the firmware version information _3 can include the device type _3 and the firmware version _3.

[0120] Since there is a compatibility relationship between firmware version _1 and firmware version _2, based on the firmware version information, PLC device _1 and PLC device _2 can be grouped into a group, which can be PLC device group _1. The two PLC devices in the PLC device group _1 can be broadcast upgraded; the above-mentioned PLC device _3 can be unicast upgraded.

[0121] Among them, the firmware version of the above-mentioned PLC device group_1 can correspond to the upgraded firmware file_1, the above-mentioned PLC gateway can generate group information corresponding to the PLC device group_1, and the group information can include the device name of the PLC device group_1 and the corresponding firmware identifier_1. The PLC gateway can broadcast the group information. When receiving the group information, the PLC device_1 and the PLC device_2 among the above-mentioned multiple PLC devices can query that their device names are included in the device name of the PLC device group_1, so that it can be determined that the group to which they belong is the PLC device group_1, and the firmware identifier corresponding to the PLC device group_1 can be recorded, that is, firmware identifier_1, so that the corresponding upgraded firmware file can be received based on the firmware identifier_1 later.

[0122] The above-mentioned PLC gateway can obtain the upgrade firmware file_1 from the server, sign the upgrade firmware file_1, and segment the signed upgrade firmware file, and then broadcast the upgraded firmware file segment carrying a partial signature after the segment processing.

[0123] The above-mentioned PLC device_1 and PLC device_2 can obtain the slices of the upgrade firmware file_1 based on the PLC device group to which they belong, and cache the slices of the upgrade firmware file_1. They can also restore the slices of the upgrade firmware file_1 to obtain the target upgrade firmware file with a complete signature.

[0124] The above-mentioned PLC gateway can send a verification request to the PLC device. When the above-mentioned PLC device_1 and PLC device_2 receive the verification request, they can verify the signature based on the above-mentioned complete signature. After the verification is successful, the PLC device_1 and PLC device_2 can return response information corresponding to the verification request to the PLC gateway.

[0125] The above-mentioned PLC gateway can determine the PLC device that has successfully verified the signature based on the response information corresponding to the verification request, and can send an end message to the PLC device that has successfully verified the signature to instruct the PLC device to restart, and at the same time, upgrade based on the received upgrade firmware file; the above-mentioned PLC device_1 and PLC device_2 can restart when receiving the end request, and at the same time, upgrade based on the received upgrade firmware file, and can return a response message containing the latest firmware version to the PLC gateway after the restart is completed.

[0126] The above-mentioned PLC gateway can compare the latest firmware version with the cached firmware version of the PLC device to determine whether the latest firmware version is the same as the cached firmware version. If the latest firmware version is the same as the cached firmware version, it indicates that the firmware upgrade of the PLC device has failed, and the PLC device can be unicast upgraded. If the latest firmware version is different from the cached firmware version, it indicates that the firmware upgrade of the PLC device is successful.

[0127] Corresponding to the embodiment of the firmware upgrade method of the PLC device, the present disclosure also provides an embodiment of a firmware upgrade apparatus for a PLC device.

[0128] See also Figure 4 , Figure 4It is a hardware structure diagram of an electronic device where a firmware upgrade device of a PLC device is located, which is shown in an exemplary embodiment. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and of course may also include hardware required for other services. One or more embodiments of the present disclosure can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of the present disclosure do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0129] See also Figure 5 , Figure 5 FIG. 1 is a block diagram of a firmware upgrade device for a PLC device according to an exemplary embodiment. The firmware upgrade device for a PLC device can be applied to Figure 4 In the electronic device shown in the figure, the technical solution of the present disclosure is implemented. The device may include:

[0130] The receiving module 502 is used to receive a remote online upgrade request for multiple PLC devices connected to the PLC gateway sent by a client; wherein the remote online upgrade request includes the firmware version information of the PLC device to be upgraded;

[0131] A division module 504 is used to divide the plurality of PLC devices into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same;

[0132] The broadcast module 506 is used to obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcast the at least one upgrade firmware file obtained, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade.

[0133] In this embodiment, the broadcast module 506 may also be used for:

[0134] The grouping information of the at least one PLC device group is broadcasted, so that each PLC device in the plurality of PLC devices determines the PLC device group to which it belongs based on the grouping information.

[0135] In this embodiment, the firmware version information may include a device type and a firmware version of the PLC device.

[0136] In this embodiment, the above device may further include a determination module, which is used to:

[0137] From the plurality of PLC devices, determining whether the number of PLC devices with consistent firmware version information is greater than a preset threshold;

[0138] If the number of target PLC devices with consistent firmware version information is greater than a preset threshold, the multiple PLC devices are further divided into at least one PLC device group based on the firmware version information.

[0139] In this embodiment, the preset threshold may include an optimal threshold value in which the total duration of unicast upgrade performed by each of the multiple PLC devices is less than the duration of broadcast upgrade performed by the multiple PLC devices.

[0140] In this embodiment, the above device may further include a unicast module, which is used to:

[0141] If the number of target PLC devices with consistent firmware version information is not greater than a preset threshold, an upgrade firmware file corresponding to the firmware version of the target PLC device is obtained from the server and sent to the target PLC device by unicast, so that the target PLC device completes the firmware upgrade based on the upgrade firmware file.

[0142] In this embodiment, the broadcast module 506 may be specifically used for:

[0143] Obtain from the server at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group;

[0144] The upgrade firmware file is fragmented and the fragmented upgrade firmware file is broadcasted, so that each PLC device among the multiple PLC devices obtains the fragmented target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file and completes the firmware upgrade.

[0145] In this embodiment, the PLC device may be an IoT device equipped with PLC firmware;

[0146] In this embodiment, the aforementioned Internet of Things device may be a smart home device.

[0147] In this embodiment, the above device may further include a signature module, which is used to:

[0148] Signing the upgrade firmware file;

[0149] The upgrade firmware file is processed in segments, and the upgraded firmware file after the segment processing is broadcasted, including:

[0150] The signed upgrade firmware file is fragmented, and the signed upgrade firmware file after the fragmentation is broadcast, so that each PLC device among the multiple PLC devices can restore the acquired target upgrade firmware file fragments, obtain the signed target upgrade firmware file and verify the signature.

[0151] The implementation process of the functions and effects of each module in the device is specifically described in the implementation process of the corresponding steps in the method, which will not be repeated here.

[0152] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0153] The system, device or module described in the embodiments may be implemented by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0154] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0155] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0156] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0157] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0158] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0159] The terms used in one or more embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present disclosure. The singular forms of "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0160] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of the present disclosure, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".

[0161] The above description is only a preferred embodiment of one or more embodiments of the present disclosure and is not intended to limit one or more embodiments of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present disclosure shall be included in the scope of protection of one or more embodiments of the present disclosure.

[0162] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

Claims

1. A method for upgrading the firmware of a PLC device, the method comprising: Receive a remote online upgrade request for multiple PLC devices connected to a PLC gateway sent by a client; wherein the remote online upgrade request includes firmware version information of the PLC device to be upgraded; The plurality of PLC devices are divided into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same; At least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group is obtained from the server, and the at least one upgrade firmware file obtained is broadcast, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade.

2. The method according to claim 1, before respectively obtaining at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcasting the obtained at least one upgrade firmware file, so that each PLC device in the plurality of PLC devices obtains a target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade, the method further comprises: The grouping information of the at least one PLC device group is broadcasted, so that each PLC device in the plurality of PLC devices determines the PLC device group to which it belongs based on the grouping information. 3 . The method according to claim 1 , wherein the firmware version information includes a device type and a firmware version of the PLC device.

4. The method according to claim 1, before dividing the plurality of PLC devices into at least one PLC device group based on the firmware version information, the method further comprises: From the plurality of PLC devices, determining whether the number of target PLC devices with consistent firmware version information is greater than a preset threshold; If the number of target PLC devices with consistent firmware version information is greater than a preset threshold, the multiple PLC devices are further divided into at least one PLC device group based on the firmware version information.

5. The method according to claim 4, wherein the preset threshold comprises an optimal threshold value in which the total duration of unicast upgrade of each of the multiple PLC devices is less than the duration of broadcast upgrade of the multiple PLC devices.

6. The method according to claim 4, further comprising: If the number of target PLC devices with consistent firmware version information is not greater than a preset threshold, an upgrade firmware file corresponding to the firmware version of the target PLC device is obtained from the server and sent to the target PLC device by unicast, so that the target PLC device completes the firmware upgrade based on the upgrade firmware file.

7. The method according to claim 1, respectively obtaining at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcasting the obtained at least one upgrade firmware file, so that each PLC device in the plurality of PLC devices obtains the corresponding target upgrade firmware file from the at least one upgrade firmware file based on the PLC device group to which it belongs, and completes the firmware upgrade, comprising: Obtain from the server at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group; The upgrade firmware file is fragmented and the fragmented upgrade firmware file is broadcasted, so that each PLC device among the multiple PLC devices obtains the fragmented target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file and completes the firmware upgrade.

8. According to the method of claim 1, the PLC device is an Internet of Things device equipped with PLC firmware.

9. The method according to claim 8, wherein the IoT device is a smart home device.

10. The method according to claim 7, before performing segmentation processing on the upgrade firmware file and broadcasting the segmented upgrade firmware file, the method further comprises: Signing the upgrade firmware file; The upgrade firmware file is processed in segments, and the upgraded firmware file after the segment processing is broadcasted, including: The signed upgrade firmware file is fragmented, and the signed upgrade firmware file after the fragmentation is broadcast, so that each PLC device among the multiple PLC devices can restore the acquired target upgrade firmware file fragments, obtain the signed target upgrade firmware file and verify the signature.

11. A firmware upgrade device for a PLC device, the device comprising: A receiving module, used to receive a remote online upgrade request sent by a client for multiple PLC devices connected to the PLC gateway; wherein the remote online upgrade request includes firmware version information of the PLC device to be upgraded; A division module, configured to divide the plurality of PLC devices into at least one PLC device group based on the firmware version information; the firmware version information of the PLC devices included in any one of the at least one PLC device group is the same; A broadcast module is used to obtain at least one upgrade firmware file corresponding to the firmware version of the at least one PLC device group from the server, and broadcast the at least one upgrade firmware file obtained, so that each PLC device among the multiple PLC devices obtains the target upgrade firmware file corresponding to the PLC device group to which it belongs from the at least one upgrade firmware file, and completes the firmware upgrade.

12. A user equipment, comprising: processor; a memory for storing processor-executable instructions; The processor is used to implement the method according to any one of claims 1 to 10.

13. A machine-readable storage medium storing machine-readable instructions, wherein the machine-readable instructions, when called and executed by a processor, implement the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Batch updating method and device, electronic equipment and computer readable storage medium

    CN121934870A