A substation communication device configuration security acceptance check method and system
By automatically identifying equipment types and dynamically compiling and optimizing calibration programs, the problem of manual errors in traditional calibration methods is resolved, enabling efficient and accurate calibration of substation communication equipment configurations and ensuring the stable operation of the power system.
Patent Information
- Application Number
- CN202411653370.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Traditional substation communication equipment configuration acceptance and verification methods rely on manual verification, which is prone to omissions and errors, resulting in incomplete or incorrect equipment configuration, threatening the stable operation of the power system.
An automated and intelligent calibration method is adopted to identify the device type through detection requests, call the communication interface to obtain configuration information, and use the first and second calibration programs for dynamic compilation optimization to achieve comprehensive calibration of substation communication equipment, and upload the results to a shared platform.
It significantly improves the accuracy and efficiency of substation communication equipment configuration acceptance and verification, enhances the stability and security of the power system, and realizes the centralized management and transparency of verification data.
Smart Images

Figure CN119544480B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of equipment checking, and in particular to a substation communication equipment configuration safety acceptance checking method and system. BACKGROUND
[0002] With the modernization and intelligentization development of the power system, the role of substation communication equipment in the power system is increasingly important. Substation communication equipment not only responsible for the transmission and exchange of power data, but also undertakes key tasks such as system monitoring, fault diagnosis and remote control. Therefore, ensuring the safety and reliability of substation communication equipment configuration is crucial to ensure the stable operation of the power system.
[0003] The traditional substation communication equipment configuration acceptance checking method is mainly realized through the following steps: 1. During the installation and debugging of substation communication equipment, the technical personnel generate the configuration file of the equipment, and transmit the configuration file to the equipment through the network. 2. The technical personnel check each parameter in the configuration file one by one through manual checking to ensure that it is consistent with the design requirements.
[0004] However, for the above traditional substation communication equipment configuration acceptance checking method, the manual checking process depends on the experience and judgment of the technical personnel, and is prone to omissions and errors. For example, the technical personnel can ignore the checking of some key parameters, resulting in incomplete or incorrect equipment configuration, thereby reducing the accuracy of equipment acceptance checking, reducing the safety of substation communication equipment, and thus threatening the stable operation of the entire power system. SUMMARY
[0005] Embodiments of the present application provide a substation communication equipment configuration safety acceptance checking method and system for improving the accuracy of substation communication equipment acceptance checking to improve the safety of communication equipment and ensure the stable operation of the power system.
[0006] To achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a substation communication equipment configuration safety acceptance checking method is provided, applied to an electronic device, the electronic device being deployed with a shared platform, and the method comprising:
[0008] sending a detection request for a to-be-tested substation communication equipment;
[0009] in response to receiving a response instruction sent by the to-be-tested substation communication equipment based on the detection request, determining the device type of the to-be-tested substation communication equipment according to the response instruction, and calling a corresponding communication interface according to the device type;
[0010] In response to receiving a configuration read instruction for the substation communication device under test, calling a read command of the substation communication device under test through the communication interface, and obtaining configuration information of the substation communication device under test based on the read command;
[0011] Performing a first calibration on the substation communication device to be tested using a first calibration program, wherein the first calibration program is used to loop through the configuration information and determine items to be calibrated in the configuration information;
[0012] Performing a second calibration on the substation communication equipment to be tested using a second calibration program, wherein the second calibration program is configured to loop through the items to be calibrated and output a calibration result;
[0013] Uploading the verification results to the sharing platform;
[0014] The first check program is optimized through a first dynamic compilation step each time it loops through the configuration information, and the second check program is optimized through a second dynamic compilation step each time it loops through the configuration information.
[0015] In a possible implementation of the first aspect, the shared platform includes a blockchain module and a big data analysis module, the blockchain module includes a verification result storage block, a distributed verification program storage block, and an instruction management block, and the big data analysis module includes the first dynamic compilation step and the second dynamic compilation step.
[0016] In another possible implementation of the first aspect, the first verification procedure includes:
[0017] calling a first dynamic compilation step in the big data analysis module, and dynamically generating an optimized first verification code according to a preset first verification rule when looping through the configuration information through the first dynamic compilation step; and
[0018] When looping through the configuration information, using the optimized first verification code to determine the items to be verified in the configuration information;
[0019] The second verification procedure includes:
[0020] calling a second dynamic compilation step in the big data analysis module, and dynamically generating an optimized second verification code according to a preset second verification rule when looping through the items to be verified through the second dynamic compilation step; and
[0021] When looping through the items to be checked, the optimized second checking code is used to check the items to be checked to obtain a checking result.
[0022] In another possible implementation of the first aspect, the first dynamic compilation step includes:
[0023] When looping through the configuration information, parsing the first checking rule into a first regular expression;
[0024] Converting the parsed first regular expression into a corresponding first JavaScript code;
[0025] identifying redundant code, a loop structure, a function call overhead, and a data structure in the first JavaScript code, and optimizing the redundant code, the loop structure, the function call overhead, and the data structure, respectively, to obtain an optimized first JavaScript code;
[0026] The optimized first JavaScript code is compiled using a preset JS engine to obtain an optimized first verification code.
[0027] In another possible implementation of the first aspect, the second dynamic compilation step includes:
[0028] When looping through the items to be checked, parsing the second checking rule into a second regular expression;
[0029] Converting the parsed second regular expression into a corresponding second JavaScript code;
[0030] Identifying a data structure and memory allocation in the second JavaScript code, and optimizing the data structure and the memory allocation respectively to obtain an optimized second JavaScript code;
[0031] The optimized second JavaScript code is compiled using a preset JS engine to obtain an optimized second verification code.
[0032] In another possible implementation of the first aspect, the method further includes:
[0033] Encapsulating the first calibration program and storing the encapsulated first calibration program in the distributed calibration program storage block, so that when calibrating the substation communication device to be tested for the first time, the first calibration program in the distributed calibration program storage block is called to loop through the configuration information and determine the items to be verified in the configuration information;
[0034] Encapsulate the second calibration program and store the encapsulated second calibration program in the distributed calibration program storage block, so that when calibrating the substation communication equipment to be tested for the second time, call the second calibration program in the distributed calibration program storage block to loop through the items to be verified and output the calibration results.
[0035] In another possible implementation of the first aspect, after verifying the item to be verified by using the optimized second verification code to obtain the verification code, the method includes:
[0036] Obtaining a first generation timestamp of the optimized second verification code, and generating a unique identifier of the optimized second verification code;
[0037] associating the unique identifier with the first generation timestamp;
[0038] The first generation timestamp, the unique identifier, and the optimized second verification code are stored in the instruction management block of the blockchain module.
[0039] In another possible implementation of the first aspect, uploading the verification result to the sharing platform includes:
[0040] Obtaining a second generation timestamp of the verification result, and obtaining an optimized second verification code corresponding to the verification result, and a unique identifier of the optimized second verification code, wherein the verification result is output based on the optimized second verification code;
[0041] The second generation timestamp, the unique identifier, and the verification result are stored in the verification result storage block of the blockchain module, wherein the first generation timestamp corresponds one-to-one to the second generation timestamp.
[0042] In a second aspect, the present application provides a machine-readable storage medium having stored thereon instructions for enabling a machine to execute the above-mentioned substation communication equipment configuration safety acceptance and verification method.
[0043] In a third aspect, the present application provides an electronic device, comprising:
[0044] The machine-readable storage medium is configured to store instructions; and
[0045] The processor is configured to call the instructions from the memory and implement the above-mentioned substation communication equipment configuration security acceptance and verification method when executing the instructions.
[0046] In a fourth aspect, the present application provides a substation communication equipment configuration security acceptance and verification system, comprising:
[0047] The above-mentioned electronic equipment;
[0048] The substation communication equipment to be tested is connected to the electronic equipment.
[0049] The above technical solution, through the introduction of an automated and intelligent verification method, significantly improves the efficiency and accuracy of substation communication equipment configuration acceptance verification. First, this technical solution automatically identifies the type of substation communication equipment under test by sending probe request and response instructions and invoking the corresponding communication interface, eliminating the tedious steps of manual identification and configuration and reducing the possibility of human error. Next, a read command is invoked through the communication interface to automatically obtain the device's configuration information, avoiding the potential risks of manually entering and transmitting configuration files. In the first verification, the first verification program loops through the configuration information, dynamically determines the items to be verified, and optimizes them through the first dynamic compilation step, ensuring the efficiency and accuracy of the verification process. The second verification is further refined, with the second verification program looping through the items to be verified, outputting the verification results, and optimizing them through the second dynamic compilation step to ensure the accuracy of the verification results. Finally, the verification results are used to conduct a comprehensive verification of the equipment and uploaded to a shared platform, enabling centralized management and real-time sharing of verification data, enhancing the transparency and traceability of the verification process. In summary, this technical solution not only improves the automation level of substation communication equipment configuration acceptance and verification, but also significantly improves the accuracy and efficiency of verification through dynamic compilation optimization and the application of a shared platform, thereby effectively ensuring the stable operation and safety of the power system.
[0050] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A flowchart of a method for security acceptance and verification of substation communication equipment configuration provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the overall process of a method for security acceptance and verification of substation communication equipment configuration provided by an embodiment of the present application;
[0053] Figure 3 A structural diagram of a substation communication equipment configuration safety acceptance and verification system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0055] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0056] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0057] Figure 1 The following schematically shows a flow chart of a method for security acceptance and verification of substation communication equipment configuration according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a method for security acceptance and verification of substation communication equipment configuration, which is applied to electronic equipment, and the electronic equipment is deployed with a shared platform. The method may include the following steps.
[0058] S110, sending a detection request for the substation communication equipment to be tested;
[0059] S120, in response to receiving a response instruction sent by the communication device of the substation to be tested based on the detection request, determining the device type of the communication device of the substation to be tested according to the response instruction, and calling a corresponding communication interface according to the device type;
[0060] S130, in response to receiving a configuration read instruction for the substation communication device under test, calling a read command for the substation communication device under test through a communication interface, and obtaining configuration information of the substation communication device under test based on the read command;
[0061] S140: Perform a first calibration on the communication equipment of the substation to be tested using a first calibration program, where the first calibration program is used to loop through the configuration information and determine items to be calibrated in the configuration information;
[0062] S150, performing a second calibration on the substation communication equipment to be tested using a second calibration program, wherein the second calibration program is used to loop through the items to be calibrated and output the calibration results;
[0063] S160, uploading the verification results to the sharing platform;
[0064] The first check program is optimized through the first dynamic compilation step each time it loops through the configuration information, and the second check program is optimized through the second dynamic compilation step each time it loops through the configuration information.
[0065] In this embodiment, first, a probe request is sent to the communication equipment of the substation under test to establish a connection with the communication equipment of the substation under test. The probe request adopts a standardized communication protocol, such as SNMP (Simple Network Management Protocol) or Modbus. The probe request contains a series of predefined parameters and commands for inquiring basic information of the device, such as device model, firmware version, communication interface type, etc. In the process of sending the probe request, a timeout period and a retry mechanism can be set to ensure that a response can still be obtained in the event of network delays or temporary communication failures. In addition, the probe request contains security authentication information to ensure that only authorized electronic devices can interact with the communication equipment of the substation under test.
[0066] In practice, a pre-configured network communication module can automatically generate and send probe requests tailored to different device types based on a pre-configured device list and communication parameters. Probe requests are sent asynchronously, allowing simultaneous probes to multiple devices to improve overall efficiency.
[0067] After receiving a response from the substation communication device under test to the probe request, the system parses the response. This response contains basic device information, such as the device type identifier and communication protocol version. This received device type information is matched against records in a pre-established device type database to accurately determine the specific type of the substation communication device under test. Once the device type is determined, the system calls the corresponding communication interface from a pre-configured communication interface library. A communication interface is a software module that encapsulates all the protocol details, command sets, and data formats required to communicate with a specific device type. The communication interface call process includes initializing interface parameters, establishing a communication session, and setting security authentication. Furthermore, a compatibility check is performed to ensure that the selected communication interface matches the firmware version of the substation communication device under test. If a version mismatch is detected, an alternate interface can be tried or dynamically adjusted.
[0068] In practice, object-oriented programming can be used to create a dedicated communication interface class for each device type. These classes inherit from a common base class but each implements the communication details of a specific device type. The corresponding interface object can be dynamically instantiated based on the device type.
[0069] When the system receives a configuration read instruction for the substation communication device under test, it immediately invokes the device-specific read command through the previously determined communication interface. Specifically, the read request can be converted into a format the device can understand based on the device's communication protocol specifications. For example, for devices using the Modbus protocol, the corresponding function code and register address can be generated; for devices supporting SNMP, an appropriate GET request is constructed. Read commands are typically broken down into multiple subcommands to retrieve different categories of configuration information, such as network settings, security parameters, and function configuration, in batches. A preset read scheduling algorithm can be used to optimize the execution order of the subcommands to maximize data acquisition efficiency.
[0070] When a read command is sent, a monitoring process is initiated to track the execution status and response time of each command, enabling timely detection and resolution of potential communication anomalies. Configuration information obtained based on the read command is parsed and stored in real time. The parsed configuration information can be organized into a structured data format, such as a hierarchical object tree or a set of key-value pairs, to facilitate subsequent verification and analysis.
[0071] The first verification process begins with the first verification of the substation's communications equipment. A looping algorithm is employed to iterate through each configuration item. This process employs a depth-first search strategy to ensure coverage of all levels and branches of the configuration information. As it iterates through each configuration item, the first verification process applies a series of predefined validation rules covering security, consistency, and validity. For example, these validation rules check whether important parameters are within acceptable ranges, verify that critical safety settings comply with the latest safety standards, and detect potential conflicts between configuration items.
[0072] During the traversal process, the first verification program maintains a dynamic list of items to be verified. When a configuration item is found that requires further analysis or may have problems, it is added to the list, and the relevant context information and preliminary analysis results are recorded. In a specific implementation, the first verification program can be optimized through the first dynamic compilation step. Dynamic compilation technology allows the program to dynamically generate and compile verification code based on the current configuration information structure and content at runtime, thereby greatly improving the efficiency of verification, because the first dynamic compilation step can generate the most optimized verification logic according to the specific situation, reducing unnecessary overhead in general verification code. For example, if certain configuration items do not exist or are not applicable to the current device, dynamic compilation can generate optimized code that skips these items. Dynamic compilation also supports the instant addition of new verification rules, enabling electronic devices to quickly respond to newly discovered security vulnerabilities or configuration issues.
[0073] Based on the first verification, the second verification program conducts a more in-depth and specialized analysis of the identified items to be verified. The second verification program also adopts a loop traversal method, and can dynamically adjust the analysis strategy according to the characteristics of the items to be verified to output more accurate verification results. For each item to be verified, the verification rules adopted by the second verification program include but are not limited to: correlation analysis between configuration items, historical data comparison, security risk assessment, performance impact prediction, etc. The second verification program can dynamically adjust subsequent verification strategies based on previous analysis results. For example, if a certain type of configuration item is found to have frequent problems, the second verification program will automatically increase the inspection intensity of this type of configuration item. At the same time, the second verification program can also use machine learning algorithms to learn from historical verification data and improve its detection capabilities, continuously improving the accuracy of identifying potential problems.
[0074] In a specific implementation, a parallel computing architecture can be used to assign different types of analysis tasks to multiple processing units for simultaneous execution to increase processing speed.
[0075] After the generation of the verification result, a comprehensive verification of the communication equipment of the substation under test begins. First, the verification result performs compliance checks on the configuration items to ensure that all settings meet predetermined safety standards and operational specifications. This includes checking password strength, the correctness of access control lists, the security of encryption algorithms, and so on. Second, the verification result performs functional consistency verification to ensure that there are no conflicts or inconsistencies between different configuration items. For example, checking whether firewall rules conflict with required communication functions, or whether bandwidth restrictions are consistent with expected data transmission requirements. In addition, the verification result also performs performance optimization analysis to evaluate whether the current configuration can support the normal operation of the equipment under various load conditions.
[0076] During the verification process, the program generates a detailed analysis report, including problems found, potential risks, optimization suggestions, and so on. The report not only contains technical details, but also outputs visual results, so that non-technical personnel can quickly understand the verification results. If configuration errors or security vulnerabilities are found, an alarm can be issued immediately, and correction suggestions can be provided.
[0077] After completing the verification, the verification result can be uploaded to the sharing platform. The uploaded content includes the source code of the verification result, the execution script, the configuration file, the usage instruction document, and so on. Metadata can be automatically generated for the uploaded content, including version number, applicable device type, update log, and so on.
[0078] In this embodiment, the sharing platform adopts a distributed storage architecture to ensure high availability and fast access of data.
[0079] Regarding the optimization process of the first verification program, each time the configuration information is looped, it is optimized through the first dynamic compilation step. Dynamic compilation refers to compiling during program execution, rather than completing all compilation before program execution. Specifically, when the program starts to loop through the configuration information, it first analyzes the data type and structure that needs to be processed at the moment. Based on this information, the dynamic compiler generates targeted machine code that optimizes the processing efficiency of the current data. For example, if a configuration item is found to be a large array, the dynamic compiler can generate code using vectorization instructions to improve processing speed. Or if a configuration item needs to be frequently accessed, the compiler can generate code that saves it in a register to reduce memory access times. Optimization is a continuous process, and each time a new configuration item is looped, it is analyzed and optimized again to ensure that the program always runs in the most efficient way. This dynamic compilation technology can significantly improve the execution speed of the program, enabling the first verification program to quickly adapt to different types and sizes of configuration information, whether it is a simple small substation or a complex large substation, and maintaining high verification speed.
[0080] The second checker is also optimized through the second dynamic compilation step each time it loops through the configuration information. The second dynamic compilation step not only focuses on the data type and structure currently being processed, but also analyzes the data flow and processing mode throughout the entire checker process. The second dynamic compilation step also performs deeper code optimization. For example, the second dynamic compilation step can perform function inlining, inserting frequently called small functions directly into the call point, reducing the overhead of function calls. In addition, the second dynamic compilation step can perform loop expansion, reduce the number of loops, and improve instruction-level parallelism. The dynamic compiler will also continue to monitor the operation of the program. If it finds that the actual operation effect of a certain section of code is not as expected, it will immediately re-optimize that part of the code, so that the second checker remains efficient when processing large-scale and complex configuration information, and can also quickly adapt to different types of configuration information.
[0081] This embodiment significantly improves the efficiency and accuracy of substation communication equipment configuration acceptance verification by introducing an automated and intelligent verification method. First, this technical solution automatically identifies the type of substation communication equipment under test by sending probe request and response instructions and invoking the corresponding communication interface, eliminating the tedious steps of manual identification and configuration and reducing the possibility of human error. Next, a read command is invoked through the communication interface to automatically obtain the device's configuration information, avoiding the potential risks of manually entering and transmitting configuration files. In the first verification, the first verification program loops through the configuration information, dynamically determines the items to be verified, and optimizes them through the first dynamic compilation step, ensuring the efficiency and accuracy of the verification process. The second verification is further refined, with the second verification program looping through the items to be verified, outputting the verification results, and optimizing them through the second dynamic compilation step to ensure the accuracy of the verification results. Finally, the verification results are used to conduct a comprehensive verification of the equipment and uploaded to a shared platform, enabling centralized management and real-time sharing of verification data and enhancing the transparency and traceability of the verification process. In summary, this technical solution not only improves the automation level of substation communication equipment configuration acceptance and verification, but also significantly improves the accuracy and efficiency of verification through dynamic compilation optimization and the application of a shared platform, thereby effectively ensuring the stable operation and safety of the power system.
[0082] In one implementation of this embodiment, the sharing platform includes a blockchain module and a big data analysis module, the blockchain module includes a verification result storage block, a distributed verification program storage block and an instruction management block, and the big data analysis module includes the first dynamic compilation step and the second dynamic compilation step.
[0083] The shared platform consists of a blockchain module and a big data analysis module. The blockchain module contains three key blocks: a verification result storage block, a distributed verification program storage block, and an instruction management block. The distributed verification program storage block stores the source code and executable files for the first and second verification programs. This block utilizes distributed storage technology, distributing the program storage across multiple nodes in the network, with each node maintaining a complete copy of the program. This storage approach not only improves data security but also enables rapid data recovery from other nodes in the event of a node failure. To ensure that the stored program versions are always up to date, each time a new version is uploaded, a new block is automatically created on the blockchain, recording the new version's details, including the version number, updated content, and upload time. This allows for tracking every program change and easily rolling back to a previous version when necessary. The program stored in this block is automatically distributed to multiple computing nodes in the network, with each node processing a portion of the data and then aggregating the results. This distributed processing approach significantly improves verification efficiency, especially when dealing with the complex configurations of large substations. The verification result storage block stores verification results. The instruction management block is responsible for storing and managing the second verification program.
[0084] The big data analysis module includes a first dynamic compilation step and a second dynamic compilation step. Both the first and second dynamic compilation steps utilize big data analysis technology to optimize the execution efficiency of the verification program. The first dynamic compilation step is mainly used to optimize data processing in the first loop traversal. It first performs a real-time analysis of the configuration information currently being processed, including characteristics such as data type, data structure, and data size. Based on the analysis results, the dynamic compiler generates targeted optimized code. For example, assuming that a large array containing 10,000 IP addresses is being processed, the first dynamic compilation step can adopt the following optimization strategies: 1) Use vectorized instructions to process multiple IP addresses at once instead of processing them one by one; 2) Convert the IP addresses to integer form for comparison instead of directly comparing strings to increase comparison speed; 3) Use parallel processing technology to split the large array into multiple small arrays and process them simultaneously on multiple processor cores. The above optimization strategies can significantly improve processing speed. In this embodiment, the optimization is performed dynamically and can automatically adjust the optimization strategy according to different data characteristics to ensure that the best processing efficiency can be achieved in various situations.
[0085] The second dynamic compilation step is used for global optimization of the entire verification process. Based on the big data model in the big data analysis module, the second dynamic compilation step can generate the required optimized code in advance and cache the code. For example, if analysis reveals that network connectivity testing is frequently required in the verification task, the second dynamic compilation step can generate a highly optimized network test function in advance and cache it in memory. When the network test is actually needed, the optimized function can be called directly, avoiding the overhead of repeated compilation. In addition, the second dynamic compilation step can also inline frequently called small functions, inserting the function code directly into the call point, reducing the overhead of function calls. In addition, loops can be expanded to reduce the number of loops and improve instruction-level parallelism. For example, the original code may have the following loop structure: for(i=0;i<1000;i++){process(data[i]);} After loop unrolling optimization, the code becomes: for(i=0; i<1000; i+=4){process(data[i]);process(data[i+1]);process(data[i+2]);process(data[i+3]);}. This optimization reduces loop control overhead and allows the processor to better implement instruction-level parallelism. The second dynamic compilation step also continuously monitors program execution. If a section of code is found to be performing below expectations, it will immediately re-optimize that section. This adaptive optimization mechanism ensures that the verification program always maintains optimal efficiency, regardless of the configuration information of a simple small substation or a complex large substation.
[0086] This implementation integrates blockchain technology and big data analysis techniques, enabling a shared platform to provide a secure solution for verifying substation communication equipment. The blockchain module ensures the secure storage and management of verification programs and related instructions, supports version control and permissions management, and significantly enhances verification security and traceability. Furthermore, the dynamic compilation technology within the big data analysis module significantly improves the execution efficiency of verification programs. It optimizes code in real time based on different data characteristics and processing requirements, ensuring optimal performance in all situations. This not only increases verification speed but also reduces resource consumption.
[0087] In one implementation of this embodiment, the first verification procedure includes the following steps:
[0088] S210, calling a first dynamic compilation step in the big data analysis module, and dynamically generating an optimized first verification code according to a preset first verification rule when looping through the configuration information through the first dynamic compilation step; and
[0089] S220: When looping through the configuration information, use the optimized first verification code to determine items to be verified in the configuration information, wherein the configuration information includes system configuration, network configuration, routing configuration, tunnel configuration, and policy configuration;
[0090] The second verification procedure includes:
[0091] S230, calling the second dynamic compilation step in the big data analysis module, and dynamically generating an optimized second verification code according to a preset second verification rule when looping through the items to be verified through the second dynamic compilation step; and
[0092] S240 : When looping through the items to be checked, use the optimized second checking code to check the items to be checked to obtain a checking result.
[0093] First, the first dynamic compilation step in the big data analysis module is called, and the optimized first verification code is dynamically generated according to the preset first verification rules when looping through the configuration information. Specifically, the characteristics of the configuration information currently being processed, such as data type, structure, and scale, are first analyzed. For example, if it is found that the configuration information contains a large amount of IP address data, the first dynamic compilation step can generate code that uses bit operations rather than string comparisons to speed up the processing of IP addresses. At the same time, the first dynamic compilation step takes into account hardware characteristics, such as the CPU's cache size and number of cores, to optimize memory access patterns and parallel processing. For example, assuming that a configuration file containing 10,000 routing entries needs to be processed, the first dynamic compilation step can generate a code that uses a hash table to quickly search and compare routing entries instead of using traditional linear search. The above-mentioned dynamically generated code can significantly improve the processing speed, and may reduce the processing time that originally took several seconds to the millisecond level. In addition, the first dynamic compilation step can also generate optimized code for specific verification tasks according to the preset first verification rules. For example, if the validation rules require that all IP addresses be checked for validity, the first dynamic compilation step can generate a highly optimized IP address verification function and inline it into the main processing loop to reduce function call overhead.
[0094] When looping through configuration information, an optimized first check code is used to identify items within the configuration information that require further verification. Configuration information includes system configuration, network configuration, routing configuration, tunnel configuration, and policy configuration. The optimized first check code efficiently traverses these configuration items and identifies those requiring further verification based on pre-set rules. For example, when processing network configuration, the optimized code uses a bitmap index to quickly identify all IP addresses and subnet masks requiring verification. For routing configuration, a prefix tree data structure is used to efficiently organize and search routing entries. When processing policy configuration, a decision tree algorithm is used to quickly evaluate whether each policy requires further verification. These optimizations not only increase processing speed but also reduce memory usage. For example, for a large substation containing 100,000 configuration items, the optimized code may complete the complete traversal and identification of items requiring verification in just a few hundred milliseconds, while the unoptimized code may take several seconds or even tens of seconds. Furthermore, by using memory-efficient data structures and algorithms, memory usage can be kept low, for example, occupying only a few hundred megabytes of memory, even when processing large amounts of configuration information.
[0095] The second dynamic compilation step in the big data analysis module is called to dynamically generate an optimized second verification code according to the preset second verification rules when looping through the entries to be verified. For example, if the analysis finds that most of the entries to be verified require network connectivity testing, the second dynamic compilation step can generate a highly optimized network test function and preload it into the memory. In addition, if it is found that certain types of verification operations occur frequently, the second dynamic compilation step can generate specific instruction sequences to speed up these operations. For example, for string matching operations that need to be performed frequently, code using SIMD (single instruction multiple data) instructions can be generated to process multiple characters at one time, significantly improving the processing speed. Specifically, if the entries to be verified contain a large number of ACL (access control list) rules, the second dynamic compilation step can generate an optimized code using bit vectors and parallel processing, which can evaluate multiple ACL rules at the same time, reducing the processing time that may have taken several minutes to a few seconds.
[0096] When looping through the items to be checked, the optimized second-level check code verifies the items to be checked, ultimately generating a check result. The optimized second-level check code can perform detailed checks and verification on each item to be checked. For example, for IP addresses in the network configuration, the optimized second-level check code can simultaneously check their format correctness, network segment validity, and address conflicts. For routing configurations, it can verify the consistency and optimality of the routing table. When processing policy configurations, it can check for conflicts and overlaps between policies. The optimized second-level check code can fully utilize the features of modern processors, such as branch prediction and out-of-order execution, to maximize processing efficiency. For example, when processing a large number of similar configuration items, the optimized second-level check code can use loop unrolling techniques to reduce the probability of branch prediction failures. Specifically, if 10,000 firewall rules need to be checked, the optimized second-level check code can group these rules into groups of 1,000 and then process 10 groups in parallel using multiple threads. Within each thread, SIMD instructions can be used to simultaneously process multiple rules. This multi-level optimization can reduce the checking process from several minutes to just a few seconds. Finally, a comprehensive optimization verification result is generated, which integrates the previous optimization strategy and verification logic.
[0097] This implementation achieves efficient and comprehensive verification of substation communication equipment configuration information through a two-stage dynamic compilation and optimization process. The first stage quickly identifies items requiring detailed verification, while the second stage conducts in-depth analysis and verification of these items, significantly improving verification efficiency. Furthermore, the flexibility and adaptability of the verification process enable it to handle configuration information of varying sizes and complexities.
[0098] In one implementation of this embodiment, the first verification rule includes basic format verification, preliminary logic verification, and keyword matching, and the first dynamic compilation step includes the following steps:
[0099] S310, while looping through the configuration information, parsing the first checking rule into a first regular expression;
[0100] S320: Convert the parsed first regular expression into a corresponding first JavaScript code;
[0101] S330: Identify redundant code, loop structure, function call overhead, and data structure in the first JavaScript code, and optimize the redundant code, loop structure, function call overhead, and data structure respectively to obtain an optimized first JavaScript code;
[0102] S340: Use a preset JS engine to compile the optimized first JavaScript code to obtain an optimized first verification code.
[0103] When looping through the configuration information, the first validation rule is parsed into a first regular expression. First, the predefined first validation rules are read, including but not limited to basic format verification, preliminary logical verification, and keyword matching. Each rule is then parsed and semantically analyzed to convert it into a standardized expression format. For example, a basic format verification rule might be "IP addresses must conform to the format XXXX, where X is an integer between 0 and 255." This rule is parsed into a regular expression, such as "^(\d{1,3}\.){3}\d{1,3}$," and then used with a numeric range check function. Preliminary logical verification rules, such as "the subnet mask must be consecutive 1s followed by consecutive 0s," can be parsed into a bitwise operation expression. Keyword matching rules, such as "the configuration file must contain the 'interface' and 'ip address' keywords," are parsed into simple string search expressions. For frequently executed rules, an expression form that is more suitable for fast execution can be selected. The entire parsing process is typically implemented using a lexical analyzer and a syntax analyzer, which can handle complex rule structures and nested relationships.
[0104] Convert the parsed first regular expression into the corresponding first JavaScript code. Specifically, map the regular expression generated in the previous step to a specific JavaScript syntax structure. For basic format verification, such as IP address verification, code using regular expressions can be generated, such as / ^(\d{1,3}\.){3}\d{1,3}$ / .test(ipAddress)&&ipAddress.split('.').every(num=>parseInt(num)>=0&&parseInt(num)<=255). For preliminary logical verification, such as checking the subnet mask, code using bitwise operations can be generated, such as (~parseInt(subnetMask)&(parseInt(subnetMask)+1))===0. Keyword matching may be converted into string search or regular expression matching code, such as configContent.includes('interface')&&configContent.includes('ip address'). When generating code, for verifications that need to be executed multiple times, they can be encapsulated into functions to improve code reusability. For complex logic validation, you can use JavaScript's high-order functions, such as map, filter, and reduce, to simplify the code structure. This step converts rule expressions into executable JavaScript code, preparing for subsequent optimization and execution.
[0105] Afterwards, redundant code, loop structure, function call overhead and data structure in the first JavaScript code are identified and optimized respectively to obtain the optimized first JavaScript code. First, static analysis is performed on the generated JavaScript code to identify optimization points. For redundant code, if repeated conditional judgments or calculations are found, they can be optimized by extracting common parts or using cache. For example, if multiple rules need to check the validity of an IP address, the check can be extracted as a separate function and executed only during the first check, and the cached results can be used subsequently. For loop structures, techniques such as loop expansion and loop merging can be applied. For example, for loops that need to traverse a large number of configuration items, a block processing strategy can be adopted to process a certain number of items each time to improve cache utilization.
[0106] Optimizing function call overhead includes inlining small functions and using arrow functions. For example, for a simple validation function that is frequently called, it can be directly inlined at the call site to avoid the function call overhead. Optimizing data structures may involve choosing a more appropriate data structure or optimizing existing structures. For example, for data that needs to be frequently searched, you can switch from an array to an object or map structure to improve search efficiency. For code that involves a large number of string operations, you can use string concatenation optimization techniques. This optimization process is iterative, and ultimately, a JavaScript code version that is optimized in both structure and performance is generated.
[0107] The optimized first JavaScript code is compiled using a preset JS engine to obtain an optimized first verification code. The JS engine can compile the JavaScript code into bytecode that can be efficiently executed in a C++ environment.
[0108] First, the JS engine environment is initialized. Specific options, such as memory limits and execution timeouts, can be set. The optimized JavaScript code is then passed to the JS engine for compilation. During the compilation process, the JS engine performs further optimizations, such as constant folding, dead code elimination, and function inlining. For frequently executed loops, the JS engine can apply loop variable hoisting optimizations to reduce variable lookup overhead during each iteration. For conditional checks, the order of checks can be reordered, placing conditions more likely to be true first to reduce the average number of checks. After compilation, the JS engine generates a function object that can be directly called from the C++ environment. This function object is essentially an encapsulation of the compiled bytecode, allowing for fast callability through a C++ interface, avoiding the overhead of JavaScript interpretation and execution. Furthermore, the JS engine can perform dynamic optimizations at runtime based on actual execution conditions. This means that even performance bottlenecks that were unforeseen at compile time can be optimized at runtime. Ultimately, the engine generates optimized, first-pass code that can be efficiently executed directly from the C++ environment.
[0109] This implementation transforms complex verification rules into efficient executable code. From rule parsing to JavaScript code generation, and then to multi-level optimization, the code is compiled into functions that can be directly called from a C++ environment. This approach not only handles a wide variety of complex verification rules but also dynamically optimizes based on the actual operating environment, significantly improving verification efficiency. Furthermore, the use of a JS engine provides excellent cross-platform compatibility and seamless integration with C++ systems, providing strong technical support for efficient verification of substation communication equipment configuration information.
[0110] In one implementation of this embodiment, the second dynamic compilation step includes the following steps:
[0111] S410, while looping through the items to be checked, parsing the second checking rule into a second regular expression;
[0112] S420: Convert the parsed second regular expression into a corresponding second JavaScript code;
[0113] S430: Identify the data structure and memory allocation in the second JavaScript code, and optimize the data structure and memory allocation respectively to obtain an optimized second JavaScript code;
[0114] S440: Use a preset JS engine to compile the optimized second JavaScript code to obtain an optimized second verification code.
[0115] While looping through the items to be checked, the parser parses the second check rule into a second regular expression. The second check rule is more complex than the first. At the beginning of the parsing process, each rule can be broken down into its basic components, such as conditional statements, operators, variables, and constants. For example, a rule might be "If the device type is a switch, then the number of ports must be greater than 16 and less than 48." This rule is broken down into the conditional portion "The device type is a switch" and the result portion "The number of ports must be greater than 16 and less than 48." Each component is then further semantically analyzed. The conditional portion is parsed as an equality comparison expression, and the result portion is parsed as a logical AND combination of two range comparison expressions. During the parsing process, for rules involving relationships between multiple items, such as "The total number of ports on all switches must be greater than 100," the parser identifies these as cross-entry aggregation rules and constructs the corresponding expression. Ultimately, each rule is converted into a standardized second regular expression that accurately expresses the semantics of the original rule and facilitates subsequent code generation and optimization. Through this approach, the complex second checking rules are converted into structured, computer-processable expressions.
[0116] The parsed second rule expression is converted into the corresponding second JavaScript code. This maps the abstract rule expression to concrete JavaScript language structures. First, a corresponding code template is defined for each type of expression. For example, for simple conditionals, an if-else structure can be generated; for range checks, logical operators can be used to combine multiple comparisons; and for cross-entry aggregation rules, code using higher-order functions such as reduce or filter can be generated.
[0117] When generating code, for frequently used constants or expressions, you can use variables to store intermediate results to improve code readability and performance. For complex conditional logic, you can use switch statements or lookup tables to replace multiple if-else statements to improve execution efficiency. For string operations, you can use regular expressions to simplify the code. When generating loop structures, you need to consider the applicable scenarios of different loop methods (such as for, while, for...of, etc.) and choose the most appropriate method. For operations that may throw exceptions, you can generate a try-catch structure to handle the exceptions.
[0118] When processing cross-entry rules, closures or higher-order functions are generated to maintain state. For example, for the rule "the total number of ports on all switches must be greater than 100," an accumulator function can be generated that accumulates the number of ports while traversing all entries and then makes a final judgment. Ultimately, this solution generates a set of fully functional JavaScript code.
[0119] Identify the data structure and memory allocation in the second JavaScript code and optimize them respectively to obtain the optimized second JavaScript code. The optimization process first requires in-depth static analysis of the generated JavaScript code to identify possible optimization points.
[0120] Specifically, when optimizing data structures, choose the data structure that best suits the specific scenario. For example, for data that requires frequent lookups, switch from arrays to objects or Map structures. If the data has a tree structure, use specialized tree structure implementations, such as binary search trees or prefix trees, to improve query and insertion efficiency. For large amounts of numerical data, use TypedArray to improve memory efficiency and operation speed. When processing large amounts of duplicate data, use Set to automatically deduplicate data. For complex data structures, implement custom data structure classes to encapsulate specific operations to improve code readability and maintainability. Regarding memory allocation, reduce unnecessary memory allocation and improve memory efficiency. Specifically, use object pools to reuse objects and avoid frequent object creation and destruction; implement string concatenation optimization techniques, such as using the array join method instead of the + operator; and avoid creating closures in loops to reduce the risk of memory leaks. For large arrays or objects, consider using lazy loading or paging loading strategies to allocate memory only when needed. When processing large amounts of data, use streaming methods to avoid loading all data into memory at once. During the optimization process, performance analysis tools can be used to identify hot code and memory usage bottlenecks, and targeted optimizations can be performed. Finally, a second JavaScript code is generated.
[0121] Finally, the optimized second JavaScript code is compiled using a preset JS engine to obtain an optimized second verification code.
[0122] This implementation converts complex secondary verification rules into highly optimized executable code. From rule parsing to expression generation, and then to JavaScript code generation and optimization, the code is compiled into functions that can be directly called from a C++ environment, enabling the processing of complex verification rules. Verification efficiency is greatly improved through multi-level optimization, including data structure optimization, memory allocation optimization, and JS engine compilation optimization. Using the JS engine not only provides excellent cross-platform compatibility but also enables seamless integration with C++ systems, providing strong technical support for the efficient verification of substation communication equipment configuration information.
[0123] In one implementation of this embodiment, the following steps are also included:
[0124] S510: Encapsulate the first calibration program and store the encapsulated first calibration program in the distributed calibration program storage block, so that when calibrating the substation communication device to be tested for the first time, the first calibration program in the distributed calibration program storage block is called to loop through the configuration information and determine the items to be verified in the configuration information;
[0125] S520. Encapsulate the second calibration program and store the encapsulated second calibration program in the distributed calibration program storage block, so that when calibrating the substation communication equipment to be tested for the second time, the second calibration program in the distributed calibration program storage block is called to loop through the items to be verified and output the calibration results.
[0126] First, encapsulate the first calibration program and store it in the distributed calibration program storage block for use during the initial calibration of the substation communication equipment under test. The purpose of encapsulation is to package the program into an independent, reusable unit, while hiding internal implementation details and providing a clear interface for external calls. The encapsulation process typically includes several key steps: First, define clear input and output interfaces. The input interface includes the configuration information to be verified, calibration rule parameters, etc., while the output interface includes calibration results, error messages, etc. Second, the first calibration program needs to be modularized, grouping code with different functions into different modules or classes to improve code maintainability and readability. For example, functions such as configuration information parsing, rule matching, and result output can be encapsulated into different modules. Error handling and exception catching mechanisms can be added to ensure that the program can generate error messages when encountering abnormal situations.
[0127] After packaging is complete, the packaged program is stored in the distributed verification program storage block. The purpose of distributed storage is to improve data availability, reliability, and scalability. During this process, the packaged program must first be serialized and converted into a format suitable for storage and transmission, such as JSON or binary format. Then, a unique identifier is generated for the program, which can usually be generated based on the program content using a hash algorithm. Next, a distributed storage strategy is selected, such as data sharding and replica replication, to ensure high data availability and load balancing. During the storage process, data encryption and access control must also be considered to ensure the security of the program. After storage is complete, the distributed index is updated to quickly locate and retrieve the program.
[0128] When the first verification is required, the first verification program can be called from the distributed storage block. First, the program is located and retrieved based on the unique identifier. After retrieving the first verification program, it is deserialized and the stored data is converted back into an executable program form. Then, the program execution environment is initialized, including allocating resources and setting operating parameters. Next, the program begins execution and loops through the configuration information. During the traversal process, the first verification program identifies and extracts the items to be verified based on predefined rules. For example, for a network device configuration file, the first verification program identifies key information such as the IP address, subnet mask, and routing table. Finally, a list of all the items to be verified is generated.
[0129] Afterwards, the second calibration program is encapsulated and stored in the distributed calibration program storage block so that it can be used during the second calibration of the substation communication equipment to be tested. Similar to step S510, first, the encapsulation of the second calibration program focuses on modularization and interface design. For example, different types of calibration rules (such as equipment compatibility check, network topology verification, performance parameter verification, etc.) can be encapsulated into independent modules, each with clearly defined input and output interfaces. In addition, users are allowed to adjust calibration parameters or rules according to specific needs. During the encapsulation process, considering that the calibration process may take a long time, it is necessary to design an interrupt and recovery mechanism to allow the calibration process to be paused and continued from the breakpoint when necessary.
[0130] In terms of performance optimization, since the second check program needs to process a large amount of data and complex calculations, efficient data structures (such as hash tables, balanced trees, etc.) can be used and cache mechanisms can be implemented to avoid repeated calculations.
[0131] After the encapsulation is completed, the process of storing the second verification program in the distributed verification program storage block is similar to S510, and this application will not go into details about this. When performing the second verification, the second verification program can be called from the distributed storage block. First, it is necessary to verify the integrity and version compatibility of the program to ensure that the latest and correct version is called. Then, initialize the operating environment, including loading necessary configuration information, preparing database connections, initializing caches, etc. Next, the program starts executing and loops through the entries to be verified. During the traversal process, the second verification program will apply the corresponding verification rules to each entry. For example, for the configuration of a network device, the program needs to check the uniqueness of the IP address, verify the consistency of the VLAN configuration, calculate whether the network bandwidth meets the requirements, etc.
[0132] Finally, the second calibration program will output the calibration results.
[0133] This implementation achieves an efficient verification process for substation communication equipment configuration information through encapsulation and distributed storage. The encapsulation of the first and second verification programs not only improves code reusability and maintainability, but also enhances verification efficiency through modular design and performance optimization. The distributed storage mechanism enhances the system's reliability, scalability, and fault tolerance. The first verification quickly identifies items to be verified, while the second verification allows for in-depth and comprehensive verification. This not only improves overall verification efficiency but also allows for flexible adjustment of verification strategies based on different needs.
[0134] In one implementation manner of this embodiment, after the optimized second verification code is used to verify the item to be verified and the verification code is obtained, the following steps are included:
[0135] S610: Obtain a first generation timestamp of the optimized second verification code, and generate a unique identifier of the optimized second verification code;
[0136] S620: Associating the unique identifier with the first generation timestamp;
[0137] S630. Store the first generation timestamp, the unique identifier, and the optimized second verification code in the instruction management block of the blockchain module.
[0138] In this embodiment, the first generation timestamp of the optimized second verification code is obtained, and a unique identifier is generated for it. Specifically, the time when the code is generated is first accurately recorded. The acquisition of the timestamp can use a system-level time function, such as the time() function in the UNIX system or the higher-precision gettimeofday() function. In order to ensure the accuracy and consistency of the timestamp, Coordinated Universal Time (UTC) is used as the benchmark. The timestamp is in seconds or milliseconds and is calculated from 00:00:00 UTC on January 1, 1970. For example, if a UNIX timestamp is used, a value similar to "1636542000" can be obtained, which represents the number of seconds that have passed since January 1, 1970.
[0139] Next, a unique identifier is generated for the optimized second verification code. This identifier must be unique to ensure that different versions of the code can be accurately distinguished. The unique identifier can be generated by hashing the code content using a hash function (such as SHA-256) to generate a fixed-length string.
[0140] The unique identifier is associated with the first generation timestamp so that the generation time of the code can be quickly located through the unique identifier, and vice versa. This association can usually be implemented in a data structure or database.
[0141] In one embodiment, the unique identifier may be used as a key and the timestamp may be used as a value, for example, using a hash table or dictionary data structure: {"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069":1636542000}.
[0142] In another embodiment, a relational database may be used to create a table containing two columns: one column is a unique identifier, and the other column is a timestamp, so as to facilitate bidirectional query and index optimization.
[0143] In actual applications, you can also add code version number, author information, etc. to enhance traceability.
[0144] The first generation timestamp, unique identifier and optimized second verification code are stored in the instruction management block of the blockchain module for permanent and tamper-proof storage to ensure the integrity and traceability of the code.
[0145] Blockchain storage is characterized by being distributed, tamper-proof, and transparent. The first step in this process is to organize the data to be stored into a unified format. Typically, this format includes the following fields: 1. A unique identifier; 2. A first generation timestamp; 3. An optimized second verification code (which may be the code itself or a hash of the code); and 4. Other metadata (such as version number and author information).
[0146] For example, a data structure is as follows:
[0147] {
[0148] "id":"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069",
[0149] "timestamp":1636542000,
[0150]
[0151] Storing the above data on a blockchain involves the following steps: 1. Convert the data structure to a format suitable for blockchain storage, typically JSON or binary. 2. Create a blockchain transaction, using the serialized data as the transaction payload. 3. Sign the transaction using your private key to verify its authenticity and integrity. 4. Broadcast the signed transaction to the blockchain network. 5. Nodes in the network verify the transaction, reach consensus, and package it into a block. 6. The new block is added to the existing blockchain, completing the storage process.
[0152] In summary, the code and its related information can be stored in a distributed ledger in an unalterable manner, ensuring the integrity and traceability of the code.
[0153] This implementation achieves comprehensive management and tracking of the optimized second verification code by accurately recording timestamps, generating unique identifiers, establishing associations, and storing them using blockchain technology. This not only ensures the uniqueness and identifiability of code versions, but also guarantees code integrity and auditability through the tamper-proof nature of blockchain. By associating and storing timestamps, identifiers, and the code itself, specific versions of code can be quickly located and verified, effectively supporting operations such as version control, rollback, and auditing. This significantly improves the reliability and efficiency of code management and provides strong technical support for the verification process of substation communication equipment.
[0154] In one implementation manner of this embodiment, uploading the verification result to the sharing platform includes the following steps:
[0155] S710: Obtain a second generation timestamp of the verification result, and obtain an optimized second verification code corresponding to the verification result, and a unique identifier of the optimized second verification code, wherein the verification result is output based on the optimized second verification code;
[0156] S720. Store the second generation timestamp, the unique identifier, and the verification result in the verification result storage block of the blockchain module, wherein the first generation timestamp corresponds one-to-one to the second generation timestamp.
[0157] Obtain a second generation timestamp of the verification result, and obtain the corresponding optimized second verification code and its unique identifier to establish an association between the verification result and the second verification code, and record the precise time of program generation.
[0158] First, the process for obtaining the second generation timestamp is similar to that for the first generation timestamp. You can use a high-precision system time function, such as the clock_gettime() function in UNIX systems. The timestamp is based on UTC time, avoiding issues caused by time zone differences.
[0159] Next, obtain the optimized second-verification code corresponding to the verification result. This can be obtained by querying the version control system or code management system. For example, if Git is used for version control, the hash value of the last commit can be used to identify a specific version of the code. The unique identifier can be obtained by searching the previously established linked data. Ultimately, a clear link between the verification result, the second-verification code, and the generation time is established, laying the foundation for subsequent tracking and verification. Through this link, the exact code version and time point of the second-verification code can be traced at any time.
[0160] Finally, the second generation timestamp, unique identifier, and verification result are stored in the verification result storage block of the blockchain module, ensuring a one-to-one correspondence between the first generation timestamp and the second generation timestamp. The tamper-proof nature of blockchain technology can be leveraged to ensure the integrity and traceability of the verification program. The data to be stored includes: 1. The second generation timestamp; 2. The unique identifier (corresponding to the optimized second verification code); 3. The verification result (usually a hash of the program, rather than the full program, to save storage space); and 4. Other metadata (such as version number, author information, etc.).
[0161] When storing this data on a blockchain, the following steps are performed: 1. The above data structure is converted into a format suitable for blockchain storage, typically JSON or binary format. 2. A blockchain transaction is created, with the serialized data as the transaction payload. 3. The transaction is signed using a private key to prove its authenticity and integrity. 4. The signed transaction is broadcast to the blockchain network. 5. Nodes in the network verify the transaction, reach consensus, and package it into a block. 6. The new block is added to the existing blockchain, completing the storage process.
[0162] To ensure a one-to-one correspondence between the first and second generation timestamps, an additional field can be added during storage to mark this correspondence. Ultimately, the verification results and related information are stored on the blockchain in an unalterable manner, while also establishing a correspondence with the generation timestamp of the second verification code. This not only ensures program integrity and traceability, but also verifies the source and version history of the second verification code.
[0163] Figure 2 The overall process diagram of a method for security acceptance and verification of substation communication equipment configuration provided by an embodiment of the present application is shown as follows: Figure 2 As shown, the sharing platform is deployed on an electronic device and includes a blockchain module and a big data analysis module. The blockchain module includes a calibration result storage block, a distributed calibration program storage block, and an instruction management block. The distributed calibration program storage block in the blockchain module is used to store the first and second calibration programs, while the instruction management block is used to store the second calibration program. The instruction management block stores the first generation timestamp and unique identifier of the second calibration program. The substation communication equipment under test can call the first and second calibration programs in the distributed calibration result storage block for calibration, and the final calibration results are stored in the calibration result storage block. The calibration results in the calibration result storage block correspond one-to-one with the second calibration program in the instruction management block via timestamps.
[0164] To illustrate the overall process, let's assume that device A is the substation communications device under test. The electronic device has deployed a shared platform, including a blockchain module and a big data analysis module. The distributed verification program storage block in the blockchain module already stores the first and second verification programs. First, the electronic device sends a probe request to device A. Device A responds, and the electronic device determines its device type is "RTU-5000." It then uses the communication interface corresponding to the RTU-5000 to read device A's configuration information.
[0165] The electronic device performs the first calibration: the electronic device calls the first calibration program from the distributed calibration program storage block. The first calibration program is optimized through the first dynamic compilation step of the big data analysis module. The optimized first calibration program loops through the configuration information of device A to determine the items that need to be calibrated, such as communication protocol settings, data transmission encryption methods, etc.
[0166] The electronic device performs a second verification: the electronic device calls the second verification program from the distributed verification program storage block. The second verification program is optimized through the second dynamic compilation step of the big data analysis module. The optimized second verification program performs an in-depth verification of the items to be verified determined by the first verification, such as verifying whether the communication protocol complies with the latest security standards and checking the strength of the encryption algorithm.
[0167] Finally, the second calibration procedure is used to calibrate device A to obtain the calibration result. The electronic device generates a unique identifier and timestamp (such as "2024-01-0510:30:00") for the second calibration procedure, and stores the second calibration procedure, its unique identifier and timestamp in the instruction management block. The final calibration result (such as "pass" or "fail", and a list of specific problems) is stored in the calibration result storage block, and the generated timestamp (such as "2024-01-0510:35:00") is recorded at the same time. The electronic device establishes a timestamp association between the calibration result and the second calibration procedure.
[0168] Afterward, any user can query the calibration result storage block to obtain the calibration results for device A. By associating the timestamp, users can also trace the specific second calibration program version that generated the result. As more substation communication equipment is calibrated, the big data analysis module continuously optimizes the dynamic compilation process. For example, the electronic equipment discovered that a certain configuration issue was common in RTU-5000 devices, so it strengthened checks for this issue in subsequent calibration procedures.
[0169] Through the above process, the electronic equipment not only completes the safety acceptance verification of Device A, but also ensures the transparency, traceability, and continuous optimization of the verification process. The application of blockchain technology ensures that the verification results and program versions cannot be tampered with, enhancing the credibility of the entire process.
[0170] This implementation achieves the management and tracking of the entire lifecycle of verification programs by accurately recording timestamps, associating source code with the final program, and utilizing blockchain technology for storage. This not only ensures the uniqueness and identifiability of program versions, but also guarantees program integrity and auditability through the blockchain's immutable nature. By associating the generation time of the second verification code with the generation time of the verification results, a complete program evolution history is provided, supporting operations such as version control, rollback, and auditing. This significantly improves the reliability and efficiency of program management, provides strong technical support for the verification process of substation communication equipment, and facilitates subsequent program verification and problem tracking.
[0171] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned substation communication equipment configuration security acceptance and verification method.
[0172] An embodiment of the present application further provides an electronic device, including:
[0173] The machine-readable storage medium is configured to store instructions; and
[0174] The processor is configured to call the instructions from the memory and implement the above-mentioned substation communication equipment configuration security acceptance and verification method when executing the instructions.
[0175] Reference Figure 3 The present application also provides a substation communication equipment configuration security acceptance and verification system, including:
[0176] The electronic device 10;
[0177] The substation communication device 20 to be tested is connected to the electronic device.
[0178] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0179] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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.
[0180] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0182] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0183] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0184] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0185] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0186] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for security acceptance and verification of substation communication equipment configuration, characterized in that: Applied to an electronic device, the electronic device being deployed with a shared platform, the method comprising: Send a detection request to the communication equipment of the substation to be tested; In response to receiving a response instruction sent by the communication device of the substation to be tested based on the detection request, determining a device type of the communication device of the substation to be tested according to the response instruction, and calling a corresponding communication interface according to the device type; In response to receiving a configuration read instruction for the substation communication device under test, calling a read command of the substation communication device under test through the communication interface, and obtaining configuration information of the substation communication device under test based on the read command; Performing a first calibration on the substation communication device to be tested using a first calibration program, wherein the first calibration program is used to loop through the configuration information and determine items to be calibrated in the configuration information; Performing a second calibration on the substation communication equipment to be tested using a second calibration program, wherein the second calibration program is configured to loop through the items to be calibrated and output a calibration result; Uploading the verification results to the sharing platform; The first checking program is optimized through a first dynamic compilation step each time it loops through the configuration information, and the second checking program is optimized through a second dynamic compilation step each time it loops through the items to be checked.
2. The method according to claim 1, characterized in that The sharing platform includes a blockchain module and a big data analysis module. The blockchain module includes a verification result storage block, a distributed verification program storage block and an instruction management block. The big data analysis module includes the first dynamic compilation step and the second dynamic compilation step.
3. The method according to claim 2, characterized in that The first verification procedure includes: calling a first dynamic compilation step in the big data analysis module, and dynamically generating an optimized first verification code according to a preset first verification rule when looping through the configuration information through the first dynamic compilation step; and When looping through the configuration information, using the optimized first verification code to determine the items to be verified in the configuration information; The second verification procedure includes: calling a second dynamic compilation step in the big data analysis module, and dynamically generating an optimized second verification code according to a preset second verification rule when looping through the items to be verified through the second dynamic compilation step; and When looping through the items to be checked, the optimized second checking code is used to check the items to be checked to obtain a checking result.
4. The method according to claim 3, characterized in that The first dynamic compilation step includes: When looping through the configuration information, parsing the first checking rule into a first regular expression; Convert the parsed first regular expression into a corresponding first JavaScript code; identifying redundant code, loop structure, function call overhead, and data structure in the first JavaScript code, and optimizing the redundant code, the loop structure, the function call overhead, and the data structure, respectively, to obtain an optimized first JavaScript code; The optimized first JavaScript code is compiled using a preset JS engine to obtain an optimized first verification code.
5. The method according to claim 3, characterized in that The second dynamic compilation step includes: When looping through the items to be checked, parsing the second checking rule into a second regular expression; Convert the parsed second regular expression into a corresponding second JavaScript code; Identifying a data structure and memory allocation in the second JavaScript code, and optimizing the data structure and the memory allocation respectively to obtain an optimized second JavaScript code; The optimized second JavaScript code is compiled using a preset JS engine to obtain an optimized second verification code.
6. The method according to claim 4 or 5, characterized in that The method further comprises: Encapsulating the first calibration program and storing the encapsulated first calibration program in the distributed calibration program storage block, so that when calibrating the substation communication device to be tested for the first time, the first calibration program in the distributed calibration program storage block is called to loop through the configuration information and determine the items to be verified in the configuration information; Encapsulate the second calibration program and store the encapsulated second calibration program in the distributed calibration program storage block, so that when calibrating the substation communication equipment to be tested for the second time, call the second calibration program in the distributed calibration program storage block to loop through the items to be verified and output the calibration results.
7. The method according to claim 6, characterized in that After verifying the item to be verified by using the optimized second verification code to obtain a verification result, the method includes: Obtaining a first generation timestamp of the optimized second verification code, and generating a unique identifier of the optimized second verification code; associating the unique identifier with the first generation timestamp; The first generation timestamp, the unique identifier, and the optimized second verification code are stored in the instruction management block of the blockchain module.
8. The method according to claim 7, characterized in that The uploading of the verification result to the sharing platform includes: Obtaining a second generation timestamp of the verification result, and obtaining an optimized second verification code corresponding to the verification result, and a unique identifier of the optimized second verification code, wherein the verification result is output based on the optimized second verification code; The second generation timestamp, the unique identifier, and the verification result are stored in the verification result storage block of the blockchain module, wherein the first generation timestamp corresponds one-to-one to the second generation timestamp.
9. An electronic device, characterized in that: include: a memory configured to store instructions; as well as The processor is configured to call the instructions from the memory and implement the substation communication equipment configuration security acceptance verification method according to any one of claims 1 to 8 when executing the instructions.
10. A substation communication equipment configuration safety acceptance and verification system, characterized in that: include: The electronic device according to claim 9; The substation communication equipment to be tested is connected to the electronic equipment.
Citation Information
Patent Citations
Intelligent substation automation and network security equipment configuration checking method and system
CN116055326A
Configuration treatment method and device, computer equipment and storage medium
CN116737221A