Model Detection Method Based on Distributed Sampling and Related Devices
By adopting distributed sampling methods in model detection, non-true domain input signals are constructed and combined with true domains for detection, the problem of low detection efficiency and accuracy in the prior art is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202510163884.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-02-14
AI Technical Summary
The prior art is less efficient or accurate in logic/model detection, especially since relying solely on truth domain detection and ignoring the impact of non-true domain input on the model.
A model detection method based on distributed sampling is adopted, by creating a true domain set and distributed sampling area, a non-true domain input signal is constructed, and a detection report is generated to improve detection accuracy by combining the true domain and the non-true domain.
By combining the detection methods of the true domain and the non-true domain, the accuracy of model detection is significantly improved, and the problem of low detection efficiency and accuracy in the prior art is solved.
Smart Images

Figure CN119621592B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of model testing and data processing, and particularly to a model detection method and related device based on distributed sampling. Background Art
[0002] When a logic / model is applied to the preliminary design of a computer system, it provides a basis for the implementation of system software logic and hardware logic. Therefore, the correctness of the logic / model itself is crucial for the reliability and stability of the system, and it needs to be detected during the development stage of the logic / model. In existing solutions, when detecting a logic / model, the true value range detection method is usually used for detection. However, only using the true value range detection method will result in low efficiency or accuracy during detection. Summary of the Invention
[0003] An embodiment of this application provides a model detection method and related device based on distributed sampling, which can construct non-true value range input signals, and then combine the true value range and non-true value range for detection to obtain a detection result, improving the accuracy during model detection.
[0004] In a first aspect of an embodiment of this application, a model detection method based on distributed sampling is provided. The method includes:
[0005] Create a true value range set of the model to be detected;
[0006] Determine p1 test case groups from the true value range set at a basic sampling rate;
[0007] Detect the model to be detected with the p1 test case groups to obtain a first detection result;
[0008] Divide the input domain of the model to be detected into p2 distributed sampling regions at an adjusted sampling rate obtained by adjusting the basic sampling rate;
[0009] Determine a non-true value range input signal group according to the p2 distributed sampling regions and the expected output signal group in the true value range set;
[0010] Input the non-true value range input signals in the non-true value range input signal group into the model to be detected for detection to obtain a second detection result;
[0011] Generate a detection report according to the first detection result and the second detection result.
[0012] In a possible implementation, the creating of the true value range set of the model to be detected includes:
[0013] Obtain the input signal group and the expected output signal group of the model to be detected;
[0014] Calibrate and quantize the input signal group to obtain a standard input signal group, and calibrate and quantize the expected output signal group to obtain a standard expected output signal group;
[0015] Construct a true value range based on the standard input signal group and the standard expected output signal group to obtain the true value range set of the model to be detected.
[0016] In a possible implementation, determining p1 test case groups from the true value range set at the basic sampling rate includes:
[0017] Determine the minimum value of p as p1 in the method shown in the following formula:
[0018] ;
[0019] where p is the value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be detected;
[0020] Randomly select p1 standard input signals and p1 standard expected output signals from the true value range set to construct p1 test case groups.
[0021] In a possible implementation, determining the non-true value range input signal group according to p2 distribution sampling regions and the expected output signal group in the true value range set includes:
[0022] Extract the linear output results of each distribution sampling region in the p2 distribution sampling regions to obtain p2 linear output result sets;
[0023] Extract the target linear output result set from the p2 linear output result sets, where the linear output results in the target linear output result set have an intersection with the expected output signal group;
[0024] Determine the input signal group corresponding to the intersection of the target linear output result set and the expected output signal group as the non-true value range output signal group.
[0025] In a possible implementation, the linear output result of the distribution sampling region is determined by the method shown in the following formula:
[0026] ;
[0027] ;
[0028] ;
[0029] ;
[0030] Among them, x1 is the abscissa of the starting point of the distributed sampling area, x2 is the abscissa of the ending point of the distributed sampling area, y1 is the ordinate of the starting point of the distributed sampling area, y2 is the ordinate of the ending point of the distributed sampling area, A is the identifier of the distributed sampling area, Model represents the operation process of the model to be detected, and K′ is the adjusted sampling rate.
[0031] The second aspect of the embodiments of the present application provides a model detection device based on distributed sampling. The device includes:
[0032] A creation unit, configured to create a true value range set of the model to be detected;
[0033] A first determination unit, configured to determine p1 test case groups from the true value range set at a basic sampling rate;
[0034] A first detection unit, configured to detect the model to be detected using the p1 test case groups to obtain a first detection result;
[0035] A partitioning unit, configured to partition the input domain of the model to be detected at an adjusted sampling rate obtained by adjusting the basic sampling rate to obtain p2 distributed sampling areas;
[0036] A second determination unit, configured to determine a non-true value range input signal group according to the p2 distributed sampling areas and the expected output signal group in the true value range set;
[0037] A second detection unit, configured to input the non-true value range input signals in the non-true value range input signal group into the model to be detected for detection to obtain a second detection result;
[0038] A generation unit, configured to generate a detection report according to the first detection result and the second detection result.
[0039] In a possible implementation manner, the creation unit is specifically configured to:
[0040] Obtain the input signal group and the expected output signal group of the model to be detected;
[0041] Perform calibration quantization processing on the input signal group to obtain a standard input signal group, and perform calibration quantization processing on the expected output signal group to obtain a standard expected output signal group;
[0042] Construct a true value range according to the standard input signal group and the standard expected output signal group to obtain the true value range set of the model to be detected.
[0043] In a possible implementation manner, the first determination unit is specifically configured to:
[0044] Determine the minimum value of the numerical value p as p1 in the method shown in the following formula:
[0045] ;
[0046] where p is the numerical value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be detected;
[0047] Randomly select p1 standard input signals and p1 standard expected output signals from the true value range set to construct a test case group, and obtain p1 test case groups.
[0048] In a possible implementation manner, the second determination unit is specifically configured to:
[0049] Extract the linear output results of each distribution sampling region in p2 distribution sampling regions to obtain p2 linear output result sets;
[0050] Extract the target linear output result set from the p2 linear output result sets, and there is an intersection between the linear output results in the target linear output result set and the expected output signal group;
[0051] Determine the input signal group corresponding to the intersection of the target linear output result set and the expected output signal group as the non-true value range output signal group.
[0052] In a possible implementation manner, the device is further configured to:
[0053] Determine the linear output result of the distribution sampling region by using the method shown in the following formula:
[0054] ;
[0055] ;
[0056] ;
[0057] ;
[0058] where x1 is the abscissa of the starting point of the distribution sampling region, x2 is the abscissa of the ending point of the distribution sampling region, y1 is the ordinate of the starting point of the distribution sampling region, y2 is the ordinate of the ending point of the distribution sampling region, A is the identifier of the distributed sampling region, Model represents the operation process of the model to be detected, and K′ is the adjusted sampling rate.
[0059] The third aspect of the embodiments of the present application provides a terminal, including a processor, an input device, an output device, and a memory. The processor, the input device, the output device, and the memory are interconnected. Among them, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the step instructions as in the first aspect of the embodiments of the present application.
[0060] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium. Among them, the computer-readable storage medium stores a computer program for electronic data exchange. Among them, the computer program enables a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application.
[0061] The fifth aspect of the embodiments of the present application provides a computer program product. Among them, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application. This computer program product can be a software installation package.
[0062] The embodiments of the present application have the following beneficial effects:
[0063] By creating a true value range set of the model to be detected, p1 test case groups are determined from the true value range set at the basic sampling rate, the model to be detected is detected using the p1 test case groups to obtain a first detection result, the input domain of the model to be detected is divided into p2 distributed sampling regions using the adjusted sampling rate obtained by adjusting the basic sampling rate, a non-true value range input signal group is determined according to the p2 distributed sampling regions and the expected output signal group in the true value range set, the non-true value range input signals in the non-true value range input signal group are input into the model to be detected for detection to obtain a second detection result, and a detection report is generated according to the first detection result and the second detection result. Therefore, non-true value range input signals can be constructed, and then detection is performed by combining the true value range and the non-true value range to obtain a detection result, improving the accuracy during model detection. Description of the Drawings
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0065] Figure 1This application provides a relationship diagram between the sampling rate and the number of test cases in an embodiment of the present application;
[0066] Figure 2 This application provides a schematic diagram of the intersection of the non - true value range result and the true value range result in an embodiment of the present application;
[0067] Figure 3 This application provides a schematic flowchart of a model detection method based on distributed sampling in an embodiment of the present application;
[0068] Figure 4 This application provides a schematic structural diagram of a terminal in an embodiment of the present application;
[0069] Figure 5 This application provides a schematic structural diagram of a model detection device based on distributed sampling in an embodiment of the present application;
[0070] K is the reference sampling rate, Pmin is the minimum value of the number of test cases, k is the sampling frequency, p is the number of test cases, 401 is the creation unit, 402 is the first determination unit, 403 is the first detection unit, 404 is the division unit, 405 is the second determination unit, 406 is the second detection unit, and 407 is the generation unit. Detailed implementation manners
[0071] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0072] The terms "first", "second", etc. in the specification and claims of the present application and the above - mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non - exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products, or devices.
[0073] Referring to "embodiment" in the present application means that a specific feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described in the present application may be combined with other embodiments.
[0074] To better understand a model detection method based on distributed sampling provided by an embodiment of the present application, the model detection method in the existing solution will be briefly introduced below. In the existing solution, there are two ways of conventional logic / model detection: true value range detection and traversal detection, which are specifically as follows:
[0075] (1) True value range detection
[0076] The true value range refers to the set of valid input for the logic / model. The detection method provides inputs to the logic / model according to the valid input combinations, and checks whether the output result of the logic / model is compared with the expected one to check whether the logic is correct. The disadvantage of this detection method is that it ignores the influence of invalid inputs (non-true value range) on the logic / model, and invalid inputs may cause unpredictable consequences to the system.
[0077] (2) Traversal detection
[0078] Traversal detection sequentially gives all input combinations and checks whether the output results of the logic / model meet the expectations. When the number of inputs of the logic / model is large, the number of input combinations will be extremely large. Assuming the number of inputs of the logic / model is 100, then the number of input combinations is approximately 2 to the power of 100. With the current computing power of computers, it is impossible to execute such a large test set within a limited time, resulting in low efficiency during testing.
[0079] Therefore, aiming to solve the above technical problems, an embodiment of the present application provides a model detection method and related device based on distributed sampling, which can construct non-true value range input signals, and then combine the true value range and non-true value range for detection to obtain the detection result, improving the accuracy during model detection.
[0080] An embodiment of the present application provides a model detection method based on distributed sampling, which is specifically as follows:
[0081] Step 1: Calibrate the order of the input and output signals of the logic / model. The input and output signals of the logic / model are all parallel and have no sequence. However, for subsequent quantization conversion, the input signals are pre-calibrated as: [input signal 1, input signal 2,..., input signal n], where n is the number of input signals;
[0082] The input signals are calibrated as: [output signal 1, input signal 2,..., output signal m], where m is the number of output signals.
[0083] The conversion rules for calibration quantization are as follows:
[0084] For each value (0 or 1) of the input or output signal, corresponding one by one to the bit positions of the quantization value in the order of high bit first and low bit second, it is converted into a constant of n bits or m bits. The corresponding relationship is shown in the following table (taking input n as an example).
[0085] Table 1 Conversion Correspondence Table for Calibration Quantization
[0086] Calibration Signal n Signal n-1 …… Signal 2 Signal 1 Quantization bit(n) bit(n-1) …… bit(2) bit(1) Value 0 / 1 0 / 1 …… 0 / 1 0 / 1
[0087] For example, when converting the output calibration to the quantization value, assuming the number of output signals m = 4, and assuming the calibration output result is: [Output Signal 1, Output Signal 2, Output Signal 3, Output Signal 4] = [1, 0, 1, 0]. Fill the bit positions in the order of 4 to 1 successively, convert the calibration output to binary 0B0101, and the corresponding quantization constant is 5.
[0088] For example, when converting the quantization value to the calibration input, assuming the number of input signals n = 8, the quantization input value is 92, and the corresponding binary is 0B01011100. Analyze the signal calibration in the order of 1 to 8 successively, and the input calibration value is obtained as [Input Signal 1, Input Signal 2, Input Signal 3, Input Signal 4, Input Signal 5, Input Signal 6, Input Signal 7, Input Signal 8] = [0, 0, 1, 1, 1, 0, 1, 0].[[]END]]
[0089] According to the above calibration quantization rules, the quantization range of the input domain x is:
[0090] ;
[0091] The quantization range of the output domain is:
[0092] ;
[0093] Step 2: Determine the reference sampling rate K. Define the number of input signals of the logic / model as n. The relationship between the number of non-correct domain test cases and the number of model inputs and the reference sampling rate is:
[0094] (Formula 1);
[0095] It can be seen from Formula 1 that when the reference sampling rate
[0096] or
[0097] , the number of test cases
[0098] , which is equivalent to a full traversal of the logic / model input. According to Formula 1, the relationship curve between the number of test cases p and the reference sampling rate K is as Figure 1as shown
[0099] Step 3: Create a set of true value ranges, which includes all valid inputs and expected outputs of the logic / model. One set of valid inputs corresponds to one set of expected outputs.
[0100] Step 4: Starting from the beginning of the set, select and only select one set of valid inputs and expected outputs as the current true value range each time. If all true value ranges in the set have been detected, jump to Step 15 to execute; otherwise, execute Step 5.
[0101] Step 5: Given the valid inputs of the current true value range of the logic / model, run the logic / model and collect the actual output. Compare the actual output result with the expected output result. If the result is inconsistent with the expectation, execute Step 6; otherwise, execute Step 7.
[0102] Step 6: Record the fault of the current true value range, return to Step 3, and select the next set of true value ranges for detection.
[0103] Step 7: According to the calibration quantization rule described in Step 1, quantify the result of the current true value range and record it as Y, which is used as the basis for determining the intersection of the sampling regions.
[0104] Step 8: Calculate the adjusted sampling rate K′ according to the basic sampling rate K. The calculation method is to expand left and right based on K as the center according to the number of adjustments N (initially 0). The formula is as follows:
[0105]
[0106] Step 9: According to the adjusted sampling rate K′, divide the entire input domain
[0107] into K′ distributed sampling regions, and establish a linear relationship within each region according to the starting point (x1, y1) and the ending point (x2, y2) of the region, where:
[0108] ;
[0109] ;
[0110] ;
[0111] ;
[0112] In Formulas 3 and 4, A is a constant representing which sampling region. In Formulas 5 and 6, Model represents the operation process of the logic / model, and K′ is the adjusted sampling rate.
[0113] When there is an intersection between the output result of the linear function of the unique sampling region and the result of the true value range (i.e.,
[0114] When it is), step 11 is executed; otherwise, step 10 is executed. For example Figure 2 In the example of, it is assumed that the adjusted sampling rate K' = 8, and there is an intersection between the non-true value range result and the true value range result in the sampling area 6.
[0115] Step 10: Increment the adjustment count N by 1. If the adjustment count N is less than the number n of input signals of the logic / model, return to step 8 for execution.
[0116] Step 11: According to the input quantization range [x1, x2] of the start point and the end point of the intersection area, obtain the non-true value input quantization set [x1, x1 + 1, x1 + 2,..., x2 - 1, x2] of the intersection area, and sequentially select only one group at a time as the current non-true value range quantization input.
[0117] Step 12: According to the calibration quantization conversion rule described in step 1, convert the current non-true value range quantization input into a calibration input and inject it into the logic / model. Run the logic / model and collect the actual output, and compare the actual output result with the current true value output result. If the results are the same, execute step 13; otherwise, execute step 14.
[0118] Step 13: Record the current non-true value range fault, return to step 3, and select the next group of true value ranges for detection.
[0119] Step 14: Determine whether the detection of the non-true value input quantization set of the current intersection area is completed. If not, return to step 12 for execution; otherwise, return to step 3 and select the next group of true value ranges for detection.
[0120] Step 15: After all true value ranges and sampling non-true value ranges are detected, form a detection report with the recorded true value range faults and non-true value range fault results.
[0121] Therefore, in this example, for a logic / model with a large number of inputs, while detecting the true value range, it can take into account the influence of the non-true value range on the logic / model, reduce the time consumption of logic detection, and improve the accuracy of the logic.
[0122] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a model detection method based on distributed sampling provided by an embodiment of the present application. As Figure 3 shown, the method includes:
[0123] 301. Create a true value range set of the model to be detected.
[0124] Among them, the method for specifically creating the true value range set of the model to be detected includes:
[0125] A1. Obtain the input signal group and the expected output signal group of the model to be detected;
[0126] A2. Perform calibration quantization processing on the input signal group to obtain a standard input signal group, and perform calibration quantization processing on the expected output signal group to obtain a standard expected output signal group;
[0127] A3. Construct a true value range according to the standard input signal group and the standard expected output signal group to obtain the true value range set of the model to be detected.
[0128] Among them, the input signal group may include the input signal and the expected output signal corresponding to the model to be detected. When the model is being detected, a test case group needs to be used to test it. The test case group includes an input signal group and an expected output signal group. When constructing the true value range, all valid input signals of the model to be detected can be used as elements in the signal input group, and the corresponding expected input signals can be used as elements in the expected output signal group. Each input signal group has a corresponding expected output signal group. The essence of the above processing is to process the input signal group and the output signal group of the model to be detected according to the calibration quantization standard to standardize and improve the efficiency of subsequent processing. The specific method for quantization processing can refer to the quantization processing methods in the aforementioned steps 1 and 2, which will not be elaborated here.
[0129] 302. Determine p1 test case groups from the true value range set at the basic sampling rate.
[0130] Among them, the specific method for determining p1 test case groups from the true value range set at the basic sampling rate includes:
[0131] Determine the minimum value of the numerical value p as p1 in the method shown in the following formula:
[0132] ;
[0133] Among them, p is the numerical value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be detected;
[0134] Randomly select p1 standard input signals and p1 standard expected output signals from the true value range set to construct test case groups, and obtain p1 test case groups.
[0135] Specifically, it can refer to Figure 1 As shown, for example, when the number of logical / model inputs n = 16 and the reference sampling rate K = 1311, the minimum value of the number of test cases Pmin = 1361 (i.e., p1 = 1361).
[0136] 303. Use p1 test case groups to detect the model to be detected, and obtain the first detection result.
[0137] Specifically, for example, input the standard input signal group in the test case group into the model to be detected for detection, obtain the detection result, and compare the detection result with the signals in the corresponding standard expected output signal group. If they are the same, it is determined that the test is normal. If they are different, it is determined as a true value range fault. The first detection result includes that the test is normal or a true value range fault.
[0138] 304. Use the adjusted sampling rate obtained by adjusting the basic sampling rate to divide the input domain of the model to be detected, and obtain p2 distributed sampling regions.
[0139] Among them, the basic sampling rate can be adjusted by the method shown in the following formula to obtain the adjusted sampling rate:
[0140] Calculate the adjusted sampling rate K′ according to the basic sampling rate K. The calculation method is to expand left and right centered on K according to the adjustment times N (initially 0). The formula is as follows:
[0141]
[0142] Among them, K′ is the adjusted sampling rate.
[0143] Specifically, the input domain of the model to be detected can be divided into p2 (p2 is the same as the value of K′) distributed sampling regions.
[0144] 305. Determine the non-true value range input signal group according to the p2 distributed sampling regions and the expected output signal group in the true value range set.
[0145] Specifically, in a possible implementation manner, the determining the non-true value range input signal group according to the p2 distributed sampling regions and the expected output signal group in the true value range set includes:
[0146] B1. Extract the linear output results of each distributed sampling region in the p2 distributed sampling regions to obtain p2 linear output result sets;
[0147] B2. Extract the target linear output result set from the p2 linear output result sets. The linear output results in the target linear output result set have an intersection with the expected output signal group;
[0148] B3. Determine the input signal group corresponding to the intersection of the target linear output result set and the expected output signal group as the non-true value range output signal group.
[0149] Among them, the linear output result of the distribution sampling area can be determined by the method shown in the following formula:
[0150] ;
[0151] ;
[0152] ;
[0153] ;
[0154] Among them, x1 is the abscissa of the starting point of the distribution sampling area, x2 is the abscissa of the ending point of the distribution sampling area, y1 is the ordinate of the ending point of the distribution sampling area, y2 is the ordinate of the ending point of the distribution sampling area, A is the identifier of the distributed sampling area, Model represents the operation process of the model to be detected, and K′ is the adjusted sampling rate.
[0155] As Figure 2 shown, assuming that the adjusted sampling rate K′ = 8, there is an intersection between the non-genuine value range result and the genuine value range result in the sampling area 6.
[0156] 306. Input the non-genuine value range input signal in the non-genuine value range input signal group into the model to be detected for detection, and obtain a second detection result.
[0157] Specifically, input the non-genuine value range input signal into the model to be detected for detection to obtain a detection result. If the detection result is the same as the corresponding true value output result, it is determined that the second detection result is that the model has a non-genuine value range fault; otherwise, the second detection result is a normal result.
[0158] 307. Generate a detection report according to the first detection result and the second detection result.
[0159] A general detection report generation method can be used to generate a detection report based on the first detection result and the second detection result.
[0160] In this example, by creating a set of true value ranges for the model to be detected, p1 test case groups are determined from the set of true value ranges at the basic sampling rate. The p1 test case groups are used to detect the model to be detected, and a first detection result is obtained. The input domain of the model to be detected is divided into p2 distributed sampling regions by using the adjusted sampling rate obtained by adjusting the basic sampling rate. A non-true value range input signal group is determined according to the p2 distributed sampling regions and the expected output signal group in the set of true value ranges. The non-true value range input signals in the non-true value range input signal group are input into the model to be detected for detection, and a second detection result is obtained. A detection report is generated according to the first detection result and the second detection result. Therefore, non-true value range input signals can be constructed, and then detection is performed by combining the true value range and the non-true value range to obtain a detection result, improving the accuracy during model detection.
[0161] Consistent with the above embodiments, please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a terminal provided by an embodiment of the present application. As Figure 4 shown, it includes a processor, an input device, an output device, and a memory. The processor, the input device, the output device, and the memory are interconnected. Among them, the memory is used to store a computer program, and the computer program includes program instructions. The processor is configured to call the program instructions, and the above program includes instructions for performing the following steps;
[0162] Create a set of true value ranges for the model to be detected;
[0163] Determine p1 test case groups from the set of true value ranges at the basic sampling rate;
[0164] Use the p1 test case groups to detect the model to be detected and obtain a first detection result;
[0165] Divide the input domain of the model to be detected into p2 distributed sampling regions by using the adjusted sampling rate obtained by adjusting the basic sampling rate;
[0166] Determine a non-true value range input signal group according to the p2 distributed sampling regions and the expected output signal group in the set of true value ranges;
[0167] Input the non-true value range input signals in the non-true value range input signal group into the model to be detected for detection and obtain a second detection result;
[0168] Generate a detection report according to the first detection result and the second detection result.
[0169] The above mainly introduces the solutions of the embodiments of the present application from the perspective of the execution process on the method side. It can be understood that in order for the terminal to implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0170] Embodiments of the present application can divide the functions of the terminal according to the above method examples. For example, each function unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function unit. It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0171] Consistent with the above, please refer to Figure 5 , Figure 5 which is a schematic structural diagram of a model detection device based on distributed sampling provided by an embodiment of the present application. As Figure 5 shown, the device includes:
[0172] A creation unit 401, configured to create a true value range set of the model to be detected;
[0173] A first determination unit 402, configured to determine p1 test case groups from the true value range set at a basic sampling rate;
[0174] A first detection unit 403, configured to detect the model to be detected with the p1 test case groups to obtain a first detection result;
[0175] A division unit 404, configured to divide the input domain of the model to be detected into p2 distributed sampling regions by using an adjusted sampling rate obtained by adjusting the basic sampling rate;
[0176] A second determination unit 405, configured to determine a non-true value range input signal group according to the p2 distributed sampling regions and the expected output signal group in the true value range set;
[0177] A second detection unit 406, configured to input the non-true value range input signals in the non-true value range input signal group into the model to be detected for detection to obtain a second detection result;
[0178] A generating unit 407, configured to generate a detection report according to the first detection result and the second detection result.
[0179] In a possible implementation manner, the creating unit 401 is specifically configured to:
[0180] Obtain the input signal group and the expected output signal group of the model to be detected;
[0181] Perform calibration quantization processing on the input signal group to obtain a standard input signal group, and perform calibration quantization processing on the expected output signal group to obtain a standard expected output signal group;
[0182] Construct a true value range according to the standard input signal group and the standard expected output signal group to obtain the true value range set of the model to be detected.
[0183] In a possible implementation manner, the first determining unit 402 is specifically configured to:
[0184] Determine the minimum value of the numerical value p as p1 in the method shown in the following formula:
[0185] ;
[0186] where p is the numerical value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be detected;
[0187] Randomly select p1 standard input signals and p1 standard expected output signals from the true value range set to construct a test case group, and obtain p1 test case groups.
[0188] In a possible implementation manner, the second determining unit 405 is specifically configured to:
[0189] Extract the linear output results of each distribution sampling area in p2 distribution sampling areas to obtain p2 linear output result sets;
[0190] Extract a target linear output result set from the p2 linear output result sets, where the linear output results in the target linear output result set have an intersection with the expected output signal group;
[0191] Determine the input signal group corresponding to the intersection of the target linear output result set and the expected output signal group as the non-true value range output signal group.
[0192] In a possible implementation manner, the device is further configured to:
[0193] Determine the linear output result of the distribution sampling area by using the method shown in the following formula:
[0194] ;
[0195] ;
[0196] ;
[0197] ;
[0198] Wherein, x1 is the abscissa of the starting point of the distributed sampling area, x2 is the abscissa of the ending point of the distributed sampling area, y1 is the ordinate of the ending point of the distributed sampling area, y2 is the ordinate of the ending point of the distributed sampling area, A is the identifier of the distributed sampling area, Model represents the operation process of the model to be detected, and K' is the adjusted sampling rate.
[0199] The embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps of any one of the model detection methods based on distributed sampling described in the above method embodiments.
[0200] The embodiment of the present application also provides a computer program product, and the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute some or all of the steps of any one of the model detection methods based on distributed sampling described in the above method embodiments.
[0201] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0202] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0203] In several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0204] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0205] In addition, each functional unit in the various embodiments of the application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software program module.
[0206] If the above-mentioned integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of the present application, 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. The computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned memory includes: USB flash drives, read-only memory (ROM), random access memory (RAM), mobile hard disks, magnetic disks, or optical discs and other media that can store program codes.
[0207] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memories, random access memories, magnetic disks, or optical discs, etc.
[0208] The above has introduced the embodiments of the present application in detail. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A model detection method based on distributed sampling, characterized in that: The method comprises: Create a set of true value domains for the model to be tested; Determine p1 test case groups from the true value domain set using a basic sampling rate; Use p1 test case groups to test the model to be tested and obtain the first test result; Using the adjusted sampling rate obtained by adjusting the basic sampling rate to divide the input domain of the to-be-detected model into regions, to obtain p2 distribution sampling regions; Determine a non-true value domain input signal group according to the p2 distribution sampling regions and the expected output signal group in the true value domain set; Inputting the non-true value domain input signal in the non-true value domain input signal group into the to-be-detected model for detection, and obtaining a second detection result; Generate a test report according to the first test result and the second test result; The step of determining the non-true value range input signal group according to the p2 distribution sampling regions and the expected output signal group in the true value range set includes: Extract the linear output result of each of the p2 distribution sampling areas to obtain p2 linear output result sets; Extracting a target linear output result set from the p2 linear output result sets, wherein the linear output results in the target linear output result set have an intersection with the expected output signal group; The input signal group corresponding to the intersection of the target linear output result set and the expected output signal group is determined as a non-true value domain input signal group.
2. The model detection method based on distributed sampling according to claim 1 is characterized in that: The step of creating a true value domain set of the model to be tested includes: Obtaining an input signal group and an expected output signal group of the model to be detected; Performing calibration and quantitative processing on the input signal group to obtain a standard input signal group, and performing calibration and quantitative processing on the expected output signal group to obtain a standard expected output signal group; A true value domain is constructed according to the standard input signal group and the standard expected output signal group to obtain a true value domain set of the model to be detected.
3. The model detection method based on distributed sampling according to claim 2 is characterized in that: The step of using the basic sampling rate to determine p1 test case groups from the true value domain set includes: The minimum value of the value p is determined as p1 in the method shown in the following formula: ; Wherein, p is the value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be tested; P1 standard input signals and p1 standard expected output signals are randomly selected from the true value domain set to construct a test case group, thereby obtaining p1 test case groups.
4. The model detection method based on distributed sampling according to claim 1 is characterized in that: The linear output result of the distribution sampling area is determined using the method shown in the following formula: ; ; ; ; Among them, x1 is the horizontal coordinate of the starting point of the distributed sampling area, x2 is the horizontal coordinate of the end point of the distributed sampling area, y1 is the vertical coordinate of the starting point of the distributed sampling area, y2 is the vertical coordinate of the end point of the distributed sampling area, A is the identifier of the distributed sampling area, Model represents the calculation process of the model to be detected, and K′ is the adjusted sampling rate.
5. A model detection device based on distributed sampling, characterized in that: The device comprises: A creation unit, used to create a set of true value domains of the model to be tested; A first determining unit, configured to determine p1 test case groups from the true value domain set using a basic sampling rate; A first detection unit is used to use p1 test case groups to detect the model to be detected, and obtain a first detection result; A division unit, used to divide the input domain of the to-be-detected model into regions using the adjusted sampling rate obtained by adjusting the basic sampling rate, to obtain p2 distribution sampling regions; A second determining unit, configured to determine a non-true value domain input signal group according to the p2 distribution sampling regions and the expected output signal group in the true value domain set; A second detection unit, used for inputting the non-true value domain input signal in the non-true value domain input signal group into the model to be detected to obtain a second detection result; A generating unit, configured to generate a test report according to the first test result and the second test result; The second determining unit is specifically configured to: Extract the linear output result of each of the p2 distribution sampling areas to obtain p2 linear output result sets; Extracting a target linear output result set from the p2 linear output result sets, wherein the linear output results in the target linear output result set have an intersection with the expected output signal group; The input signal group corresponding to the intersection of the target linear output result set and the expected output signal group is determined as a non-true value domain input signal group.
6. The model detection device based on distributed sampling according to claim 5, characterized in that: The creation unit is specifically used for: Obtaining an input signal group and an expected output signal group of the model to be detected; Performing calibration and quantitative processing on the input signal group to obtain a standard input signal group, and performing calibration and quantitative processing on the expected output signal group to obtain a standard expected output signal group; A true value domain is constructed according to the standard input signal group and the standard expected output signal group to obtain a true value domain set of the model to be detected.
7. The model detection device based on distributed sampling according to claim 6, characterized in that: The first determining unit is specifically configured to: The minimum value of the value p is determined as p1 in the method shown in the following formula: ; Wherein, p is the value of the test case group, K is the basic sampling rate, and n is the number of input signals in the input signal group of the model to be tested; P1 standard input signals and p1 standard expected output signals are randomly selected from the true value domain set to construct a test case group, thereby obtaining p1 test case groups.
8. A terminal, characterized in that: The invention comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the model detection method based on distributed sampling as described in any one of claims 1 to 4.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the model detection method based on distributed sampling according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for determining detection accuracy of target detection model
CN112712119A
Method and system for detecting web service
JP2010218538A