Power grid protocol test method and device, electronic equipment and storage medium

Through training and generation of adversarial networks, a large number of target test messages are generated, which solves the problem of low testing efficiency and comprehensiveness in grid protocol testing, and realizes efficient discovery and positioning of grid protocol security vulnerabilities.

CN118984232APending Publication Date: 2024-11-19GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410981638.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The existing technology has low testing efficiency and comprehensiveness in power grid protocol testing, making it difficult to effectively discover security vulnerabilities.

Method used

By obtaining real grid protocol messages, the adversarial network is trained to generate a large number of target test messages, and these messages are used to test the grid system, thereby improving testing efficiency and comprehensiveness.

Benefits of technology

It significantly improves the efficiency and comprehensiveness of grid protocol testing, and can more accurately detect and locate security vulnerabilities, which has advantages over manual construction or acquisition of target test messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118984232A_ABST
    Figure CN118984232A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a power grid protocol test method and device, electronic equipment and a storage medium. The method comprises the steps that for a power grid system applying a power grid protocol, a real power grid protocol message collected from the power grid system is acquired, and the real power grid protocol message is generated based on the power grid protocol; based on the real power grid protocol messages, training a pre-constructed initial generative adversarial network to generate target test messages based on a target generator in a target generative adversarial network obtained by training, the number of the target test messages being greater than the number of the real power grid protocol messages; and testing the power grid system based on the target test message to obtain a first operation result of the power system for the target test message, and determining a security vulnerability condition in the power grid protocol based on the first operation result. According to the technical scheme of the embodiment of the invention, the test efficiency and test comprehensiveness of the power grid protocol test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing, and in particular to a power grid protocol testing method, device, electronic device and storage medium. Background Art

[0002] With the development of smart grid technology, the security of the grid is becoming increasingly important. The grid protocol is a key communication protocol in the smart grid. Security vulnerabilities in the grid protocol may lead to serious security issues. Therefore, it is very important to test the grid protocol and eliminate the security vulnerabilities.

[0003] However, when testing power grid protocols, the test efficiency and comprehensiveness are currently low, making it difficult to effectively discover security vulnerabilities, which needs to be addressed urgently. Summary of the invention

[0004] The embodiments of the present invention provide a power grid protocol testing method, device, electronic device and storage medium to improve the test efficiency and test comprehensiveness of the power grid protocol test.

[0005] According to one aspect of the present invention, a power grid protocol testing method is provided, comprising:

[0006] For a power grid system that applies a power grid protocol, obtaining a real power grid protocol message collected from the power grid system, wherein the real power grid protocol message is generated based on the power grid protocol;

[0007] Based on real power grid protocol messages, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages;

[0008] Based on the target test message, the power grid system is tested to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result.

[0009] According to another aspect of the present invention, there is provided a power grid protocol testing device, comprising:

[0010] A real power grid protocol message acquisition module is used to acquire real power grid protocol messages collected from a power grid system that applies the power grid protocol, wherein the real power grid protocol messages are generated based on the power grid protocol;

[0011] A target test message generation module is used to train a pre-constructed initial generative adversarial network based on real power grid protocol messages, so as to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages;

[0012] The security vulnerability determination module is used to test the power grid system based on the target test message, obtain the first operation result of the power system for the target test message, and determine the security vulnerability in the power grid protocol based on the first operation result.

[0013] According to another aspect of the present invention, there is provided an electronic device, comprising:

[0014] at least one processor; and a memory in communication with the at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor executes any power grid protocol testing method provided by any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a processor to implement any power grid protocol testing method provided by any embodiment of the present invention when executed.

[0017] The technical solution of the embodiment of the present invention is aimed at a power grid system that applies a power grid protocol. By acquiring real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol, more target test messages similar to the real power grid protocol messages are further generated based on the real power grid protocol messages; based on the real power grid protocol messages, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages, and a large number of target test messages can be generated by the trained target generator, thereby improving the generation efficiency of the target test messages, thereby improving the test efficiency of the power grid protocol test; based on the target test message, the power grid system is tested to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result. The power system is tested by a large number of target test messages, which can improve the comprehensiveness of the power grid protocol test. The above technical solution uses real power grid protocol messages to train the target generative adversarial network, and then uses the target generator in the target generative adversarial network to automatically generate more target test messages. Compared with manually constructing or manually collecting target test messages, this can significantly improve the test efficiency and comprehensiveness of the power grid protocol test.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a flow chart of a power grid protocol testing method provided according to an embodiment of the present invention;

[0021] Figure 2 is a flow chart of another power grid protocol testing method provided according to an embodiment of the present invention;

[0022] Figure 3 is a flowchart of a specific example of another power grid protocol testing method provided in an embodiment of the present invention;

[0023] Figure 4 is a structural block diagram of a power grid protocol testing device provided according to an embodiment of the present invention;

[0024] Figure 5 It is a structural schematic diagram of an electronic device for implementing the power grid protocol testing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Figure 1 1 is a flow chart of a power grid protocol testing method provided by an embodiment of the present invention. This embodiment is applicable to the case of testing a power grid protocol. The method can be executed by a power grid protocol testing device provided by an embodiment of the present invention, the device can be implemented by software and / or hardware, the device can be integrated on an electronic device, and the electronic device can be various user terminals or servers.

[0028] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:

[0029] S110. For a power grid system that applies a power grid protocol, obtain real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol.

[0030] Among them, the grid protocol can be understood as a series of rules and conventions for realizing communication and data exchange between power equipment in the power grid system to ensure the reliability, safety and efficiency of power supply.

[0031] Real grid protocol messages can be understood as messages generated in accordance with grid protocols and used for data transmission and exchange in the grid system, such as grid communication protocol message data in accordance with standards such as IEC 61850, DNP3 or Modbus, etc., to ensure that data can be accurately and reliably transmitted between various devices in the grid.

[0032] For a power grid system that uses a power grid protocol, real power grid protocol messages generated based on the power grid protocol can be collected from the power grid system. Optionally, a data collector can be used to access the power grid system to monitor and collect real power grid protocol messages. Optionally, after collecting the real power grid protocol messages, a detailed analysis can be performed to determine the data format, message structure, and communication process of the real power grid protocol messages.

[0033] S120. Based on real power grid protocol messages, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages.

[0034] The initial generative adversarial network can be understood as a pre-built untrained generative adversarial network. By training the initial generative adversarial network with real power grid protocol messages, a trained target generative adversarial network can be obtained.

[0035] The target test message can be understood as a message generated by the target generator and close to the real power grid protocol. Optionally, when there are fewer real power grid protocol messages, a large number of target test messages can be generated by the target generator to replace the real power grid protocol messages.

[0036] The pre-built initial generative adversarial network can be trained using real power grid protocol messages, and the target generator in the trained target generative adversarial network generates target test messages. Optionally, the initial generative network can be composed of an initial generator and an initial discriminator. The initial generator can use a deep learning model to generate virtual power grid protocol messages by learning real power grid protocol messages; the initial discriminator can be used to evaluate the effectiveness of the generated virtual power grid protocol messages and provide feedback to optimize the performance of the initial generator, so that the initial generator generates messages as close to the real power grid protocol messages as possible, so as to complete the training of the initial generative adversarial network and obtain the target generative adversarial network; finally, the trained target generator in the target generative adversarial network is used to generate a large number of target test messages.

[0037] S130. Testing the power grid system based on the target test message to obtain a first operation result of the power system for the target test message, and determining a security vulnerability in the power grid protocol based on the first operation result.

[0038] The first operation result can be understood as the operation result of the power grid system after the operation based on the target test message. Optionally, when there are multiple target test messages, multiple first operation results can be obtained.

[0039] The power grid system can be tested based on the target test message to obtain a first operating result of the power system for the target test message, and the security vulnerability situation in the power grid protocol can be determined based on the first operating result. For example, whether there is an abnormal operating situation in the first operating result can be used to determine whether there is a security vulnerability in the power grid protocol. Further, in the case of a security vulnerability, the type and location of the security vulnerability in the power grid protocol can be determined through the target test message to further repair the security vulnerability.

[0040] The technical solution of the embodiment of the present invention is aimed at a power grid system that applies a power grid protocol. By acquiring real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol, more target test messages similar to the real power grid protocol messages are further generated based on the real power grid protocol messages; based on the real power grid protocol messages, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages, and a large number of target test messages can be generated by the trained target generator, thereby improving the generation efficiency of the target test messages, thereby improving the test efficiency of the power grid protocol test; based on the target test message, the power grid system is tested to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result. The power system is tested by a large number of target test messages, which can improve the comprehensiveness of the power grid protocol test. The above technical solution uses real power grid protocol messages to train the target generative adversarial network, and then uses the target generator in the target generative adversarial network to automatically generate more target test messages. Compared with manually constructing or manually collecting target test messages, this can significantly improve the test efficiency and comprehensiveness of the power grid protocol test.

[0041] An optional technical solution, a power grid protocol testing method, also includes: for a first problem operation result having a problem in the first operation result, determining an operation test message corresponding to the first problem operation result from a target test message; based on the operation test message, training a target generative adversarial network to update a target generator based on the training result, and generating a problem test message based on the target generator; based on the problem test message, testing the power grid system to obtain a second operation result of the power system for the problem test message, and determining the security vulnerability in the power grid protocol based on the second operation result.

[0042] Among them, the first problem operation result can be understood as the operation result in which there is an operation problem in the first operation result. The operation test message corresponding to the first problem operation result can be found from the target test message through the first problem operation result. Further, the target generative adversarial network can be trained again using the operation test message, the target generator can be updated based on the training results, and a problem test message that can cause problems in the operation of the power grid system can be generated based on the target generator. In this way, more problem test messages can be generated in a targeted manner, and then the power grid system can be tested through the problem test message, and the second operation result after the power system is operated for the problem test message can be obtained, and the security vulnerability in the power grid protocol can be determined based on the second operation result.

[0043] The above technical solution can generate problem test messages in a targeted manner by running test messages to train the target generative adversarial network again, so as to more effectively discover security vulnerabilities in the power grid protocol based on the problem test messages.

[0044] Another optional technical solution, the power grid protocol testing method, also includes: when the security vulnerability situation indicates that there is a security vulnerability in the power grid protocol, executing response measures based on a pre-set security policy and emergency plan.

[0045] Among them, when the security vulnerability situation indicates that there is a security vulnerability in the power grid protocol, response measures can be executed based on the pre-set security policies and emergency plans, such as blocking malicious traffic, isolating infected devices, and notifying security administrators. Further, the response results and processing records of the security vulnerability can be archived and a report can be generated to facilitate the subsequent processing of the security vulnerability.

[0046] The above technical solution, by executing response measures based on pre-set security policies and emergency plans, can achieve rapid response and dynamic adjustment when security vulnerabilities occur, thereby shortening the response time of security incidents and reducing the risk of human error.

[0047] Another optional technical solution is that the initial generative adversarial network includes an initial generator and an initial discriminator. Based on real power grid protocol messages, the pre-constructed initial generative adversarial network is trained to generate multiple groups of target test messages based on the target generator in the trained target generative adversarial network, including: training the initial generator based on the real power grid protocol message so that the initial generator generates a virtual power grid protocol message; inputting the real power grid protocol message and the virtual power grid protocol message into the initial discriminator to obtain the real probability values ​​corresponding to the real power grid protocol message and the virtual power grid protocol message respectively; obtaining the real vulnerability label of the real power grid protocol message and the virtual vulnerability label of the virtual power grid protocol message, and performing loss calculation based on the real probability value, the real vulnerability label and the virtual vulnerability label to obtain the loss value of the initial generator; adjusting the parameters of the initial generator based on the loss value to train the target generator, and generating the target test message based on the target generator.

[0048] The above technical solution obtains a target generator by training an initial generator using real power grid protocol messages and adjusting the parameters of the initial generator using loss values, so that the target generator can generate target test messages that are closer to real power grid protocol messages.

[0049] Figure 2It is a flowchart of another power grid protocol testing method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the number of target test messages is multiple, and based on the target test message, the power grid system is tested to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result, including: for each target test message in the multiple target test messages, the target test message is input into a predetermined fuzzy test tool, a test case is generated, and the test case is input into the power grid system to obtain the first operation result of the power grid system for the target test message; the second problem operation result with a problem is determined from the multiple first operation results obtained, and the problem test case corresponding to the second problem operation result is determined from the multiple test cases generated, and the security vulnerability situation in the power grid protocol is determined based on the problem test case. Among them, the explanation of the terms that are the same or corresponding to the above-mentioned embodiments will not be repeated here.

[0050] See also Figure 2 The method of this embodiment may specifically include the following steps:

[0051] S210. For a power grid system that applies a power grid protocol, obtain real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol.

[0052] S220. Based on real power grid protocol messages, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is multiple and greater than the number of real power grid protocol messages.

[0053] S230. For each target test message among multiple target test messages, the target test message is input into a predetermined fuzzy testing tool to generate a test case, and the test case is input into the power grid system to obtain a first running result of the power grid system for the target test message.

[0054] Among them, the fuzz testing tool can be understood as a method of discovering security vulnerabilities by providing unexpected inputs to the power grid system and monitoring abnormal results. Through the fuzz testing tool, the input target test message can generate different test cases for different layers of the power grid communication protocol (such as the physical layer, data link layer, network layer, and application layer, etc.), and the generated test cases are input into the power grid system to observe and record the response of the power grid system, such as abnormal behaviors of the power grid system, such as crashes and abnormal exits, so as to obtain the first running result of the power grid system for the target test message.

[0055] S240, determining a problematic second operation result from the obtained multiple first operation results, and determining a problematic test case corresponding to the second problem operation result from the generated multiple test cases, and determining the security vulnerability situation in the power grid protocol based on the problematic test case.

[0056] The second problem operation result can be understood as the operation result with problems in the first operation result, and can be the same as or different from the first problem operation result.

[0057] Determine the problematic second problem operation result from the multiple first operation results obtained, and further determine the problematic test case corresponding to the second problem operation result from the multiple test cases generated. Based on the problematic test case, the security vulnerability in the power grid protocol can be determined. Optionally, the use case test message corresponding to the problematic test case can be determined from the multiple target test messages; determine the problematic protocol that generates the use case test message in the power grid protocol, and determine the problematic protocol as the security vulnerability in the power grid protocol. In this way, the security vulnerability in the power grid protocol can be accurately found through the problematic test case and reverse deduction.

[0058] The technical solution of the embodiment of the present invention realizes accurate determination of security vulnerabilities in power grid protocols by using fuzzy testing tools based on target test messages.

[0059] On this basis, optionally, after determining the problematic protocol as a security vulnerability existing in the power grid protocol, it also includes: correcting the problematic protocol, and updating the configuration parameters of the power grid protocol based on the correction result of the problematic protocol.

[0060] Among them, after the security vulnerability is determined, the security vulnerability in the power grid protocol can be repaired and the entire power grid protocol can be updated to avoid the occurrence of security vulnerabilities.

[0061] The above technical solution avoids the occurrence of security loopholes by correcting the problematic protocol.

[0062] In order to better understand the above-mentioned technical solutions, the following is an exemplary description with reference to specific examples. For example, a power grid protocol fuzz testing method based on a generative adversarial network is shown in the specific flow chart. Figure 3 As shown, the specific steps are as follows:

[0063] Step 1: Monitor the power grid system, collect the real power grid protocol messages in the power grid system and conduct detailed analysis to determine the data format, message structure and communication process of the real power grid protocol messages.

[0064] Step 2: Based on the analysis results of the real power grid protocol messages, an initial generative adversarial network model is designed, and the initial generative adversarial network model is trained based on the real power grid protocol messages to obtain the target generative adversarial network.

[0065] Step 3: Use the target generator of the target generative adversarial network model to generate a large number of target test messages.

[0066] Step 4: Use the target test message and fuzzy testing tools to test the power grid system, execute response measures based on the second problem operation result that occurs when the power grid system is running, and determine the problem test case corresponding to the second problem operation result in the target test message, and further determine the problem protocol corresponding to the problem test case.

[0067] Step 5: Based on the problematic protocol, modify the power grid protocol.

[0068] In the above specific example, by using a generative adversarial network to generate a large number of target test messages, the test efficiency and comprehensiveness of the power grid protocol test can be improved.

[0069] Figure 3 This is a structural block diagram of a power grid protocol testing device provided in an embodiment of the present invention, and the device is used to execute the power grid protocol testing method provided in any of the above embodiments. The device and the power grid protocol testing method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the power grid protocol testing device can be referred to the embodiment of the above power grid protocol testing method. Figure 3 The device may specifically include: a real power grid protocol message acquisition module 310, a target test message generation module 320 and a security vulnerability determination module 330.

[0070] A real power grid protocol message acquisition module 310 is used to acquire, for a power grid system that applies a power grid protocol, real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol;

[0071] A target test message generation module 320 is used to train a pre-constructed initial generative adversarial network based on real power grid protocol messages, so as to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages;

[0072] The security vulnerability determination module 330 is used to test the power grid system based on the target test message, obtain a first operation result of the power system for the target test message, and determine the security vulnerability in the power grid protocol based on the first operation result.

[0073] An optional power grid protocol testing device further includes:

[0074] An operation test message determination module is used to determine, for a first problem operation result having a problem in the first operation result, an operation test message corresponding to the first problem operation result from a target test message;

[0075] A problem test message generation module is used to train the target generative adversarial network based on the running test message, to update the target generator based on the training result, and to generate a problem test message based on the target generator;

[0076] The second operation result obtaining module is used to test the power grid system based on the problem test message, obtain the second operation result of the power system for the problem test message, and determine the security vulnerability situation in the power grid protocol based on the second operation result.

[0077] Alternatively, the number of target test messages is multiple, and the security vulnerability determination module 330 includes:

[0078] A first operation result obtaining submodule is used for inputting the target test message into a predetermined fuzzy test tool for each target test message among a plurality of target test messages, generating a test case, and inputting the test case into the power grid system to obtain a first operation result of the power grid system for the target test message;

[0079] The security vulnerability determination submodule is used to determine the problematic second problem operation result from the multiple first operation results obtained, and to determine the problematic test case corresponding to the second problem operation result from the multiple test cases generated, and to determine the security vulnerability situation in the power grid protocol based on the problematic test case.

[0080] On this basis, optional security vulnerability determination submodules include:

[0081] A use case test message determination unit, used to determine a use case test message corresponding to a problem test case among multiple target test messages;

[0082] The security vulnerability determination unit is used to determine the problematic protocol that generates the use case test message in the power grid protocol, and determine the problematic protocol as a security vulnerability existing in the power grid protocol.

[0083] On this basis, the optional grid protocol test device also includes:

[0084] The configuration parameter updating module is used to correct the problematic protocol and update the configuration parameters of the power grid protocol based on the correction result of the problematic protocol.

[0085] Another optional power grid protocol testing device further includes:

[0086] The response measure execution module is used to execute response measures based on pre-set security policies and emergency plans when the security vulnerability situation indicates that there is a security vulnerability in the power grid protocol.

[0087] Alternatively, the initial generative adversarial network includes an initial generator and an initial discriminator, and the target test message generation module 320 includes:

[0088] A virtual power grid protocol message generation submodule, used for training the initial generator based on the real power grid protocol message so that the initial generator generates the virtual power grid protocol message;

[0089] A submodule for obtaining a true probability value is used to input the true power grid protocol message and the virtual power grid protocol message into the initial discriminator to obtain true probability values ​​corresponding to the true power grid protocol message and the virtual power grid protocol message respectively;

[0090] The loss value obtaining submodule is used to obtain the real vulnerability label of the real power grid protocol message and the virtual vulnerability label of the virtual power grid protocol message, and perform loss calculation based on the real probability value, the real vulnerability label and the virtual vulnerability label to obtain the loss value of the initial generator;

[0091] The target test message generation submodule is used to adjust the parameters of the initial generator based on the loss value to train the target generator and generate the target test message based on the target generator.

[0092] The power grid protocol testing device provided by the embodiment of the present invention, for a power grid system applying the power grid protocol, acquires the real power grid protocol message collected from the power grid system through the real power grid protocol message acquisition module, wherein the real power grid protocol message is generated based on the power grid protocol, so as to further generate more target test messages similar to the real power grid protocol message based on the real power grid protocol message; through the target test message generation module, based on the real power grid protocol message, the pre-constructed initial generative adversarial network is trained to generate the target test message based on the target generator in the trained target generative adversarial network, wherein the number of target test messages is greater than the number of real power grid protocol messages, and the target generator obtained by training can generate a large number of target test messages, thereby improving the generation efficiency of the target test message, thereby improving the test efficiency of the power grid protocol test; through the security vulnerability situation determination module, based on the target test message, the power grid system is tested, and the first operation result of the power system for the target test message is obtained, and the security vulnerability situation in the power grid protocol is determined based on the first operation result. The power system is tested by a large number of target test messages, which can improve the comprehensiveness of the power grid protocol test. The above-mentioned power grid protocol testing device uses real power grid protocol messages to train the target generation adversarial network, thereby using the target generator in the target generation adversarial network to automatically generate more target test messages. Compared with manually constructing or manually collecting target test messages, this can significantly improve the test efficiency and comprehensiveness of the power grid protocol test.

[0093] The power grid protocol testing device provided in the embodiment of the present invention can execute the power grid protocol testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0094] It is worth noting that in the embodiment of the above-mentioned power grid protocol testing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0095] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0096] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0097] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0098] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the power grid protocol test method.

[0099] In some embodiments, the power grid protocol test method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the power grid protocol test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the power grid protocol test method in any other appropriate manner (e.g., by means of firmware).

[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0102] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A power grid protocol testing method, characterized in that: include: For a power grid system that applies a power grid protocol, obtaining a real power grid protocol message collected from the power grid system, wherein the real power grid protocol message is generated based on the power grid protocol; Based on the real power grid protocol message, a pre-constructed initial generative adversarial network is trained to generate target test messages based on a target generator in the trained target generative adversarial network, wherein the number of the target test messages is greater than the number of the real power grid protocol messages; Based on the target test message, the power grid system is tested to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result.

2. The method according to claim 1, characterized in that Also includes: For a first problematic operation result having a problem in the first operation result, determining an operation test message corresponding to the first problematic operation result from the target test message; Based on the running test message, the target generation adversarial network is trained to update the target generator based on the training result, and a problem test message is generated based on the target generator; Based on the problem test message, the power grid system is tested to obtain a second operation result of the power system for the problem test message, and the security vulnerability situation in the power grid protocol is determined based on the second operation result.

3. The method according to claim 1, characterized in that The number of the target test messages is multiple, and the power grid system is tested based on the target test messages to obtain a first operation result of the power system for the target test message, and the security vulnerability situation in the power grid protocol is determined based on the first operation result, including: For each target test message among the multiple target test messages, input the target test message into a predetermined fuzzy testing tool to generate a test case, and input the test case into the power grid system to obtain a first running result of the power grid system for the target test message; Determine a problematic second problem operation result from the multiple first operation results obtained, and determine a problematic test case corresponding to the second problem operation result from the multiple test cases generated, and determine the security vulnerability situation in the power grid protocol based on the problematic test case.

4. The method according to claim 3, characterized in that Determining the security vulnerability in the power grid protocol based on the problem test case includes: Determine a use case test message corresponding to the problem test case among the multiple target test messages; A problematic protocol in the power grid protocol that generates the use case test message is determined, and the problematic protocol is determined to be a security vulnerability existing in the power grid protocol.

5. The method according to claim 4, characterized in that After determining the problematic protocol as a security vulnerability existing in the power grid protocol, the method further includes: The problematic protocol is modified, and based on the modified result of the problematic protocol, the configuration parameters of the power grid protocol are updated.

6. The method according to claim 1, characterized in that Also includes: In the case where the security vulnerability situation indicates that a security vulnerability exists in the power grid protocol, response measures are executed based on a pre-set security policy and emergency plan.

7. The method according to claim 1, characterized in that The initial generative adversarial network includes an initial generator and an initial discriminator. The pre-constructed initial generative adversarial network is trained based on the real power grid protocol message to generate a target test message based on a target generator in a target generative adversarial network obtained by training, including: Training the initial generator based on the real power grid protocol message so that the initial generator generates a virtual power grid protocol message; Inputting the real power grid protocol message and the virtual power grid protocol message into the initial discriminator to obtain real probability values ​​corresponding to the real power grid protocol message and the virtual power grid protocol message respectively; Obtaining a real vulnerability label of the real power grid protocol message and a virtual vulnerability label of the virtual power grid protocol message, and performing loss calculation based on the real probability value, the real vulnerability label and the virtual vulnerability label to obtain a loss value of the initial generator; Based on the loss value, the parameters of the initial generator are adjusted to train the target generator, and a target test message is generated based on the target generator.

8. A power grid protocol testing device, characterized in that: include: A real power grid protocol message acquisition module, used for acquiring, for a power grid system that applies the power grid protocol, real power grid protocol messages collected from the power grid system, wherein the real power grid protocol messages are generated based on the power grid protocol; A target test message generation module, used to train a pre-constructed initial generative adversarial network based on the real power grid protocol message, so as to generate a target test message based on a target generator in the trained target generative adversarial network, wherein the number of the target test messages is greater than the number of the real power grid protocol messages; A security vulnerability determination module is used to test the power grid system based on the target test message, obtain a first operation result of the power system for the target test message, and determine the security vulnerability situation in the power grid protocol based on the first operation result.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor performs the power grid protocol testing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the power grid protocol testing method as described in any one of claims 1-7 when executed.