Fuzzy test method and device for power distribution terminal communication protocol
Through the fuzzy testing method for the communication protocol of the power distribution terminal, the fuzzy test sample use cases are generated and sent, which solves the problem of low safety testing efficiency of power distribution terminal equipment in the distribution network automation system, improves safety performance, and ensures the stability of the system and security.
Patent Information
- Application Number
- CN202411197154.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-14
AI Technical Summary
In the distribution network automation system, the safety testing of massive distribution terminal equipment is inefficient, and there are safety hazards, making it difficult to effectively discover and repair vulnerabilities, affecting the robustness and security of the system.
A fuzz testing method for the communication protocol of the power distribution terminal is proposed. By obtaining the target protocol type and variable fields, fuzzing it with fuzzy processing strategy, fuzzing it, generating a fuzzy test sample use case, and sending it to the power distribution terminal to obtain the test results , improve safety testing efficiency.
It improves the security testing efficiency of the communication protocol of the power distribution terminal, enhances the security performance, can detect and repair vulnerabilities in advance, and ensures the stable operation of the distribution network automation system.
Smart Images

Figure CN119316328A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a fuzzy testing method and device for a power distribution terminal communication protocol. Background Art
[0002] Distribution terminals and related automation technologies play an important role in the construction of distribution network automation, enabling the distribution network automation system to realize real-time monitoring, data analysis, remote operation and other functions, thereby continuously improving the reliability of power distribution. However, the distribution network automation system is connected to a large number of distribution terminal devices, which makes the previously clear security boundaries unclear, further highlighting the urgency of ensuring system security. In view of the massive distribution terminal equipment, it is urgent to mine the security vulnerabilities of the distribution terminals, discover potential safety hazards in advance and conduct closed-loop disposal, and improve the robustness of the distribution network automation system.
[0003] The distribution terminal communication protocol has many advantages in communication performance and expansion, but it is vulnerable to attacks in terms of security and poses security risks. Therefore, security testing based on the distribution terminal communication protocol is particularly important. In addition, the real-time operation data volume of the distribution network is large and the data items are numerous, which brings great inconvenience to security testing, especially the construction of security test cases, resulting in low efficiency of security testing. Summary of the invention
[0004] In view of the problems in the prior art, an embodiment of the present invention provides a fuzzy testing method and device for a power distribution terminal communication protocol, which can at least partially solve the problems in the prior art.
[0005] On the one hand, the present invention proposes a fuzzy testing method for a power distribution terminal communication protocol, comprising:
[0006] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0007] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0008] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0009] The target protocol type includes a standard protocol and a private protocol, the target application service data unit type includes first application service data unit types corresponding to the standard protocol, and the target application service data unit type includes second application service data unit types corresponding to the private protocol; accordingly, determining the target variable fields corresponding to the target application service data unit type includes:
[0010] First variable fields corresponding to first application service data unit types are determined, and second variable fields corresponding to second application service data unit types are determined.
[0011] Wherein, each first variable field includes a call qualifier and a public address corresponding to the general call command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0012] The target fuzzy processing strategy corresponding to the summon qualifier is determined to be a full-field fuzzy strategy; and the target fuzzy processing strategy corresponding to the public address is determined to be a full-field fuzzy strategy.
[0013] Wherein, each first variable field includes a time stamp corresponding to the clock synchronization command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0014] The target fuzzy processing strategy corresponding to the time scale is determined to be a strategy combining a selection fuzzy strategy and a setting fuzzy strategy.
[0015] Wherein, each first variable field includes a reset process command qualifier corresponding to the reset process command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0016] The target fuzzy processing strategy corresponding to the reset process command qualifier is determined to be a set fuzzy strategy.
[0017] Wherein, each first variable field includes an information object address, single command information / dual command information and a message type identifier corresponding to the remote control command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0018] Determine that the target fuzzy processing strategy corresponding to the information object address is the full-field fuzzy strategy and the selective fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the single-command information / dual-command information is the selective fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the message type identifier is the set fuzzy strategy.
[0019] Wherein, each second variable field includes a variable frame length qualifier, an information object address and a fixed value area code corresponding to a read parameter and a fixed value; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0020] Determine that the target fuzzy processing strategy corresponding to the variable frame length qualifier is a bit fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the information object address is a strategy that combines the full field fuzzy strategy and the selection fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the fixed area code is a setting fuzzy strategy.
[0021] Wherein, each second variable field includes the information object address, data type, data length, data value and parameter characteristic identifier corresponding to the write parameter and the fixed value; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0022] Determine that the target fuzzy processing strategy corresponding to the information object address is the full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data type is the full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data length is the shift fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data value is a strategy that combines the selection fuzzy strategy and the setting fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the parameter feature identifier is the bit fuzzy strategy.
[0023] Wherein, each second variable field includes a fixed value area number corresponding to the switching fixed value area; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0024] Determine that the target fuzzy processing strategy corresponding to the fixed value area code is a full-field fuzzy strategy.
[0025] Wherein, each second variable field includes a public address corresponding to the current fixed value area code; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0026] It is determined that the target obfuscation processing strategy corresponding to the public address is a full-field obfuscation strategy.
[0027] On the one hand, the present invention provides a fuzzy testing device for a power distribution terminal communication protocol, comprising:
[0028] An acquisition unit, configured to acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0029] A processing unit, used to perform fuzzy processing on each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splice the processed target variable field with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0030] The testing unit is used to send each target fuzzy test sample case to the power distribution terminal, so that the power distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case.
[0031] In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein:
[0032] The processor and the memory communicate with each other via the bus;
[0033] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:
[0034] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0035] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0036] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0037] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
[0038] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:
[0039] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0040] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0041] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0042] The fuzzy testing method and device for the communication protocol of a distribution terminal provided in an embodiment of the present invention obtain the target protocol type of the distribution terminal, determine the target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type; fuzzy process each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splice the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case; send each target fuzzy test sample case to the distribution terminal, so that the distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case, which can improve the efficiency of the security testing of the communication protocol of the distribution terminal, and thereby improve the safety performance of the communication protocol of the distribution terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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. In the drawings:
[0044] Figure 1 It is a flow chart of a fuzzy testing method for a power distribution terminal communication protocol provided in one embodiment of the present invention.
[0045] Figure 2 It is a flow chart of a fuzzy testing method for a power distribution terminal communication protocol provided in another embodiment of the present invention.
[0046] Figure 3 It is a schematic diagram for explaining the general call test sample 1 provided in an embodiment of the present invention.
[0047] Figure 4 It is a schematic diagram for explaining the general call test sample 2 provided in an embodiment of the present invention.
[0048] Figure 5 It is a schematic diagram illustrating a clock synchronization sample provided by an embodiment of the present invention.
[0049] Figure 6 It is a schematic diagram illustrating a reset process sample provided by an embodiment of the present invention.
[0050] Figure 7 It is a schematic diagram illustrating a remote control sample 1 provided in an embodiment of the present invention.
[0051] Figure 8 It is a schematic diagram illustrating a remote control sample 2 provided in an embodiment of the present invention.
[0052] Fig. 9 It is a schematic diagram illustrating the remote control sample 3 provided in an embodiment of the present invention.
[0053] Fig.10 It is a schematic diagram illustrating a remote control sample 4 provided in an embodiment of the present invention.
[0054] Fig.11 It is a schematic diagram for explaining the reading parameters and the constant value sample 1 provided in an embodiment of the present invention.
[0055] Fig.12 It is a schematic diagram for explaining the reading parameters and the fixed value sample 2 provided in an embodiment of the present invention.
[0056] Fig.13 It is a schematic diagram for explaining the reading parameter and fixed value sample 3 provided in an embodiment of the present invention.
[0057] Fig.14 It is a schematic diagram for explaining the writing parameters and constant value sample 1 provided in an embodiment of the present invention.
[0058] Fig.15 It is a schematic diagram for explaining the writing parameters and constant value sample 2 provided in an embodiment of the present invention.
[0059] Fig.16 It is a schematic diagram for explaining the writing parameters and constant value sample 3 provided in an embodiment of the present invention.
[0060] Fig.17 It is a schematic diagram for explaining the writing parameters and the constant value sample 4 provided in the embodiment of the present invention.
[0061] Fig.18 It is a schematic diagram for explaining the writing parameters and the fixed value sample 5 provided in the embodiment of the present invention.
[0062] Fig.19 It is a schematic diagram illustrating a sample of switching fixed value zones provided in an embodiment of the present invention.
[0063] Fig. 20 It is a schematic diagram illustrating a sample of reading a current fixed value area code provided by an embodiment of the present invention.
[0064] Fig.21 It is a structural diagram of a fuzzy testing device for a power distribution terminal communication protocol provided by an embodiment of the present invention.
[0065] Fig. 22 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.
[0067] Explanation of related terms:
[0068] Fuzz testing: Fuzz testing is an automated software testing method that injects illegal, malformed, or unexpected inputs into a system to reveal software defects and vulnerabilities.
[0069] Vulnerability mining: Analyzing security vulnerabilities in software, systems, or networks to discover and exploit them.
[0070] Assertions: are conditional expressions set by developers that are expected to be true. If the assertion condition is false, the program will throw an error or exception, usually causing the program to terminate, and may provide error messages to help developers debug and diagnose problems.
[0071] Figure 1 FIG. 1 is a flow chart of a fuzzy testing method for a communication protocol of a power distribution terminal provided by an embodiment of the present invention. Figure 1 As shown, the fuzzy testing method for the power distribution terminal communication protocol provided by the embodiment of the present invention includes:
[0072] Step S1: Acquire a target protocol type of a power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type.
[0073] Step S2: Fuzzy process each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and concatenate the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case.
[0074] Step S3: Send each target fuzzy test sample case to the power distribution terminal, so that the power distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case.
[0075] In the above step S1, the device obtains the target protocol type of the distribution terminal, determines the target application service data unit type corresponding to the target protocol type, and determines each target variable field corresponding to the target application service data unit type. The device can be a computer device that executes the method, for example, it can include a server, specifically a distribution automation terminal detection platform server. It should be noted that the acquisition and analysis of data involved in the embodiments of the present invention are authorized by the user.
[0076] like Figure 2 The above-mentioned embodiment embodies the specific steps of the fuzzy testing method for the distribution terminal communication protocol, and the main steps include:
[0077] Step 1: Data packet analysis of distribution terminal; Step 2: Fuzzy test sample generation of distribution terminal; Step 3: Abnormal monitoring of distribution terminal; Step 4: Fuzzy test technology verification of distribution terminal.
[0078] They are briefly described as follows:
[0079] Step 1: Based on the distribution terminal communication message sample set, the protocol layered analysis and data clustering methods are used to extract the distribution terminal communication protocol message features from the application layer; after obtaining the distribution terminal communication protocol message feature set, the distribution terminal communication protocol is divided into standard protocols and private protocols (i.e., target protocol types), and the variable fields and immutable fields in the protocol message are determined.
[0080] Step 2: Use generation and mutation to fuzzify the above variable fields, and concatenate the fuzzy processing results of the variable fields with the immutable fields, encapsulate them into complete test sample cases, and build a fuzzy test sample case library for the power distribution terminal protocol. The generation-based method can ensure that the sample cases have a high pass rate, thereby obtaining a high fuzzy test coverage rate; the mutation-based method usually mutates in bits, which can effectively simulate data errors due to interference during the transmission process, etc., and cover more abnormal input situations.
[0081] Step 3: After sending the test case, the terminal status is monitored by abnormal response and crash detection, so as to timely discover the protocol loopholes caused by the sending of the test case. The abnormal status of the distribution terminal is judged according to the response message replied by the terminal. If the response message is unexpected, it is determined that the test case has triggered the abnormal response of the terminal; the active status of the terminal is judged by the terminal socket connection. If the connection cannot be established, it is determined that the test case has triggered the terminal crash.
[0082] Step 4: Based on the distribution network automation system experimental environment, send samples of the distribution terminal protocol fuzzy test sample case library to the distribution terminal to perform fuzzy testing, monitor abnormal information of the distribution terminal, analyze and record and determine protocol vulnerabilities, summarize the test results, and optimize the distribution terminal protocol fuzzy test sample case library.
[0083] The target protocol type includes a standard protocol and a private protocol, the target application service data unit type includes first application service data unit types corresponding to the standard protocol, and the target application service data unit type includes second application service data unit types corresponding to the private protocol; accordingly, determining target variable fields corresponding to the target application service data unit type includes:
[0084] Determine each first variable field corresponding to each first application service data unit type, and determine each second variable field corresponding to each second application service data unit type. The above step 1 is described in detail as follows:
[0085] Step 1.1: Obtain the distribution terminal communication message sample set, as follows:
[0086] Use network packet analysis software to capture packets on the network card of the distribution automation terminal detection platform server to obtain the distribution terminal communication messages, including: connecting terminal (L), disconnecting terminal (N), general call (G), reading time (M), clock synchronization (A), terminal reset (S), terminal software upgrade (U), remote separation (O), remote closing (C), reading inherent parameters (X), reading operating parameters (Y), writing operating parameters (Z), reading set values (R), writing set values (W), switching set value area (Q), reading recorded wave file directory (D), reading historical file directory (H), reading files (F), etc.
[0087] The captured distribution terminal communication messages are subjected to protocol stratification and data clustering to obtain a distribution terminal communication protocol message sample set.
[0088] Step 1.2: Extract variable fields of the power distribution terminal communication protocol:
[0089] Each command message of the distribution terminal communication protocol is deconstructed and the message features are extracted to distinguish between standard protocols and private protocols and determine variable fields and immutable fields.
[0090] The communication protocol message of the distribution terminal is divided into application protocol control information APCI and application service data unit ASDU. Among them, the control field in the application protocol control information APCI (starter, message length, control field) is used as a variable field. The purpose is to test the terminal's verification mechanism for the message sending and receiving order.
[0091] a. Standard protocol:
[0092] The standard protocol commands include general call, clock synchronization, reset process and remote control, etc. The feature of the application service data unit ASDU field is extracted to obtain the variable field.
[0093] The general call ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information object address, call qualifier) field, in which the variable fields are the public address and call qualifier. The former can fuzzy test whether the site address information of the terminal is accurate, and the latter can fuzzy test the calling status of the terminal call qualifier.
[0094] The clock synchronization ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information object address (=0), time stamp) field is used to test whether the terminal clock can be tampered with to any value, and the time stamp in the message feature is extracted as a variable field.
[0095] The reset process ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information object address (=0), reset process command qualifier) field tests the terminal reset type and extracts the reset process command qualifier in the message features as a variable field.
[0096] The remote control ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information object address, single command SCO / dual command DCO) field is used to fuzzy test the execution order, execution logic, missing steps, etc. of the remote control commands. The message type identifier, information object address, single command SCO / dual command DCO in the message features are extracted as variable fields.
[0097] b. Private protocol:
[0098] The message fields for reading parameters and set values, writing parameters and set values, switching set value areas and reading the current set value area number also include the general APCI and ASDU parts.
[0099] Read parameter and fixed value ASDU (type identifier, variable frame length qualifier, transmission reason, public address, fixed value area code, information object address 1...information object address i) fields. Under normal circumstances, when the variable frame length qualifier field is 0, the terminal addresses different information object addresses separately; when it is 1, it addresses continuously according to the order of the first information object address. In order to fuzzy test the impact of the variable frame length qualifier on the terminal addressing method, the variable frame length qualifier needs to be mutated, so the variable frame length qualifier is extracted as a variable field. In order to test the validity of the information object address of the terminal reading parameters and fixed values, the range of the valid fixed value area, and the site configuration, the information object address and fixed value area code are extracted as variable fields.
[0100] Write parameter and fixed value ASDU (type identifier, variable frame length qualifier, transmission reason, public address, fixed value area code, parameter feature identifier, information object address, data type, data length, data value, etc.) fields. In order to test the information object address range, fixed value area range and site configuration of write parameters and fixed values, the information object address, fixed value area code and public address are extracted as variable fields for mutation. In order to test the execution logic of write parameter and fixed value instructions, the parameter feature identifier is mutated as a variable field. In order to test the terminal's recognition and protection of the type, length and value boundary of the written parameter, the data type, data length and data value are used as variable fields for mutation.
[0101] Switch the fixed value area ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information body address (0), fixed value area number) field. To test the fixed value area range of the terminal, extract the fixed value area number as a variable field for variation.
[0102] Read the current fixed area number ASDU (type identifier, variable frame length qualifier, transmission reason, public address, information body address (0)) field. To test the accuracy of the terminal fixed area site address information, extract the public address as a variable field for mutation.
[0103] In the above step S2, the device performs fuzzy processing on each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splices the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case.
[0104] The generation method of the fuzzy processing is described as follows:
[0105] The generation method aims to generate legal test sample cases that comply with the terminal protocol specifications. There are the following implementation methods:
[0106] Length fuzzy strategy: The currently selected byte is iterated and fuzzified multiple times according to the specified length starting from the specified starting value.
[0107] Select Fuzzy Strategy: Allows the user to specify any number of byte values, and then restricts the currently selected message bytes to the specified byte value range for fuzzy processing.
[0108] Set fuzzy strategy: By specifying a minimum value and a maximum value range for the currently selected byte, fuzzy processing is implemented for all possible values of the byte within the range.
[0109] Full field fuzzification strategy: All possible values of the currently selected byte (from 0x00 to 0xFF, i.e., 0 to 255) are fuzzified one by one.
[0110] The variation method of fuzzy processing is described as follows:
[0111] The mutation method aims to generate abnormal random test sample cases to improve the coverage of test cases. Usually mutation is performed in bytes or bits, and there are the following implementation methods:
[0112] Bit flip fuzzy strategy: convert the selected variable field bytes to binary, then randomly flip a specified number of bits and convert them to hexadecimal representation.
[0113] Byte replacement strategy: convert the selected variable field bytes into binary, then randomly replace a specified number of consecutive bits in the binary, and convert to hexadecimal representation.
[0114] Shift fuzzy strategy: convert the selected variable field byte to binary, shift the binary number left or right by a specified number of bits, then align the binary bits of the byte to complete eight bits and convert it to hexadecimal representation.
[0115] Bit fuzzy strategy: convert the selected variable field bytes to binary, then invert one or more specified bits in the binary and convert to hexadecimal representation.
[0116] Each first variable field includes a call qualifier and a public address corresponding to the general call command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field, including:
[0117] Determine that the target fuzzy processing strategy corresponding to the call qualifier is the full-field fuzzy strategy; determine that the target fuzzy processing strategy corresponding to the public address is the full-field fuzzy strategy. To test whether the QOI symbol (query qualifier) configured by the target terminal has an abnormal response (the normal response of the terminal is 0x14), select the full-field fuzzy strategy for the call qualifier to generate all possible byte sequences, and splice the generated sequence with other message fields (corresponding to the same target Immutable field) to form the final general call test case, such as Figure 3 shown.
[0118] In order to test whether the site address information configured by the target terminal is accurate and whether it can correctly respond to the general call command, the two bytes of the public address in the general call command are fuzzy-coded to generate all possible site information sequences. The generated sequence is concatenated with other message fields (corresponding to the immutable fields of the same target) to form the final general call test case, such as Figure 4 shown.
[0119] Each first variable field includes a time stamp corresponding to the clock synchronization command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field, including:
[0120] The target fuzzy processing strategy corresponding to the time scale is determined to be a strategy combining a selection fuzzy strategy and a setting fuzzy strategy.
[0121] In order to test whether the terminal clock can be arbitrarily tampered to any value and whether it can be tampered continuously, the time stamp field is generated by using two strategies: selection and setting fuzzy. The selection fuzzy means can realize the specified clock value to be tampered, and the setting fuzzy means can generate continuous time values. The generated time stamp sequence is spliced with other message fields (corresponding to the same target immutable fields) to form the final clock synchronization test case, such as Figure 5 shown.
[0122] Each first variable field includes a reset process command qualifier corresponding to the reset process command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes:
[0123] Determine that the target fuzzy processing strategy corresponding to the reset process command qualifier is the set fuzzy strategy. To test the type of terminal process reset (local power-on reset, local manual reset, and remote reset), the set fuzzy strategy can be used to generate a byte sequence of 0 to 2 for the reset process qualifier, and the byte sequence is spliced with other message fields (corresponding to the same target immutable field) to form the final reset process test case, such as Figure 6 shown.
[0124] Each first variable field includes an information object address, single command information / dual command information and a message type identifier of a corresponding remote control command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes:
[0125] Determine the target fuzzy processing strategy corresponding to the information object address as the full-field fuzzy strategy and the selective fuzzy strategy, determine the target fuzzy processing strategy corresponding to the single command information / dual command information as the selective fuzzy strategy, and determine the target fuzzy processing strategy corresponding to the message type identifier as the set fuzzy strategy. In order to test the tamperability of the terminal remote control point, the full-field fuzzy strategy is used to generate all possible remote control points for the lowest byte of the information object address in the preset message to detect the response of the terminal point. Finally, the generated byte sequence is spliced with other message fields (corresponding to the immutable fields of the same target) to form the final remote control command test case, such as Figure 7 shown.
[0126] In order to test whether the terminal can bypass the preset steps and directly perform the closing or opening operation, the lowest byte of the information object address in the execution message is mutated, and the full field fuzzy method is used to ensure that all possible information object addresses are generated. Finally, the generated byte sequence and other message fields (corresponding to the immutable fields of the same target) are spliced to form the final remote control command test case, such as Figure 8 shown.
[0127] In order to test whether the terminal can be operated with single command remote opening (opening), single command remote closing (closing), dual command remote opening (opening) and dual command remote closing (closing), the message type identifier, information object address, single command (SCO) / dual command (DCO) of the remote control command preset and execution message fields can be mutated at the same time. By setting the message type identifier to be fuzzy, the message types of single-point and dual-point commands are generated; by performing full-field fuzzification on the information object address, all possible information object addresses are generated; when generating the single command (SCO) and dual command (DCO) variant fields, the selective fuzzy method can be used to specify the generation of messages in four states: preset remote opening, preset remote closing, execution remote opening and execution remote closing. Finally, the generated byte sequence and other message fields (corresponding to the immutable fields of the same target) are spliced to form the final remote control command test case. For example, the single command remote opening test case Fig. 9 shown.
[0128] In order to explore the impact of the inconsistency between the preset point and the execution point on the remote control command, a fuzzy method can be used to generate a variant field with inconsistent addresses between the preset point and the execution point. Finally, the generated byte sequence and other message fields (corresponding to the invariant fields of the same target) are spliced to form the final remote control command test case, such as Fig.10 shown.
[0129] Each second variable field includes a variable frame length qualifier, an information object address and a fixed value area code corresponding to a read parameter and a fixed value; accordingly, a target fuzzy processing strategy corresponding to each target variable field is determined, including:
[0130] Determine that the target fuzzy processing strategy corresponding to the variable frame length qualifier is a bit fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the information object address is a strategy that combines the full field fuzzy strategy and the selection fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the fixed value area code is a setting fuzzy strategy. In order to test whether the target terminal can correctly handle the different bit values of the variable frame length qualifier field and realize the correct parsing of the frame length, the variable frame length qualifier field is converted to binary, and the eighth bit is bit-inverted by bit fuzzy means. The generated sequence is spliced with other message fields (corresponding to the same target immutable field) to form the final read parameter and fixed value command test case, such as Fig.11 shown.
[0131] In order to test the target terminal's response to repeated information object addresses and out-of-range information object addresses, two strategies, full-field fuzzy and selective fuzzy, are used to generate the corresponding byte sequences. The full-field fuzzy test will cover all possible values of the information object address, while the selective fuzzy test focuses on specific, potential abnormal, repeated and boundary information object addresses. Finally, the generated sequence is spliced with other message fields (corresponding to the same target's immutable fields) to form the final read parameter and fixed value command test case, such as Fig.12 shown.
[0132] To test the valid range of the fixed value area for reading parameters and fixed values, use the fuzzy setting method to generate a byte sequence for the fixed value area code. The fuzzy setting can set the test range of the fixed value area. The generated sequence is spliced with other message fields (corresponding to the immutable fields of the same target) to form the final read parameter and fixed value command test case, such as Fig.13 shown.
[0133] Each second variable field includes an information object address, a data type, a data length, a data value and a parameter characteristic identifier corresponding to a write parameter and a fixed value; accordingly, a target fuzzy processing strategy corresponding to each target variable field is determined, including:
[0134] Determine that the target fuzzy processing strategy corresponding to the information object address is a full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data type is a full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data length is a shift fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data value is a strategy that combines the selection fuzzy strategy and the setting fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the parameter feature identifier is a bit fuzzy strategy. In order to test the address range of the information object that can write parameters and fixed values, the full-field fuzzy strategy can be used to generate all possible information object address byte sequences, and the generated sequence is spliced with other message fields (corresponding to the same target immutable fields) to form the final write parameter and fixed value command test case, such as Fig.14 shown.
[0135] In order to test the terminal's recognition mechanism for data types and detect the terminal's ability to process different types of parameters, the data type field is mutated using full-field fuzzy means to generate all possible data type byte sequences. The generated sequence is spliced with other message fields (corresponding to the same target's immutable fields) to form the final write parameter and set value command test case, such as Fig.15 shown.
[0136] In order to test whether the terminal's protection measures are effective when the data length is abnormal, the data length field is converted to binary, and then the binary number is shifted left or right using shift fuzzy means to increase or decrease the data length multiple, and then the binary eight bits are filled and converted to a hexadecimal byte sequence. Finally, the generated sequence is spliced with other message fields (corresponding to the same target immutable fields) to form the final write parameter and fixed value command test case, such as Fig.16 shown.
[0137] In order to test the terminal's processing capability and protection mechanism for data value boundary conditions, a byte sequence with a specified data value range is generated by combining selection and setting fuzziness. Finally, the generated sequence is spliced with other message fields (corresponding to the immutable fields of the same target) to form the final write parameter and fixed value command test case, such as Fig.17 shown.
[0138] The method also includes two steps of presetting and curing, which are described as follows:
[0139] The execution steps of writing parameters and fixed values need to go through two steps: preset and solidify. In order to test the impact of preset and solidify on writing parameters and fixed values, the following sample generation method is designed:
[0140] 1. Test whether parameters and set values can be successfully written in the absence of the curing step;
[0141] 2. Modify the parameter feature identification value of the preset message to the parameter feature identification value of the fixed message to test the impact of the parameter feature identification on the execution effect of the write parameter and set value command. By converting the parameter feature identification field to binary, then using bit fuzziness to invert the eighth bit, and then converting the flipped bit to a hexadecimal byte sequence, and finally splicing the generated sequence with other message fields, the final write parameter and set value command test case is formed, such as Fig.18 shown.
[0142] Each second variable field includes a fixed value area number corresponding to the switching fixed value area; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0143] Determine that the target fuzzy processing strategy corresponding to the fixed value area code is the full field fuzzy strategy. In order to test the range of the fixed value area of writable parameters and fixed values, use the full field fuzzy method to generate all possible byte sequences for the fixed value area code, and splice the generated sequence with other message fields (corresponding to the same target immutable fields) to form the final write parameter and fixed value command test case, such as Fig.19 shown.
[0144] Each second variable field includes a public address corresponding to the current fixed value area code; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0145] Determine that the target fuzzy processing strategy corresponding to the public address is the full-field fuzzy strategy. In order to test whether the site address information configuration of the terminal fixed value area is accurate, the low-order bytes of the public address of the read current fixed value area number command are mutated, and all possible site information sequences are generated by full-field fuzzy means. The generated sequence is spliced with other message fields (corresponding to the same target immutable fields) to form the final read current fixed value area number test case, such as Fig. 20 shown.
[0146] In the above step S3, the device sends each target fuzzy test sample case to the power distribution terminal, so that the power distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case. The above step 3 is described in detail as follows:
[0147] Step 3.1: Abnormal response monitoring:
[0148] After sending a target fuzzy test sample case, the different feature field values in the distribution terminal reply message can be used to determine whether there are any abnormal behaviors and abnormal conditions in the distribution terminal. The message feature monitored for abnormal response is the transmission reason field. When the transmission reason value is 0x44, it means that the message type of the test case cannot be recognized by the distribution terminal; when the transmission reason value is 0x45, it means that the transmission reason type of the test case message cannot be processed by the distribution terminal; when the transmission reason value is 0x46, it means that the public address of the test case message does not exist in the distribution terminal; when the transmission reason value is 0x47, it means that the information object address of the test case message does not exist in the distribution terminal. Whether the response of the distribution terminal is abnormal is determined based on whether the distribution terminal replies to the expected response message. If an unexpected response message is replied, it is considered that the test case has triggered an abnormal response of the distribution terminal.
[0149] Step 3.2: Crash Monitoring:
[0150] After sending a target fuzz test sample case to the distribution terminal, a detection message for detecting the activity of the distribution terminal can also be sent to the distribution terminal to monitor the distribution terminal and determine whether the distribution terminal is in a normal and active state, so as to timely discover protocol anomalies caused by the sending of test cases. The so-called detection message refers to a request message sent to the distribution terminal to establish a socket connection to determine whether the distribution terminal is in a crashed or interrupted state.
[0151] During the fuzzy process, each time a test case is sent to the distribution terminal, a detection message is sent to the distribution terminal after a set short period of time; if no response message is received from the distribution terminal within the time limit, it is considered that the test case has triggered a distribution terminal crash or interruption exception.
[0152] The above step 4 is described in detail as follows:
[0153] The technology of the present invention is verified through experiments to verify the effectiveness and advancement of the test cases. For example, fuzz testing is carried out on 11 power distribution terminals of 7 brands, and the vulnerability types found include unauthorized vulnerability (unauthorized remote control), arbitrary tampering vulnerability (arbitrary tampering of the clock, arbitrary tampering of remote adjustment parameters), denial of service vulnerability (resetting terminal process), configuration error vulnerability (error type identification, unprotected upper limit of remote adjustment parameter value, invalid fixed value area code, abnormal terminal addressing), etc. The specific vulnerability information is as follows:
[0154] The protocol security issues found in the standard protocol command fuzz testing experiment are:
[0155] 1. Arbitrary tampering of the clock: Inaccurate timestamps may lead to data recording errors, disordered execution order of equipment control instructions, and even threaten the stable operation of the entire power system;
[0156] 2. Reset terminal process: Exploiting this vulnerability can cause the terminal parameter configuration to be restored to the default configuration, resulting in the loss of the current status data of the "three remote control" function, information fault collection and processing function, and power-off load recording function of the protected line;
[0157] 3. Unauthorized remote control: This vulnerability can be exploited to send remote control commands to the terminal without authentication, causing the terminal to execute abnormal commands and perform incorrect operations such as opening, closing, and closing lock on the switch position, resulting in switch abnormalities.
[0158] The protocol security issues found in the private protocol command fuzz testing experiment are:
[0159] 1. Arbitrary tampering of remote adjustment parameters: This vulnerability can be exploited to modify the fixed value parameters calculated and set before the terminal is put into operation, causing the accurate fixed value parameters calculated in the early stage through parameters such as line length and transformer capacity to become invalid, resulting in abnormal functions such as overcurrent protection, zero-sequence protection, and ground fault confirmation; the protected line section cannot be properly protected, affecting the normal operation of the terminal business;
[0160] 2. Error type identification: This vulnerability can be exploited to modify the terminal's parameter setting to any type of value, which may cause the original standard setting to become invalid, resulting in the terminal being unable to perform effective standardized comparison of the values on the line, unable to quickly detect and handle line faults, and affecting the line's power transmission and transformation;
[0161] 3. The upper limit of the remote adjustment parameter value is not protected: This vulnerability can be exploited to modify the terminal remote adjustment parameter to a very large value. When the value on the line exceeds the originally set threshold, the terminal will not issue an abnormal alarm; resulting in a continuous excessive line load, causing line damage and affecting the normal transmission of the line;
[0162] 4. Fixed area code invalidation: This vulnerability can be exploited to obtain terminal parameter configuration through an incorrect fixed area code, resulting in terminal configuration data leakage;
[0163] 5. Terminal addressing anomaly: When the variable frame length qualifier parameter value is modified, the terminal returns terminal fixed value data outside the requested information object address, causing the terminal configuration data to be leaked.
[0164] The fuzzy testing method for the power distribution terminal communication protocol provided by the embodiment of the present invention has the following beneficial technical effects:
[0165] First, in the new power system, there are massive distribution terminals, which poses huge security risks. The present invention detects potential vulnerabilities in distribution terminals before they are put into operation, improves the security of distribution terminals, and ensures the safe and stable operation of the distribution network automation system.
[0166] Second, the present invention can provide effective safety detection for power distribution terminals containing private protocols, and at the same time support power distribution terminal manufacturers to build a safety detection system before product release. It is more economical and efficient to discover and fix problems in advance than to fix them after product release.
[0167] The fuzzy testing method for the communication protocol of a distribution terminal provided in an embodiment of the present invention obtains the target protocol type of the distribution terminal, determines the target application service data unit type corresponding to the target protocol type, and determines each target variable field corresponding to the target application service data unit type; fuzzy processes each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splices the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case; sends each target fuzzy test sample case to the distribution terminal, so that the distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case, which can improve the efficiency of the security testing work of the distribution terminal communication protocol, and thereby improve the safety performance of the distribution terminal communication protocol.
[0168] Further, the target protocol type includes a standard protocol and a private protocol, the target application service data unit type includes first application service data unit types corresponding to the standard protocol, and the target application service data unit type includes second application service data unit types corresponding to the private protocol; accordingly, determining the target variable fields corresponding to the target application service data unit type includes:
[0169] Determine each first variable field corresponding to each first application service data unit type, and determine each second variable field corresponding to each second application service data unit type. Refer to the above embodiment for description, and no further details are given.
[0170] Further, each first variable field includes a call qualifier and a public address corresponding to the general call command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0171] Determine the target fuzzy processing strategy corresponding to the call qualifier as the full-field fuzzy strategy; determine the target fuzzy processing strategy corresponding to the public address as the full-field fuzzy strategy. The above embodiments can be referred to for explanation and will not be repeated here.
[0172] Further, each first variable field includes a time stamp corresponding to the clock synchronization command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes:
[0173] The target fuzzy processing strategy corresponding to the time scale is determined to be a strategy combining a selection fuzzy strategy with a setting fuzzy strategy.
[0174] Further, each first variable field includes a reset process command qualifier corresponding to the reset process command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes:
[0175] Determine that the target fuzzy processing strategy corresponding to the reset process command qualifier is a set fuzzy strategy. The above embodiment can be referred to for explanation, and no further details are given.
[0176] Further, each first variable field includes an information object address, single command information / dual command information and a message type identifier of a corresponding remote control command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes:
[0177] The target fuzzy processing strategy corresponding to the information object address is determined to be a full-field fuzzy strategy and a selective fuzzy strategy, the target fuzzy processing strategy corresponding to the single command information / dual command information is determined to be a selective fuzzy strategy, and the target fuzzy processing strategy corresponding to the message type identifier is determined to be a set fuzzy strategy. The above-mentioned embodiments can be referred to for explanation and will not be repeated here.
[0178] Further, each second variable field includes a variable frame length qualifier, an information object address and a fixed value area code corresponding to the read parameter and the fixed value; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0179] The target fuzzy processing strategy corresponding to the variable frame length qualifier is determined to be a bit fuzzy strategy, the target fuzzy processing strategy corresponding to the information object address is determined to be a strategy combining the full field fuzzy strategy and the selection fuzzy strategy, and the target fuzzy processing strategy corresponding to the fixed value area code is determined to be a setting fuzzy strategy. The above embodiments can be referred to for explanation and will not be repeated here.
[0180] Further, each second variable field includes an information object address, a data type, a data length, a data value and a parameter characteristic identifier corresponding to a write parameter and a fixed value; accordingly, a target fuzzy processing strategy corresponding to each target variable field is determined, including:
[0181] The target fuzzy processing strategy corresponding to the information object address is determined to be a full-field fuzzy strategy, the target fuzzy processing strategy corresponding to the data type is determined to be a full-field fuzzy strategy, the target fuzzy processing strategy corresponding to the data length is determined to be a shift fuzzy strategy, the target fuzzy processing strategy corresponding to the data value is determined to be a strategy combining a selection fuzzy strategy and a setting fuzzy strategy, and the target fuzzy processing strategy corresponding to the parameter feature identifier is determined to be a bit fuzzy strategy. The above embodiments can be referred to for explanation and will not be repeated here.
[0182] Further, each second variable field includes a fixed value area number corresponding to the switching fixed value area; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0183] Determine that the target fuzzy processing strategy corresponding to the fixed value area code is a full field fuzzy strategy. The above embodiment can be referred to for explanation and will not be described in detail.
[0184] Further, each second variable field includes a public address corresponding to the current fixed value area code; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes:
[0185] Determine that the target obfuscation processing strategy corresponding to the public address is a full-field obfuscation strategy. The above-mentioned embodiment can be referred to for explanation, and no further description is given.
[0186] Fig.21 FIG. 1 is a schematic diagram of a fuzzy testing device for a communication protocol of a power distribution terminal provided by an embodiment of the present invention. Fig.21 As shown, the fuzzy testing device for the power distribution terminal communication protocol provided by the embodiment of the present invention includes an acquisition unit 2101, a processing unit 2102 and a testing unit 2103, wherein:
[0187] The acquisition unit 2101 is used to acquire the target protocol type of the distribution terminal, determine the target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type; the processing unit 2102 is used to perform fuzzy processing on each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splice the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case; the testing unit 2103 is used to send each target fuzzy test sample case to the distribution terminal, so that the distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case.
[0188] Specifically, the acquisition unit 2101 in the device is used to acquire the target protocol type of the distribution terminal, determine the target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type; the processing unit 2102 is used to perform fuzzy processing on each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splice the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case; the testing unit 2103 is used to send each target fuzzy test sample case to the distribution terminal, so that the distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case.
[0189] The fuzzy testing device for the communication protocol of a distribution terminal provided in an embodiment of the present invention obtains the target protocol type of the distribution terminal, determines the target application service data unit type corresponding to the target protocol type, and determines each target variable field corresponding to the target application service data unit type; fuzzy processes each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splices the processed target variable field with the immutable field corresponding to the same target to obtain each target fuzzy test sample case; sends each target fuzzy test sample case to the distribution terminal, so that the distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case, which can improve the efficiency of the security testing work of the distribution terminal communication protocol, and thereby improve the security performance of the distribution terminal communication protocol.
[0190] The embodiment of the present invention provides an embodiment of a fuzzy testing device for a distribution terminal communication protocol, which can be specifically used to execute the processing flow of the above-mentioned method embodiments. Its functions are not repeated here, and reference can be made to the detailed description of the above-mentioned method embodiments.
[0191] Fig. 22 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Fig. 22As shown, the electronic device includes: a processor (processor) 2201, a memory (memory) 2202 and a bus 2203;
[0192] The processor 2201 and the memory 2202 communicate with each other via a bus 2203;
[0193] The processor 2201 is used to call the program instructions in the memory 502 to execute the methods provided by the above method embodiments, for example, including:
[0194] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0195] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0196] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0197] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above method embodiments, for example, including:
[0198] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0199] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0200] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0201] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables the computer to execute the methods provided by the above method embodiments, for example, including:
[0202] Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type;
[0203] Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target;
[0204] Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
[0205] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0206] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0207] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0209] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0210] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A fuzzy testing method for distribution terminal communication protocol, characterized in that: include: Acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type; Each target variable field is fuzzified according to the target fuzzification strategy corresponding to each target variable field, and the processed target variable field is spliced with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target; Each target fuzzy test sample case is sent to the power distribution terminal, so that the power distribution terminal returns a target fuzzy test result corresponding to the target fuzzy test sample case.
2. The fuzzy testing method for the power distribution terminal communication protocol according to claim 1 is characterized in that: The target protocol type includes a standard protocol and a private protocol, the target application service data unit type includes first application service data unit types corresponding to the standard protocol, and the target application service data unit type includes second application service data unit types corresponding to the private protocol; accordingly, determining target variable fields corresponding to the target application service data unit type includes: First variable fields corresponding to first application service data unit types are determined, and second variable fields corresponding to second application service data unit types are determined.
3. The fuzzy testing method for the power distribution terminal communication protocol according to claim 2 is characterized in that: Each first variable field includes a call qualifier and a public address corresponding to the general call command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field, including: The target fuzzy processing strategy corresponding to the summon qualifier is determined to be a full-field fuzzy strategy; and the target fuzzy processing strategy corresponding to the public address is determined to be a full-field fuzzy strategy.
4. The fuzzy testing method for the power distribution terminal communication protocol according to claim 2 is characterized in that: Each first variable field includes a time stamp corresponding to the clock synchronization command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field, including: The target fuzzy processing strategy corresponding to the time scale is determined to be a strategy combining a selection fuzzy strategy and a setting fuzzy strategy.
5. The fuzzy testing method for power distribution terminal communication protocol according to claim 2 is characterized in that: Each first variable field includes a reset process command qualifier corresponding to the reset process command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes: The target fuzzy processing strategy corresponding to the reset process command qualifier is determined to be a set fuzzy strategy.
6. The fuzzy testing method for power distribution terminal communication protocol according to claim 2 is characterized in that: Each first variable field includes an information object address, single command information / dual command information and a message type identifier of a corresponding remote control command; accordingly, determining a target fuzzy processing strategy corresponding to each target variable field includes: Determine that the target fuzzy processing strategy corresponding to the information object address is the full-field fuzzy strategy and the selective fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the single-command information / dual-command information is the selective fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the message type identifier is the set fuzzy strategy.
7. The fuzzy testing method for power distribution terminal communication protocol according to claim 2 is characterized in that: Each second variable field includes a variable frame length qualifier, an information object address and a fixed value area code corresponding to a read parameter and a fixed value; accordingly, a target fuzzy processing strategy corresponding to each target variable field is determined, including: Determine that the target fuzzy processing strategy corresponding to the variable frame length qualifier is a bit fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the information object address is a strategy that combines the full field fuzzy strategy and the selection fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the fixed area code is a setting fuzzy strategy.
8. The fuzzy testing method for power distribution terminal communication protocol according to claim 2 is characterized in that: Each second variable field includes an information object address, a data type, a data length, a data value, and a parameter characteristic identifier corresponding to a write parameter and a fixed value; accordingly, a target fuzzy processing strategy corresponding to each target variable field is determined, including: Determine that the target fuzzy processing strategy corresponding to the information object address is the full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data type is the full-field fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data length is the shift fuzzy strategy, determine that the target fuzzy processing strategy corresponding to the data value is a strategy that combines the selection fuzzy strategy and the setting fuzzy strategy, and determine that the target fuzzy processing strategy corresponding to the parameter feature identifier is the bit fuzzy strategy.
9. The fuzzy testing method for power distribution terminal communication protocol according to claim 2 is characterized in that: Each second variable field includes a fixed value area number corresponding to the switching fixed value area; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes: Determine that the target fuzzy processing strategy corresponding to the fixed value area code is a full-field fuzzy strategy.
10. The fuzzy testing method for power distribution terminal communication protocol according to claim 2, characterized in that: Each second variable field includes a public address corresponding to the current fixed value area code; accordingly, determining the target fuzzy processing strategy corresponding to each target variable field respectively includes: It is determined that the target obfuscation processing strategy corresponding to the public address is a full-field obfuscation strategy.
11. A fuzzy testing device for a power distribution terminal communication protocol, characterized in that: include: An acquisition unit, configured to acquire a target protocol type of the power distribution terminal, determine a target application service data unit type corresponding to the target protocol type, and determine each target variable field corresponding to the target application service data unit type; A processing unit, used to perform fuzzy processing on each target variable field according to the target fuzzy processing strategy corresponding to each target variable field, and splice the processed target variable field with the immutable field corresponding to the same target to obtain a fuzzy test sample case for each target; The testing unit is used to send each target fuzzy test sample case to the power distribution terminal, so that the power distribution terminal returns the target fuzzy test result corresponding to the target fuzzy test sample case.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.