Power fault oscillograph batch upgrading method and system based on Expect

Through the Expect script, the Socket link and batch upgrade of the fault recorder in the LAN is solved, and the problem of inefficient upgrade of the fault recorder in the power system is realized, and the batch iterative update of the software version is improved, and the production efficiency is saved is improved. Labor costs.

CN119201175APending Publication Date: 2024-12-27SHANDONG SHANDONG UNIV ELECTRIC POWER TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411373799.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the power system, with the increase in the number of fault recorders, serial upgrade efficiency is inefficient, which cannot meet the needs of mass production, especially when new high-voltage and ultra-high voltage substations are put into use, resulting in low batch update and upgrade efficiency. .

Method used

Using the method based on Expect script, the software version number is obtained through the Socket link of all fault recorders in the LAN, and whether the upgrade is required is determined. After the upgrade signal is checked, batch upgrade operations are performed, and the DHCP service is used to allocate a unique IP address. Batch upgrade is achieved through run.sh and update.tcl scripts.

Benefits of technology

It realizes iterative update of batch software versions of power failure recorders, saves labor costs and improves the production efficiency of manufacturers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201175A_ABST
    Figure CN119201175A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent upgrading of equipment, and particularly relates to an Expect-based batch upgrading method and system for power fault oscilloscopes, and the method comprises the steps: obtaining the IP addresses of all power fault oscilloscopes in a local area network; based on the acquired IP addresses, adopting an Expect script to establish Socket links of all the power fault oscillographs in the local area network; according to the established Socket link, obtaining a software version number of the power fault oscillograph traversing all the IP addresses; judging whether the obtained software version number meets expected requirements or not, if yes, not upgrading the electric power fault oscillograph, otherwise, upgrading the electric power fault oscillograph in batches, triggering an upgrading signal in the electric power fault oscillograph needing to be upgraded, verifying an upgrading file, and upgrading the electric power fault oscillograph needing to be upgraded. And after the to-be-upgraded file passes the verification, batch upgrading operation of the power fault oscillograph is carried out, and after the power fault oscillograph is upgraded, if the verification code passes the verification, batch upgrading succeeds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of equipment intelligent upgrading, and in particular relates to a method and system for batch upgrading electric power fault recorders based on Expect. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the rapid development of the power system field, the demand for various types of protection, measurement and control, monitoring and other intelligent power grid devices of various voltage levels is increasing. After the power system manufacturers complete the processing, production and assembly of the device, they need to burn the software.

[0004] At present, the common method is to use a chip-specific burner and supporting online upgrade software to serially burn the software of the produced power system intelligent devices one by one. The serial burning method can meet the production needs when the number of machines is small, but it is somewhat stretched when the fault recorders are mass-produced. With the gradual commissioning of new high-voltage and ultra-high-voltage substations, the demand for the number of power system fault recorders has also increased sharply. For example, a new 110kV substation has dozens of fault recorders put into operation at the same time. When the fault recorder software version is iteratively updated, the efficiency of single-unit upgrade is low, and batch update and upgrade becomes particularly important. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a method and system for batch upgrading of power fault recorders based on Expect, which performs Socket linking of all power fault recorders in a local area network based on the Expect script, performs software upgrade and verification on the power fault recorders that need to be upgraded, and realizes batch software version iterative update of the power fault recorders, thereby saving labor costs and improving the production efficiency of manufacturers.

[0006] According to some embodiments, a first solution of the present invention provides a method for batch upgrading power fault recorders based on Expect, which adopts the following technical solution:

[0007] A batch upgrade method of power fault recorders based on Expect, comprising:

[0008] Get the IP addresses of all power fault recorders in the local area network;

[0009] Based on the obtained IP address, the Expect script is used to establish the Socket link of all power fault recorders in the LAN;

[0010] According to the established Socket link, the software version number of the power fault recorder traversing all IP addresses is obtained;

[0011] Determine whether the obtained software version number meets the expected requirements. If so, there is no need to upgrade the power fault recorder. Otherwise, perform a batch upgrade of the power fault recorder.

[0012] Among them, during the batch upgrade of the power fault recorder, an upgrade signal is triggered in the power fault recorder to be upgraded, and the upgrade file is verified. After the upgrade file is verified, the batch upgrade operation of the power fault recorder is performed. If the verification code is verified after the power fault recorder is upgraded, the batch upgrade is successful.

[0013] As a further technical limitation, in the process of obtaining the IP addresses of all power fault recorders in the local area network, the power fault recorder to be upgraded is connected to the local area network, and a unique IP address is allocated to each power fault recorder to be upgraded through the Dynamic Host Configuration Protocol (DHCP service for short), and the uniqueness of the power fault recorder is characterized based on the allocated IP address and the identification code of the power fault recorder.

[0014] As a further technical limitation, the power fault recorder is provided with a run.sh script for batch upgrades, and the run.sh script is responsible for organizing the batch upgrade path and establishing a Socket link for each power fault recorder in the local area network based on the run.sh script.

[0015] Furthermore, in the process of establishing the Socket link, the get_remote_machine_ip.tcl script in the Expect script is called by the run.sh script, and the result of the called get_remote_machine_ip.tcl script is recorded.

[0016] As a further technical limitation, the batch upgrade of the power fault recorder is completed based on the upgrade platform, the upgrade platform is connected to the power fault recorder to be upgraded through the network, and after the verified files to be upgraded are transferred to the emmc designated block in each power fault recorder, the batch upgrade task of the power fault recorder is performed based on the update.tcl script.

[0017] Furthermore, after the power fault recorder is upgraded, a version verification code is sent based on the upgrade platform to obtain the upgraded version number; the power fault recorder is upgraded successfully if and only if the sent version verification code and the upgraded version number are consistent with the expected requirements.

[0018] According to some embodiments, the second solution of the present invention provides a batch upgrade system of power fault recorders based on Expect, which adopts the following technical solution:

[0019] An Expect-based power fault recorder batch upgrade system, comprising:

[0020] A first acquisition module is configured to acquire IP addresses of all power fault recorders in the local area network;

[0021] A link establishment module is configured to establish Socket links of all power fault recorders in the local area network using an Expect script based on the acquired IP address;

[0022] A second acquisition module is configured to acquire software version numbers of power fault recorders traversing all IP addresses according to the established Socket link;

[0023] A batch upgrade module is configured to determine whether the obtained software version number meets the expected requirements. If so, there is no need to upgrade the power fault recorder. Otherwise, a batch upgrade of the power fault recorder is performed.

[0024] Among them, during the batch upgrade of the power fault recorders in the batch upgrade module, an upgrade signal is triggered in the power fault recorders to be upgraded, and the upgrade file is verified. After the upgrade file is verified, the batch upgrade operation of the power fault recorders is performed. If the verification code is verified after the power fault recorders are upgraded, the batch upgrade is successful.

[0025] According to some embodiments, a third solution of the present invention provides a computer-readable storage medium, which adopts the following technical solution:

[0026] A computer-readable storage medium stores a program, which, when executed by a processor, implements the steps of the Expect-based batch upgrade method for power fault recorders as described in the first solution of the present invention.

[0027] According to some embodiments, a fourth solution of the present invention provides an electronic device, which adopts the following technical solution:

[0028] An electronic device comprises a memory, a processor and a program stored in the memory and running on the processor, wherein when the processor executes the program, the steps in the method for batch upgrading power fault recorders based on Expect as described in the first solution of the present invention are implemented.

[0029] According to some embodiments, a fifth solution of the present invention provides a computer program product, which adopts the following technical solution:

[0030] A computer program product includes software codes, wherein the program in the software codes executes the steps in the method for batch upgrading power fault recorders based on Expect as described in the first solution of the present invention.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] The present invention performs Socket links of all power fault recorders in a local area network based on an Expect script, performs software upgrade and verification on the power fault recorders that need to be upgraded, realizes batch software version iterative update of the power fault recorders, and improves the production efficiency of manufacturers while saving labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The drawings in the specification that constitute a part of this embodiment are used to provide a further understanding of this embodiment. The schematic embodiments of this embodiment and their descriptions are used to explain this embodiment and do not constitute improper limitations on this embodiment.

[0034] Figure 1 It is an overall block diagram of the method for batch upgrading electric power fault recorders based on Expect in the first embodiment of the present invention;

[0035] Figure 2 It is a flow chart of a method for batch upgrading electric power fault recorders based on Expect in Embodiment 1 of the present invention;

[0036] Figure 3 It is a structural block diagram of a batch upgrade system for electric power fault recorders based on Expect in the second embodiment of the present invention. DETAILED DESCRIPTION

[0037] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0038] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0039] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0040] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention and should not be understood as limitations on the present invention.

[0041] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0042] Embodiment 1

[0043] Embodiment 1 of the present invention introduces a method for batch upgrading of electric power fault recorders based on Expect.

[0044] This embodiment provides a method for batch upgrading of electric power fault recorders based on Expect, which ensures that batch burning of software is realized after the manufacturer completes the production of the device, and that the fault recorders in operation in the substation are batch updated with software versions due to business needs, thereby saving labor costs and improving enterprise production efficiency.

[0045] It should be noted that Expect is an automated interactive suite based on the Tcl language; the Tcl core is a subroutine library that can be embedded in scripting languages ​​such as Shell to provide language services. Therefore, Expect is mainly used when executing commands and programs, and the system requires the input of a specified string in an interactive form to achieve interactive communication. Based on this, Expect scripts can be used to complete some interactive operations in the power system fault recorder and realize batch upgrade operations of the fault recorder.

[0046] After the board processing manufacturer completes the hardware welding production of the board, it usually burns the initial image provided by the customer into ROM (Read-Only Memory). The more commonly used medium that does not lose power at the moment is EMMC (Embedded MultiMedia Card). The complete image in the embedded Linux system usually consists of modules such as uboot, boot (kernel), rootfs, misc, userdata, recovery, and OEM. The board processing manufacturer will give the burned board to the customization manufacturer and then carry out the overall assembly and software development of the power intelligent device. When the function development is completed and the test is problem-free, it is necessary to batch upgrade the software of multiple intelligent devices.

[0047] The software to be upgraded in this embodiment includes both underlying software such as Linux system image and upper-level applications such as front-end programs of power system fault recorders, background applications, acquisition / control board FPGA programs, expansion board (GOOSE / SV board, FT3 board) FPGA programs, and probe programs.

[0048] like Figure 1 and Figure 2 The batch upgrade method of power fault recorders based on Expect shown includes the following steps:

[0049] Step S01: Connect the fault recorder to be upgraded to the local area network, and assign a unique IP to each fault recorder to be upgraded through the DHCP service. The IP is bound to the "device unique identification code" of the fault recorder to characterize the uniqueness of the device;

[0050] Step S02: Start the script run.sh responsible for the entire upgrade process, which involves the control command that needs to use telnet to connect to each fault recorder. Two Expect scripts can be used to complete the IP traversal of all fault recorders in the local area network and the batch update of the software of all fault recorders respectively;

[0051] Step S03: Get the Expect script get_remote_machine_ip.tcl of the fault recorder IP address, traverse the IP addresses of all fault recorders in the local area network and establish a Socket link with the batch upgrade platform; call the get_remote_machine_ip.tcl script through the run.sh script and record the result in text form in the ip.out file;

[0052] Step S04: Obtain the software version number of the fault recorder obtained by traversing the IP. If it matches the expected version number, there is no need to upgrade. Otherwise, some devices need to be selected from the traversed fault recorders for batch software upgrade.

[0053] Step S05: Select the fault recorder to be upgraded, select a new upgrade file and then execute the update.tcl script for batch upgrade; before executing the upgrade action, first verify the upgrade file, if the file fails to pass the verification, stop the upgrade operation; the batch upgrade operation can be performed only after the update file is verified;

[0054] Step S06: After the fault recorder completes the upgrade, it sends a verification code to the batch upgrade platform and reads back the version number. If the verification code and the version number are consistent with expectations, it indicates that the upgrade is successful.

[0055] As one or more implementation methods, in step S02, the run.sh script is responsible for organizing the batch upgrade process, establishing a Socket link with each fault recorder in the local area network, and subsequently calling get_remote_machine_ip.tcl to implement IP traversal and recording of all fault recorders; and calling update.tcl to complete the batch upgrade operation.

[0056] As one or more implementation modes, in step S03, when establishing a Socket link, the upgrade platform is used as the server and each power fault recorder is used as the client; the Port port is specified by the server (i.e., the upgrade platform); the steps executed in the client (i.e., each power fault recorder) are: calling socket to create a socket—initializing the socket structure—calling connect to connect to the server (i.e., the upgrade platform); the steps executed by the server (i.e., the upgrade platform) are: socket creates a socket—stockpot sets the local port and address—bind address—listen to the listening port.

[0057] As one or more implementation modes, in step S04, according to the received version information, if it is the same as the expected version, there is no need to upgrade the version, and the process ends; if it is different from the expected version, subsequent batch upgrade steps are performed.

[0058] It should be noted that before upgrading the software version, a backup strategy and rollback plan must be formulated so that you can quickly restore to the previous stable state if problems occur during the upgrade process.

[0059] This embodiment monitors the upgrade progress in real time (the upgrade progress is represented by the percentage of the file size of the written data to the total file size) and the status of each device (each device sends a heartbeat status message to the upgrade platform, and the device status can be represented in the heartbeat communication message) to handle any upgrade failures or problems, and when problems occur during the upgrade process, take necessary remedial measures immediately (such as rolling back or retrying the upgrade).

[0060] It should be noted that this embodiment can use a single emmc dual mirror to implement version rollback, partition 1 stores image 1, and partition 2 stores image 2. By default, partition 1 is started and the upgrade update file is written to partition 1. If the upgrade is successful, partition 2 will synchronize with partition 1. If the upgrade of partition 1 fails, switch to partition 2 to start and roll back to the normal version before the upgrade.

[0061] As one or more implementation modes, in step S05, the upgrade file is essentially a binary text (string), and the starting position and length of the file are known, and the crc32 algorithm can be used for verification to ensure the integrity of the file.

[0062] It should be noted that the upgrade platform is connected to multiple fault recorders to be upgraded through the network. The upgrade platform transfers the files to be upgraded to the storage media of each fault recorder, such as flash or the specified block of emmc, through TCP. Before confirming the transmission of new files, the corresponding blocks of the storage media of each recorder will be erased. After the new files are completely placed in the specified block of emmc, execute the update.tcl script to perform the batch upgrade task.

[0063] It should be noted that the update.tcl script in this embodiment is generally used with three parameters, namely, ip, account, and password; wherein, the IP can be obtained through step S03, and both account and password are root by default.

[0064] As one or more implementation modes, in step S06, after the upgrade is completed, by verifying that the verification code and the new software version of each device are the same as expected, it is indicated whether the batch upgrade is successful and the device is operating normally.

[0065] This embodiment performs Socket linking of all power fault recorders in the local area network based on the Expect script, performs software upgrade and verification on the power fault recorders that need to be upgraded, and realizes batch software version iterative update of the power fault recorders, thereby saving labor costs and improving the production efficiency of manufacturers.

[0066] Embodiment 2

[0067] The second embodiment of the present invention introduces a batch upgrade system for power fault recorders based on Expect.

[0068] like Figure 3 The power fault recorder batch upgrade system shown in the figure based on Expect includes:

[0069] A first acquisition module is configured to acquire IP addresses of all power fault recorders in the local area network;

[0070] A link establishment module is configured to establish Socket links of all power fault recorders in the local area network using an Expect script based on the acquired IP address;

[0071] A second acquisition module is configured to acquire software version numbers of power fault recorders traversing all IP addresses according to the established Socket link;

[0072] A batch upgrade module is configured to determine whether the obtained software version number meets the expected requirements. If so, there is no need to upgrade the power fault recorder. Otherwise, a batch upgrade of the power fault recorder is performed.

[0073] Among them, during the batch upgrade of the power fault recorders in the batch upgrade module, an upgrade signal is triggered in the power fault recorders to be upgraded, and the upgrade file is verified. After the upgrade file is verified, the batch upgrade operation of the power fault recorders is performed. If the verification code is verified after the power fault recorders are upgraded, the batch upgrade is successful.

[0074] The detailed steps are the same as the Expect-based batch upgrade method for power fault recorders provided in Example 1, and will not be repeated here.

[0075] Embodiment 3

[0076] Embodiment 3 of the present invention provides a computer-readable storage medium.

[0077] A computer-readable storage medium stores a program thereon, and when the program is executed by a processor, the program implements the steps in the method for batch upgrading of electric power fault recorders based on Expect as described in the first embodiment of the present invention.

[0078] The detailed steps are the same as the Expect-based batch upgrade method for power fault recorders provided in Example 1, and will not be repeated here.

[0079] Embodiment 4

[0080] A fourth embodiment of the present invention provides an electronic device.

[0081] An electronic device comprises a memory, a processor and a program stored in the memory and running on the processor, wherein when the processor executes the program, the steps in the method for batch upgrading power fault recorders based on Expect as described in the first embodiment of the present invention are implemented.

[0082] The detailed steps are the same as the Expect-based batch upgrade method for power fault recorders provided in Example 1, and will not be repeated here.

[0083] Embodiment 5

[0084] Embodiment 5 of the present invention provides a computer program product.

[0085] A computer program product includes software codes, wherein the program in the software codes executes the steps in the method for batch upgrading electric power fault recorders based on Expect as described in the first embodiment of the present invention.

[0086] The detailed steps are the same as the Expect-based batch upgrade method for power fault recorders provided in Example 1, and will not be repeated here.

[0087] The above description is only a preferred embodiment of the present embodiment and is not intended to limit the present embodiment. For those skilled in the art, the present embodiment may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present embodiment shall be included in the protection scope of the present embodiment.

Claims

1. A method for batch upgrading power fault recorders based on Expect, characterized in that: include: Get the IP addresses of all power fault recorders in the local area network; Based on the obtained IP address, the Expect script is used to establish the Socket link of all power fault recorders in the LAN; According to the established Socket link, the software version number of the power fault recorder traversing all IP addresses is obtained; Determine whether the obtained software version number meets the expected requirements. If so, there is no need to upgrade the power fault recorder. Otherwise, perform a batch upgrade of the power fault recorder. Among them, during the batch upgrade of the power fault recorder, an upgrade signal is triggered in the power fault recorder to be upgraded, and the upgrade file is verified. After the upgrade file is verified, the batch upgrade operation of the power fault recorder is performed. If the verification code is verified after the power fault recorder is upgraded, the batch upgrade is successful.

2. A method for batch upgrading power fault recorders based on Expect as claimed in claim 1, characterized in that: In the process of obtaining the IP addresses of all power fault recorders in the local area network, the power fault recorder to be upgraded is connected to the local area network, and a unique IP address is allocated to each power fault recorder to be upgraded through the dynamic host configuration protocol. The uniqueness of the power fault recorder is characterized based on the allocated IP address and the identification code of the power fault recorder.

3. A method for batch upgrading power fault recorders based on Expect as claimed in claim 1, characterized in that: The electric power fault recorder is provided with a run.sh script for batch upgrade, and the run.sh script is responsible for arranging the batch upgrade path, and establishing a Socket link for each electric power fault recorder in the local area network based on the run.sh script.

4. A method for batch upgrading power fault recorders based on Expect as claimed in claim 3, characterized in that: In the process of establishing the Socket link, the get_remote_machine_ip.tcl script in the Expect script is called through the run.sh script, and the result of the called get_remote_machine_ip.tcl script is recorded.

5. A method for batch upgrading power fault recorders based on Expect as claimed in claim 1, characterized in that: The batch upgrade of the power fault recorders is completed based on the upgrade platform. The upgrade platform is connected to the power fault recorders to be upgraded through the network. After the upgraded files that have passed the inspection are transferred to the emmc specified block in each power fault recorder, the batch upgrade task of the power fault recorders is performed based on the update.tcl script.

6. A method for batch upgrading power fault recorders based on Expect as claimed in claim 5, characterized in that: After the power fault recorder is upgraded, a version verification code is sent based on the upgrade platform to obtain the upgraded version number; the power fault recorder is upgraded successfully if and only if the sent version verification code and the upgraded version number are consistent with the expected requirements.

7. A batch upgrade system for power fault recorders based on Expect, characterized in that: include: A first acquisition module is configured to acquire the IP addresses of all power fault recorders in the local area network; A link establishment module is configured to establish Socket links of all power fault recorders in the local area network using an Expect script based on the acquired IP address; A second acquisition module is configured to acquire the software version number of the power fault recorder traversing all IP addresses according to the established Socket link; A batch upgrade module is configured to determine whether the obtained software version number meets the expected requirements. If so, there is no need to upgrade the power fault recorder. Otherwise, a batch upgrade of the power fault recorder is performed. Among them, during the batch upgrade of the power fault recorders in the batch upgrade module, an upgrade signal is triggered in the power fault recorders to be upgraded, and the upgrade file is verified. After the upgrade file is verified, the batch upgrade operation of the power fault recorders is performed. If the verification code is verified after the power fault recorders are upgraded, the batch upgrade is successful.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for batch upgrading power fault recorders based on Expect as described in any one of claims 1 to 6 are implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the steps of the method for batch upgrading power fault recorders based on Expect as described in any one of claims 1 to 6 are implemented.

10. A computer program product comprising software code, characterized in that The program in the software code executes the steps of the method for batch upgrading power fault recorders based on Expect as described in any one of claims 1 to 6.