Dynamic generation method of mainboard test item test plan based on 0-1 backpack

Through the 0-1 backpack model and the improved reptile search algorithm, the mainboard test item test plan is dynamically generated, which solves the problem that the test plan cannot be flexibly adjusted in the existing technology, improves the defect detection coverage and efficiency, and reduces the cost.

CN118567923APending Publication Date: 2024-08-30UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410685000.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing motherboard functional testing methods cannot quickly and flexibly adjust the test plan according to the actual situation, resulting in defective samples being missed and increasing testing costs and rework costs.

Method used

Adopt a dynamic generation method of test plan based on 0-1 backpack, combine expert experience and historical test data, generate test plan through improved reptile search algorithm, optimize test proportion and time allocation, reduce test cost and improve efficiency.

Benefits of technology

It is possible to dynamically adjust the test proportion based on the defective rate of different test items and expert scores, improve defect detection coverage, reduce test time and labor costs, and improve corporate efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567923A
    Figure CN118567923A
Patent Text Reader

Abstract

The invention relates to the technical field of PCB mainboard function test, and discloses a dynamic generation method of a mainboard test item test plan based on a 0-1 backpack. Relevant information of the mainboard is obtained; the test plan decision problem is to test a test item which is most likely to generate defects within limited test time; carrying out 0-1 backpack modeling on the test plan decision problem; the reptile search algorithm is improved, the 0-1 knapsack problem is solved through the obtained improved reptile search algorithm, a solution of the 0-1 knapsack problem is obtained, and a mainboard test item test plan is obtained; the improvement on the reptile search algorithm comprises the following steps of: initializing a population of the reptile search algorithm by using a Faure sequence; and after the population uses the updating strategy, the capability of jumping out of the local optimal solution of the population is improved by utilizing sine and cosine optimization operation. According to the method, the test item test plan can be dynamically and flexibly adjusted in real time, and quick response to emergency situations can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PCB mainboard function testing, and in particular to a method for dynamically generating a mainboard test item test plan based on a 0-1 backpack. Background Art

[0002] In the PCB motherboard production process, motherboard function testing plays a vital role as the last link of the motherboard production line. The next link is often to install the motherboard on the whole machine. If the motherboard cannot be ensured to be functional before installation, it will cause the product to be returned for repair due to abnormal functions after installation, which will generate a lot of rework costs, including delays in product delivery speed, logistics and warehousing costs, etc. Take a certain electronics manufacturer as an example. The economic losses caused by missed inspections in the functional testing link are as high as 30 million yuan each year, causing serious economic losses.

[0003] Motherboard functional testing refers to the comprehensive functional testing of the motherboard during the manufacturing process of electronic products to ensure the normal operation of its various functions and components. Common test items (referred to as test items) include: processor, network card, various interfaces, etc. On the automated test production line, the common functional test area layout is as follows: Figure 1 As shown. After each motherboard is finished with SMT, it flows into the functional test area at the speed of the assembly line. A mechanical arm on one side loads the motherboard in the test area into the test machine for functional testing. After the test is completed, the mechanical arm removes the motherboard from the machine and puts it back into the tested area. The motherboard flows into the next link along the assembly line. From the above, it can be seen that the time each motherboard can be tested in the functional test area is affected by the assembly line speed.

[0004] The test parameters and test plans of the existing motherboard function test are mainly manually adjusted based on expert experience, with a uniform test ratio set for all test items. The set test plan is fixed and cannot be quickly and flexibly adjusted according to the actual test situation, which may cause more defective samples to be missed. In addition, the set test plan is not detailed to the test ratio of different test items, which will bring a lot of redundant test costs. In addition, the existing method has high requirements on the operator's experience and technical level. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a method for dynamically generating a motherboard test plan based on a 0-1 knapsack, which combines expert experience and takes historical test data into consideration; the present invention considers the actual scenario of the functional testing link on the automated production line, models the test plan decision problem into a 0-1 knapsack problem, and proposes an improved reptile search algorithm to solve the knapsack problem and generate a test plan, which can reduce the test cost as much as possible within an acceptable defect range, speed up the test speed, and improve the enterprise efficiency.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A method for dynamically generating a motherboard test plan based on a 0-1 backpack includes the following steps:

[0008] Step 1: Obtain motherboard related information, including motherboard model, historical test data of test items, and expert scores of test items;

[0009] Step 2: The test plan decision problem is: within a limited test time, test the test items that are most likely to cause defects; 0-1 knapsack modeling is performed on the test plan decision problem:

[0010] The test time t of each motherboard is calculated by the pipeline speed speed, the distance between the two motherboards dis and the number of test machines num c ; Set the test time t of each motherboard c , mapped to backpack capacity C:

[0011] The defect rate and expert score of item i are mapped to item o i The value of i ; Long-term defect rate d of each test item l , short-term bad rate d s And expert rating score, calculate item o i The value of i :v i =f(w s d s +w l d l +w sc score); w s 、w l 、w l is the weight parameter;

[0012] Average test time for item i Mapped to item o i The volume c i : time j is the time consumed by the test item in each piece of historical test data, and N represents the number of entries in the historical test data of the test item;

[0013] The test plan decision problem is transformed into a 0-1 knapsack problem: select the items with the highest value combination within the limited knapsack capacity, and the resulting solution is the generated test plan; the mathematical solution form of the maximum knapsack value V is: Among them, n is the total number of measurement items, xi is the individual solution of the 0-1 knapsack problem, representing whether to test item i, x i =0 means that item i is not tested, x i =0 means testing item i; Represents the maximum backpack value;

[0014] Step 3, improving the reptile search algorithm, solving the 0-1 knapsack problem by using the improved reptile search algorithm, and obtaining a solution to the 0-1 knapsack problem, that is, obtaining a motherboard test item test plan;

[0015] The improvements made to the reptile search algorithm include: using the Faure sequence to initialize the population of the reptile search algorithm; after the population uses the update strategy, using the sine-cosine optimization operation to improve the population's ability to jump out of the local optimal solution.

[0016] Furthermore, step three specifically includes the following steps:

[0017] S31, initializing the parameters of the improved reptile search algorithm, the parameters include: population size p, maximum number of population iterations max_iter, search accuracy α of hunting cooperation, exploration accuracy β of the encirclement phase, solution dimension d=n, upper bound UB and lower bound LB of each solution;

[0018] S32, initialize the population using the Faure sequence;

[0019] S33, calculate the optimal solution and the maximum backpack value;

[0020] S34, updating the parameters of the population action, the parameters of the population action include evolutionary sensitivity ES, reduction function R, percentage difference P, and hunting operator η;

[0021] S35, the population begins to explore;

[0022] S36, sine-cosine optimization of the population;

[0023] S37, update the optimal solution and the maximum knapsack value;

[0024] S38, increment the number of iterations t;

[0025] S39, determine whether the current number of iterations t is less than or equal to the maximum number of iterations max_iter, if so, jump to step S34, otherwise execute step S310;

[0026] S310, output the optimal solution Best(max_iter) and the maximum backpack value V(Best(max_iter)).

[0027] Furthermore, in step S32, the use of the Faure sequence to initialize the population specifically includes:

[0028] For the two-dimensional Faure sequence F(n), two mutually prime numbers b1 and b2 are selected as the bases, and the i-th point in the Faure sequence is expressed as:

[0029]

[0030] Among them, f 1,k and f 2,k Respectively represent the k-th dimension of the number i in b1 and b2 bases, b1 k 、b2 k They represent the kth power of b1 and the kth power of b2 respectively;

[0031] The formula for population initialization using the two-dimensional Faure sequence F(n) is as follows:

[0032] X(n)=F(n)(UB-LB)+LB;

[0033] The final population solution X(n) is in the form of:

[0034] Furthermore, in step S33, the calculation of the optimal solution and the maximum backpack value specifically includes:

[0035] Individual solution x of the 0-1 knapsack problem i It can only be 0 or 1, so the individual solution needs to be binarized;

[0036] S331, the solution of the individual i Bring it into the following sigmoid function:

[0037]

[0038] S332, we get f(x i ), a random value is generated by the random function rand, and the random value is judged whether it is greater than f(x i ), if so, then the individual solution x′ after binarization i (t) = 1, if not, x′ i (t) = 0:

[0039]

[0040] Repeat S331 and S332 until all individual solutions are binarized;

[0041] Calculate the maximum backpack value in the current population And the optimal solution:

[0042]

[0043]

[0044] Furthermore, in step S34, the parameters of the population action are updated, and the parameters of the population action include evolutionary sensitivity ES, reduction function R, percentage difference P, and hunting operator η, specifically including:

[0045] Update the evolutionary sensitivity ES(t) of the population at the tth iteration. ES(t) is a random value in the interval (-2,2) during the tth iteration:

[0046]

[0047] Among them, r3 is a random number between [-1,1], and max_iter represents the maximum number of iterations of the population;

[0048] Update the reduction function R, which is used to reduce the scope of the search area. i,j , updated by the following formula:

[0049]

[0050] Among them, R i,j Represents the reduction factor of the i-th individual in the j-th dimension, the reduction factor R i,j Determines the step size when the position of the i-th individual is updated in the j-th dimension; Best j (t) is the jth position of the optimal solution in the tth iteration, r2 is a random number in [1,N], represents the jth bit of a random individual solution, and ε is a custom value used to prevent division by zero errors;

[0051] Update P and η, P i,j is the best solution in the tth iteration j The percentage difference between the jth position of (t) and the jth position of the current solution, η i,j represents the hunting operator of the jth position in the i-th individual solution; η i,j and P i,j The calculation formula is as follows:

[0052] η i,j =Best j (t)×P i,j ;

[0053]

[0054] Among them, x i,j represents the jth position in the i-th individual solution, M(xi ) is the average value of the i-th individual solution, and α is the precision in exploration, which is set during initialization:

[0055]

[0056] Furthermore, in step S35, the population begins to explore, which specifically includes:

[0057] Use different strategies according to the current number of iterations to update the population:

[0058] If the current number of iterations Then the high-belly walking strategy is used, and then step S36 is executed; the formula for updating the population with the high-belly walking strategy is as follows:

[0059] x ij (t+1)=Best j (t)×(-v i,j (t))×β-R i,j (t) × rand;

[0060] Among them, rand represents a random number between 0 and 1, β is a parameter set during the initialization process, and x ij (t+1) is the jth position in the i-th individual solution of the t+1-th iteration;

[0061] If the current number of iterations t satisfies: Then the low-belly walking strategy is used, and then step S36 is executed; the formula for updating the population with the low-belly walking strategy is as follows:

[0062]

[0063] Among them, r1 is a random number in [1,N], Represents the jth position of a random individual solution;

[0064] If the current number of iterations t satisfies: The hunting coordination strategy is then used, and step S36 is then executed; the formula for updating the population using the hunting coordination strategy is as follows:

[0065] x ij (t+1)=Best j (t)×P ij (t) × rand;

[0066] If the current number of iterations t satisfies: The hunting cooperation strategy is then used, and step S36 is then executed. The formula for updating the population using the hunting cooperation strategy is as follows:

[0067] x ij (t+1)=Bestj (t)-η i,j (t)×ε-R i,j (t)×rand.

[0068] Furthermore, in step S36, the sine-cosine optimization of the population specifically includes:

[0069] Update the population solution through sine-cosine optimization:

[0070]

[0071] Among them, r4, r5, r6 and r7 are random numbers. r4 controls the movement of the individual solution towards the global optimal solution. r5 is a random angle. r6 controls the moving distance of the solution. r7 is used to control whether the current iteration t uses the sine strategy optimization or the cosine strategy optimization. j (t) is the jth optimal solution in the tth iteration.

[0072] Compared with the prior art, the beneficial technical effects of the present invention are:

[0073] 1. The present invention can timely adjust the test ratio of each test item according to the test results of different time periods in the recent test process;

[0074] 2. For some defects with time correlation, the present invention increases the test ratio and tests these items more specifically;

[0075] 3. Combined with the actual situation of the production line, each motherboard has a certain test time. The present invention uses on-site test equipment to fully test the test items of the motherboard within the time limit;

[0076] 4. When building a new production line, the present invention can appropriately reduce the test time of each motherboard if the test meets the standards, thereby reducing the investment in test equipment costs;

[0077] 5. The present invention does not require personnel to pay attention to the test situation 24 hours a day, and the test ratio can be automatically adjusted, thus reducing labor costs;

[0078] 6. The detection coverage of defective test items of the present invention is higher than that of traditional methods, and only a lower testing time is required to ensure the traditional detection effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 It is a schematic diagram of the layout of the functional test area of ​​the present invention;

[0080] Figure 2 Schematic diagram of random initial population distribution of the present invention;

[0081] Figure 3 This is a schematic diagram of the initial population distribution of the Faure sequence used in the present invention;

[0082] Figure 4 It is a schematic diagram of the optimal convergence curve of the f1 function;

[0083] Figure 5 It is a schematic diagram of the optimal convergence curve of the f2 function;

[0084] Figure 6 A flowchart of a method for dynamically generating a test plan for motherboard items based on a 0-1 backpack;

[0085] Figure 7 It is a schematic diagram of a flow chart of an embodiment of the present invention;

[0086] Figure 8 A schematic diagram of a motherboard test in a simulation experiment of an embodiment of the present invention;

[0087] Fig. 9 It is a schematic diagram of the test items in the simulation experiment of the embodiment of the present invention. DETAILED DESCRIPTION

[0088] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0089] The flowchart of the method for dynamically generating a motherboard test plan based on a 0-1 backpack in the present invention is as follows: Figure 6 As shown; the present invention is described in detail in steps below.

[0090] Step 1: Obtain motherboard related information, including the motherboard model to be tested, historical test data of related test items, and expert scores of the test items.

[0091] Step 2, 0-1 backpack modeling. The time available for testing each motherboard in the functional test area is limited, and in order to balance the test cost and detection coverage, the test time available for each motherboard is often insufficient to test all test items. Therefore, the test items that are most likely to cause defects should be tested within the limited test time.

[0092] Furthermore, step 2 specifically includes:

[0093] (1) The test time t of each motherboard c , mapped to the capacity of the backpack C. The time each motherboard can be tested is calculated by the pipeline speed speed, the distance between the two motherboards dis, and the number of test machines mum.

[0094]

[0095] (2) The defect rate and expert rating of item i are mapped to the value v of item i i . The long-term defective rate of each test item d l , short-term defect rate d s And expert rating score, calculate the value v of item i i .

[0096] v i =f(w s d s +w l d l +w sc score); (2)

[0097] Among them, w s 、w l and w sc Calculate v i When the short-term defect rate d s , Long-term defect rate d l and the weight of the expert score.

[0098] (3) Average test time for item i Mapped to the volume c of item i i .

[0099]

[0100] Among them, time j It is the time consumed by the test item in each test record, and N is the number of entries of the historical test data of the test item in the database.

[0101] (4) The original test plan decision problem can be described as: select the item with the highest value combination within a limited back-packing volume, and the resulting solution is the generated test plan. The mathematical solution form of the maximum value V of the test plan is:

[0102]

[0103]

[0104] Among them, n is the total number of measurement items, x i Indicates whether the test item with subscript i needs to be tested, 0 means no test, 1 means test; Represents the maximum value of the current problem.

[0105] After modeling it as a 0-1 knapsack problem, an improved reptile search algorithm (eRSA) was invented to solve it. The reptile search algorithm (RSA) was proposed by Laith Abualigah in 2022. The algorithm simulates the hunting behavior of crocodiles. The main steps include: randomly initializing the population, updating the parameters of the population action (ES, R, P, η), and four population update strategies (high-belly walking strategy, low-belly walking strategy, hunting coordination strategy, hunting cooperation strategy).

[0106] The eRSA proposed in the present invention makes two improvements to RSA: 1. Use the Faure sequence to initialize the population; 2. After the population uses four update strategies, use the sine-cosine optimization operation to improve the ability of the population to jump out of the local optimal solution.

[0107] Step 3: Initialize eRSA parameters. eRSA parameters include: population size p, maximum number of algorithm iterations max_iter, search accuracy α of hunting cooperation, exploration accuracy β of the encirclement phase, solution dimension d=n, upper bound UB and lower bound LB of each solution value.

[0108] Step 4: Use the Faure sequence to initialize the population. The generation of the initial solution of RSA is completely random, and the distribution of the generated initial solution may not be uniform enough, resulting in slow convergence of the algorithm, difficulty in fully exploring the solution space, and easy to do unnecessary calculations around the local optimal solution, and increase the instability of the algorithm performance. Therefore, this method uses the Faure sequence to initialize the population. The Faure sequence is a type of low-discrepancy sequence, and its distribution in high-dimensional space is more uniform than pseudo-random numbers.

[0109] Furthermore, step 4 specifically includes:

[0110] (1) Assume that we want to generate a one-dimensional Faure sequence and select a prime number b greater than or equal to 2 as the base. Each point in the sequence can be expressed as:

[0111]

[0112] Among them, f k is the k-th digit of i in base b.

[0113] For the two-dimensional Faure sequence F(n), two mutually prime numbers b1 and b2 are selected as the bases, and each point in the sequence can be expressed as:

[0114]

[0115] Among them, f 1,k and f 2,kThey represent the k-th dimensional number of i in b1 and b2 bases respectively.

[0116] (2) The formula for population initialization using the two-dimensional Faure sequence is as follows:

[0117] X(n)=F(n)(UB-LB)+LB; (7)

[0118] Among them, UB and LB are the upper and lower bounds of each individual solution respectively.

[0119] (3) The final population solution X(n) is in the form of:

[0120]

[0121] Step 5: Calculate the optimal solution and the maximum knapsack value. The solution carried by each individual in the population is a decimal in [0,1], and the individual solution x of the 0-1 knapsack problem is i It can only be 0 or 1, so the individual solution needs to be binarized.

[0122] Furthermore, step 5 specifically includes:

[0123] (1) The individual solution x i Bring it into the following sigmoid function:

[0124]

[0125] (2) get f(x i ), generate a random value through rand, and determine whether the random value is greater than f(x i ), 1 if greater than, 0 otherwise.

[0126]

[0127] (3) Repeat (1)-(2) until all individual solutions are binarized.

[0128] (4) Calculate the maximum backpack value in the current population and update the optimal solution:

[0129]

[0130]

[0131] Step 6: Update the parameters of population action: ES, R, P, η.

[0132] Furthermore, step 6 specifically includes:

[0133] (1) Update the evolutionary sensitivity ES(t) of the population at the tth iteration. ES(t) is a random value in the interval (-2, 2) throughout the entire number of iterations.

[0134]

[0135] Among them, r3 is a random number between [-1,1], and max_iter represents the maximum number of iterations of the population.

[0136] (2) Update R, which is used to narrow the search area. i,j , updated by the following formula.

[0137]

[0138] Among them, Best j (t) is the jth optimal solution in the current t iterations, r2 is a random number in [1,N], Represents the jth bit of a random solution, and ε is a custom very small value used to prevent division by zero errors.

[0139] (3) Update P and η, P i,j is the best solution j The percentage difference between the jth position of (t) and the jth position of the current solution, η i,j Represents the hunting operator at the jth position in the i-th solution. i,j and P i,j The calculation formula is as follows.

[0140] η i,j =Best jj (t)×P i,j ; (14)

[0141]

[0142] Among them, M(x i ) is the average of the i-th individual solutions, and α is the precision in exploration, which is set during initialization.

[0143]

[0144] Step 7: The population begins to explore.

[0145] (1) If the current number of iterations Use the high-belly walking strategy and then execute step 8. The formula for updating the population with the high-belly walking strategy is as follows:

[0146] x ij (t+1)=Best j (t)×(-η i,j(t))×β-R i,j (t)×rand; (17)

[0147] Among them, rand represents a random number between 0 and 1, and β is a parameter set during the initialization process.

[0148] (2) If Then use the low-belly walking strategy, and then execute step 8. The formula for updating the population with the low-belly walking strategy is as follows:

[0149]

[0150] Among them, r1 is a random number in [1,N], Represents the jth bit of a random solution.

[0151] (3) If Then use the hunting coordination strategy, and then execute step 8. The formula for updating the population with the hunting coordination strategy is as follows:

[0152] x ij (t+1)=Best j (t)×P ij (t)×rand; (19)

[0153] (4) If Then use the hunting cooperation strategy, and then execute step 8. The formula for updating the population with the hunting cooperation strategy is as follows:

[0154] x ij (t+1)=Best j (t)-η i,j (t)×ε-R i,j (t)×rand; (20)

[0155] Step 8, perform sine-cosine optimization on the population. The global exploration and local development of RSA simulate the hunting behavior of crocodiles. Different optimization strategies are adopted in each stage. However, these strategies are all based on the location information of the current optimal individual. In the later stage of algorithm iteration, the population is prone to rapid aggregation and stagnation in the local optimal state. To address this problem, the eRSA proposed in the present invention introduces sine-cosine optimization operations in RSA to improve the ability of the algorithm to get rid of the constraints of local extreme values.

[0156] After the introduction of the sine-cosine optimization algorithm, the solution is updated using the following formula:

[0157]

[0158] Among them, r4, r5, r6 and r7 are random numbers, r4 controls the movement of the individual solution towards the global optimal solution, r5 is a random angle, r6 controls the moving distance of the solution, and r7 is used to control whether the current t-th iteration uses the sine strategy optimization or the cosine strategy optimization. j (t) is the jth position of the optimal solution in the current iteration.

[0159] Step 9: Update the optimal solution. Use the formula in step 5 to update the optimal solution and the maximum knapsack value.

[0160] Step 10: Increase the number of iterations t.

[0161] Step 11: Determine whether the current number of iterations t is less than or equal to the maximum number of iterations max_iter. If so, jump to step 6; otherwise, execute step 12.

[0162] Step 12, end. The algorithm is solved and the optimal solution Best(max_iter) and the maximum backpack value V(Best(max_iter)) are output.

[0163] Example

[0164] Taking a certain model of notebook motherboard as an example, there are a total of 20,000 motherboards to be tested, and each motherboard has 34 test items to be tested. Before adopting this solution for testing, there are already 200 test records, each of which records all the test information of the test items of the motherboard, including the test site, test item name, test procedure, test duration, test results and test time.

[0165] The implementation process of this embodiment is as follows Figure 7 The specific steps are as follows:

[0166] S1: The server obtains the model of the motherboard to be tested from the test machine, and then obtains the test item data related to the motherboard model from the database.

[0167] S2: After obtaining the required data, process the data to complete the 0-1 knapsack modeling.

[0168] (1) Set the test time t for each motherboard c The time that each motherboard can be tested is calculated using formula (1) by using the pipeline speed speed, the distance between two motherboards dis and the number of test machines num.

[0169] (2) Calculate the defect rate d of each test item in the last 1000 tests from historical test data 1000 (If there are less than 1,000 motherboards, the data of all motherboards will be used for calculation). The defect rate in the last 100 tests is d 100(If there are less than 100 motherboards, the data of all motherboards will be used for calculation.) The defective rate of 1000 tests, the defective rate of nearly 100 tests and the expert scores are calculated into the comprehensive value of the test item v i The mathematical description is:

[0170] v i =f(w 100 d 100 +w 1000 d 1000 +w sc score); (22)

[0171] Among them, w 100 、w 1000 and w s is the weight.

[0172] (3) Calculate the average test time of nearly 1,000 tests for each test item from historical test data (If there are less than 1,000 motherboards, the data of all motherboards will be used for calculation).

[0173]

[0174] Among them, time j Indicates the test time recorded in the j-th test record of test item i.

[0175] (4) Substitute the test time t of each motherboard calculated in step S2 (1) into c , mapped to the capacity C of the backpack; the comprehensive value of each measurement item i calculated in step S2 (2) is mapped to the value v of item i i ; The average test time of each test item calculated in step S2 (3) Consumption is mapped to the volume c of the item i Solving the test plan problem is modeled as solving the 0-1 knapsack problem, which is mathematically described as:

[0176]

[0177]

[0178] Among them, n is the total number of measurement items, x i Indicates whether the test item with subscript i needs to be tested, 0 means no test, 1 means test; Represents the maximum value of the current problem.

[0179] S3: Call eRSA to solve the 0-1 knapsack problem.

[0180] (1) Initialize eRSA parameters. The initial parameters of eRSA in this embodiment need to consider the actual situation. The solution time required for this problem is: the round-trip time between the assembly line and the machine for the robot arm that clamps the motherboard, plus the installation and removal time of the motherboard on the machine; therefore, through experiments, this method sets the following parameters: population size n = 40, maximum number of algorithm iterations max_iter = 200, search accuracy of hunting cooperation α = 0.1, exploration accuracy of the encirclement stage β = 0.1, the solution dimension is the number of measurement items of a motherboard dimension = 34, and the upper bound UB = 1 and the lower bound LB = 0 for each solution value.

[0181] (2) Initialize the population using the two-dimensional Faure sequence F(n).

[0182] X(n)=F(n)(UB-LB)+LB; (24)

[0183] The search space is 2-dimensional, with the upper and lower bounds being 1 and 0 respectively. Considering the solution efficiency in this embodiment, the population size is set to 40, and the population distribution obtained by completely random population is as follows: Figure 2 As shown. The population distribution initialized using the Faure sequence is as follows Figure 3 As shown. Figure 2 and Figure 3 By comparison, the population distribution obtained by completely random initialization is more random, while the population position distribution obtained by using the Faure sequence initialization is more uniform, with no overlapping areas, a small search blind area, and a smaller distance difference between each point, which is conducive to the population not missing the position of the global optimal solution.

[0184] (3) Then, eRSA is run to solve the 0-1 knapsack problem. During the algorithm iteration, after each position update of individuals in the population using RSA, sine or cosine operations are used to optimize each individual in the population, thereby enhancing the population's ability to escape the dilemma of local optimal solutions.

[0185]

[0186] In order to test whether the improvement of eRSA is effective, two test functions are selected to simulate the algorithm performance. The population size is set to 30 and the maximum number of iterations is set to 200. The specific information of the test function is shown in Table 1. The optimization process of the two test functions is shown in Figure 4 and Figure 5 As shown. Figure 4 and Figure 5 It can be seen that eRSA can converge to the optimal value faster than RSA on both test functions, proving that the performance of eRSA is superior.

[0187] Table 1 Two test functions

[0188] serial number Function Name Domain Optimal value Dimensions f1 Schwefel'2.26 [-32,32] -12569.5 30 f2 Rastrigin [-5.12,5.12] 0 30

[0189] S4: After the number of eRSA iterations reaches the maximum number of iterations max_iter, the obtained solution is mapped into a test plan for the mainboard test items, where each value in the solution is 0 or 1, 0 represents that the test item corresponding to the subscript is not tested, and 1 represents that the test item corresponding to the subscript needs to be tested. The test plan is sent to the test machine, and the embodiment ends.

[0190] Summary: The simulation results of this embodiment are as follows Figure 8 and Fig. 9 As shown. Figure 8 and Fig. 9 It can be seen that when compared with the traditional experience-based testing method, the method of the present invention detects more defective motherboards and defective test items at each motherboard quantity stage, which is closer to the actual number of motherboard defects and test item defects. This shows that compared with the traditional experience-based testing method, the method of the present invention is more targeted in testing defective test items when generating a motherboard test item test plan, and the number of missed detections of defective motherboards and defective test items is smaller, which illustrates the application value of the present method. Furthermore, the present method is suitable for generating test plans for PCB boards on an automatic test production line when the test time for each PCB board is limited, and is not limited to notebook motherboards.

[0191] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.

[0192] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.

Claims

1. A method for dynamically generating a motherboard test plan based on a 0-1 backpack, comprising the following steps: Step 1: Obtain motherboard related information, including motherboard model, historical test data of test items, and expert scores of test items; Step 2: The test plan decision problem is: within the limited test time, test the test items that are most likely to cause defects; 0-1 knapsack modeling of the test planning decision problem: The test time t of each motherboard is calculated by the pipeline speed speed, the distance between the two motherboards dis and the number of test machines num c ; Set the test time t of each motherboard c , mapped to backpack capacity C: The defect rate and expert score of item i are mapped to item o i The value of i ; Long-term defect rate d of each test item l , short-term bad rate d s And expert rating score, calculate item o i The value of i :v i =f(w s d s +w l d l +w sc score); w s 、w l 、w l is the weight parameter; Average test time for item i Mapped to item o i The volume c i : time j is the time consumed by the test item in each piece of historical test data, and N represents the number of entries in the historical test data of the test item; The test plan decision problem is transformed into a 0-1 knapsack problem: select the items with the highest value combination within the limited knapsack capacity, and the resulting solution is the generated test plan; the mathematical solution form of the maximum knapsack value V is: Among them, n is the total number of measurement items, x i is the individual solution of the 0-1 knapsack problem, representing whether to test item i, x i =0 means that item i is not tested, x i =0 means testing item i; Represents the maximum backpack value; Step 3, improving the reptile search algorithm, solving the 0-1 knapsack problem by using the improved reptile search algorithm, and obtaining a solution to the 0-1 knapsack problem, that is, obtaining a motherboard test item test plan; The improvements made to the reptile search algorithm include: using the Faure sequence to initialize the population of the reptile search algorithm; after the population uses the update strategy, using the sine-cosine optimization operation to improve the population's ability to jump out of the local optimal solution.

2. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 1, characterized in that: Step three specifically includes the following steps: S31, initializing the parameters of the improved reptile search algorithm, the parameters include: population size p, maximum number of population iterations max_iter, search accuracy α of hunting cooperation, exploration accuracy β of the encirclement phase, solution dimension d=n, upper bound UB and lower bound LB of each solution; S32, initialize the population using the Faure sequence; S33, calculate the optimal solution and the maximum backpack value; S34, updating the parameters of the population action, the parameters of the population action include evolutionary sensitivity ES, reduction function R, percentage difference P, and hunting operator η; S35, the population begins to explore; S36, sine-cosine optimization of the population; S37, update the optimal solution and the maximum knapsack value; S38, increment the number of iterations t; S39, determine whether the current number of iterations t is less than or equal to the maximum number of iterations max_iter, if so, jump to step S34, otherwise execute step S310; S310, output the optimal solution Best(max_iter) and the maximum backpack value V(Best(max_iter)).

3. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 2, characterized in that: In step S32, the use of the Faure sequence to initialize the population specifically includes: For the two-dimensional Faure sequence F(n), two mutually prime numbers b1 and b2 are selected as the bases, and the i-th point in the Faure sequence is expressed as: Among them, f 1,k and f 2,k Respectively represent the k-th dimension of the number i in b1 and b2 bases, b1 k 、b2 k They represent the kth power of b1 and the kth power of b2 respectively; The formula for population initialization using the two-dimensional Faure sequence F(n) is as follows: X(n)=F(n)(UB-LB)+LB; The final population solution X(n) is in the form of:

4. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 2, characterized in that: In step S33, the calculation of the optimal solution and the maximum backpack value specifically includes: Individual solution x of the 0-1 knapsack problem i It can only be 0 or 1, so the individual solution needs to be binarized; S331, the solution of the individual i Bring it into the following sigmoid function: S332, we get f(x i ), a random value is generated by the random function rand, and the random value is judged whether it is greater than f(x i ), if so, then the individual solution x′ after binarization i (t) = 1, if not, x′ i (t) = 0: Repeat S331 and S332 until all individual solutions are binarized; Calculate the maximum backpack value in the current population And the optimal solution:

5. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 2, characterized in that: In step S34, the parameters of the population action are updated. The parameters of the population action include evolutionary sensitivity ES, reduction function R, percentage difference P, and hunting operator η, specifically including: Update the evolutionary sensitivity ES(t) of the population at the tth iteration. ES(t) is a random value in the interval (-2,2) during the tth iteration: Among them, r3 is a random number between [-1,1], and max_iter represents the maximum number of iterations of the population; Update the reduction function R, which is used to reduce the scope of the search area. i,j , updated by the following formula: Among them, R i,j Represents the reduction factor of the i-th individual in the j-th dimension, the reduction factor R i,j Determines the step size when the position of the i-th individual is updated in the j-th dimension; Best j (t) is the jth position of the optimal solution in the tth iteration, r2 is a random number in [1,N], represents the jth bit of a random individual solution, and ε is a custom value used to prevent division by zero errors; Update P and η, P i,j is the best solution in the tth iteration j The percentage difference between the jth position of (t) and the jth position of the current solution, η i,j represents the hunting operator of the jth position in the i-th individual solution; η i,j and P i,j The calculation formula is as follows: or i,j =Best j (t)×P i,j Among them, x i,j represents the jth position in the i-th individual solution, M(x i ) is the average value of the i-th individual solution, and α is the precision in exploration, which is set during initialization:

6. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 5, characterized in that: In step S35, the population begins to explore, which specifically includes: Use different strategies according to the current number of iterations to update the population: If the current number of iterations Then the high-belly walking strategy is used, and then step S36 is executed; the formula for updating the population with the high-belly walking strategy is as follows: x ij (t+1)=Best j (t)×(-η i,j (t))×β-R i,j (t)×rand; Among them, rand represents a random number between 0 and 1, β is a parameter set during the initialization process, and x ij (t+1) is the jth position in the i-th individual solution of the t+1-th iteration; If the current number of iterations t satisfies: Then the low-belly walking strategy is used, and then step S36 is executed; the formula for updating the population with the low-belly walking strategy is as follows: Where r1 is a random number in [1, N], Represents the jth position of a random individual solution; If the current number of iterations t satisfies: The hunting coordination strategy is then used, and step S36 is then executed; the formula for updating the population using the hunting coordination strategy is as follows: x ij (t+1)=Best j (t)×P ij (t)×rand; If the current number of iterations t satisfies: The hunting cooperation strategy is then used, and step S36 is then executed. The formula for updating the population using the hunting cooperation strategy is as follows: x ij (t+1)=Best j (t)-η i,j (t)×ε-R i,j (t)×rand。 7. The method for dynamically generating a motherboard test plan based on a 0-1 backpack according to claim 2, characterized in that: In step S36, the sine-cosine optimization of the population specifically includes: Update the population solution through sine-cosine optimization: Among them, r4, r5, r6 and r7 are random numbers. r4 controls the movement of the individual solution towards the global optimal solution. r5 is a random angle. r6 controls the moving distance of the solution. r7 is used to control whether the current iteration t uses the sine strategy optimization or the cosine strategy optimization. j (t) is the jth optimal solution in the tth iteration.

Citation Information

Cited By

  • Man-machine cooperation function test cross-domain overall optimization method, system, equipment and medium

    CN120354036A

  • Man-machine cooperation function test fault analysis and cross-domain optimization method and system and medium

    CN120407315A