Model detection method based on distributed sampling and related device
Through the distributed sampling-based model detection method, combining the true domain and the non-true domain for detection, the problem of low detection efficiency and accuracy in the prior art is solved, and more efficient and accurate model detection is achieved.
Patent Information
- Application Number
- CN202510163884.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-14
AI Technical Summary
In the prior art, when detecting logic/models, the true domain detection efficiency or accuracy is low, and the impact of non-true domain input on the model cannot be effectively handled.
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.
It improves the accuracy of model detection, can effectively handle the impact of non-true domain input on the model, reduces detection time consumption and improves the accuracy of logic.
Smart Images

Figure CN119621592A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of model testing and data processing technology, and specifically to a model detection method based on distributed sampling and related devices. Background Art
[0002] When logic / models are applied to the early design of computer systems, they provide a basis for the implementation of system software logic and hardware logic. Therefore, the correctness of the logic / model itself is very critical to the reliability and stability of the system, and it needs to be tested during the logic / model development stage. In existing solutions, when testing logic / models, true value domain testing is usually used. However, only true value domain testing will result in low efficiency or accuracy during testing. Summary of the invention
[0003] The embodiment of the present application provides a model detection method and related device based on distributed sampling, which can construct a non-true value domain input signal, and then perform detection in combination with the true value domain and the non-true value domain to obtain a detection result, thereby improving the accuracy of model detection.
[0004] A first aspect of an embodiment of the present application provides a model detection method based on distributed sampling, the method comprising: 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; A test report is generated according to the first test result and the second test result.
[0005] In a possible implementation, the step of creating a set of true value domains 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.
[0006] In a possible implementation, the step of determining p1 test case groups from the true value domain set using a basic sampling rate includes: The minimum value of the value p is determined as p1 in the method shown in the following formula: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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.
[0007] In a possible implementation, 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 partial sampling area in 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 output signal group.
[0008] In a possible implementation, the linear output result of the distribution sampling area is determined by 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 end 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.
[0009] A second aspect of an embodiment of the present application provides a model detection device based on distributed sampling, the device comprising: 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 determination unit is used to determine a non-true value range input signal group according to the p2 distribution sampling areas and the expected output signal group in the true value range 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 is used to generate a test report according to the first test result and the second test result.
[0010] In a possible implementation, the creating unit is specifically configured to: 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.
[0011] In a possible implementation manner, 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: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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.
[0012] In a possible implementation manner, the second determining unit is specifically configured to: Extract the linear output result of each partial sampling area in 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 output signal group.
[0013] In a possible implementation, the device is further used for: 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 end 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.
[0014] A third aspect of an embodiment of the present application provides a terminal, comprising a processor, an input device, an output device and a memory, wherein the processor, input device, output device and 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 step instructions in the first aspect of the embodiment of the present application.
[0015] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiments of the present application.
[0016] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
[0017] The embodiments of the present application have the following beneficial effects: A true value domain set of the model to be detected is created, and p1 test case groups are determined from the true value domain set using a basic sampling rate. The model to be detected is tested using the p1 test case group to obtain a first test result. The input domain of the model to be detected is divided into regions using an adjusted sampling rate obtained by adjusting the basic sampling rate to obtain p2 distributed sampling regions. A non-true value domain input signal group is determined based on the p2 distributed sampling regions and the expected output signal group in the true value domain set. The non-true value domain input signals in the non-true value domain input signal group are input into the model to be detected for testing to obtain a second test result. A test report is generated based on the first test result and the second test result. Therefore, a non-true value domain input signal can be constructed, and then the true value domain and the non-true value domain are combined for testing to obtain a test result, thereby improving the accuracy of model testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A relationship diagram between a sampling rate and the number of test cases is provided for an embodiment of the present application; Figure 2 A schematic diagram of the intersection of a non-true value domain result and a true value domain result is provided for an embodiment of the present application; Figure 3 A schematic diagram of a flow chart of a model detection method based on distributed sampling is provided for an embodiment of the present application; Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of a model detection device based on distributed sampling is provided for an embodiment of the present application; K is the benchmark 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 a creation unit, 402 is a first determination unit, 403 is a first detection unit, 404 is a division unit, 405 is a second determination unit, 406 is a second detection unit, and 407 is a generation unit. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0022] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0023] In order to better understand the model detection method based on distributed sampling provided by the embodiment of the present application, the following first briefly introduces the model detection method in the existing scheme. In the existing scheme, conventional logic / model detection has two methods: truth domain detection and traversal detection, as follows: (1) True value range detection The true value domain refers to the valid input set of the logic / model. The detection method provides input to the logic / model according to the valid input combination, and compares the output of the logic / model with the expected one to check whether the logic is correct. The disadvantage of this detection method is that it ignores the impact of invalid input (non-true value domain) on the logic / model. Invalid input may cause unpredictable consequences in the system.
[0024] (2) Traversal detection Traversal testing is to give all input combinations in turn to check whether the results of the logic / model output are in line with expectations. When there are many inputs to the logic / model, the number of input combinations will be very large. Assuming that the number of inputs to the logic / model is 100, 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.
[0025] Therefore, in order to solve the above-mentioned technical problems, the embodiments of the present application provide a model detection method and related devices based on distributed sampling, which can construct a non-true value domain input signal, and then combine the true value domain and the non-true value domain for detection to obtain a detection result, thereby improving the accuracy of model detection.
[0026] The present application embodiment provides a model detection method based on distributed sampling, which is as follows: 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 parallel and have no order. However, for the subsequent quantization conversion, the input signals are calibrated in advance as: [input signal 1, input signal 2, ..., input signal n], where n is the number of input signals; The input signal is calibrated as: [output signal 1, input signal 2, ..., output signal m], where m is the number of output signals.
[0027] The conversion rule for calibration quantification is: Convert each input or output signal value (0 or 1) to an n-bit or m-bit constant in the order of high bit first and low bit last. The corresponding relationship is shown in the following table (taking input n as an example).
[0028] Table 1. Conversion correspondence table of calibration quantification Calibration Signal n Signal n-1 …… Signal 2 Signal 1 Quantification bit(n) bit(n-1) …… bit(2) bit(1) value 0 / 1 0 / 1 …… 0 / 1 0 / 1 For example, convert the output calibration into a quantized value. Assuming that the number of output signals m=4, the result of the calibration output is: [output signal 1, output signal 2, output signal 3, output signal 4] = [1,0,1,0]. Fill the bits in the order of 4~1, convert the calibration output to binary 0B0101, and the corresponding quantization constant is 5.
[0029] For example, convert the quantized value into a calibrated input. Assuming that the number of input signals n=8, the quantized input value is 92, and the corresponding binary value is 0B01011100. The signals are analyzed and calibrated in the order of 1 to 8, and the input calibration value is [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].
[0030] According to the above calibration quantization rules, the quantization range of the input domain x is: ; The quantization range of the output domain is: ; Step 2: Determine the base sampling rate K, define the number of input signals of the logic / model as n, and the relationship between the number of incorrect domain test cases, the number of model inputs and the base sampling rate is: ; in (Formula 1); It can be seen from formula 1 that when the base sampling rate or When the number of test cases , 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 benchmark sampling rate k is as follows Figure 1 shown.
[0031] according to Figure 1 As shown, when the number of logic / model inputs n is determined, a benchmark sampling rate K can be determined to obtain the minimum value Pmin of the number of test cases. For example, when the number of logic / model inputs n=16, the benchmark sampling rate K=1311, and the minimum value Pmin of the number of test cases is 1361.
[0032] Step 3: Create a true value domain set, which contains all valid inputs and expected outputs of the logic / model. A set of valid inputs corresponds to a set of expected outputs.
[0033] Step 4: Starting from the beginning of the set, select one set of valid inputs and expected outputs as the current true value domain in sequence each time. If all the true value domains in the set have been detected, jump to step 15 to execute, otherwise execute step 5.
[0034] Step 5: Given valid input of the current truth domain 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 expected result, execute step 6, otherwise execute step 7.
[0035] Step 6: Record the current true value range fault, return to step 3, and select the next set of true value ranges for detection.
[0036] Step 7: According to the calibration quantification rules described in step 1, the result of the current true value domain is quantified and recorded as Y, which serves as the basis for determining the intersection of the sampling areas.
[0037] Step 8: Calculate the adjusted sampling rate K' based on the basic sampling rate K. The calculation method is to take K as the center and expand left and right according to the adjustment number N (initial 0). The formula is as follows:
[0038] Step 9: According to the adjusted sampling rate K′, the entire input domain Divide into K′ distribution sampling areas, and establish a linear relationship in each area according to the starting point (x1, y1) and the end point (x2, y2) of the area, where: ; ; ; ; A in Formula 3 and Formula 4 is a constant, indicating the sampling area, and Model in Formula 5 and Formula 6 indicates the operation process of the logic / model.
[0039] When there is a unique sampling area, the output result of the linear function intersects with the true value range result (ie: ), then execute step 11, otherwise execute step 10. Figure 2 In the example, assuming the sampling rate K′=8, there is an intersection of non-true value domain results and true value domain results in sampling area 6.
[0040] Step 10: Add 1 to the number of adjustments N. If the number of adjustments N is less than the number of input signals n of the logic / model, return to step 8 for execution.
[0041] Step 11. According to the input quantization range [x1, x2] of the starting point and 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 select only one group as the current non-true value domain quantization input in turn.
[0042] Step 12: According to the calibration quantization conversion rules described in step 1, convert the current non-true value domain quantization input into a calibration input and inject it into the logic / model, run the logic / model and collect the actual output, 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.
[0043] Step 13: Record the current non-true value range fault, return to step 3, and select the next set of true value ranges for detection.
[0044] Step 14: Determine whether the non-true value input quantization set in the current intersection area has been detected. If not, return to step 12 to execute. Otherwise, return to step 3 and select the next set of true value domains for detection.
[0045] Step 15: After all true value domains and sampled non-true value domains are tested, the true value domain faults and non-true value domain fault results are recorded to form a test report.
[0046] Therefore, in this example, it is possible to detect the true value domain for input logic / models with more true value domains while taking into account the impact of non-true value domains on the logic / model, thereby reducing the time consumption of logic detection and improving the accuracy of logic.
[0047] See also Figure 3 , Figure 3 A schematic diagram of a model detection method based on distributed sampling is provided for an embodiment of the present application. Figure 3 As shown, the method includes: 301. Create a true value domain set of the model to be tested.
[0048] The specific method of creating a true value domain set of the model to be tested includes: A1. Obtaining an input signal group and an expected output signal group of the model to be detected; A2, 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; A3. Construct a true value domain 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.
[0049] Among them, the input signal group may include input signals and expected output signals corresponding to the model to be detected. When the model is detected, it is necessary to use a test case group to test it, and the test case group includes an input signal group and an expected output signal group. When constructing the true value domain, 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, and each input signal group has a corresponding expected output signal group. The above-mentioned processing is essentially to process the input signal group and the output signal group of the model to be detected according to the standard of calibration quantification, so as to standardize and improve the efficiency of subsequent processing. The specific method for quantization processing can refer to the quantization processing method in the aforementioned steps 1 and 2, which will not be repeated here.
[0050] 302. Determine p1 test case groups from the true value domain set using a basic sampling rate.
[0051] The method of determining p1 test case groups from the true value domain set using the basic sampling rate specifically includes: The minimum value of the value p is determined as p1 in the method shown in the following formula: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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.
[0052] For details, please refer to Figure 1 As shown, for example, when the number of logic / model inputs n=16 and the benchmark sampling rate K=1311, the minimum value of the number of test cases Pmin=1361 (ie, p1=1361).
[0053] 303. Use p1 test case groups to test the model to be tested and obtain a first test result.
[0054] Specifically, for example, the standard input signal group in the test case group is input into the model to be tested for testing, and the test result is obtained, and the test result is compared with the signal in the corresponding standard expected output signal group. If they are the same, it is determined that the test is normal, and if they are different, it is determined to be a true value domain fault. The first test result includes whether there is a test normal or a true value domain fault.
[0055] 304. Use the adjusted sampling rate obtained by adjusting the basic sampling rate to perform region division on the input domain of the to-be-detected model to obtain p2 distribution sampling regions.
[0056] The basic sampling rate can be adjusted by the following formula to obtain the adjusted sampling rate: The adjusted sampling rate K' is calculated based on the basic sampling rate K. The calculation method is to take K as the center and expand left and right according to the adjustment number N (initial 0). The formula is as follows:
[0057] Where K′ is the adjusted sampling rate.
[0058] Specifically, the input domain of the model to be tested can be divided into p2 (p2 has the same value as K′) distribution sampling areas.
[0059] 305. Determine a 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.
[0060] Specifically, in a possible implementation, 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: B1, extract the linear output result of each sub-sampling area in the p2 distribution sampling areas to obtain p2 linear output result sets; B2, 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; B3. Determine the input signal group corresponding to the intersection of the target linear output result set and the expected output signal group as a non-true value domain output signal group.
[0061] Among them, the linear output result of the distribution sampling area can be determined by 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 end 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.
[0062] like Figure 2 As shown, assuming the sampling rate K′= 8, there is an intersection of non-true value range results and true value range results in sampling area 6.
[0063] 306. Input the non-true value domain input signals in the non-true value domain input signal group into the model to be detected to obtain a second detection result.
[0064] Specifically, the non-true value domain input signal is input into the model to be detected to obtain a detection result. If the detection result is the same as the corresponding true value output result, the second detection result is determined to be that there is a non-true value domain fault in the model. Otherwise, the second detection result is a normal result.
[0065] 307. Generate a test report according to the first test result and the second test result.
[0066] A general test report generation method may be used to generate a test report based on the first test result and the second test result.
[0067] In this example, a true value domain set of the model to be detected is created, and a basic sampling rate is used to determine p1 test case groups from the true value domain set. The p1 test case groups are used to test the model to be detected to obtain a first detection result. The input domain of the model to be detected is divided into regions using an adjusted sampling rate obtained by adjusting the basic sampling rate to obtain p2 distributed sampling regions. A non-true value domain input signal group is determined based on the p2 distributed sampling regions and the expected output signal group in the true value domain set. The non-true value domain input signals in the non-true value domain input signal group are input into the model to be detected for detection to obtain a second detection result. A detection report is generated based on the first detection result and the second detection result. Therefore, a non-true value domain input signal can be constructed, and then the true value domain and the non-true value domain are combined for detection to obtain a detection result, thereby improving the accuracy of model detection.
[0068] For the above embodiments, please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application, such as Figure 4 As shown, it includes a processor, an input device, an output device and a memory, which are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, the processor is configured to call the program instructions, and the program includes instructions for executing the following steps; 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; A test report is generated according to the first test result and the second test result.
[0069] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that in order to realize the above functions, the terminal includes a hardware structure and / or software module corresponding to the execution of 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 function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0070] The embodiment of the present application can divide the terminal into functional units according to the above method example. For example, each functional unit can be divided according 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 software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0071] In line with the above, see Figure 5 , Figure 5 The present invention provides a schematic diagram of a model detection device based on distributed sampling. Figure 5 As shown, the device comprises: A creation unit 401 is used to create a true value domain set of a model to be detected; A first determining unit 402 is used to determine p1 test case groups from the true value domain set using a basic sampling rate; The first detection unit 403 is used to detect the model to be detected by using p1 test case groups to obtain a first detection result; A division unit 404 is 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 405 is used to determine a 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; A second detection unit 406, configured to input the non-true value range input signal in the non-true value range input signal group into the to-be-detected model for detection, and obtain a second detection result; The generating unit 407 is configured to generate a detection report according to the first detection result and the second detection result.
[0072] In a possible implementation, the creating unit 401 is specifically configured to: 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.
[0073] In a possible implementation, the first determining unit 402 is specifically configured to: The minimum value of the value p is determined as p1 in the method shown in the following formula: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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.
[0074] In a possible implementation, the second determining unit 405 is specifically configured to: Extract the linear output result of each partial sampling area in 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 output signal group.
[0075] In a possible implementation, the device is further used for: 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 end 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.
[0076] An 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 part or all of the steps of any one of the model detection methods based on distributed sampling recorded in the above method embodiments.
[0077] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute part or all of the steps of any one of the model detection methods based on distributed sampling recorded in the above method embodiments.
[0078] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0079] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0080] In the 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 only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0082] In addition, the functional units in the various embodiments of the application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.
[0083] If the 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 this understanding, the technical solution of the present application, 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, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk, etc., and other media that can store program codes.
[0084] A person 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 related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.
[0085] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on 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; A test report is generated according to the first test result and the second test result.
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: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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 any one of claims 1 to 3, characterized in that: 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 partial sampling area in 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 output signal group.
5. The model detection method based on distributed sampling according to claim 4 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 end 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.
6. 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 determination unit is used to determine a non-true value range input signal group according to the p2 distribution sampling areas and the expected output signal group in the true value range 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 is used to generate a test report according to the first test result and the second test result.
7. The model detection device based on distributed sampling according to claim 6, 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.
8. The model detection device based on distributed sampling according to claim 7, 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: ;in ; Where p is the value of the test case group, is the basic sampling rate, is the number of input signals in the input signal group of the model to be detected; 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.
9. 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 5.
10. 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 5.
Citation Information
Patent Citations
Detection method for distributed statistic model based on abstraction and learning
CN107391805A
Method and device for determining detection accuracy of target detection model
CN112712119A
Adversarial sample generation method and device, storage medium and electronic equipment
CN113537267A
Detection method and device, storage medium, equipment and program product
CN115130537A
Model testing method and device
CN118467389A