Remote OTA upgrading method and device of EMS equipment, electronic equipment and product
By configuring edge devices for EMS devices, remote OTA upgrades of EMS devices are solved, and the problems of low upgrade efficiency, high cost and the inability to remote upgrade for a single device in the existing technology are solved, and an efficient and safe upgrade process is achieved.
Patent Information
- Application Number
- CN202510087235.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, the remote OTA upgrade of EMS devices is inefficient and costly, and the EMS on a single device does not have the conditions for accessing the Internet separately, so it is impossible to perform remote upgrades.
By configuring edge devices for all EMS devices, the edge devices communicate and connect with the server and EMS devices, the software version number is obtained and the upgrade file download and transmission is realized, and the upgrade command is generated and sent to complete the remote OTA upgrade of EMS devices.
A large number of EMS devices have been implemented to achieve remote upgrades, reducing upgrade costs, improving upgrade efficiency, and improving security and reliability through real-time monitoring and dual encryption.
Smart Images

Figure CN120075041A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of remote device upgrade, and particularly relates to a remote OTA upgrade method, device, electronic device and product for EMS devices. Background Art
[0002] At present, there are many device-side EMS (Equipment Management System) in many energy storage stations. Among them, if there are software problems with the devices, or due to unsatisfactory actual on-site control, or various functions required by customers, etc., there will be a need to update the device software. At this time, it is necessary to upgrade the software of the EMS device to meet different usage requirements.
[0003] In actual application, the traditional upgrade of the device-side EMS requires specialized technicians to operate on-site. When there are many device-side EMS in the same energy storage station that need to be upgraded, or even many device-side EMS in different energy storage stations need to be upgraded, it will take a lot of time and manpower, which not only reduces the upgrade efficiency but also increases the upgrade cost. At this time, the advantage of remote OTA upgrade is highlighted. Remote OTA upgrade can be automatically completed without manual operation, greatly improving the efficiency. However, in actual use, a single device-side EMS does not have the condition to access the Internet alone. Therefore, remote OTA upgrade cannot be performed. Thus, based on the above deficiencies, how to provide a remote OTA upgrade method for EMS devices with high upgrade efficiency and low cost has become an urgent problem to be solved. Summary of the Invention
[0004] The object of the present invention is to provide a remote OTA upgrade method, device, electronic device and product for EMS devices, so as to solve the problems in the prior art that require a large amount of time and labor costs, low efficiency, and a single device-side EMS does not have the condition to access the Internet alone, resulting in the inability to perform remote upgrade.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] In the first aspect, a remote OTA upgrade method for EMS devices is provided. Edge devices are configured for all EMS devices. Among them, the edge devices are respectively communicatively connected to a server and each EMS device, and the method includes:
[0007] Obtain the software version numbers of each EMS device and send the software version numbers of each EMS device to the server, so that the server can determine the devices to be upgraded from all EMS devices according to the software version numbers of each EMS device, and send the download address of the upgrade file of the devices to be upgraded to the edge device;
[0008] Receive the download address of the upgrade file sent by the server, and download the upgrade file of the device to be upgraded from the server according to the download address of the upgrade file;
[0009] Generate a first upgrade command, where the first upgrade command includes the storage address of the upgrade file in the edge device;
[0010] Send the first upgrade command to the device to be upgraded, so that after receiving the first upgrade command, the device to be upgraded switches its device status to the standby state, and downloads the upgrade file from the edge device according to the storage address in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade file.
[0011] Based on the above disclosed content, the present invention configures an edge device for all EMS devices and uniformly manages them by the edge device; in this way, the update of each EMS device can be completed through the edge device, that is, first obtain the software version numbers of each EMS device and send them to the server, and the server can judge whether each EMS device needs to be updated according to the software version numbers, so as to use the devices that need to be updated as the devices to be upgraded and send the download address of the upgrade file to the edge device; then, the edge device can download the upgrade file based on this address; then, generate a first upgrade command and send it to the device to be upgraded; finally, the device to be upgraded can download the upgrade file from the edge device according to the first upgrade command, so as to complete the software upgrade based on this file.
[0012] Through the above design, the present invention configures an edge device to uniformly manage EMS devices. Among them, the edge device can control the EMS at the device end and can also obtain their information, and the edge device can exchange with the server through the network, so as to centrally feedback this information to the server. Therefore, the present invention uses the Internet access conditions at the edge end to perform OTA upgrade on the EMS at the device end. Based on this, simultaneous remote upgrade of a large number of EMS devices can be realized, and the entire upgrade process does not require manual intervention. Therefore, not only the upgrade efficiency is improved, but also the upgrade cost is reduced. Therefore, the present invention is very suitable for large-scale application and promotion.
[0013] In a possible design, obtaining the software version numbers of each EMS device includes:
[0014] Based on the Modbus TCP protocol, regularly send a first version number request instruction to each EMS device, so that after each EMS device receives the first version number request instruction, it returns its software version number and SN code to the edge device;
[0015] Receive the software version number and SN code returned by each EMS device;
[0016] Correspondingly, sending the software version number of each EMS device to the server includes:
[0017] Receive the second version number request instruction sent by the server, and after receiving the second version number request instruction, send the software version number and SN code of each EMS device to the server, so that the server can, according to the software version number of each EMS device, screen out the EMS devices whose software version numbers do not belong to the latest version number from all EMS devices as the devices to be upgraded, and generate a second upgrade command for the devices to be upgraded, so as to send the upgrade file download address and the second upgrade command of the devices to be upgraded to the edge device, where the second upgrade command contains the SN code of the device to be upgraded.
[0018] In a possible design, after the server determines the devices to be upgraded from all EMS devices, it will also generate a second upgrade command for the devices to be upgraded, and the second upgrade command contains the SN code of the device to be upgraded;
[0019] Wherein, before downloading the upgrade file of the device to be upgraded from the server according to the upgrade file download address, the method further includes:
[0020] Receive the second upgrade command sent by the server, and determine whether there is an EMS device in the target device set that matches the SN code in the second upgrade command, where the target device set contains all EMS devices managed by the edge device;
[0021] If so, use the EMS device in the target device set that matches the SN code in the second upgrade command as the device to be upgraded, and download the upgrade file of the device to be upgraded from the server according to the upgrade file download address.
[0022] In a possible design, the upgrade file stored in the server is a double-encrypted file. After downloading the upgrade file of the device to be upgraded from the server according to the upgrade file download address, the method further includes:
[0023] Use the first decryption key to perform a first-level decryption process on the upgrade file to obtain a first-level decrypted upgrade file;
[0024] Perform verification processing on the upgraded file decrypted at the first layer, and determine whether the verification passes;
[0025] If so, store the upgraded file decrypted at the first layer at a specified location, and send a file download success message to the server.
[0026] In a possible design, if the verification of the upgraded file decrypted at the first layer fails, the method further includes:
[0027] Send an upgraded file verification failure message to the server through the MQTT protocol.
[0028] In a possible design, the upgraded file stored in the edge device is the upgraded file decrypted at the first layer. Among them, generating the first upgrade command includes:
[0029] Generate the first upgrade command according to the storage address corresponding to the specified location of the edge device;
[0030] Send the first upgrade command to the device to be upgraded, so that the device to be upgraded downloads the upgraded file decrypted at the first layer from the specified location of the edge device according to the storage address in the first upgrade command, in order to use the second decryption key stored in itself to perform two-layer decryption processing on the upgraded file decrypted at the first layer to obtain the decrypted upgraded file, and perform verification processing on the decrypted upgraded file. After the verification passes, use the decrypted upgraded file for software upgrade.
[0031] In a possible design, the method further includes:
[0032] Receive the upgrade status information and the upgraded software version number sent by the device to be upgraded. Among them, the upgrade status information is sent by the device to be upgraded to the edge device in real time during the upgrade process, and the upgraded software version number is the version number corresponding to the software of the device to be upgraded after the upgrade is completed;
[0033] Based on the upgraded software version number, count the upgraded successful EMS devices and the non-upgraded successful EMS devices, and send the upgraded software version number of the device to be upgraded, the upgraded successful EMS devices, the non-upgraded successful EMS devices, and the upgrade status information to the server, so that the server visually displays the upgraded successful EMS devices, the non-upgraded successful EMS devices, the upgraded software version number, and the upgrade status information.
[0034] Second aspect, a remote OTA upgrade device for EMS devices is provided. Edge devices are configured for all EMS devices. Among them, the edge devices are respectively communicatively connected to a server and each EMS device, and the device includes:
[0035] An acquisition unit, configured to acquire the software version numbers of each EMS device and send the software version numbers of each EMS device to the server, so that the server determines the devices to be upgraded from all EMS devices according to the software version numbers of each EMS device, and sends the upgrade file download addresses of the devices to be upgraded to the edge device;
[0036] A download unit, configured to receive the upgrade file download addresses sent by the server and download the upgrade files of the devices to be upgraded from the server according to the upgrade file download addresses;
[0037] A command generation unit, configured to generate a first upgrade command, where the first upgrade command includes the storage address of the upgrade file in the edge device;
[0038] A sending unit, configured to send the first upgrade command to the devices to be upgraded, so that after receiving the first upgrade command, the devices to be upgraded switch their device states to the standby state, and download the upgrade files from the edge device according to the storage addresses in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade files.
[0039] Third aspect, another remote OTA upgrade device for EMS devices is provided. Taking the device as an electronic device as an example, it includes a memory, a processor, and a transceiver that are communicatively connected in sequence. Among them, the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer programs and execute the remote OTA upgrade method of the EMS device as described in the first aspect or any possible design in the first aspect.
[0040] Fourth aspect, a storage medium is provided. Instructions are stored on the storage medium. When the instructions run on a computer, they execute the remote OTA upgrade method of the EMS device as described in the first aspect or any possible design in the first aspect.
[0041] Fifth aspect, a computer program product containing instructions is provided. When the instructions run on a computer, the computer is enabled to execute the remote OTA upgrade method of the EMS device as described in the first aspect or any possible design in the first aspect.
[0042] Beneficial effects:
[0043] (1) The present invention manages EMS devices uniformly by configuring edge devices. Among them, the edge device can control the EMS at the device end and can also obtain their information. The edge device can communicate with the server through the network, so that this information can be centrally fed back to the server. Therefore, the present invention uses the Internet access conditions at the edge end to perform OTA upgrades on the EMS at the device end. Based on this, simultaneous remote upgrades of a large number of EMS devices can be realized, and the entire upgrade process requires no manual intervention. Therefore, not only the upgrade efficiency is improved, but also the upgrade cost is reduced. Therefore, the present invention is very suitable for large-scale application and promotion.
[0044] (2) The present invention will upload the upgrade status information and the version number after the upgrade in real time. In this way, the upgrade process can be monitored and controlled in real time, so as to ensure the security and reliability of the upgrade.
[0045] (3) The present invention performs double-layer different encryption on the upgrade file and performs different verifications in the edge device and the EMS device. In this way, the deciphering difficulty and anti-interference ability are improved, thereby further increasing the security of the upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a schematic diagram of the architecture of the remote OTA upgrade system for EMS devices provided by an embodiment of the present invention;
[0047] Figure 2 is a schematic diagram of the overall process of the system provided by an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of the step flow of the remote OTA upgrade method for EMS devices provided by an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of the overall interaction solution flow of the remote OTA upgrade method for EMS devices provided by an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of the structure of the remote OTA upgrade device for EMS devices provided by an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of the structure of the electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the accompanying drawings and the description of the embodiments or the prior art. Obviously, the following descriptions of the structures of the accompanying drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. It should be noted here that the descriptions of these embodiments are used to help understand the present invention, but do not constitute a limitation to the present invention.
[0053] It should be understood that although terms such as first and second may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, the first unit may be referred to as the second unit, and similarly, the second unit may be referred to as the first unit, without departing from the scope of the exemplary embodiments of the present invention.
[0054] It should be understood that for the term "and / or" that may appear herein, it is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist simultaneously. For the term " / and" that may appear herein, it is a description of another association relationship of associated objects, indicating that two relationships may exist. For example, A / and B may represent: A exists alone, and A and B exist alone. Additionally, for the character " / " that may appear herein, generally, it represents that the associated objects before and after are in an "or" relationship.
[0055] Embodiment:
[0056] See Figure 1 As shown, before elaborating on the remote OTA upgrade method of the EMS device provided in this embodiment, a remote OTA upgrade system for the EMS device is first provided. This system may but is not limited to include: a server, an edge device, and several EMS devices. Among them, an edge device can be configured for all EMS devices of different energy storage stations. The edge device is respectively communicatively connected to the server and the corresponding EMS devices. In this way, the Internet access capability of the edge device can be utilized to interact with the server, thereby realizing the remote OTA upgrade of each EMS device.
[0057] Specifically, see Figure 2As shown, the technician uploads the double - encrypted program upgrade file and the corresponding configuration file (the above two files are included in the following upgrade file) to the server. The server determines whether an upgrade is needed by checking the version number of the EMS device. If it is found that an upgrade is required, the server sends a second upgrade command and sends the download address of the corresponding upgrade file to the edge device. After receiving the corresponding content, the edge device downloads the upgrade file to the local through FTP, then decrypts it at one layer according to its internal key and verifies the decrypted file, and then stores the verified upgrade file at the specified location.
[0058] Then, an upgrade command is sent to the EMS device to be upgraded. After receiving the upgrade command, the device - side EMS downloads the upgrade file from the specified location through FTP, then decrypts it at two layers according to its internal key, verifies the decrypted file, and then performs the upgrade operation, and sends the corresponding upgrade status to the edge device. At the same time, after the upgrade is completed, it sends the latest version number to the edge device. Finally, the edge device can collate and count the upgrade status and the latest version number of the device - side EMS and forward them to the server for visual display, and the technician can view information such as the upgrade status and the latest version number of the device through the server.
[0059] In this way, this system can achieve the simultaneous remote upgrade of a large number of EMS devices, and the entire upgrade process does not require manual intervention. Therefore, it not only improves the upgrade efficiency but also reduces the upgrade cost. So, it is very suitable for large - scale application and promotion.
[0060] See Figure 3 As shown, the remote OTA upgrade method for the EMS device provided in this embodiment can run on the server, edge device, and EMS device side, but is not limited to this. It can be understood that the foregoing execution entities do not constitute a limitation to the embodiments of the present application. Correspondingly, the running steps of this method can be but are not limited to the following steps S1 - S4 as shown.
[0061] S1. Obtain the software version numbers of each EMS device and send the software version numbers of each EMS device to the server, so that the server can determine the devices to be upgraded from all EMS devices according to the software version numbers of each EMS device, and send the download address of the upgrade file of the devices to be upgraded to the edge device; In this embodiment, for example, the edge device can, but is not limited to, regularly send a first version number request instruction to each EMS device based on the Modbus TCP protocol; after each EMS device receives the first version number request instruction sent by the edge device, it can return its own software version number and SN code (Serial Number) to the edge device; in this way, the edge device can regularly obtain the software version numbers and SN codes of each EMS device, and the SN code can be used for subsequent confirmation of the devices to be upgraded.
[0062] Meanwhile, when the server (i.e., the cloud) obtains the software version numbers of all EMS devices in the energy storage station from the edge device through the MQTT protocol, the edge device can report the software version numbers and SN codes of all EMS devices to the cloud, that is: the server will send a second version number request instruction to the edge device through the MQTT protocol; and the edge device will receive the second version number request instruction sent by the server, and after receiving the second version number request instruction, send the software version numbers and SN codes of each EMS device to the server (of course, the information is also uploaded through the MQTT protocol); finally, the server can screen out the EMS devices whose software version numbers do not belong to the latest version number from all EMS devices according to the software version numbers of each EMS device, as the devices to be upgraded, and generate a second upgrade command for the devices to be upgraded, so as to send the download address of the upgrade file of the devices to be upgraded and the second upgrade command to the edge device, where the second upgrade command contains the SN code of the device to be upgraded, and the upgrade file contains a program upgrade file and a corresponding configuration file.
[0063] Of course, when the edge device obtains the software version number of the EMS device, it will also obtain the running status of each EMS device at the same time and send the running status to the server, and the server will send the aforementioned download address of the upgrade file and the second upgrade command to the edge device only when it determines that the device to be upgraded is in an idle state based on the running status of the device to be upgraded.
[0064] In this way, after the download address of the upgrade file and the second upgrade command are sent, the edge device can, based on this, perform file download and verification, and the process is as shown in the following step S2.
[0065] S2. Receive the upgrade file download address sent by the server, and download the upgrade file of the device to be upgraded from the server according to the upgrade file download address; in specific implementation, as previously described, after the server determines the device to be upgraded from all EMS devices, it will also generate a second upgrade command for the device to be upgraded at the same time; therefore, before the edge device downloads the upgrade file, it will first receive the second upgrade command sent by the server, and determine whether there is an EMS device in the target device set that matches the SN code in the second upgrade command (in this embodiment, the target device set includes all EMS devices managed by the edge device); thus, it is equivalent to judging whether there is an EMS device that matches the SN code among all the EMS devices it manages according to the SN code of the device to be upgraded. Among them, if it exists, it means that there is an EMS device that needs to be upgraded. At this time, the EMS device in the target device set that matches the SN code in the second upgrade command can be used as the device to be upgraded, and the upgrade file of the device to be upgraded can be downloaded from the server according to the upgrade file download address (the file can be downloaded through the FTP protocol (File Transfer Protocol)); otherwise, it means that there is no device that needs to be upgraded among the various EMS devices managed by this edge device. Therefore, the software upgrade process can be terminated, that is, no further processing is performed.
[0066] At the same time, as previously described, the upgrade file is a double-encrypted file, that is, the upgrade file stored in the server is a double-encrypted file. Therefore, after the edge device downloads the upgrade file of the device to be upgraded from the server according to the upgrade file download address, it is also necessary to perform file decryption and verification, and the process is as shown in the following steps S21 to S23.
[0067] S21. Use the first decryption key to perform a first-level decryption process on the upgrade file to obtain the first-level decrypted upgrade file; in specific implementation, the first decryption key is pre-sent by the server to the edge device. Therefore, when using it, by calling the first decryption key in its storage space, the first-level decryption process of the upgrade file can be completed, and thus the first-level decrypted upgrade file can be obtained; of course, the foregoing first-level decryption method can correspond to the corresponding first-level encryption method, and different decryption methods can be adopted according to different first-level encryption methods, which will not be specifically limited here.
[0068] After obtaining the first-level decrypted upgrade file, the verification of the first-level decrypted upgrade file can be performed, and the process is as shown in the following step S22.
[0069] Perform verification processing on the upgraded file after decryption at the first layer, and determine whether the verification passes; in specific applications, examples can include but are not limited to performing digital signature verification, file integrity verification, etc. Of course, the foregoing verification content and methods can be specifically set according to actual use; thus, when the verification passes, the file after decryption at the first layer can be stored and a download feedback can be sent; among them, the storage and feedback processes are as shown in step S23 below.
[0070] S23. If so, store the upgraded file after decryption at the first layer in a specified location, and reply to the server with a message indicating that the file download is successful; in specific applications, if the upgraded file after decryption at the first layer fails the verification, at this time, the edge device sends a message indicating that the upgrade file verification fails to the server through the MQTT protocol; of course, the foregoing specified location can be custom-set by the user and is not specifically limited here.
[0071] Thus, through the foregoing steps S21 - S23, the edge device can complete the download of the upgrade file and decryption at the first layer; then, a first upgrade command can be sent to the device to be upgraded, so that the device to be upgraded can download the upgraded file after decryption at the first layer from the edge device based on this first upgrade command for software update; among them, the foregoing command issuance and device upgrade processes can include but are not limited to as shown in step S3 and step S4 below.
[0072] S3. Generate a first upgrade command, where the first upgrade command contains the storage address of the upgrade file in the edge device; in specific applications, the edge device generates the first upgrade command according to the storage address corresponding to the specified location of the edge device; then, the first upgrade command can be sent to the device to be upgraded, so that the device to be upgraded can pull the upgraded file after decryption at the first layer according to the storage address in the first upgrade command, so as to perform software update based on this, where the update process is as shown in step S4 below.
[0073] S4. Send the first upgrade command to the device to be upgraded, so that after receiving the first upgrade command, the device to be upgraded switches its device status to the standby state, and downloads the upgrade file from the edge device according to the storage address in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade file; in this embodiment, as described above, the upgrade file is encrypted twice, and only one layer of decryption is performed at the edge device. Therefore, when the device to be upgraded receives the first upgrade command, it can download the upgrade file decrypted at one layer from the specified location of the edge device according to the storage address in the first upgrade command through the FTP protocol; then, use the second decryption key stored in itself to perform two-layer decryption processing on the upgrade file decrypted at one layer to obtain the decrypted upgrade file; then, perform verification processing on the decrypted upgrade file, and after the verification passes, perform software upgrade using the decrypted upgrade file; of course, if the verification fails, send an upgrade file verification failure message to the edge device through the Modbus TCP protocol.
[0074] Meanwhile, during the upgrade process, the device to be upgraded will also send upgrade status information to the edge device in real time, and after the upgrade is completed, it will send the upgraded software version number to the edge device, and the edge device can, based on this, perform statistics on the upgrade status and the latest version number of the ENMS device; finally, forward the statistical information to the server for display to the technical staff.
[0075] That is: the edge device will also receive the upgrade status information and the upgraded software version number sent by the device to be upgraded (wherein, the upgrade status information is sent to the edge device by the device to be upgraded in real time during the upgrade process, and the upgraded software version number is the version number corresponding to the software of the device to be upgraded after the upgrade is completed); then, based on the upgraded software version number, count the EMS devices that have been upgraded successfully and the EMS devices that have not been upgraded successfully (the quantity, the SN code corresponding to the device, the device number, etc. can be counted); finally, the edge device sends the upgraded software version number of the device to be upgraded, the EMS devices that have been upgraded successfully, the EMS devices that have not been upgraded successfully, and the upgrade status information to the server, so that the server visualizes the EMS devices that have been upgraded successfully, the EMS devices that have not been upgraded successfully, the upgraded software version number, and the upgrade status information, so as to facilitate the technical staff to view and master the remote OTA upgrade situation of the EMS devices.
[0076] Based on the foregoing description, the overall interaction scheme of the remote OTA upgrade method for the EMS device provided in this embodiment is as follows:
[0077] See Figure 4 as shown in
[0078] (1) The edge device regularly obtains its software version number from the device-side EMS at the device end through Modbus TCP. When the server obtains the software version numbers of all device-side EMSs in the energy storage station from the edge device through MQTT, the edge device reports the software version numbers of all device-side EMSs to the server.
[0079] (2) The server determines whether it is the latest program version by comparing the software version numbers of the device-side EMSs. If there is a device-side EMS that needs to upgrade the program and the server determines that the device is in an idle state, it will send an upgrade command and the download address of the upgrade file to the edge device through MQTT. The upgrade command contains the SN code of the device-side EMS that needs to be upgraded.
[0080] (3) After receiving the upgrade command and the download address, the edge device compares the SN codes of the device-side EMSs. If it finds that there is no device to be upgraded among the managed device-side EMSs, it will not perform further processing.
[0081] (4) If there are devices to be upgraded, the edge device automatically pulls the upgrade file from the server through FTP, and then decrypts it at one layer according to its internal key and verifies the decrypted file; among them, if the verification fails, it will send an upgrade file verification failure message to the server through MQTT.
[0082] (5) If the edge device successfully verifies the decrypted file, it will store the verified upgrade file in the specified location, finally reply to the server that the upgrade file has been pulled successfully, and send an upgrade command to the device-side EMS with the corresponding SN code through Modbus TCP.
[0083] (6) After receiving the upgrade command, all device-side EMSs will all switch to the standby state, download the upgrade file from the specified location of the edge device through FTP, and then decrypt it at two layers according to their internal keys and verify the decrypted file. If the verification is successful, they will then enter the upgrade state and perform the upgrade action; if the verification fails, they will send an upgrade file verification failure message to the edge device.
[0084] (7) All device-side EMSs automatically perform the upgrade and report the upgrade status to the edge device in real time through Modbus TCP.
[0085] (8) The edge device records the upgrade process status of all device-side EMSs until all devices are upgraded.
[0086] (9) The upgraded device-side uploads the latest program version number to the edge device through Modbus TCP.
[0087] (10) The edge device counts all the successful and unsuccessful device - side EMS upgrades, and uploads the latest software version numbers of the upgraded devices to the server via MQTT.
[0088] (11) The server can obtain the upgrade status and the latest version numbers of the device - side EMS sorted and counted by the edge device via MQTT, and display them to the technical staff.
[0089] Through the remote OTA upgrade method of the EMS device detailed in the foregoing steps S1 - S4, the present invention can achieve the simultaneous remote upgrade of a large number of EMS devices, and the entire upgrade process requires no manual intervention. Therefore, not only is the upgrade efficiency improved, but the upgrade cost is also reduced. Therefore, the present invention is very suitable for large - scale application and promotion.
[0090] As Figure 5 shown, in the second aspect of this embodiment, a hardware device for implementing the remote OTA upgrade method of the EMS device described in the first aspect of the embodiment is provided. Taking the device as an edge device as an example, it includes:
[0091] An acquisition unit, configured to acquire the software version numbers of each EMS device, and send the software version numbers of each EMS device to the server, so that the server determines the devices to be upgraded from all EMS devices according to the software version numbers of each EMS device, and sends the upgrade file download addresses of the devices to be upgraded to the edge device.
[0092] A download unit, configured to receive the upgrade file download address sent by the server, and download the upgrade file of the device to be upgraded from the server according to the upgrade file download address.
[0093] A command generation unit, configured to generate a first upgrade command, where the first upgrade command includes the storage address of the upgrade file in the edge device.
[0094] A sending unit, configured to send the first upgrade command to the device to be upgraded, so that after receiving the first upgrade command, the device to be upgraded switches its device state to the standby state, and downloads the upgrade file from the edge device according to the storage address in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade file.
[0095] For the working process, working details and technical effects of the device provided in this embodiment, reference can be made to the first aspect of the embodiment, which will not be elaborated here.
[0096] As Figure 6As shown in the figure, the third aspect of this embodiment provides another remote OTA upgrade device for an EMS device. Taking the device as an electronic device as an example, it includes: a memory, a processor, and a transceiver that are communicatively connected in sequence. Among them, the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer programs and execute the remote OTA upgrade method for the EMS device as described in the first aspect of the embodiment.
[0097] Specifically, the memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO), and / or first in last out (FILO), etc.; specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). At the same time, the processor may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state.
[0098] In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit). The GPU is responsible for rendering and drawing the content to be displayed on the display screen. For example, the processor may be, but is not limited to, a microprocessor of the STM32F105 series, a reduced instruction set computer (RISC) microprocessor, a processor with an X86 architecture, or a processor integrated with an embedded neural-network processing unit (NPU). The transceiver may be, but is not limited to, a Wi-Fi wireless transceiver, a Bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee (a low-power local area network protocol based on the IEEE 802.15.4 standard) wireless transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver, etc. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0099] For the working process, working details, and technical effects of the electronic device provided in this embodiment, reference may be made to the first aspect of the embodiment, which will not be elaborated herein.
[0100] In the fourth aspect of this embodiment, a storage medium storing instructions for the remote OTA upgrade method of the EMS device described in the first aspect of the embodiment is provided, that is, instructions are stored on the storage medium. When the instructions run on a computer, the remote OTA upgrade method of the EMS device described in the first aspect of the embodiment is executed.
[0101] Among them, the storage medium refers to a carrier for storing data, and may include, but is not limited to, a floppy disk, an optical disc, a hard disk, a flash memory, a USB flash drive, and / or a Memory Stick, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0102] For the working process, working details, and technical effects of the storage medium provided in this embodiment, reference may be made to the first aspect of the embodiment, which will not be elaborated herein.
[0103] In the fifth aspect of this embodiment, a computer program product containing instructions is provided. When the instructions run on a computer, the computer is caused to execute the remote OTA upgrade method of the EMS device described in the first aspect of the embodiment. Among them, the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0104] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A remote OTA upgrade method for EMS equipment, characterized in that: All EMS devices are configured with edge devices, wherein the edge devices are respectively communicatively connected with a server and each EMS device, and the method includes: Obtain the software version number of each EMS device, and send the software version number of each EMS device to the server, so that the server determines the device to be upgraded from all EMS devices according to the software version number of each EMS device, and sends the upgrade file download address of the device to be upgraded to the edge device; Receiving the upgrade file download address sent by the server, and downloading the upgrade file of the device to be upgraded from the server according to the upgrade file download address; Generate a first upgrade command, wherein the first upgrade command includes a storage address of the upgrade file in the edge device; The first upgrade command is sent to the device to be upgraded, so that after receiving the first upgrade command, the device to be upgraded switches the device state to the standby state, and downloads the upgrade file from the edge device according to the storage address in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade file.
2. The method according to claim 1, characterized in that Obtain the software version number of each EMS device, including: Based on the Modbus TCP protocol, a first version number request instruction is periodically sent to each EMS device, so that each EMS device returns its own software version number and SN code to the edge device after receiving the first version number request instruction; Receive the software version number and SN code returned by each EMS device; Accordingly, the software version number of each EMS device is sent to the server, which includes: Receive a second version number request instruction issued by the server, and after receiving the second version number request instruction, send the software version number and SN code of each EMS device to the server, so that the server can filter out EMS devices whose software version numbers do not belong to the latest version number from all EMS devices according to the software version numbers of each EMS device as devices to be upgraded, and generate a second upgrade command for the devices to be upgraded, so as to send the upgrade file download address of the devices to be upgraded and the second upgrade command to the edge device, wherein the second upgrade command includes the SN code of the device to be upgraded.
3. The method according to claim 1, characterized in that: After determining the device to be upgraded from all EMS devices, the server will also generate a second upgrade command for the device to be upgraded, and the second upgrade command includes the SN code of the device to be upgraded; Before downloading the upgrade file of the device to be upgraded from the server according to the upgrade file download address, the method further includes: Receive a second upgrade command sent by the server, and determine whether there is an EMS device matching the SN code in the second upgrade command in the target device set, wherein the target device set includes all EMS devices managed by the edge device; If so, the EMS devices that match the SN code in the second upgrade command are concentrated as the devices to be upgraded, and the upgrade file of the devices to be upgraded is downloaded from the server according to the upgrade file download address.
4. The method according to claim 1, characterized in that: The upgrade file stored in the server is a double encrypted file, wherein, after downloading the upgrade file of the device to be upgraded from the server according to the upgrade file download address, the method further includes: Using the first decryption key, performing a layer of decryption processing on the upgrade file to obtain a layer of decrypted upgrade file; Verifying the upgraded file after the decryption of the first layer and determining whether the verification passes; If yes, the decrypted upgrade file is stored in the specified location, and the server is replied with a successful file download message.
5. The method according to claim 4, characterized in that If the verification of the upgrade file after the first layer of decryption fails, the method further includes: Send upgrade file verification failure information to the server via the MQTT protocol.
6. The method according to claim 1, characterized in that The upgrade file stored in the edge device is a decrypted upgrade file, wherein generating a first upgrade command includes: Generate the first upgrade command according to the storage address corresponding to the designated position of the edge device; The first upgrade command is sent to the device to be upgraded, so that the device to be upgraded downloads the first-layer decrypted upgrade file from the specified location of the edge device through the FTP protocol according to the storage address in the first upgrade command, so as to use the second decryption key stored in itself to perform a second-layer decryption processing on the first-layer decrypted upgrade file to obtain the decrypted upgrade file, and verify the decrypted upgrade file, so as to use the decrypted upgrade file to perform software upgrade after the verification passes.
7. The method according to claim 1, characterized in that The method further comprises: Receive upgrade status information and upgraded software version number sent by the device to be upgraded, wherein the upgrade status information is sent by the device to be upgraded to the edge device in real time during the upgrade process, and the upgraded software version number is the version number corresponding to the software of the device to be upgraded after the upgrade is completed; Based on the upgraded software version number, statistics are obtained on the EMS devices that have been successfully upgraded and the EMS devices that have not been successfully upgraded, and the upgraded software version numbers of the devices to be upgraded, the EMS devices that have been successfully upgraded, the EMS devices that have not been successfully upgraded, and the upgrade status information are sent to the server, so that the server can visualize the EMS devices that have been successfully upgraded, the EMS devices that have not been successfully upgraded, the upgraded software version numbers, and the upgrade status information.
8. A remote OTA upgrade device for EMS equipment, characterized in that: All EMS devices are configured with edge devices, wherein the edge devices are respectively connected to the server and each EMS device in communication, and the device includes: An acquisition unit, used to acquire software version numbers of each EMS device, and send the software version numbers of each EMS device to the server, so that the server determines the device to be upgraded from all EMS devices according to the software version numbers of each EMS device, and sends the upgrade file download address of the device to be upgraded to the edge device; A download unit, configured to receive an upgrade file download address sent by a server, and download the upgrade file of the device to be upgraded from the server according to the upgrade file download address; A command generating unit, configured to generate a first upgrade command, wherein the first upgrade command includes a storage address of an upgrade file in an edge device; A sending unit is used to send the first upgrade command to the device to be upgraded, so that after receiving the first upgrade command, the device to be upgraded switches the device state to the standby state, and downloads the upgrade file from the edge device according to the storage address in the first upgrade command, so as to perform software upgrade according to the downloaded upgrade file.
9. An electronic device, characterized in that: include: A memory, a processor and a transceiver that are sequentially communicatively connected, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program, and execute the remote OTA upgrade method of the EMS device as described in any one of claims 1 to 7.
10. A computer program product comprising instructions, characterized in that When the instructions are executed on a computer, the computer is enabled to execute the remote OTA upgrade method for EMS equipment according to any one of claims 1 to 7.