A method, system, and device for real-time modeling of test cases for a smart distribution gateway.
By breaking down the test scheme for the power distribution smart gateway, matching and verifying the test case model, and generating the test state sequence with the smallest error, the problem of inflexible test case configuration is solved, and the test efficiency and adaptability are improved.
Patent Information
- Application Number
- CN202210961392.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-08-11
AI Technical Summary
In existing technologies, the test case configuration of power distribution smart gateways is inflexible, resulting in low testing efficiency and an inability to meet testing requirements under different conditions.
By splitting the test plan into multiple split plans, matching the target test case model, extracting parameter information and assigning weights, generating a test state sequence, simulating and verifying, selecting the pre-selected test state sequence with the smallest test error, and generating the target test model.
It enables flexible configuration of test cases for power distribution smart gateways, improves testing efficiency, and can meet testing requirements under different conditions.
Smart Images

Figure CN115269432B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power distribution network testing technology, and in particular to a method, system and device for real-time modeling of test cases for power distribution smart gateways. Background Technology
[0002] A test case is a set of test inputs, execution conditions, and expected results designed for a specific objective. It aims to test whether the results obtained from a given input under specified execution conditions and parameters meet the expected outcomes. Since test cases can be used to inspect the functionality of a device or system, the quality of the test cases directly affects the effectiveness of the inspection of that system or device.
[0003] Currently, performance testing of smart distribution gateways often involves generating appropriate test cases on-site based on the gateway's specific conditions. However, this process requires redesigning test cases under varying testing requirements, resulting in inflexible test case configuration and low testing efficiency for smart distribution gateways. Summary of the Invention
[0004] This invention provides a method, system, and device for real-time modeling of test cases for power distribution smart gateways, solving the technical problem of how to improve the flexibility of test cases for power distribution smart gateways, thereby improving the testing efficiency of power distribution smart gateways.
[0005] The first aspect of this invention provides a real-time modeling method for test cases of a power distribution smart gateway, comprising:
[0006] Determine the test plan for the target power distribution smart gateway;
[0007] The test plan is split into multiple split plans;
[0008] For each of the splitting schemes, a target test case model is matched from the test case model library; the test case model library stores test case models of different types.
[0009] Extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences;
[0010] Each target test case model is simulated and verified sequentially according to the test state sequence to obtain the corresponding simulation and verification results.
[0011] Based on the simulation verification results, a pre-selected test state sequence is determined. The test error amount corresponding to each pre-selected test state sequence is calculated based on the degree of interference between adjacent test case models. The pre-selected test state sequence with the smallest test error amount is selected as the target test state sequence. The test model of the target power distribution smart gateway is generated based on the target test state sequence.
[0012] According to one achievable method of the first aspect of the present invention, the splitting of the test scheme to obtain multiple split schemes includes:
[0013] Determine the test case model required for the test plan;
[0014] The test plan is split according to the type of the required test case model so that the required test case models in the same initial split plan belong to the same type;
[0015] The initial splitting scheme is split into multiple splitting schemes, with each test project as a unit.
[0016] A second aspect of the present invention provides a real-time modeling system for test cases of a power distribution smart gateway, comprising:
[0017] The scheme determination module is used to determine the test scheme for the target power distribution smart gateway;
[0018] The scheme splitting module is used to split the test scheme into multiple split schemes;
[0019] The model acquisition module is used to match a target test case model from the test case model library for each of the splitting schemes; the test case model library stores test case models of different types.
[0020] The sequence generation module is used to extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences.
[0021] The simulation verification module is used to perform simulation verification on each of the target test case models in sequence according to the test state sequence, and obtain the corresponding simulation verification results.
[0022] The modeling module is used to determine the pre-selected test state sequence based on the simulation verification results, calculate the test error corresponding to each pre-selected test state sequence based on the degree of interference between adjacent test case models, select the pre-selected test state sequence with the smallest test error as the target test state sequence, and generate the test model of the target power distribution smart gateway based on the target test state sequence.
[0023] According to one achievable method of the second aspect of the present invention, the scheme splitting module includes:
[0024] A determining unit is used to determine the test case model required for the test plan;
[0025] The first splitting unit is used to split the test plan according to the type of the required test case model, so that the required test case models in the same initial splitting plan are of the same type.
[0026] The second splitting unit is used to split the initial splitting scheme into multiple splitting schemes by taking the test items as the unit.
[0027] According to one achievable method of the second aspect of the present invention, the different types of test case models include:
[0028] The three-remote test model is used to test the telemetry, remote signaling and remote control performance of power distribution smart gateways;
[0029] A cross-sectional data model is used to perform cross-sectional tests based on selected cross-sectional data; the cross-sectional tests include dead zone testing, zero drift testing, waveform recording steady-state error testing, and / or feeder automation testing.
[0030] The time synchronization model is used for time synchronization testing of the power distribution smart gateway;
[0031] The timekeeping accuracy model is used to test the timekeeping accuracy of power distribution smart gateways.
[0032] According to one achievable method of the second aspect of the present invention, the cross-sectional data model comprises:
[0033] The status sequence number section is used to record and store the status sequence number of the power distribution smart gateway;
[0034] The voltage channel section is used to read and store the amplitude and phase data of the voltage channel;
[0035] The current channel section is used to read and store the amplitude and phase data of the current channel;
[0036] The switch action unit is used to read and store the switch position and switch action strategy;
[0037] The switching time section is used to read and store the switching duration;
[0038] The data filtering unit is used to filter the amplitude and phase data of the voltage and current channels.
[0039] The first calculation unit is used to calculate the cross-sectional test results based on the switch position, the switch action strategy, the switch duration, and the data filtered by the data filtering unit.
[0040] According to one achievable method of the second aspect of the present invention, the timekeeping accuracy model includes:
[0041] The time synchronization confirmation unit is used to confirm the time synchronization of the power distribution smart gateway.
[0042] The motion generation unit is used to generate test instructions for performing timekeeping accuracy tests.
[0043] The terminal recording unit is used to record the terminal event time of the power distribution smart gateway in response to the test command;
[0044] The system recording unit is used to record the system event time of the power distribution smart gateway in response to the test command;
[0045] An error removal unit is used to remove the error amount between the terminal event time and the system event time;
[0046] The second calculation unit is used to calculate the timekeeping accuracy based on the terminal event time and system event time after removing the error amount.
[0047] According to one achievable method of the second aspect of the present invention, the action generation unit is specifically used for:
[0048] Generate at least three of the test commands; the time interval between two adjacent test commands is greater than half the operating cycle of the power distribution smart gateway;
[0049] The second computing unit is specifically used for:
[0050] Calculate the timing accuracy corresponding to each pair of adjacent test commands, and calculate the target accuracy and error range of the power distribution smart gateway based on the multiple timing accuracies.
[0051] According to one achievable method of the second aspect of the present invention, the second computing unit is specifically used for:
[0052] Calculate the timing accuracy for each pair of adjacent test commands using the following formula:
[0053] A=|BC|, B=|t2-t1|, C=|t4-t3|
[0054] In the formula, A represents the timekeeping accuracy, B represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the first test command, C represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the second test command, the first test command and the second test command are adjacent test commands, t1 represents the system event time of the smart distribution gateway responding to the first test command, t2 represents the terminal event time of the smart distribution gateway responding to the first test command, t3 represents the system event time of the smart distribution gateway responding to the second test command, and t4 represents the terminal event time of the smart distribution gateway responding to the second test command.
[0055] According to one achievable method of the second aspect of the present invention, the error removal unit is specifically used for:
[0056] Obtain the jitter time and message byte count when the power distribution smart gateway responds to the test command;
[0057] The error amount is calculated based on the jitter time and the number of bytes in the message.
[0058] A third aspect of the present invention provides a real-time modeling device for test cases of a power distribution smart gateway, comprising:
[0059] A memory for storing instructions; wherein the instructions are used to implement the real-time modeling method for power distribution smart gateway test cases as described in any of the above-mentioned ways;
[0060] A processor for executing instructions in the memory.
[0061] The fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the real-time modeling method for test cases of a power distribution smart gateway as described in any of the above embodiments.
[0062] As can be seen from the above technical solutions, the present invention has the following advantages:
[0063] This invention breaks down the test scheme of a target smart distribution gateway into multiple sub-schemes. For each sub-scheme, a target test case model is matched from a test case model library, and parameter information of each target test case model is extracted. Based on the parameter information, corresponding weights are assigned to each target test case model, and then the target test case models are sorted and modeled according to the weights to generate multiple test state sequences. After simulating and verifying each target test case model, a pre-selected test state sequence is determined based on the simulation results. The test error corresponding to each pre-selected test state sequence is calculated based on the degree of interference between adjacent test case models. The pre-selected test state sequence with the smallest test error is selected as the target test state sequence, and a test model of the target smart distribution gateway is generated based on the target test state sequence. This invention can quickly complete the test case configuration of the smart distribution gateway, improve testing efficiency, and the entire test case configuration is more flexible, meeting the testing requirements under different conditions. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 A flowchart of a real-time modeling method for test cases of a power distribution smart gateway is provided as an optional embodiment of the present invention;
[0066] Figure 2 This is a structural connection block diagram of a real-time modeling system for test cases of a power distribution smart gateway, provided as an optional embodiment of the present invention.
[0067] Figure 3 This is a structural connection block diagram of a scheme determination module provided in an optional embodiment of the present invention;
[0068] Figure 4 This is a structural connection block diagram of a solution splitting module provided in an optional embodiment of the present invention;
[0069] Figure 5 This is a structural connection block diagram of a cross-sectional data model provided in an optional embodiment of the present invention;
[0070] Figure 6 The diagram shows the structural connection of a timekeeping accuracy model provided in an optional embodiment of the present invention.
[0071] Figure label:
[0072] 1-Scheme Determination Module; 2-Scheme Splitting Module; 3-Model Acquisition Module; 4-Sequence Generation Module; 5-Simulation Verification Module; 6-Model Modeling Module; 11-Permission Allocation Unit; 12-Feature Information Extraction Unit; 13-Scheme Generation Unit; 21-Determination Unit; 22-First Splitting Unit; 23-Second Splitting Unit; 31-Status Sequence Number Unit; 32-Voltage Channel Unit; 33-Current Channel Unit; 34-Switch Action Unit; 35-Switch Time Unit; 36-Data Filtering Unit; 37-First Calculation Unit; 41-Time Confirmation Unit; 42-Action Generation Unit; 43-Terminal Recording Unit; 44-System Recording Unit; 45-Second Calculation Unit; 46-Error Removal Unit. Detailed Implementation
[0073] This invention provides a method, system, and device for real-time modeling of test cases for power distribution smart gateways, which addresses the technical problem of improving the flexibility of test cases for power distribution smart gateways to enhance testing efficiency.
[0074] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0075] This invention provides a method for real-time modeling of test cases for a power distribution smart gateway.
[0076] Please see Figure 1 , Figure 1 A flowchart of a real-time modeling method for test cases of a power distribution smart gateway provided by an embodiment of the present invention is shown.
[0077] The present invention provides a real-time modeling method for test cases of a power distribution smart gateway, comprising steps S1-S6.
[0078] Step S1: Determine the test plan for the target power distribution smart gateway.
[0079] The test plan can be a pre-set test plan, which can be retrieved from where the test plan is stored. Alternatively, the test plan can be obtained through manual online setup or transmission from a pre-configured terminal.
[0080] One feasible approach is to extract the characteristic information of the target smart distribution gateway based on the set extraction permissions when determining the test plan, and then generate the test plan based on this characteristic information. This characteristic information can be the functional information to be tested.
[0081] In this embodiment, by restricting the extraction of feature information from the smart distribution gateway, and then generating a corresponding test plan based on the feature information, the confidentiality and security of relevant information in the smart distribution gateway can be improved, preventing it from being read arbitrarily.
[0082] Step S2: The test scheme is split into multiple split schemes.
[0083] In this embodiment, after the test plan is determined, the test plan is split by the plan splitting module 2 to facilitate the subsequent matching of the corresponding test case model.
[0084] In one feasible approach, splitting the test scheme to obtain multiple split schemes includes:
[0085] Determine the test case model required for the test plan;
[0086] The test plan is split according to the type of the required test case model so that the required test case models in the same initial split plan belong to the same type;
[0087] The initial splitting scheme is split into multiple splitting schemes, with each test project as a unit.
[0088] In this embodiment, the test models required in the test plan are first classified to obtain multiple initial splitting schemes, so as to place the test models required in the same category together, which facilitates the subsequent allocation of test models. Then, the initial splitting schemes of each category are further split to refine the splitting schemes to test items, so as to match a target test case model for each splitting scheme.
[0089] Step S3: Match the target test case model from the test case model library for each of the splitting schemes; the test case model library stores test case models of different types.
[0090] The different types of test case models include:
[0091] The three-remote test model is used to test the telemetry, remote signaling and remote control performance of power distribution smart gateways;
[0092] A cross-sectional data model is used to perform cross-sectional tests based on selected cross-sectional data; the cross-sectional tests include dead zone testing, zero drift testing, waveform recording steady-state error testing, and / or feeder automation testing.
[0093] The time synchronization model is used for time synchronization testing of the power distribution smart gateway;
[0094] The timekeeping accuracy model is used to test the timekeeping accuracy of power distribution smart gateways.
[0095] The specific details of each model will be explained in the following description, and will not be repeated here.
[0096] Step S4: Extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences.
[0097] In this embodiment, after obtaining different target test case models according to the splitting scheme, the parameter information of each target test case model is extracted by parameters, weights are assigned to each target test case model according to the parameter information, and then test state sequences are generated according to the assigned weights.
[0098] Weights can be allocated based on expert methods, the proportion of successful or failed executions in the test case model's history, or the level of the test function corresponding to the test case model. It should be noted that some target test case models may be assigned the same weight value. To implement weight allocation, a corresponding weight allocation mechanism can be set up based on the above methods, allowing for automatic weight allocation based on existing mechanisms. For example, the set weight allocation mechanism can include a weight allocation list, storing the weight information for each test case model.
[0099] When generating several test state sequences based on the assigned weights, they are sorted in descending order of weight value. For target test case models with the same weight value, such as model A and model B, model A can be placed before model B in the first test state sequence, while model B can be placed before model A in the second test state sequence.
[0100] Step S5: Simulate and verify each target test case model sequentially according to the test state sequence to obtain the corresponding simulation verification results.
[0101] In existing test case verification processes, the test cases are typically run, and the results are compared with the expected results to verify whether the design of the currently running test cases is correct; alternatively, the parameters and operation information of each test item in the test cases are reviewed to verify their correctness. In this embodiment, each target test case model is simulated and verified sequentially according to the test state sequence. This can be done according to existing test case verification methods, and this embodiment does not impose any limitations on this approach.
[0102] Step S6: Determine the pre-selected test state sequence based on the simulation verification results, calculate the test error amount corresponding to each pre-selected test state sequence based on the degree of interference between adjacent test case models, select the pre-selected test state sequence with the smallest test error amount as the target test state sequence, and generate the test model of the target power distribution smart gateway based on the target test state sequence.
[0103] In this process, a pre-selected test state sequence is determined based on the simulation verification results. The test state sequence corresponding to the correct simulation verification results for each target test case model is selected as the pre-selected test state sequence. It should be noted that if no pre-selected test state sequence is found, an alarm message is sent, and the weight allocation in step S4 is manually adjusted. In other embodiments, multiple weight allocation mechanisms can be set up so that if no pre-selected test state sequence is found, the process returns to step S4, and the weights are reallocated by changing the weight allocation mechanism.
[0104] In this embodiment, the test error is determined by the interference between adjacent test cases when selecting a test case model according to the current test state sequence. One feasible approach is to pre-set specific values for the degree of interference between two test cases, and then calculate the sum or average of the interference levels under each pre-selected test state sequence as the corresponding test error. This average value can be an arithmetic mean, root mean square mean, or weighted average. When using a weighted average, weights can be set according to the order of the test cases, with the weight corresponding to the interference level of the preceding two adjacent test cases being greater than the weight corresponding to the interference level of the following two adjacent test cases.
[0105] By selecting the target test model corresponding to the pre-selected test state sequence with the least interference, the interference between different test processes can be reduced, and the accuracy of the test results can be maximized.
[0106] The present invention also provides a real-time modeling system for test cases of power distribution smart gateways.
[0107] Please see Figure 2 , Figure 2 The diagram shows the structural connection of a real-time modeling system for test cases of a power distribution smart gateway provided by an embodiment of the present invention.
[0108] This invention provides a real-time modeling system for test cases of a power distribution smart gateway, comprising:
[0109] Module 1, which determines the test plan for the target smart distribution gateway, is used to determine the test plan for the target smart distribution gateway.
[0110] Scheme splitting module 2 is used to split the test scheme to obtain multiple split schemes;
[0111] Model acquisition module 3 is used to match target test case models from the test case model library for each of the splitting schemes; the test case model library stores test case models of different types;
[0112] The sequence generation module 4 is used to extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences.
[0113] Simulation verification module 5 is used to perform simulation verification on each of the target test case models in sequence according to the test state sequence, and obtain the corresponding simulation verification results;
[0114] Modeling module 6 is used to determine a pre-selected test state sequence based on the simulation verification results, calculate the test error corresponding to each pre-selected test state sequence based on the degree of interference between adjacent test case models, select the pre-selected test state sequence with the smallest test error as the target test state sequence, and generate a test model of the target power distribution smart gateway based on the target test state sequence.
[0115] In some embodiments, reference Figure 3 The scheme determination module 1 includes a permission allocation unit 11, a feature information extraction unit 12, and a scheme generation unit 13. The permission allocation unit 11 is communicatively connected to the feature information extraction unit 12 and is used to provide extraction permissions to the feature information extraction unit 12. The feature information extraction unit 12 is used to extract feature information from the power distribution smart gateway after the permission allocation unit 11 provides the extraction permissions. The scheme generation unit 13 is electrically connected to the feature information extraction unit 12 and is used to generate the test scheme based on the feature information.
[0116] In this embodiment, a feature information extraction unit 12 is set up to extract feature information from the smart distribution gateway, so that the solution generation unit 13 can generate corresponding test solutions based on the feature information. This facilitates the rapid acquisition of test solutions for the smart distribution gateway by the entire solution determination module 1, enabling rapid configuration of test case sets and improving testing efficiency. On the other hand, during the process of the feature information extraction unit 12 extracting feature information from the smart distribution gateway, an appropriate permission allocation unit 11 is set up to allocate appropriate permissions to the feature information extraction unit 12, so as to realize permission control over the solution determination module 1, improve the confidentiality and security of relevant information in the smart distribution gateway, and prevent unauthorized reading.
[0117] In one feasible way, such as Figure 4 As shown, the scheme splitting module 2 includes:
[0118] Determining unit 21 is used to determine the test case model required for the test plan;
[0119] The first splitting unit 22 is used to split the test plan according to the type of the required test case model, so that the required test case models in the same initial splitting plan are of the same type.
[0120] The second splitting unit 23 is used to split the initial splitting scheme into multiple splitting schemes by taking the test items as the unit.
[0121] In one feasible approach, the different types of test case models include:
[0122] The three-remote test model is used to test the telemetry, remote signaling and remote control performance of power distribution smart gateways;
[0123] A cross-sectional data model is used to perform cross-sectional tests based on selected cross-sectional data; the cross-sectional tests include dead zone testing, zero drift testing, waveform recording steady-state error testing, and / or feeder automation testing.
[0124] The time synchronization model is used for time synchronization testing of the power distribution smart gateway;
[0125] The timekeeping accuracy model is used to test the timekeeping accuracy of power distribution smart gateways.
[0126] In one feasible way, such as Figure 5 As shown, the cross-sectional data model includes:
[0127] The status sequence number section 31 is used to record and store the status sequence number of the power distribution smart gateway;
[0128] Voltage channel section 32 is used to read and store amplitude data and phase data of voltage channel;
[0129] The current channel section 33 is used to read and store the amplitude data and phase data of the current channel;
[0130] The switch action unit 34 is used to read and store the switch position and switch action strategy;
[0131] The switching time unit 35 is used to read and store the switching duration;
[0132] The data filtering unit 36 is used to filter the amplitude and phase data of the voltage channel and the current channel;
[0133] The first calculation unit 37 is used to calculate the cross-sectional test results based on the switch position, the switch action strategy, the switch duration, and the data filtered by the data filtering unit 36.
[0134] In this embodiment, during the testing process using the cross-sectional data model as a test case, the state sequence number of the power distribution smart gateway is recorded and stored by the state sequence number unit 31, the amplitude data and phase data of the voltage channel and current channel are read and stored by the voltage channel unit 32 and the current channel unit 33, the switch position and switch action strategy are read and stored by the switch action unit 34, and the switch duration is read and stored by the switch time unit 35. This allows the power distribution smart gateway's state sequence number, voltage channel and current channel amplitude data, phase data, switch position, and switch action strategy to be recorded during the testing process. The data filtering unit 36 is electrically connected to the voltage channel unit 32 and the current channel unit 33 respectively, and is used to filter amplitude data and phase data. After data filtering, since the first calculation unit 37 is electrically connected to the switch action unit 34 and the switch time unit 35 respectively, the first calculation unit 37 calculates the test results based on the switch position, the switch action strategy, the switch duration, the amplitude data and phase data of the voltage channel and the current channel, including the results of dead zone test, zero drift test, waveform recording steady state error test and / or feeder automation test.
[0135] In the process of filtering amplitude data and phase data, the data filtering unit 36 mainly removes values whose deviation from the average value of amplitude data and phase data is greater than the deviation threshold, so as to filter out obviously problematic data and improve the accuracy of test results.
[0136] It should be noted that since the testing processes for dead zone testing, zero drift testing, waveform recording steady-state error testing, and feeder automation testing are existing technologies, this solution does not involve any improvements to them, and will not be elaborated here.
[0137] In one feasible way, such as Figure 6 As shown, the timekeeping accuracy model includes:
[0138] The time synchronization confirmation unit 41 is used to confirm the time synchronization of the power distribution smart gateway;
[0139] The motion generation unit 42 is used to generate test instructions for performing timekeeping accuracy tests;
[0140] Terminal recording unit 43 is used to record the terminal event time of the power distribution smart gateway in response to the test command;
[0141] System recording unit 44 is used to record the system event time of the power distribution smart gateway responding to the test command;
[0142] Error removal unit 46 is used to remove the error amount of the terminal event time and the system event time;
[0143] The second calculation unit 45 is used to calculate the timekeeping accuracy based on the terminal event time and system event time after removing the error amount.
[0144] Before the calculation process of the second calculation unit 45, the error removal unit 46 first removes the error in the terminal event time and system event time, which can improve the calculation accuracy of the timekeeping accuracy.
[0145] In one feasible implementation, the action generation unit 42 is specifically used for:
[0146] Generate at least three of the test commands; the time interval between two adjacent test commands is greater than half the operating cycle of the power distribution smart gateway;
[0147] The second calculation unit 45 is specifically used for:
[0148] Calculate the timing accuracy corresponding to each pair of adjacent test commands, and calculate the target accuracy and error range of the power distribution smart gateway based on the multiple timing accuracies.
[0149] For example, when the number of test instructions generated by the action generation unit 42 is an even number greater than 3, the two adjacent test instructions corresponding to two adjacent timekeeping accuracy calculation processes do not overlap; while when the number of test instructions generated by the action generation unit 42 is an odd number greater than or equal to 3, the two adjacent test instructions corresponding to two adjacent timekeeping accuracy calculation processes overlap, thereby ensuring that each test instruction is fully utilized to improve the accuracy of the calculation results.
[0150] In other embodiments, the target accuracy is the minimum of a plurality of timekeeping accuracies, and the error range is the standard deviation among the plurality of timekeeping accuracies. By selecting the minimum of a plurality of timekeeping accuracies as the target accuracy, errors in subsequent testing processes are reduced, and the calculated error range facilitates the assessment of the accuracy of test results during the testing of the power distribution smart gateway.
[0151] In one feasible implementation, the second computing unit 45 is specifically used for:
[0152] Calculate the timing accuracy for each pair of adjacent test commands using the following formula:
[0153] A=|BC|, B=|t2-t1|, C=|t4-t3|
[0154] In the formula, A represents the timekeeping accuracy, B represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the first test command, C represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the second test command, the first test command and the second test command are adjacent test commands, t1 represents the system event time of the smart distribution gateway responding to the first test command, t2 represents the terminal event time of the smart distribution gateway responding to the first test command, t3 represents the system event time of the smart distribution gateway responding to the second test command, and t4 represents the terminal event time of the smart distribution gateway responding to the second test command.
[0155] In the process of calculating the timekeeping accuracy using the timekeeping accuracy model, the time confirmation unit 41 first performs time confirmation to ensure that the smart distribution gateway meets the time synchronization requirements, thereby reducing subsequent timekeeping calculation errors. The action generation unit 42 generates test commands for testing; different test commands can be generated, and compared to a single test command, this scheme can improve test accuracy under different test conditions. After the action generation unit 42 generates and sends the test commands, the terminal event time of the smart distribution gateway's response to the test commands and the system event time of the smart distribution gateway's response to the test commands are recorded by the terminal recording unit 43 and the system event time, respectively. This allows the second calculation unit 45 to calculate the timekeeping accuracy of the smart distribution gateway based on the terminal event time and the system event time.
[0156] In one feasible implementation, the error removal unit 46 is specifically used for:
[0157] Obtain the jitter time and message byte count when the power distribution smart gateway responds to the test command;
[0158] The error amount is calculated based on the jitter time and the number of bytes in the message.
[0159] Specifically, taking the terminal event time S as an example, the terminal event time after removing the error is:
[0160] M = STL × (N-1)
[0161] In the formula, M is the terminal event time after removing the error amount, T represents the jitter time when the power distribution smart gateway responds to the test command, N is the number of message bytes when the power distribution smart gateway responds to the test command, and L is the time spent for a single message byte.
[0162] In this embodiment, by removing the amount of extra packet bytes and network jitter time from the terminal event time, the accuracy of the terminal event time can be ensured.
[0163] This invention also provides a real-time modeling device for test cases of a power distribution smart gateway, comprising:
[0164] A memory is used to store instructions; wherein the instructions are used to implement the real-time modeling method for power distribution smart gateway test cases as described in any of the above embodiments;
[0165] A processor for executing instructions in the memory.
[0166] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the real-time modeling method for power distribution smart gateway test cases as described in any of the above embodiments.
[0167] The first aspect of this invention provides a real-time modeling method for test cases of a power distribution smart gateway, comprising:
[0168] Determine the test plan for the target power distribution smart gateway;
[0169] The test plan is split into multiple split plans;
[0170] For each of the splitting schemes, a target test case model is matched from the test case model library; the test case model library stores test case models of different types.
[0171] Extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences;
[0172] Each target test case model is simulated and verified sequentially according to the test state sequence to obtain the corresponding simulation and verification results.
[0173] Based on the simulation verification results, a pre-selected test state sequence is determined. The test error amount corresponding to each pre-selected test state sequence is calculated based on the degree of interference between adjacent test case models. The pre-selected test state sequence with the smallest test error amount is selected as the target test state sequence. The test model of the target power distribution smart gateway is generated based on the target test state sequence.
[0174] According to one achievable method of the first aspect of the present invention, the splitting of the test scheme to obtain multiple split schemes includes:
[0175] Determine the test case model required for the test plan;
[0176] The test plan is split according to the type of the required test case model so that the required test case models in the same initial split plan belong to the same type;
[0177] The initial splitting scheme is split into multiple splitting schemes, with each test project as a unit.
[0178] A second aspect of the present invention provides a real-time modeling system for test cases of a power distribution smart gateway, comprising:
[0179] Module 1, which determines the test plan for the target smart distribution gateway, is used to determine the test plan for the target smart distribution gateway.
[0180] Scheme splitting module 2 is used to split the test scheme to obtain multiple split schemes;
[0181] Model acquisition module 3 is used to match target test case models from the test case model library for each of the splitting schemes; the test case model library stores test case models of different types;
[0182] The sequence generation module 4 is used to extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences.
[0183] Simulation verification module 5 is used to perform simulation verification on each of the target test case models in sequence according to the test state sequence, and obtain the corresponding simulation verification results;
[0184] Modeling module 6 is used to determine a pre-selected test state sequence based on the simulation verification results, calculate the test error corresponding to each pre-selected test state sequence based on the degree of interference between adjacent test case models, select the pre-selected test state sequence with the smallest test error as the target test state sequence, and generate a test model of the target power distribution smart gateway based on the target test state sequence.
[0185] According to one achievable method of the second aspect of the present invention, the scheme splitting module 2 includes:
[0186] Determining unit 21 is used to determine the test case model required for the test plan;
[0187] The first splitting unit 22 is used to split the test plan according to the type of the required test case model, so that the required test case models in the same initial splitting plan are of the same type.
[0188] The second splitting unit 23 is used to split the initial splitting scheme into multiple splitting schemes by taking the test items as the unit.
[0189] According to one achievable method of the second aspect of the present invention, the different types of test case models include:
[0190] The three-remote test model is used to test the telemetry, remote signaling and remote control performance of power distribution smart gateways;
[0191] A cross-sectional data model is used to perform cross-sectional tests based on selected cross-sectional data; the cross-sectional tests include dead zone testing, zero drift testing, waveform recording steady-state error testing, and / or feeder automation testing.
[0192] The time synchronization model is used for time synchronization testing of the power distribution smart gateway;
[0193] The timekeeping accuracy model is used to test the timekeeping accuracy of power distribution smart gateways.
[0194] According to one achievable method of the second aspect of the present invention, the cross-sectional data model comprises:
[0195] The status sequence number section 31 is used to record and store the status sequence number of the power distribution smart gateway;
[0196] Voltage channel section 32 is used to read and store amplitude data and phase data of voltage channel;
[0197] The current channel section 33 is used to read and store the amplitude data and phase data of the current channel;
[0198] The switch action unit 34 is used to read and store the switch position and switch action strategy;
[0199] The switching time unit 35 is used to read and store the switching duration;
[0200] The data filtering unit 36 is used to filter the amplitude and phase data of the voltage channel and the current channel;
[0201] The first calculation unit 37 is used to calculate the cross-sectional test results based on the switch position, the switch action strategy, the switch duration, and the data filtered by the data filtering unit 36.
[0202] According to one achievable method of the second aspect of the present invention, the timekeeping accuracy model includes:
[0203] The time synchronization confirmation unit 41 is used to confirm the time synchronization of the power distribution smart gateway;
[0204] The motion generation unit 42 is used to generate test instructions for performing timekeeping accuracy tests;
[0205] Terminal recording unit 43 is used to record the terminal event time of the power distribution smart gateway in response to the test command;
[0206] System recording unit 44 is used to record the system event time of the power distribution smart gateway responding to the test command;
[0207] Error removal unit 46 is used to remove the error amount of the terminal event time and the system event time;
[0208] The second calculation unit 45 is used to calculate the timekeeping accuracy based on the terminal event time and system event time after removing the error amount.
[0209] According to one embodiment of the second aspect of the present invention, the action generation unit 42 is specifically configured to:
[0210] Generate at least three of the test commands; the time interval between two adjacent test commands is greater than half the operating cycle of the power distribution smart gateway;
[0211] The second calculation unit 45 is specifically used for:
[0212] Calculate the timing accuracy corresponding to each pair of adjacent test commands, and calculate the target accuracy and error range of the power distribution smart gateway based on the multiple timing accuracies.
[0213] According to one embodiment of the second aspect of the present invention, the second computing unit 45 is specifically configured to:
[0214] Calculate the timing accuracy for each pair of adjacent test commands using the following formula:
[0215] A=|BC|, B=|t2-t1|, C=|t4-t3|
[0216] In the formula, A represents the timekeeping accuracy, B represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the first test command, C represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the second test command, the first test command and the second test command are adjacent test commands, t1 represents the system event time of the smart distribution gateway responding to the first test command, t2 represents the terminal event time of the smart distribution gateway responding to the first test command, t3 represents the system event time of the smart distribution gateway responding to the second test command, and t4 represents the terminal event time of the smart distribution gateway responding to the second test command.
[0217] According to one achievable method of the second aspect of the present invention, the error removal unit 46 is specifically configured to:
[0218] Obtain the jitter time and message byte count when the power distribution smart gateway responds to the test command;
[0219] The error amount is calculated based on the jitter time and the number of bytes in the message.
[0220] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and the specific beneficial effects of the systems, devices, and modules described above can be referred to the corresponding beneficial effects in the foregoing method embodiments, and will not be repeated here.
[0221] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0222] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0223] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0224] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0225] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A real-time modeling method for test cases of a power distribution smart gateway, characterized in that, include: Determine the test plan for the target power distribution smart gateway; The test plan is split into multiple split plans; For each of the splitting schemes, a target test case model is matched from the test case model library; the test case model library stores test case models of different types. Extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences; Each target test case model is simulated and verified sequentially according to the test state sequence to obtain the corresponding simulation and verification results. Based on the simulation verification results, a pre-selected test state sequence is determined. The test error amount corresponding to each pre-selected test state sequence is calculated based on the degree of interference between adjacent test case models. The pre-selected test state sequence with the smallest test error amount is selected as the target test state sequence. The test model of the target power distribution smart gateway is generated based on the target test state sequence.
2. The real-time modeling method for test cases of a power distribution smart gateway according to claim 1, characterized in that, The process of splitting the test scheme into multiple split schemes includes: Determine the test case model required for the test plan; The test plan is split according to the type of the required test case model so that the required test case models in the same initial split plan belong to the same type; The initial splitting scheme is split into multiple splitting schemes, with each test project as a unit.
3. A real-time modeling system for test cases of a power distribution smart gateway, characterized in that, include: The scheme determination module is used to determine the test scheme for the target power distribution smart gateway; The scheme splitting module is used to split the test scheme into multiple split schemes; The model acquisition module is used to match a target test case model from the test case model library for each of the splitting schemes; the test case model library stores test case models of different types. The sequence generation module is used to extract parameter information of each target test case model, assign corresponding weights to each target test case model according to the parameter information, and sort and model each target test case model according to the weights to generate multiple test state sequences. The simulation verification module is used to perform simulation verification on each of the target test case models in sequence according to the test state sequence, and obtain the corresponding simulation verification results. The modeling module is used to determine the pre-selected test state sequence based on the simulation verification results, calculate the test error corresponding to each pre-selected test state sequence based on the degree of interference between adjacent test case models, select the pre-selected test state sequence with the smallest test error as the target test state sequence, and generate the test model of the target power distribution smart gateway based on the target test state sequence.
4. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 3, characterized in that, The scheme splitting module includes: A determining unit is used to determine the test case model required for the test plan; The first splitting unit is used to split the test plan according to the type of the required test case model, so that the required test case models in the same initial splitting plan are of the same type. The second splitting unit is used to split the initial splitting scheme into multiple splitting schemes by taking the test items as the unit.
5. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 3, characterized in that, The different types of test case models include: The three-remote test model is used to test the telemetry, remote signaling and remote control performance of power distribution smart gateways; A cross-sectional data model is used to perform cross-sectional tests based on selected cross-sectional data; the cross-sectional tests include dead zone testing, zero drift testing, waveform recording steady-state error testing, and / or feeder automation testing. The time synchronization model is used for time synchronization testing of the power distribution smart gateway; The timekeeping accuracy model is used to test the timekeeping accuracy of power distribution smart gateways.
6. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 5, characterized in that, The cross-sectional data model includes: The status sequence number section is used to record and store the status sequence number of the power distribution smart gateway; The voltage channel section is used to read and store the amplitude and phase data of the voltage channel; The current channel section is used to read and store the amplitude and phase data of the current channel; The switch action unit is used to read and store the switch position and switch action strategy; The switching time section is used to read and store the switching duration; The data filtering unit is used to filter the amplitude and phase data of the voltage and current channels. The first calculation unit is used to calculate the cross-sectional test results based on the switch position, the switch action strategy, the switch duration, and the data filtered by the data filtering unit.
7. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 5, characterized in that, The timekeeping accuracy model includes: The time synchronization confirmation unit is used to confirm the time synchronization of the power distribution smart gateway. The motion generation unit is used to generate test instructions for performing timekeeping accuracy tests. The terminal recording unit is used to record the terminal event time of the power distribution smart gateway in response to the test command; The system recording unit is used to record the system event time when the power distribution smart gateway responds to the test command; An error removal unit is used to remove the error amount between the terminal event time and the system event time; The second calculation unit is used to calculate the timekeeping accuracy based on the terminal event time and system event time after removing the error amount.
8. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 7, characterized in that, The action generation unit is specifically used for: Generate at least three of the test commands; the time interval between two adjacent test commands is greater than half the operating cycle of the power distribution smart gateway; The second computing unit is specifically used for: Calculate the timing accuracy corresponding to each pair of adjacent test commands, and calculate the target accuracy and error range of the power distribution smart gateway based on the multiple timing accuracies.
9. The real-time modeling system for test cases of intelligent power distribution gateways according to claim 8, characterized in that, The second computing unit is specifically used for: Calculate the timing accuracy for each pair of adjacent test commands using the following formula: A=|BC|, B=|t2-t1|, C=|t4-t3| In the formula, A represents the timekeeping accuracy, B represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the first test command, C represents the difference between the system event time and the terminal event time of the smart distribution gateway responding to the second test command, the first test command and the second test command are adjacent test commands, t1 represents the system event time of the smart distribution gateway responding to the first test command, t2 represents the terminal event time of the smart distribution gateway responding to the first test command, t3 represents the system event time of the smart distribution gateway responding to the second test command, and t4 represents the terminal event time of the smart distribution gateway responding to the second test command.
10. The real-time modeling system for test cases of a power distribution smart gateway according to claim 8, characterized in that, The error removal unit is specifically used for: Obtain the jitter time and message byte count when the power distribution smart gateway responds to the test command; The error amount is calculated based on the jitter time and the number of bytes in the message.
11. A real-time modeling device for test cases of a power distribution smart gateway, characterized in that, include: A memory for storing instructions; wherein the instructions are used to implement the real-time modeling method for power distribution smart gateway test cases as described in claim 1 or 2; A processor for executing instructions in the memory.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the real-time modeling method for test cases of a power distribution smart gateway as described in claim 1 or 2.
Citation Information
Patent Citations
Test case execution method and apparatus
CN108268366A
Test case sorting model training method and device and test case sorting method and device
CN114461523A