Complete machine upgrading method and system for multi-plug-in relay protection device

By decrypting and verifying the encryption upgrade package, the upgrade tasks are extracted and sorted, and version comparison and automatic upgrades are performed, which solves the problems of cumbersome operation of traditional upgrade methods and the dependence of manpower, and realizes efficient and accurate upgrades of the whole machine of multi-plugin relay protection device.

CN119806592APending Publication Date: 2025-04-11NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510004475.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The traditional single plug-in upgrade method is cumbersome and time-consuming to operate in multi-plug-in relay protection devices, and depends on the skill level and experience of the operator, making it difficult to ensure the correctness and efficiency of the upgrade.

Method used

By obtaining the encrypted upgrade package, decrypting and checking, extracting and sorting upgrade tasks, connecting to plug-ins for version comparison, automatically updating the upgrade task list and performing upgrade operations.

Benefits of technology

It significantly improves the upgrade efficiency and accuracy, reduces the dependence on the skill level of operators, ensures the stability and reliability of the entire relay protection device, and adapts to the development needs of power grid technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806592A_ABST
    Figure CN119806592A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of relay protection, in particular to a complete machine upgrading method and system for a multi-plug-in relay protection device, and the method comprises the steps: obtaining an encrypted upgrading package, and carrying out the decryption and signature verification of the encrypted upgrading package, and obtaining a non-encrypted upgrading package; decompressing the non-encrypted upgrade package to obtain upgrade information, extracting upgrade tasks from the upgrade information and generating an upgrade task list; connecting a corresponding plug-in according to the upgrading task list, reading version information of the plug-in, and comparing the version information with corresponding version information in an upgrading package to obtain a comparison result; and updating the upgrading task list according to the comparison result, and executing upgrading operation according to the updated upgrading task list. Through decryption and signature verification of the encrypted upgrade package, information extraction and task generation of the non-encrypted upgrade package, comparison of the plug-in version information and updating and execution of the upgrade task list, automation of the upgrade process is realized, the upgrade efficiency is remarkably improved, and the error rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of relay protection, and in particular to a whole-machine upgrading method and system of a multi-plug-in relay protection device. Background Art

[0002] With the continuous advancement and complexity of power grid technology, the functional requirements of relay protection devices are showing an increasing trend, and their architectural design has also evolved from a single plug-in mode to a multi-plug-in integrated mode. However, this change has posed a severe challenge to the traditional upgrade method. Specifically, the traditional single-plug-in upgrade method to update multi-plug-in relay protection devices is not only cumbersome and time-consuming, but also requires strict adherence to the established upgrade order during the implementation process to ensure the stability and reliability of the entire system, which undoubtedly increases the complexity and difficulty of the upgrade process. In addition, this method is highly dependent on the skill level and experience of the operator and is easily interfered by human factors (such as irregular operation, misoperation and lack of experience, etc.), resulting in the difficulty in effectively ensuring the correctness and efficiency of the upgrade process. Therefore, in response to the upgrade needs of multi-plug-in relay protection devices, the traditional single-plug-in upgrade method has become inadequate, and a more efficient, reliable and easy-to-manage upgrade solution is urgently needed to meet the challenges of current power grid development. Summary of the invention

[0003] The purpose of the present invention is to provide a whole-machine upgrading method and system for a multi-plug-in relay protection device in order to solve at least one of the above-mentioned technical problems.

[0004] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0005] A method for upgrading a multi-plug-in relay protection device comprises the following steps:

[0006] Obtain an encrypted upgrade package, decrypt and verify the signature of the encrypted upgrade package to obtain an unencrypted upgrade package;

[0007] Decompressing the non-encrypted upgrade package to obtain upgrade information, extracting upgrade tasks from the upgrade information and generating an upgrade task list;

[0008] Connect the corresponding plug-in according to the upgrade task list, read the plug-in version information and compare it with the corresponding version information in the upgrade package to obtain a comparison result;

[0009] The upgrade task list is updated according to the comparison result, and the upgrade operation is performed according to the updated upgrade task list.

[0010] Further, decrypting the encrypted upgrade package includes:

[0011] Read the encrypted upgrade package file content in byte format to obtain a byte stream;

[0012] Performing an XOR logic operation on each byte in the byte stream;

[0013] The byte stream after the XOR logic operation is saved again to the upgrade package file to obtain the decrypted upgrade package.

[0014] Further, the encrypted upgrade package is verified, including:

[0015] Read the decrypted upgrade package file content in byte format to obtain a byte stream;

[0016] Search the byte stream from the end to find the key byte sequence "sign:";

[0017] Obtaining the content from the position of the key byte sequence in the byte stream to the end of the byte stream as the source signature;

[0018] Calculate a 32-bit message digest of the content from the byte stream header to the key byte sequence position using the SHA256 algorithm;

[0019] Get the public key at the specified location and read the public key content;

[0020] The source signature is decrypted and verified using the RSA algorithm according to the 32-bit message digest and the public key.

[0021] Furthermore, the upgrade information includes: HMI upgrade information, CPU1 upgrade information and CPU2 upgrade information; wherein each type of upgrade information includes multiple upgrade files and version files.

[0022] Further, the upgrade tasks include, in order of priority, an HMI firmware upgrade task, a CPU1 firmware upgrade task, a CPU2 firmware upgrade task, a CPU1 application upgrade task, a CPU2 application upgrade task, and an HMI application upgrade task;

[0023] The upgrade tasks are sorted according to a preset priority to generate the upgrade task list.

[0024] Further, if there is a firmware file in the HMI upgrade information, the HMI firmware upgrade task is added to the upgrade task list;

[0025] If there are other files except the firmware file and the version file in the HMI upgrade information, adding the HMI application upgrade task to the upgrade task list;

[0026] If there is a firmware file in the CPU1 upgrade information, adding the CPU1 firmware upgrade task to the upgrade task list;

[0027] If there are other files except the firmware file and the version file in the CPU1 upgrade information, the CPU1 application upgrade task is added to the upgrade task list;

[0028] If there is a firmware file in the CPU2 upgrade information, adding the CPU2 firmware upgrade task to the upgrade task list;

[0029] If there are other files except the firmware file and the version file in the CPU2 upgrade information, the CPU2 application upgrade task is added to the upgrade task list.

[0030] Further, the plug-in of the relay protection device includes an HMI plug-in, a CPU1 plug-in and a CPU2 plug-in;

[0031] Connect all plugins simultaneously via TCP and read the version files in the plugins to the PC side;

[0032] For the HMI plug-in, comparing the version field in the version file in the HMI upgrade information and the version file in the HMI plug-in;

[0033] For the CPU1 plug-in, compare the version field in the version file in the CPU1 upgrade information and the version file in the CPU1 plug-in;

[0034] For the CPU2 plug-in, the version field in the version file in the CPU2 upgrade information and the version file in the CPU2 plug-in are compared.

[0035] Further, traverse the upgrade task list, and for each upgrade task, connect the corresponding plug-in;

[0036] If the upgrade task is an HMI firmware upgrade task, a CPU1 firmware upgrade task, or a CPU2 firmware upgrade task, perform the firmware upgrade operation;

[0037] If the upgrade task is an HMI application upgrade task, a CPU1 application upgrade task, or a CPU2 application upgrade task, the application upgrade operation is performed.

[0038] Further, the firmware upgrade operation includes: obtaining a firmware file in the corresponding upgrade information, downloading the firmware file to the relay protection device, sending a firmware upgrade instruction, waiting for the firmware upgrade to be completed, and executing the next upgrade task;

[0039] The application upgrade operation includes: obtaining application files in the corresponding upgrade information, downloading the application files to the relay protection device in sequence, and directly executing the next upgrade task without waiting for the application upgrade task to be completed.

[0040] A whole machine upgrade system for a multi-plug-in relay protection device, comprising:

[0041] An upgrade package decryption and signature verification module is used to obtain an encrypted upgrade package, decrypt the encrypted upgrade package and verify the signature to obtain a non-encrypted upgrade package;

[0042] An upgrade task extraction module, used to decompress the non-encrypted upgrade package to obtain upgrade information, extract upgrade tasks from the upgrade information and generate an upgrade task list;

[0043] A version comparison module, used to connect to the corresponding plug-in according to the upgrade task list, read the plug-in version information and compare it with the corresponding version information in the upgrade package to obtain a comparison result;

[0044] The whole machine upgrade module is used to update the upgrade task list according to the comparison result, and perform the upgrade operation according to the updated upgrade task list.

[0045] An electronic device comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements any of the methods described above when executed by the processor.

[0046] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the methods described above is implemented.

[0047] The beneficial effects of the present invention are:

[0048] The present invention realizes the safe and efficient processing of encrypted upgrade packages, accurately identifies and sorts upgrade tasks, supports parallel processing of application upgrades and sequential execution of firmware upgrades, significantly improves upgrade efficiency and accuracy, reduces dependence on operator skill levels, effectively ensures the stability and reliability of the entire relay protection device, and adapts to the needs of continuous advancement and complexity of power grid technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flowchart of a whole-machine upgrade method for a multi-plug-in relay protection device according to an embodiment of the present invention;

[0050] Figure 2 It is a flow chart of a whole machine upgrade method of a multi-plug-in relay protection device according to another embodiment of the present invention;

[0051] Figure 3This is a structural diagram of a whole machine upgrade system for a multi-plug-in relay protection device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The content of the present invention will now be discussed with reference to exemplary embodiments. It should be understood that the embodiments discussed are only to enable those skilled in the art to better understand and thus implement the content of the present invention, rather than implying any limitation on the scope of the present invention.

[0053] As used herein, the term “including” and variations thereof are to be interpreted as open-ended terms meaning “including, but not limited to.” The term “based on” is to be interpreted as “based, at least in part, on.” The terms “one embodiment” and “an embodiment” are to be interpreted as “at least one embodiment.”

[0054] Embodiment 1

[0055] Figure 1 This is a flow chart of a method for upgrading a whole machine of a multi-plug-in relay protection device according to an embodiment of the present invention. Figure 1 As shown, according to one embodiment of the present invention, a method for upgrading a whole machine of a multi-plug-in relay protection device comprises the following steps:

[0056] Step S102, obtaining an encrypted upgrade package, decrypting the encrypted upgrade package and verifying the signature to obtain a non-encrypted upgrade package;

[0057] Step S104, decompressing the non-encrypted upgrade package to obtain upgrade information, extracting upgrade tasks from the upgrade information and generating an upgrade task list;

[0058] Step S106, connecting to the corresponding plug-in according to the upgrade task list, reading the plug-in version information and comparing it with the corresponding version information in the upgrade package to obtain a comparison result;

[0059] Step S108: updating the upgrade task list according to the comparison result, and performing the upgrade operation according to the updated upgrade task list.

[0060] In the present embodiment, a whole-machine upgrade method for a multi-plug-in relay protection device is provided. The method first obtains an encrypted upgrade package, and then decrypts and verifies the signature to obtain a non-encrypted upgrade package. Next, the non-encrypted upgrade package is decompressed, the upgrade information is extracted from it, and an upgrade task list is generated based on the upgrade information. After the upgrade task list is generated, the corresponding plug-ins are connected according to the tasks in the list, the current version information of these plug-ins is read, and this information is compared with the corresponding version information provided in the upgrade package to determine which plug-ins need to be upgraded. Based on the comparison results, the upgrade task list will be updated accordingly. Finally, according to the updated upgrade task list, specific upgrade operations are performed to complete the whole-machine upgrade process of the entire relay protection device.

[0061] The present invention provides a whole-machine upgrade method for a multi-plug-in relay protection device, which realizes the automation of the upgrade process through decryption and signature verification of encrypted upgrade packages, information extraction and task generation of non-encrypted upgrade packages, comparison of plug-in version information, and updating and execution of upgrade task lists, thereby significantly improving upgrade efficiency and reducing error rates.

[0062] According to an embodiment of the present invention, in step S102, decrypting the encrypted upgrade package includes:

[0063] Step S1021, reading the encrypted upgrade package file content in byte format to obtain a byte stream;

[0064] Step S1022, performing an XOR logic operation on each byte in the byte stream;

[0065] Step S1023, saving the byte stream after the XOR logic operation to the upgrade package file again to obtain the decrypted upgrade package.

[0066] In this embodiment, a specific decryption process is used for the processing of the encrypted upgrade package. First, in step S1021, the content of the encrypted upgrade package file is read in byte format and converted into a continuous byte stream. This byte stream is the original representation of the encrypted data and contains all the information required for subsequent decryption operations. Then, in step S1022, an exclusive OR (XOR) logic operation is performed on each byte in the byte stream. This step is the core of the decryption process. It uses a predetermined key or algorithm to perform a bit-by-bit exclusive OR operation on each byte in the byte stream to restore the original non-encrypted data. Finally, in step S1023, the byte stream after the exclusive OR logic operation is saved back to the upgrade package file to generate a decrypted upgrade package.

[0067] The decryption process of the present invention effectively decrypts the encrypted upgrade package by performing XOR logic operations byte by byte, ensuring the security of the upgrade package data during transmission and storage, preventing unauthorized access and tampering, and laying a solid data foundation for subsequent signature verification and upgrade operations, thereby ensuring the reliability and security of the entire upgrade process.

[0068] According to an embodiment of the present invention, in step S102, verifying the signature of the encrypted upgrade package includes:

[0069] Step S1024, reading the decrypted upgrade package file content in byte format to obtain a byte stream;

[0070] Step S1025, searching the byte stream from the tail to find the key byte sequence "sign:";

[0071] Step S1026, obtaining the content from the key byte sequence position to the end of the byte stream as the source signature;

[0072] Step S1027, calculating a 32-bit message digest of the content from the byte stream header to the key byte sequence position using the SHA256 algorithm;

[0073] Step S1028, obtaining the public key at the specified location and reading the public key content;

[0074] Step S1029, decrypt and verify the source signature using the RSA algorithm based on the 32-bit message digest and the public key.

[0075] In this embodiment, a detailed signature verification process is adopted for the decrypted upgrade package. First, in step S1024, the decrypted upgrade package file content is read again in byte format and converted into a continuous byte stream for subsequent processing. Then, in step S1025, a search is started from the end of the byte stream to find a specific keyword byte sequence "sign:", which marks the starting position of the signature data. Once this sequence is found, in step S1026, the content after the sequence position until the end of the byte stream is obtained. This part of the content is regarded as the source signature, which is the key data for verifying the integrity and authenticity of the upgrade package. Then, in step S1027, a 32-bit message digest is calculated using the SHA256 algorithm for the part of the byte stream from the beginning to the position before the keyword byte sequence "sign:". This digest is a unique representation of the main content of the upgrade package and is used to compare with the signature data. In addition, during the signature verification process, step S1028 reads the public key content from the specified position. This public key corresponds to the private key used when encrypting the signature and is used to verify the validity of the signature. Finally, step S1029 uses the RSA algorithm to decrypt and verify the source signature in combination with the previously calculated 32-bit message digest and the read public key. If the decrypted content matches the message digest, then the upgrade package can be considered complete and untampered, allowing the subsequent upgrade operation to proceed.

[0076] The signature verification process of the present invention processes the byte stream of the decrypted upgrade package, retrieves the key byte sequence from the tail to locate the signature data, calculates the message digest using the SHA256 algorithm, and verifies the validity of the source signature with the public key and the RSA algorithm, thereby ensuring the integrity and authenticity of the upgrade package, effectively preventing tampering, and providing security for subsequent upgrade operations.

[0077] According to an embodiment of the present invention, the upgrade information in step S104 includes: HMI upgrade information, CPU1 upgrade information and CPU2 upgrade information; wherein each type of upgrade information includes multiple upgrade files and version files.

[0078] Preferably, the upgrade tasks include, in order of priority, an HMI firmware upgrade task, a CPU1 firmware upgrade task, a CPU2 firmware upgrade task, a CPU1 application upgrade task, a CPU2 application upgrade task, and an HMI application upgrade task;

[0079] The upgrade tasks are sorted according to the preset priorities to generate an upgrade task list.

[0080] Preferably, if there is a firmware file in the HMI upgrade information, the HMI firmware upgrade task is added to the upgrade task list;

[0081] If there are other files besides the firmware file and version file in the HMI upgrade information, the HMI application upgrade task is added to the upgrade task list;

[0082] If the firmware file exists in the CPU1 upgrade information, add the CPU1 firmware upgrade task to the upgrade task list;

[0083] If there are other files besides the firmware file and version file in the CPU1 upgrade information, add the CPU1 application upgrade task to the upgrade task list;

[0084] If there is a firmware file in the CPU2 upgrade information, add the CPU2 firmware upgrade task to the upgrade task list;

[0085] If the CPU2 upgrade information contains other files except the firmware file and the version file, the CPU2 application upgrade task is added to the upgrade task list.

[0086] In this embodiment, after decompressing the upgrade package, detailed data including HMI upgrade information, CPU1 upgrade information and CPU2 upgrade information will be obtained, and these upgrade information are composed of multiple upgrade files and version files. During the upgrade process, according to the preset priority, the upgrade tasks are subdivided into HMI firmware upgrade tasks, CPU1 firmware upgrade tasks, CPU2 firmware upgrade tasks, CPU1 application upgrade tasks, CPU2 application upgrade tasks and HMI application upgrade tasks. Specifically, check whether each type of upgrade information contains firmware files. If so, add this type of firmware upgrade task to the upgrade task list; if there are other files in the upgrade information except firmware files and version files, add this type of application upgrade task to the upgrade task list. This process ensures that the upgrade tasks are sorted and executed in the order from firmware to application and according to the preset priority, thereby realizing an efficient and orderly upgrade process and ensuring the comprehensiveness and stability of the equipment upgrade.

[0087] The present invention achieves comprehensive analysis and orderly upgrade of HMI, CPU1 and CPU2 upgrade information by finely dividing the upgrade tasks and sorting them according to preset priorities; ensures that firmware upgrades take precedence over application upgrades, and at the same time follows the upgrade sequence from key components to auxiliary components, effectively improving the efficiency and stability of the upgrade process, and ensuring the functional integrity and operational safety of the equipment after the upgrade.

[0088] According to an embodiment of the present invention, in step S106, the plug-in of the relay protection device includes an HMI plug-in, a CPU1 plug-in and a CPU2 plug-in;

[0089] Connect all plugins simultaneously via TCP and read the version files in the plugins to the PC side;

[0090] For the HMI plug-in, compare the version field in the version file in the HMI upgrade information and the version file in the HMI plug-in;

[0091] For the CPU1 plug-in, compare the version field in the version file in the CPU1 upgrade information and the version file in the CPU1 plug-in;

[0092] For the CPU2 plug-in, compare the version field in the version file in the CPU2 upgrade information and the version file in the CPU2 plug-in.

[0093] In this embodiment, the version comparison process of the relay protection device plug-in is described in detail. Specifically, the process first establishes connections with the HMI plug-in, CPU1 plug-in and CPU2 plug-in through the TCP protocol at the same time to ensure that all plug-ins can communicate with the PC side. Then, read its version file from each plug-in to the PC side for subsequent comparison operations. In the comparison stage, for the HMI plug-in, CPU1 plug-in and CPU2 plug-in, the version fields in their respective version files are compared one by one with the corresponding version files in the upgrade information. This step is crucial because it can accurately identify which plug-ins need to be upgraded and which plug-ins are already the latest versions, thereby ensuring the pertinence and accuracy of the upgrade operation.

[0094] The present invention realizes simultaneous connection with the HMI plug-in, CPU1 plug-in and CPU2 plug-in in the relay protection device through the TCP protocol, and accurately reads and compares the version fields in each plug-in version file and the upgrade information, ensuring the pertinence and accuracy of the upgrade operation, and effectively improving the efficiency and reliability of the relay protection device plug-in version management.

[0095] According to an embodiment of the present invention, the upgrade task list is traversed, and for each upgrade task, the corresponding plug-in is connected;

[0096] If the upgrade task is an HMI firmware upgrade task, a CPU1 firmware upgrade task, or a CPU2 firmware upgrade task, perform the firmware upgrade operation;

[0097] If the upgrade task is an HMI application upgrade task, a CPU1 application upgrade task, or a CPU2 application upgrade task, the application upgrade operation is performed.

[0098] Preferably, the firmware upgrade operation includes: obtaining a firmware file in the corresponding upgrade information, downloading the firmware file to the relay protection device, sending a firmware upgrade instruction, waiting for the firmware upgrade to be completed, and executing the next upgrade task;

[0099] The application upgrade operation includes: obtaining the application files in the corresponding upgrade information, downloading the application files to the relay protection device in sequence, and directly executing the next upgrade task without waiting for the application upgrade task to be completed.

[0100] In this embodiment, the upgrade task list is traversed, and for each upgrade task, the corresponding plug-in is connected. If the upgrade task is an HMI firmware upgrade task, a CPU1 firmware upgrade task, or a CPU2 firmware upgrade task, the firmware upgrade operation is performed. Including: obtaining the firmware file in the corresponding upgrade information, downloading the firmware file to the relay protection device, sending a firmware upgrade instruction, waiting for the firmware upgrade to be completed, and executing the next upgrade task; if the upgrade task is an HMI application upgrade task, a CPU1 application upgrade task, or a CPU2 application upgrade task, the application upgrade operation is performed. Including: obtaining the application file in the corresponding upgrade information, downloading the application file to the relay protection device in sequence, without waiting for the application upgrade task to be completed, and directly executing the next upgrade task.

[0101] The present invention realizes efficient upgrading of relay protection devices by traversing the upgrade task list and intelligently distinguishing between firmware and application upgrade tasks; when upgrading the firmware, it ensures complete download and waits for the upgrade to be completed; when upgrading the application, it adopts a parallel processing method to directly download the application file and immediately execute the next task without waiting for the current upgrade to be completed, thereby significantly improving the overall upgrade efficiency and flexibility.

[0102] Embodiment 2

[0103] Figure 2 This is a flow chart of a method for upgrading a whole machine of a multi-plug-in relay protection device according to another embodiment of the present invention. Figure 2 As shown, according to an embodiment of the present invention, a whole machine upgrade method of a multi-plug-in relay protection device includes the following specific steps:

[0104] Step S1, XOR decrypting the encrypted upgrade package; specifically including:

[0105] Step S1-1, reading the encrypted upgrade package file content in byte format to obtain a byte stream;

[0106] Step S1-2, performing an XOR logic operation on each byte in the byte stream;

[0107] Step S1-3, saving the byte stream after the XOR operation back to the original upgrade package file;

[0108] Step S2, verifying the signature of the decrypted upgrade package; specifically,

[0109] Step S2-1, reading the decrypted upgrade package file content in byte format to obtain a byte stream;

[0110] Step S2-2, searching for the keyword byte sequence "sign:" from the end of the byte stream;

[0111] Step S2-3, obtaining the content from the key byte sequence to the end of the byte stream as the source signature;

[0112] Step S2-4, calculating a 32-bit message digest of the content from the head position of the byte stream to before the key byte sequence using the SHA256 algorithm.

[0113] Step S2-5, obtain the public key at the specified location and read the public key content.

[0114] Step S2-6, decrypt and verify the source signature using the RSA algorithm based on the 32-bit message digest and the public key.

[0115] Step S3, extracting upgrade tasks from the upgrade information in the non-encrypted upgrade package to generate an upgrade task list; specifically including:

[0116] Step S3-1, after decompressing the upgrade package, obtain the following information: HMI upgrade information, CPU1 upgrade information and CPU2 upgrade information, each type of upgrade information consists of multiple upgrade files and version files;

[0117] Step S3-2, if there is a firmware file in the HMI upgrade information, add the HMI firmware upgrade task to the upgrade task list;

[0118] If there are other files besides the firmware file and version file in the HMI upgrade information, the HMI application upgrade task is added to the upgrade task list;

[0119] Step S3-3, the processing of CPU1 upgrade information and CPU2 upgrade information refers to the processing of HMI upgrade information in step S3-2, and so on, which will not be repeated here.

[0120] Step S3-4, sorting the upgrade task list according to the upgrade task priority.

[0121] Step S4, connecting to the corresponding plug-in according to the upgrade task list and comparing the version with the information in the upgrade package; specifically including:

[0122] Step S4-1, the upgrade tool connects to all plug-ins simultaneously via TCP;

[0123] Step S4-2, read the version file in the plug-in to the PC side;

[0124] For HMI plug-ins, compare the version fields in the version file in the HMI upgrade information and the version file in the plug-in;

[0125] The processing of the CPU1 plug-in and the CPU2 plug-in refers to the processing of the HMI plug-in, and so on, which will not be repeated here.

[0126] Step S4-3, displayed on the interface.

[0127] Step S5, executing the upgrade tasks in the upgrade list in sequence; specifically including:

[0128] Traverse the upgrade task list, and for each upgrade task, connect the corresponding plug-in;

[0129] Example: HMI firmware upgrade and HMI application upgrade connected to HMI plug-in;

[0130] If the upgrade task is HMI firmware upgrade, CPU1 firmware upgrade, or CPU2 firmware upgrade, perform the firmware upgrade operation:

[0131] Obtain the firmware file in the corresponding upgrade information, download the firmware file to the device, send a firmware upgrade instruction, wait for the firmware upgrade to complete, and execute the next upgrade task;

[0132] If the upgrade task is HMI application upgrade, CPU1 application upgrade, or CPU2 application upgrade, perform the application upgrade operation:

[0133] Obtain the application files in the corresponding upgrade information, and download the application files to the device in sequence, without waiting for the application upgrade task to be completed, and directly execute the next upgrade task.

[0134] The present invention provides a whole-machine upgrade method for a multi-plug-in relay protection device, realizes XOR decryption, signature verification, upgrade task extraction and sorting, version comparison and automatic upgrade execution of encrypted upgrade packages, effectively improves upgrade efficiency and reduces error rate.

[0135] Embodiment 3

[0136] Figure 3 This is a structural diagram of a whole machine upgrade system for a multi-plug-in relay protection device according to an embodiment of the present invention. Figure 3 As shown, according to one embodiment of the present invention, a whole machine upgrade system for a multi-plug-in relay protection device includes:

[0137] The upgrade package decryption and signature verification module is used to obtain the encrypted upgrade package, decrypt the encrypted upgrade package and verify the signature to obtain the non-encrypted upgrade package;

[0138] An upgrade task extraction module is used to decompress the non-encrypted upgrade package to obtain upgrade information, extract upgrade tasks from the upgrade information and generate an upgrade task list;

[0139] The version comparison module is used to connect to the corresponding plug-in according to the upgrade task list, read the plug-in version information and compare it with the corresponding version information in the upgrade package to obtain the comparison result;

[0140] The whole machine upgrade module is used to update the upgrade task list according to the comparison result, and perform the upgrade operation according to the updated upgrade task list.

[0141] In this embodiment, a whole-machine upgrade system for a multi-plug-in relay protection device is proposed. The system first receives the encrypted upgrade package through the upgrade package decryption and signature verification module, decrypts and verifies the upgrade package to ensure the authenticity and integrity of the upgrade package, thereby generating a non-encrypted upgrade package. Subsequently, the upgrade task extraction module decompresses the non-encrypted upgrade package, extracts the upgrade information from it, and generates a detailed upgrade task list based on this information. Next, the version comparison module will connect the corresponding plug-ins one by one according to the tasks in the upgrade task list, read and compare the current version information of the plug-in with the version information provided in the upgrade package to determine which plug-ins need to be upgraded. Finally, the whole-machine upgrade module will make necessary updates to the upgrade task list according to the comparison results, and perform the corresponding upgrade operations in the order of the updated list, thereby achieving efficient and accurate upgrades of the whole relay protection device.

[0142] The multi-plug-in relay protection device whole-machine upgrade system proposed in the present invention realizes the security verification and efficient decompression of the encrypted upgrade package by integrating the upgrade package decryption and signature verification module, the upgrade task extraction module, the version comparison module and the whole-machine upgrade module, and accurately identifies and updates the plug-ins that need to be upgraded, thereby ensuring that the relay protection device can perform efficient and accurate whole-machine upgrades based on the latest version information, thereby improving the reliability and maintenance efficiency of the system.

[0143] Embodiment 4

[0144] like Figure 3 As shown, according to one embodiment of the present invention, a whole machine upgrade system for a multi-plug-in relay protection device includes:

[0145] The upgrade package decryption and signature verification module is used to decrypt and verify the encrypted upgrade package;

[0146] An upgrade task extraction module is used to extract upgrade tasks from upgrade package information and sort them according to priority;

[0147] A version comparison module, used to compare the version information in the upgraded version with the version information in the device;

[0148] The whole machine upgrade module is used to perform upgrade operations.

[0149] The present invention implements a whole-machine upgrade system for a multi-plug-in relay protection device, which realizes efficient and accurate whole-machine automatic upgrade by integrating functional modules such as upgrade package decryption and signature verification, upgrade task extraction and sorting, version comparison and whole-machine upgrade, thereby significantly improving the reliability and efficiency of the upgrade process.

[0150] Embodiment 5

[0151] According to one embodiment of the present invention, an electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, a whole-machine upgrade method for any multi-plug-in relay protection device of the present invention is implemented.

[0152] According to one embodiment of the present invention, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a whole-machine upgrade method for any multi-plug-in relay protection device of the present invention is implemented.

[0153] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices and media can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0154] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.

[0155] It should be understood that the size of the serial numbers of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

Claims

1. A method for upgrading a multi-plug-in relay protection device, characterized in that: The following steps are involved: Obtain an encrypted upgrade package, decrypt and verify the signature of the encrypted upgrade package to obtain an unencrypted upgrade package; Decompressing the non-encrypted upgrade package to obtain upgrade information, extracting upgrade tasks from the upgrade information and generating an upgrade task list; Connect the corresponding plug-in according to the upgrade task list, read the plug-in version information and compare it with the corresponding version information in the upgrade package to obtain a comparison result; The upgrade task list is updated according to the comparison result, and the upgrade operation is performed according to the updated upgrade task list.

2. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 1, characterized in that: Decrypting the encrypted upgrade package includes: Read the encrypted upgrade package file content in byte format to obtain a byte stream; Performing an XOR logic operation on each byte in the byte stream; The byte stream after the XOR logic operation is saved again to the upgrade package file to obtain the decrypted upgrade package.

3. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 2, characterized in that: Verifying the signature of the encrypted upgrade package includes: Read the decrypted upgrade package file content in byte format to obtain a byte stream; Search the byte stream from the end to retrieve the key byte sequence "sign:"; Obtaining the content from the position of the key byte sequence in the byte stream to the end of the byte stream as the source signature; Calculate a 32-bit message digest of the content from the byte stream header to the key byte sequence position using the SHA256 algorithm; Get the public key at the specified location and read the public key content; The source signature is decrypted and verified using the RSA algorithm according to the 32-bit message digest and the public key.

4. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 1, characterized in that: The upgrade information includes: HMI upgrade information, CPU1 upgrade information and CPU2 upgrade information; wherein each upgrade information includes multiple upgrade files and version files.

5. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 4, characterized in that: The upgrade tasks include HMI firmware upgrade tasks, CPU1 firmware upgrade tasks, CPU2 firmware upgrade tasks, CPU1 application upgrade tasks, CPU2 application upgrade tasks, and HMI application upgrade tasks in order of priority; The upgrade tasks are sorted according to a preset priority to generate the upgrade task list.

6. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 5, characterized in that: If there is a firmware file in the HMI upgrade information, adding the HMI firmware upgrade task to the upgrade task list; If there are other files except the firmware file and the version file in the HMI upgrade information, adding the HMI application upgrade task to the upgrade task list; If there is a firmware file in the CPU1 upgrade information, adding the CPU1 firmware upgrade task to the upgrade task list; If there are other files except the firmware file and the version file in the CPU1 upgrade information, the CPU1 application upgrade task is added to the upgrade task list; If there is a firmware file in the CPU2 upgrade information, adding the CPU2 firmware upgrade task to the upgrade task list; If there are other files except the firmware file and the version file in the CPU2 upgrade information, the CPU2 application upgrade task is added to the upgrade task list.

7. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 4, characterized in that: The plug-in of the relay protection device includes an HMI plug-in, a CPU1 plug-in and a CPU2 plug-in; Connect all plugins simultaneously via TCP and read the version files in the plugins to the PC side; For the HMI plug-in, comparing the version field in the version file in the HMI upgrade information and the version file in the HMI plug-in; For the CPU1 plug-in, compare the version field in the version file in the CPU1 upgrade information and the version file in the CPU1 plug-in; For the CPU2 plug-in, the version field in the version file in the CPU2 upgrade information and the version file in the CPU2 plug-in are compared.

8. The whole machine upgrade method of a multi-plug-in relay protection device according to claim 7, characterized in that: Traverse the upgrade task list, and for each upgrade task, connect the corresponding plug-in; If the upgrade task is an HMI firmware upgrade task, a CPU1 firmware upgrade task, or a CPU2 firmware upgrade task, perform the firmware upgrade operation; If the upgrade task is an HMI application upgrade task, a CPU1 application upgrade task, or a CPU2 application upgrade task, the application upgrade operation is performed.

9. The whole machine upgrading method of a multi-plug-in relay protection device according to claim 8, characterized in that: The firmware upgrade operation includes: obtaining a firmware file in the corresponding upgrade information, downloading the firmware file to the relay protection device, sending a firmware upgrade instruction, waiting for the firmware upgrade to be completed, and executing the next upgrade task; The application upgrade operation includes: obtaining application files in the corresponding upgrade information, downloading the application files to the relay protection device in sequence, and directly executing the next upgrade task without waiting for the application upgrade task to be completed.

10. A whole machine upgrade system for a multi-plug-in relay protection device, characterized in that: include: An upgrade package decryption and signature verification module is used to obtain an encrypted upgrade package, decrypt the encrypted upgrade package and verify the signature to obtain a non-encrypted upgrade package; An upgrade task extraction module, used to decompress the non-encrypted upgrade package to obtain upgrade information, extract upgrade tasks from the upgrade information and generate an upgrade task list; A version comparison module, used to connect to the corresponding plug-in according to the upgrade task list, read the plug-in version information and compare it with the corresponding version information in the upgrade package to obtain a comparison result; The whole machine upgrade module is used to update the upgrade task list according to the comparison result, and perform the upgrade operation according to the updated upgrade task list.