Disclosure of Invention
In view of the above, an object of the present invention is to provide a program upgrading method, system, application system, and storage medium, which can upgrade a target device through a server.
According to an aspect of the present invention, there is provided a program upgrading method including: the method comprises the steps that a server responds to a received program upgrading request sent by a client, obtains a first program upgrading file according to the program upgrading request and determines target equipment; the server generates an upgrade verification request based on the program upgrade request and the first program upgrade file, and sends the upgrade verification request to the target device; and the server correspondingly performs program upgrading treatment according to verification result information returned by the target equipment for the upgrading verification request so as to upgrade the program of the target equipment.
Optionally, the obtaining a first program upgrade file according to the program upgrade request and determining the target device includes: the server extracts file information from the program upgrading request, and obtains the first program upgrading file corresponding to the file information and first version information corresponding to the first program upgrading file; the server extracts first address information from the program upgrading request and determines the target equipment corresponding to the first address information.
Optionally, the generating, by the server, an upgrade verification request based on the program upgrade request and the first program upgrade file includes: the server calculates a first check code of the first program upgrading file by using a first check code generating algorithm; the server generates the upgrade verification request; wherein, the information carried by the upgrade verification request includes: the first address information, the first version information, and the first check code.
Optionally, the target device determines whether second address information configured by the target device is matched with the first address information, and determines whether a version corresponding to second version information of a currently running program is lower than a version corresponding to the first version information; if both the two judgment results are yes, the target device generates verification result information used for indicating successful verification and returns the verification result information, and if at least one of the two judgment results is no, the target device generates verification result information used for indicating failed verification, adds the second address information and/or the second version information, and returns the verification result information.
Optionally, the performing, by the server, corresponding program upgrade processing according to verification result information returned by the target device for the upgrade verification request, so that the performing, by the target device, program upgrade includes: the server encrypts the first program upgrading file to obtain program upgrading encrypted data; if the verification is determined to be successful according to the verification result information, the server sends the program upgrading encrypted data to the target equipment so that the target equipment can carry out program upgrading according to the program upgrading encrypted data; if the verification is determined to fail according to the verification result information, the server sends upgrade information exception prompt information to the client, wherein the upgrade information exception prompt information comprises: the second address information and/or the second version information.
Optionally, the encrypting, by the server, the first program upgrade file to obtain program upgrade encrypted data includes: the server divides the first program upgrading file to generate a plurality of first data blocks and sets numbers corresponding to the first data blocks; the server calculates a second check code of the first data block by using a second check code generation algorithm; and the server encrypts the first data block by using a preset encryption algorithm to generate an encrypted data block.
Optionally, the sending, by the server, the program upgrade encrypted data to the target device includes: the server sequentially sends the plurality of encrypted data blocks, the corresponding serial numbers and the second check codes to the target equipment; wherein the encrypted data block comprises: at least one encrypted data frame.
Optionally, after sending each encrypted data block, the corresponding number, and the second check code to the target device, the server receives first response information returned by the target device; if the server determines that the sending is successful according to the first response information, the server continues to send the next encrypted data block, the corresponding number and the second check code; and if the server determines that the transmission fails according to the first response information, the server acquires the number information from the first response information and retransmits the encrypted data block corresponding to the number information, the number and the second check code.
Optionally, the server records retransmission times of retransmitting the encrypted data block corresponding to the number information and the number and the second check code; and if the retransmission times are larger than or equal to a preset time threshold, the server stops data transmission and transmits upgrading program transmission failure information to the client.
Optionally, the target device decrypts the received encrypted data block by using the encryption algorithm to obtain a second data block; the target device calculates a third check code of the second data block by using the second check code generation algorithm; and the target equipment judges whether a second verification code corresponding to the received encrypted data block is the same as the third verification code, if so, the target equipment determines that the transmission is successful, generates and returns first response information carrying transmission success information, and if not, the target equipment determines that the transmission is failed, generates and returns first response information carrying transmission failure information and a number corresponding to the received encrypted data block.
Optionally, when the server sends the last encrypted data block, the sending end identification information, the number, and the second check code to the target device.
Optionally, the target device determines, according to the transmission end identification information, that the received encrypted data block is the last encrypted data block, and if it is determined that the last encrypted data block is successfully transmitted, merges all second data blocks to generate a second program upgrade file; calculating a fourth check code of the second program upgrading file by utilizing the first check code generating algorithm; and the target equipment judges whether the fourth verification code is the same as the first verification code, and if not, a program receiving failure message is generated and returned.
Optionally, if the fourth verification code is the same as the first verification code, the target device performs automatic upgrade based on the second program upgrade file, if the upgrade is successful, a program upgrade success message is returned, and if the upgrade is failed, a program upgrade failure message is returned; and the server generates prompt information according to the received program upgrading success message, the received program upgrading failure message or the received program receiving failure message sent by the target equipment and sends the prompt information to the client.
Optionally, the client includes: a web page client; the first program upgrade file includes: a bin file; the target device includes: processor means, gateway device.
According to another aspect of the present invention, there is provided a program upgrading system including: a server, comprising: the upgrading determining module is used for responding to a received program upgrading request sent by a client, obtaining a first program upgrading file according to the program upgrading request and determining target equipment; the upgrading verification module is used for generating an upgrading verification request based on the program upgrading request and the first program upgrading file and sending the upgrading verification request to the target equipment; and the upgrading processing module is used for carrying out corresponding program upgrading processing according to the verification result information which is returned by the target equipment and is used for the upgrading verification request so as to upgrade the program of the target equipment.
Optionally, the upgrade determining module is configured to extract file information from the program upgrade request, and obtain the first program upgrade file corresponding to the file information and first version information corresponding to the first program upgrade file; extracting first address information from the program upgrading request, and determining the target equipment corresponding to the first address information.
Optionally, the upgrade verification module is configured to calculate a first check code of the first program upgrade file by using a first check code generation algorithm; generating the upgrade verification request; wherein, the information carried by the upgrade verification request includes: the first address information, the first version information, and the first check code.
Optionally, the target device includes: the verification unit is used for judging whether self-configured second address information is matched with the first address information or not and judging whether the version corresponding to the second version information of the current running program is lower than the version corresponding to the first version information or not; if both judgment results are yes, generating the verification result information used for indicating the verification success and returning, and if at least one of the two judgment results is no, generating the verification result information used for indicating the verification failure and adding the second address information and/or the second version information, and returning the verification result information.
Optionally, the upgrade processing module includes: the file processing unit is used for carrying out encryption processing on the first program upgrading file to obtain program upgrading encryption data; the file sending unit is used for sending the program upgrading encrypted data to the target equipment if the verification is determined to be successful according to the verification result information so as to enable the target equipment to carry out program upgrading according to the program upgrading encrypted data; an information prompting unit, configured to send upgrade information exception prompting information to the client if it is determined that the verification fails according to the verification result information, where the upgrade information exception prompting information includes: the second address information and/or the second version information.
Optionally, the file processing unit is configured to split the first program upgrade file, generate a plurality of first data blocks, and set numbers corresponding to the first data blocks; calculating a second check code of the first data block by using a second check code generation algorithm; and encrypting the first data block by using a preset encryption algorithm to generate an encrypted data block.
Optionally, the file sending unit is configured to send the plurality of encrypted data blocks, the corresponding numbers, and the second check code to the target device in sequence; wherein the encrypted data block comprises: at least one encrypted data frame.
Optionally, the file sending unit is further configured to receive first response information returned by the target device after sending each encrypted data block and the corresponding number and second check code to the target device; if the transmission is determined to be successful according to the first response information, continuing to transmit the next encrypted data block, the corresponding number and the second check code; and if the transmission is determined to fail according to the first response information, acquiring the number information from the first response information, and retransmitting the encrypted data block corresponding to the number information, the number and the second check code.
Optionally, the file sending unit is further configured to record retransmission times of retransmitting the encrypted data block corresponding to the number information and the number and the second check code; if the retransmission times are larger than or equal to a preset time threshold value, stopping data transmission; and the information prompting unit is used for sending upgrading program sending failure information to the client.
Optionally, the target device includes: the decryption unit is used for decrypting the received encrypted data block by using the encryption algorithm to obtain a second data block; the verification unit is used for calculating a third check code of the second data block by using the second check code generation algorithm; and judging whether a second verification code corresponding to the received encrypted data block is the same as the third verification code, if so, determining that the transmission is successful, generating and returning first response information carrying transmission success information, and if not, determining that the transmission is failed, generating and returning the first response information carrying transmission failure information and a number corresponding to the received encrypted data block.
Optionally, the file sending unit is further configured to send the last encrypted data block, the sending end identifier information, the number, and the second check code to the target device when the last encrypted data block is sent.
Optionally, the target device includes: a merging unit, configured to determine that the received encrypted data block is the last encrypted data block according to the transmission end identification information, and if it is determined that the last encrypted data block is successfully transmitted, merge all second data blocks to generate a second program upgrade file; the verification unit is used for calculating a fourth check code of the second program upgrading file by utilizing the first check code generation algorithm; and judging whether the fourth verification code is the same as the first verification code, if not, generating a program receiving failure message and returning.
Optionally, the target device includes: the upgrading unit is used for automatically upgrading the target equipment based on the second program upgrading file if the fourth verification code is the same as the first verification code, returning a program upgrading success message if the upgrading is successful, and returning a program upgrading failure message if the upgrading is failed; and the information prompting unit is used for generating prompting information according to the received program upgrading success message, the received program upgrading failure message or the received program receiving failure message sent by the target equipment and sending the prompting information to the client.
Optionally, the client includes: a web page client; the first program upgrade file includes: a bin file; the target device includes: processor means, gateway device.
According to still another aspect of the present invention, there is provided a program upgrading system including: a memory; and a processor coupled to the memory, the processor configured to perform the method as described above based on instructions stored in the memory.
According to still another aspect of the present invention, there is provided an application system including: a program upgrade system as described above.
Optionally, the application system includes: an IEMS system.
According to yet another aspect of the invention, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method as described above.
According to the program upgrading method, the system, the application system and the storage medium, the server obtains a program upgrading file according to a program upgrading request sent by a client, determines target equipment, generates an upgrading verification request and sends the upgrading verification request to the target equipment; carrying out corresponding program upgrading treatment according to verification result information which is returned by the target equipment and is used for upgrading the verification request; the remote program upgrading can be realized, and the operation is more convenient and simpler than the field program upgrading operation; the program upgrading does not need to be carried out by a person on site, so that the labor expenditure can be reduced, and the cost of after-sale maintenance upgrading of the product is reduced; the efficiency and the safety of program upgrading can be improved.
Detailed Description
The present invention now will be described more fully hereinafter with reference to the accompanying drawings, in which exemplary embodiments of the invention are shown. The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The technical solution of the present invention is described in various aspects below with reference to various figures and embodiments.
The terms "first", "second", and the like are used hereinafter only for descriptive distinction and have no other special meaning.
Fig. 1 is a schematic flowchart of an embodiment of a program upgrading method according to the present invention, as shown in fig. 1:
step 101, a server responds to a received program upgrading request sent by a client, obtains a first program upgrading file according to the program upgrading request, and determines target equipment.
The client can be a webpage client and the like, the webpage client can be a smart phone, a personal computer, a tablet computer, a portable computer and the like, the webpage client can support the embedding of a page in a browser, and a user can complete functions such as program upgrading of target equipment through the page. The client can be connected with the server through the network to establish connection with the server. The server can be a background server corresponding to a page opened by the webpage client, and performs data interaction with the client to complete various functions.
The target device may be a variety of devices, such as a FirmWare (FirmWare) device, where the FirmWare is a hardware device with a software function, and a driver of the device is stored inside the device, and a specific operation action may be implemented according to the driver. The target device may include a processor apparatus, a gateway device, and the like.
The server may be a variety of servers or other devices, and stores a first program upgrade file, which may be a firmware upgrade program file or the like, and may be a bin file or the like, where the bin file is a binary file. The server may be connected to the target device via a bus, an industrial ethernet, etc. The user can select a bin file for upgrading the target equipment on a webpage of the client, select the address of the target equipment, and click an upgrade issuing button to send a program upgrade request to the server.
And 102, the server generates an upgrading verification request based on the program upgrading request and the first program upgrading file, and sends the upgrading verification request to the target equipment.
And 103, the server correspondingly performs program upgrading processing according to verification result information returned by the target equipment for the upgrading verification request so as to upgrade the program of the target equipment.
In one embodiment, there may be multiple ways to obtain the first program upgrade file and determine the target device based on the program upgrade request. For example, the server extracts the file information from the program upgrade request, obtains a first program upgrade file corresponding to the file information, and obtains first version information corresponding to the first program upgrade file, where the first version information may be a version number or the like.
The server extracts the first address information from the program upgrading request and determines the target equipment corresponding to the first address information. The first address information may be various kinds of address information, for example, may be primary address information or secondary address information, etc. The central processing unit is a father node, and the primary address is a corresponding central processing unit number or an MAC address of the central processing unit; the gateway is a child node under the central processing unit, and the secondary address is a gateway number defined by the corresponding gateway or an MAC address of the gateway.
There may be a variety of ways for the server to generate the upgrade validation request based on the program upgrade request and the first program upgrade file. For example, the server calculates a first check code of the first program upgrade file using a first check code generation algorithm. The first Check code generation algorithm may have a variety of algorithms, for example, the first Check code generation algorithm is a CRC Check algorithm or the like, and CRC is Cyclic Redundancy Check (Cyclic Redundancy Check) to ensure correctness and integrity of data transmission. The server generates an upgrade verification request, wherein information carried by the upgrade verification request comprises: the first address information, the first version information, the first check code and the like. The upgrade verification request may take a variety of formats, and may be, for example, a can frame, an ethernet message, etc.
Fig. 2 is a schematic flowchart illustrating verification of an upgrade verification request in an embodiment of a program upgrade method according to the present invention, as shown in fig. 2:
step 201, the target device determines whether the second address information configured by the target device is matched with the first address information, and whether the version corresponding to the second version information of the currently running program is lower than the version corresponding to the first version information.
For example, after receiving an upgrade validation request sent by a server, a target device extracts first address information and first version information from the upgrade validation request. The target device judges whether the second address information configured by the target device is equal to the first address information or not, judges whether the version corresponding to the second version information of the currently-operated program is lower than the version corresponding to the first version information or not, and carries out judgment twice.
If so, the target device generates verification result information indicating that the verification is successful and returns,step 202.
For example, if the second address information is the same as the first address information and the version corresponding to the second version information of the currently running program is lower than the version corresponding to the first version information, verification result information indicating that the verification is successful is generated and sent to the server.
If not, the target device generates verification result information indicating that the verification fails, adds second address information and/or second version information, and returns the verification result information.
For example, if the second address information is different from the first address information and the version corresponding to the second version information of the currently running program is higher than the version corresponding to the first version information, verification result information indicating that verification fails is generated, and the second address information and the second version information are added to the verification result information and sent to the server.
In one embodiment, the server performs corresponding program upgrading processing according to verification result information returned by the target device for the upgrade verification request by adopting a plurality of methods. Fig. 3 is a schematic flow chart of sending program upgrade data in an embodiment of the program upgrade method according to the present invention, as shown in fig. 3:
step 301, the server encrypts the first program upgrade file to obtain program upgrade encrypted data. The encryption process may employ a variety of encryption algorithms.
Step 302, if the verification is determined to be successful according to the verification result information, the server sends the program upgrading encrypted data to the target device, so that the target device performs program upgrading according to the program upgrading encrypted data.
Step 303, if the verification is determined to fail according to the verification result information, the server sends upgrade information exception prompting information to the client, wherein the upgrade information exception prompting information includes: second address information and/or second version information.
For example, if the second address information is different from the first address information and/or the version corresponding to the second version information of the currently running program is higher than the version corresponding to the first version information, the server sends upgrade information exception prompt information to the client, where the upgrade information exception prompt information includes the second address information and/or the second version information. The user can reselect the upgrade file or other operations according to the upgrade information abnormity prompting information displayed in the page.
In one embodiment, the server may perform an encryption process on the first program upgrade file to obtain the program upgrade encrypted data in a variety of ways. Fig. 4 is a schematic flowchart of generating an encrypted data block in an embodiment of the program upgrading method according to the present invention, as shown in fig. 4:
step 401, the server performs splitting processing on the first program upgrade file, generates a plurality of first data blocks, and sets numbers corresponding to the first data blocks.
For example, the number of bytes of the first program upgrade file is obtained, the first program upgrade file is split according to the size of the number of bytes, the first program upgrade file may be split according to a preset protocol, the first program upgrade file is split into a plurality of first data blocks, and the first data blocks may include one or more bus data frames, and the like. The number may be the ID of the first data block, etc.
Instep 402, the server calculates a second parity code of the first data block using a second parity code generation algorithm. The second check code generation algorithm may have various algorithms, such as a CRC check algorithm, etc.
Instep 403, the server encrypts the first data block by using a preset encryption algorithm to generate an encrypted data block. The encryption algorithm may employ various encryption algorithms, such as an AES encryption algorithm, and the like.
Instep 404, the server sequentially sends a plurality of encrypted data blocks, which include at least one encrypted data frame, and corresponding numbers and second check codes to the target device. The split first data blocks can be numbered according to the sequence, and the plurality of encrypted data blocks, the corresponding numbers and the second check codes are sent to the target device according to the sequence of the numbers.
Fig. 5 is a schematic flowchart of sending an encrypted data block in an embodiment of the program upgrading method according to the present invention, as shown in fig. 5:
step 501, after sending each encrypted data block, the corresponding number and the second check code to the target device, the server receives first response information returned by the target device.
Step 502, if the transmission is determined to be successful according to the first response information, the server continues to transmit the next encrypted data block and the corresponding number and second check code.
Instep 503, if it is determined that the transmission fails according to the first response information, the server acquires the number information from the first response information, and retransmits the encrypted data block corresponding to the number information, the number, and the second check code.
For example, after sending the second encrypted data block and the corresponding number and second check code to the target device, the server receives the first response information returned by the target device. If the transmission is determined to be successful according to the first response information, the server continues to transmit the third encrypted data block and the corresponding number and second check code.
And if the transmission failure is determined according to the first response information, the server acquires the number information from the first response information, determines that the second encrypted data block fails to be transmitted based on the number information, and retransmits the second encrypted data block corresponding to the number information, the number and the second check code.
And the server records the retransmission times of retransmitting the encrypted data block corresponding to the number information and the number and the second check code, and stops data transmission and transmits upgrading program transmission failure information to the client if the retransmission times are greater than or equal to a preset time threshold. The number threshold may be 3 times, etc., for example, if the number of retransmissions is equal to 3 times, the server stops data transmission and transmits upgrade program transmission failure information to the client.
Fig. 6 is a schematic flowchart of verifying a received encrypted data block in an embodiment of a program upgrading method according to the present invention, as shown in fig. 6:
step 601, the target device decrypts the received encrypted data block by using the encryption algorithm to obtain a second data block. The target device uses the same encryption algorithm as the server, and can share the secret key used by the encryption algorithm.
Instep 602, the target device calculates a third parity code of the second data block using the second parity code generation algorithm.
Instep 603, the target device determines whether the second verification code and the third verification code corresponding to the received encrypted data block are the same.
And step 604, if so, determining that the transmission is successful, generating first response information carrying the transmission success information and returning, and if not, determining that the transmission is failed, generating first response information carrying the transmission failure information and the number corresponding to the received encrypted data block and returning.
For example, if it is determined that the second encrypted data block fails to be transmitted, first response information carrying transmission failure information and a number corresponding to the second encrypted data block is generated and transmitted to the server. When the server sends the last encrypted data block, the sending end identification information, the serial number and the second check code to the target equipment, wherein the end identification information can adopt various identifications.
Fig. 7 is a schematic flow chart of performing automatic upgrade in an embodiment of the program upgrade method according to the present invention, as shown in fig. 7:
instep 701, the target device determines that the received encrypted data block is the last encrypted data block according to the transmission end identifier information.
Step 702, if it is determined that the last encrypted data block is successfully transmitted, merging all the second data blocks to generate a second program upgrade file. The program generation file having the original format may be generated using a merging method corresponding to the splitting method used by the server.
And 703, calculating a fourth check code of the second program upgrading file by using the first check code generating algorithm.
Step 704, the target device determines whether the fourth verification code is the same as the first verification code, and if not, the generating program receives a failure message and returns the failure message.
Step 705, if the fourth verification code is the same as the first verification code, the target device performs automatic upgrade based on the second program upgrade file, and the automatic upgrade may adopt various existing program upgrade modes. If the upgrade is successful, returning a program upgrade success message, and if the upgrade is failed, returning a program upgrade failure message.
And the server generates prompt information according to the received program upgrading success message, the received program upgrading failure message or the received program receiving failure message sent by the target equipment and sends the prompt information to the client. For example, program upgrade success prompt information, program upgrade failure prompt information, or program reception failure prompt information is generated according to the program upgrade success message, the program upgrade failure message, or the program reception failure message, respectively, and is sent to the client. The user can further process the program upgrading success prompt message, the program upgrading failure prompt message or the program receiving failure prompt message displayed by the webpage in the client.
In one embodiment, as shown in fig. 8A, the present invention provides a program upgrade system, comprising: a server 82. As shown in fig. 8B, the server 82 includes: an upgrade determination module 821, an upgrade validation module 822, and an upgrade processing module 823.
The upgrade determination module 821, in response to a received program upgrade request sent by the client 81, obtains a first program upgrade file according to the program upgrade request and determines a target device. The upgrade validation module 822 generates an upgrade validation request based on the program upgrade request and the first program upgrade file, and transmits the upgrade validation request to the target device.
The upgrade processing module 823 performs corresponding program upgrade processing according to the verification result information for the upgrade verification request returned by the target device. The client 81 includes a web page client and the like; the first program upgrade file comprises a bin file and the like; the target device includes a processor apparatus, a gateway device, and the like.
In one embodiment, the upgrade determination module 821 extracts file information from the program upgrade request, and obtains a first program upgrade file corresponding to the file information and first version information corresponding to the first program upgrade file. The upgrade determination module 821 extracts the first address information from the program upgrade request, and determines a target device corresponding to the first address information.
The upgrade verification module 822 calculates a first check code of the first program upgrade file using a first check code generation algorithm. The upgrade validation module 822 generates an upgrade validation request; the information carried by the upgrade verification request comprises first address information, first version information, a first check code and the like.
As shown in fig. 8D, the target device 83 includes: a verification unit 831. The verification unit 831 determines whether the second address information configured by itself matches the first address information and whether the version corresponding to the second version information of the currently running program is lower than the version corresponding to the first version information; if so, the verification unit 831 generates verification result information indicating a success of the verification, and if not, the verification unit 831 generates verification result information indicating a failure of the verification and adds the second address information and/or the second version information, returning this verification result information.
As shown in fig. 8C, the upgrade processing module 823 includes: a file processing unit 823, a file transmitting unit 824, and an information presentation unit 825. The file processing unit 824 performs encryption processing on the first program upgrade file to obtain program upgrade encrypted data. If it is determined that the verification is successful according to the verification result information, the file transmitting unit 825 transmits the program upgrade encryption data to the target device so that the target device performs program upgrade according to the program upgrade encryption data. If the verification is determined to fail according to the verification result information, the information prompt unit 825 sends upgrade information exception prompt information to the client 81, where the upgrade information exception prompt information includes: second address information and/or second version information.
In one embodiment, the file processing unit 824 performs a splitting process on the first program upgrade file, generates a plurality of first data blocks, and sets numbers corresponding to the first data blocks. The file processing unit 824 calculates the second parity of the first data block using the second parity generation algorithm. The file processing unit 824 performs encryption processing on the first data block by using a preset encryption algorithm to generate an encrypted data block.
The file transmitting unit 825 sequentially transmits a plurality of encrypted data blocks, which include at least one encrypted data frame, and corresponding numbers and second check codes to the target device. The file sending unit 825 receives the first response information returned by the target device after sending each encrypted data block and the corresponding number and second check code to the target device.
If it is determined from the first response information that the transmission is successful, the file transmission unit 825 continues to transmit the next encrypted data block and the corresponding number and second check code. If it is determined that the transmission has failed based on the first response information, the file transmission unit 825 acquires the number information from the first response information, and retransmits the encrypted data block corresponding to the number information together with the number and the second check code.
The file transmission unit 825 records the number of retransmissions of the encrypted data block corresponding to the number information and the number and the second check code. The file transmission unit 825 stops data transmission if the number of retransmissions is greater than or equal to a preset number threshold; the information prompt unit 826 transmits upgrade program transmission failure information to the client 81.
In one embodiment, the destination device 83 includes a decryption unit 832, and the decryption unit 832 performs decryption processing on the received encrypted data block by using an encryption algorithm to obtain a second data block. The verification unit 831 calculates a third check code of the second data block using the second check code generation algorithm.
The verification unit 831 determines whether the second verification code corresponding to the received encrypted data block is identical to the third verification code, and if so, the verification unit 831 determines that the transmission is successful, generates and returns first response information carrying transmission success information, and if not, the verification unit 831 determines that the transmission is failed, generates and returns first response information carrying transmission failure information, a number corresponding to the received encrypted data block. The file transmission unit 825 transmits the last encrypted data block, the transmission end identification information, and the number and the second check code to the target device when transmitting the last encrypted data block.
The target device 83 includes a merging unit 833, and the merging unit 833 determines that the received encrypted data block is the last encrypted data block according to the transmission end identification information, and if it is determined that the last encrypted data block is successfully transmitted, performs merging processing on all the second data blocks, and generates the second program upgrade file. The verification unit 831 calculates a fourth check code of the second program upgrade file using the first check code generation algorithm. The verification unit 831 determines whether the fourth verification code is the same as the first verification code, and if not, generates a program reception failure message and returns.
The target device 83 includes an upgrade unit 834. If the fourth verification code is the same as the first verification code, the upgrade unit 834 performs automatic upgrade based on the second program upgrade file, if the upgrade is successful, the upgrade unit 834 returns a program upgrade success message, and if the upgrade is failed, the upgrade unit 834 returns a program upgrade failure message. The information prompting unit 826 generates prompting information according to the received program upgrade success message, program upgrade failure message, or program reception failure message sent by the target device, and sends the prompting information to the client 81.
Fig. 9 is a block diagram of another embodiment of a program upgrade system according to the present invention. As shown in fig. 9, the apparatus may include amemory 91, aprocessor 92, acommunication interface 93, and a bus 94. Thememory 91 is used for storing instructions, theprocessor 92 is coupled to thememory 91, and theprocessor 92 is configured to execute the program upgrading method implemented above based on the instructions stored in thememory 91.
Thememory 91 may be a high-speed RAM memory, a non-volatile memory (non-volatile memory), or the like, and thememory 91 may be a memory array. Thestorage 91 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules. Theprocessor 92 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement the program upgrade method of the present disclosure.
In one embodiment, the invention is an application system comprising: the program upgrading system is as above. The application System includes an IEMS (Intelligent Energy Management System) System and the like.
In one embodiment, the present disclosure provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a program upgrade method as in any one of the above embodiments.
In the program upgrading method, system, application system and storage medium in the above embodiments, the server obtains a program upgrading file according to a program upgrading request sent by the client, determines the target device, generates an upgrading verification request, and sends the upgrading verification request to the target device; carrying out corresponding program upgrading treatment according to verification result information which is returned by the target equipment and is used for upgrading the verification request; the program upgrading can be realized, and the operation is more convenient and simpler than the field program upgrading operation; the program upgrading does not need to be carried out by a person on site, so that the labor expenditure can be reduced, and the cost of after-sale maintenance upgrading of the product is reduced; the program upgrading does not need to be operated by using a writer, is convenient and simple, and improves the efficiency and the safety of the program upgrading.
The method and system of the present invention may be implemented in a number of ways. For example, the methods and systems of the present invention may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically indicated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as a program recorded in a recording medium, the program including machine-readable instructions for implementing a method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.