Meter test strategy making method and system and test method

By formulating a test strategy for the test fixture using a multi-objective genetic algorithm, the problems of low testing efficiency and difficulty in ensuring the rationality of the test fixture in the existing technology are solved, and efficient and reasonable test fixture testing is achieved.

CN121503595APending Publication Date: 2026-02-10ZHEJIANG WEIXING INTELLIGENT METER STOCK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511504772.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing instrument testing strategies rely on human experience, resulting in low testing efficiency and difficulty in ensuring their rationality, especially in large-scale production where efficiency is reduced.

Method used

A multi-objective genetic algorithm is used to formulate a test strategy for the instrument. By establishing objective functions to minimize the total instruction execution time, maximize the total instruction execution accuracy, and maximize instruction coverage, the Pareto optimal test strategy solution set is obtained, and a reasonable test strategy is formulated.

Benefits of technology

While improving instrument testing efficiency, it is essential to ensure the rationality of the testing strategy, taking into account the total instruction execution time, total instruction execution accuracy, and instruction coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503595A_ABST
    Figure CN121503595A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a method and system for formulating a meter test strategy and a test method. The strategy formulating method comprises the following steps: firstly, establishing a first objective function for minimizing the total instruction execution duration, a second objective function for maximizing the total instruction execution accuracy and a third objective function for maximizing the instruction coverage rate; and further obtaining a Pareto optimal test strategy solution set by adopting a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, strategy making constraint conditions, a test instruction set and a mode for testing a standard meter. And further making a meter test strategy based on the Pareto optimal test strategy solution set. According to the meter testing strategy formulated in the mode, three factors including the total instruction execution time length, the total instruction execution accuracy rate and the instruction coverage rate are comprehensively considered, and therefore the reasonability of the testing strategy is guaranteed on the basis that the meter testing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Several embodiments of this specification relate to the field of testing technology, specifically to a method, system, and testing method for formulating a testing strategy for a device. Background Technology

[0002] For testing watches, the first step is to develop a reasonable testing strategy. The most comprehensive testing strategy involves issuing all possible test commands that may be required during the watch's future use, thus conducting a thorough test. However, this method is very time-consuming, especially for factories with large watch production volumes, as it significantly reduces production efficiency.

[0003] Currently, some watch manufacturing plants select a subset of test instructions from a complete set based on human experience, and then combine these selected instructions to create a test strategy. This strategy is then used to test the watches. While this method improves testing efficiency, the development of the test strategy relies entirely on human experience, thus raising questions about its rationality. Summary of the Invention

[0004] This specification provides a method, system, and testing method for formulating a testing strategy for a watch. It uses a multi-objective genetic algorithm to rationally formulate a testing strategy for the watch, thereby improving the efficiency of watch testing while ensuring the rationality of the testing strategy.

[0005] The technical solution is as follows: Firstly, embodiments of this specification provide a method for formulating a testing strategy for a device, including: Obtain the test instruction set and strategy formulation constraints, wherein the test instruction set includes multiple test instructions; The standard instrument is obtained by issuing all test instructions in a separate test instruction set. Establish a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage; Based on the first objective function, the second objective function, the third objective function, the policy formulation constraints, the test instruction set, and the method of testing the standard instrument, a multi-objective genetic algorithm is used to obtain the Pareto optimal test policy solution set; Formulate instrument testing strategies based on the Pareto optimal test strategy solution set; The method of obtaining the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the testing of standard instruments, and using a multi-objective genetic algorithm, includes: Population initialization is performed based on the test instruction set and policy constraints to obtain a population that includes multiple test policies. The standard instrument is tested based on multiple test strategies in the current population to obtain the test results of the standard instrument corresponding to each of the multiple test strategies in the current population. The test results of the standard instrument include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. Based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, a multi-objective genetic algorithm is used to optimize the current population to obtain a new population, and then return to the previous step until the preset conditions are met, so as to obtain the Pareto optimal test strategy solution set; The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.

[0006] As a preferred embodiment, the method of conducting instrument testing by separately issuing all test instructions in a test instruction set, before obtaining a standard instrument, further includes: Obtain the command issuance order conditions; The method of testing the meter by issuing all test instructions in a separate test instruction set to obtain a standard meter is constrained by the order of instruction issuance.

[0007] As a preferred approach, the method of issuing all test instructions in the test instruction set separately to test the instrument is adopted to obtain a standard instrument that can correctly execute all test instructions in the test instruction set.

[0008] As a preferred embodiment, the policy formulation constraints also include: the order in which test instructions are issued in the test policy satisfies the instruction issuance order condition.

[0009] As a preferred option, the policy formulation constraints also include: the number of test commands involved in a single command issuance operation is no greater than a preset number.

[0010] As a preferred option, the total execution time of the first instruction in the standard instrument test result is the time required for the standard instrument to complete all test instructions involved in the test strategy. The overall execution accuracy of the first instruction in the standard instrument test results is obtained based on the execution accuracy of each instruction issued in the test strategy. The instruction coverage in the standard instrument test results is calculated based on the total number of test instructions involved in the test strategy and the total number of test instructions in the test instruction set.

[0011] As a preferred approach, the first overall instruction execution accuracy is obtained based on the instruction execution accuracy of each instruction issued in the test strategy, including: Each instruction issuance operation is assigned an adjustment coefficient based on the number of test instructions in each instruction issuance operation. The overall accuracy of the first instruction execution is obtained based on the adjustment coefficients corresponding to each instruction issuance operation and the instruction execution accuracy.

[0012] As a preferred embodiment, before obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, strategy formulation constraints, the test instruction set, and the method of testing standard instruments, the method further includes: Establish a fourth objective function that minimizes the number of instruction issuance operations; When obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm, a fourth objective function is also employed.

[0013] Secondly, embodiments of this specification provide a method for testing a meter, including: A meter testing strategy is formulated using the meter testing strategy formulation method described in the first aspect of the above embodiments; The instrument under test is tested based on the established instrument testing strategy to obtain the instrument test results, which include the total execution time of the second instruction and the total accuracy of the second instruction execution. Based on the total execution time of the second instruction, the total execution accuracy of the second instruction, and the total execution time and total execution accuracy of the first instruction corresponding to the established instrument testing strategy, determine whether the instrument under test meets the requirements.

[0014] Thirdly, the embodiments of this specification provide a table testing strategy formulation system, based on the table testing strategy formulation method described in the first aspect of the above embodiments, including a first acquisition module, a second acquisition module, an establishment module, a third acquisition module, and a formulation module; The first acquisition module acquires a test instruction set and strategy formulation constraints, wherein the test instruction set includes multiple test instructions; The second acquisition module uses a method of issuing all test instructions in a separate test instruction set to test the instrument in order to obtain a standard instrument. The establishment module establishes a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage. The third acquisition module obtains the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the method of testing the standard instrument, and uses a multi-objective genetic algorithm. The formulation module formulates the fixture testing strategy based on the Pareto optimal test strategy solution set. The third acquisition module includes a first acquisition unit, a second acquisition unit, and a third acquisition unit; The first acquisition unit initializes the population based on the test instruction set and policy formulation constraints to obtain a population including multiple test policies. The second acquisition unit tests the standard instrument based on multiple testing strategies in the current population to obtain the standard instrument test results corresponding to each of the multiple testing strategies in the current population. The standard instrument test results include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. The third acquisition unit optimizes the current population using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, to obtain a new population, and returns to the previous step until the preset conditions are met, so as to obtain the Pareto optimal test strategy solution set. The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.

[0015] Fourthly, embodiments of this specification provide an electronic device, including a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to perform the steps described in the first or second aspect of the above embodiments.

[0016] Fifthly, embodiments of this specification provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the steps described in the first or second aspect of the above embodiments.

[0017] The beneficial effects of the technical solutions provided in some embodiments of this specification include at least the following: First, a primary objective function is established to minimize the total instruction execution time, a secondary objective function to maximize the overall instruction execution accuracy, and a tertiary objective function to maximize instruction coverage. Further, based on the primary, secondary, and tertiary objective functions, policy formulation constraints, the test instruction set, and the method of testing standard instruments, a multi-objective genetic algorithm is used to obtain the Pareto optimal test policy solution set. Then, an instrument testing strategy is formulated based on the Pareto optimal test policy solution set. The instrument testing strategy formulated in this way comprehensively considers the three factors of total instruction execution time, overall instruction execution accuracy, and instruction coverage, thus improving instrument testing efficiency while ensuring the rationality of the testing strategy. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating a method for formulating a testing strategy for a device, as provided in an embodiment of this specification.

[0020] Figure 2 This is a flowchart illustrating a test method for a gauge provided in an embodiment of this specification.

[0021] Figure 3 This is a schematic diagram of the structure of a fixture testing strategy formulation system provided in the embodiments of this specification.

[0022] Figure 4 This is a schematic diagram of the structure of an electronic device provided in the embodiments of this specification. Detailed Implementation

[0023] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.

[0024] The terms "first," "second," "third," etc., in the description, claims, and accompanying drawings are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0025] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this specification. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.

[0026] Reference Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for formulating a testing strategy for a device, as provided in one embodiment of this specification.

[0027] The methodology for developing a testing strategy for this instrument may include at least the following: Step 102: Obtain the test instruction set and strategy formulation constraints. The test instruction set includes multiple test instructions. Step 104: Test the instrument by issuing all test instructions in the test instruction set separately in order to obtain a standard instrument; Step 106: Establish a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage; Step 108: Based on the first objective function, the second objective function, the third objective function, the policy formulation constraints, the test instruction set, and the method of testing the standard instrument, a multi-objective genetic algorithm is used to obtain the Pareto optimal test policy solution set; Step 110: Formulate a fixture testing strategy based on the Pareto optimal test strategy solution set; The method of obtaining the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the testing of standard instruments, and using a multi-objective genetic algorithm, includes: Step 1082: Initialize the population based on the test instruction set and policy constraints to obtain a population that includes multiple test policies; Step 1084: Test the standard instrument based on multiple test strategies in the current population to obtain the standard instrument test results corresponding to each of the multiple test strategies in the current population. The standard instrument test results include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. Step 1086: Based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, a multi-objective genetic algorithm is used to optimize the current population to obtain a new population, and the previous step is returned until the preset conditions are met to obtain the Pareto optimal test strategy solution set. The preset conditions may be, but are not limited to, reaching a preset number of iterations. The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.

[0028] It is understandable that testing all meters using all test instructions from the test instruction set would reduce testing efficiency, thereby reducing meter production efficiency. It is also understandable that some instructions can be executed synchronously by the meters, such as reading cumulative gas consumption instructions and reading log instructions. Therefore, to reduce the total execution time of the strategy, the number of test instructions involved in a single instruction issuance operation is allowed to be greater than one. However, the more instructions a meter executes synchronously, the lower its accuracy will be to some extent. Therefore, testing efficiency cannot be improved indefinitely by increasing the number of test instructions involved in a single instruction issuance operation. Therefore, in the meter testing strategy formulation method provided in several embodiments of this specification, a first objective function is established to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage. Further, based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the method of testing standard meters, a multi-objective genetic algorithm is used to obtain the Pareto optimal test strategy solution set. Finally, the meter testing strategy is formulated based on the Pareto optimal test strategy solution set. The instrument testing strategy developed under this approach comprehensively considers three factors: total instruction execution time, total instruction execution accuracy, and instruction coverage. Therefore, while improving instrument testing efficiency, it also ensures the rationality of the testing strategy.

[0029] Specifically, a testing strategy was developed for standard meters that comprehensively considers three factors: total instruction execution time, total instruction execution accuracy, and instruction coverage. Subsequent testing of the meter under test only requires considering the total execution time and total accuracy of the second instruction under this testing strategy, as well as the total execution time and total accuracy of the first instruction under this strategy for the standard meter. This testing method reduces the number of instruction issuance operations and the total number of test instructions involved, thereby improving testing efficiency.

[0030] It's important to note that the Multi-Objective Genetic Algorithm (MOGA) is an evolutionary algorithm used to solve multi-objective optimization problems. Multi-objective optimization problems involve multiple objective functions that may conflict, meaning that improving one objective might worsen another. The goal of MOGA is to find an equilibrium among these objectives, generating a set of Pareto optimal solutions that are at least as good as any other solution on all objectives and superior to all other solutions on at least one objective.

[0031] The following are the basic steps of a multi-objective genetic algorithm: Step 1: Initialize the population: A certain number of initial solutions (individuals) are randomly generated, and each individual represents a potential solution.

[0032] The decision variables for each individual are initialized randomly.

[0033] Step 2: Evaluate the objective function: Calculate the objective function value for each individual; these values ​​reflect the individual's performance on various objectives.

[0034] The evaluation results may include values ​​of multiple objective functions, which may be maximized or minimized.

[0035] Step 3, Non-dominated sorting: The individuals in the population are non-dominated and ordered according to the objective function value to determine the Pareto rank of each individual.

[0036] Non-dominated individuals are those who are not dominated by any other individual.

[0037] Step 4: Calculate congestion level: For individuals within the same Pareto class, calculate their crowding level.

[0038] Crowding reflects an individual's relative position in their target space; higher crowding indicates a lower density of individuals in their surrounding area.

[0039] Step 5, assign fitness values: Each individual is assigned a fitness value based on its Pareto rank and crowding level.

[0040] Fitness values ​​reflect an individual's relative advantage within the population.

[0041] Step 6, Genetic manipulation: Selection: Select individuals for breeding based on their fitness value.

[0042] Crossover: Perform a crossover operation on the selected individuals to generate new offspring.

[0043] Mutation: Mutation operations are performed on the offspring after crossover to introduce new genetic diversity.

[0044] Step 7, Population Optimization and Update: A new population is formed by combining the parents and offspring.

[0045] Step 8: Repeat the above steps until the termination condition is met.

[0046] Step 9, Output Results: After the algorithm finishes, it outputs the Pareto optimal solution set, which is the set containing all Pareto optimal solutions.

[0047] In the instrument testing strategy formulation method described in several embodiments of this specification, during the cross-mutation process, it is permissible, but not limited to, to change the number of instruction issuance operations in the testing strategy, the number of test instructions involved in each instruction issuance operation, the issuance order of each test instruction in the testing strategy, and the time interval between each two adjacent instruction issuance operations in the testing strategy.

[0048] In one embodiment of this specification: The total execution time of the first instruction in the standard instrument test results is the time required for the standard instrument to complete all test instructions involved in the test strategy. The overall execution accuracy of the first instruction in the standard instrument test results is obtained based on the execution accuracy of each instruction issued in the test strategy. The instruction coverage in the standard instrument test results is calculated based on the total number of test instructions involved in the test strategy and the total number of test instructions in the test instruction set.

[0049] It should be noted that for the first objective function, the second objective function, and the third objective function, corresponding weight coefficients can be set for each. Taking the first objective function as an example, it can be illustrated as follows: F(x) = A*x Where F(x) is the first objective function, A is the weighting coefficient corresponding to the total instruction execution time factor, and x is the total execution time of the first instruction.

[0050] That is, by setting different weight coefficients for different factors, the influence of total instruction execution time, total instruction execution accuracy, and instruction coverage on the solution can be changed.

[0051] In one embodiment of this specification, before obtaining a standard instrument by separately issuing all test instructions from a test instruction set to perform instrument testing, the method further includes: Obtain the command issuance order conditions; The method of testing the meter by issuing all test instructions in a separate test instruction set to obtain a standard meter is constrained by the order of instruction issuance.

[0052] It is understandable that there may be certain dependencies between multiple test commands. For example, the operation of reading cumulative gas consumption needs to read the gas consumption in various time periods. Therefore, it should be executed after the calibration time command; otherwise, it will affect the accuracy of its execution. Therefore, in this embodiment, the command issuance sequence condition is obtained in advance to avoid affecting the standard meter testing process.

[0053] In one embodiment of this specification, the method of testing the instrument by individually issuing all test instructions in the test instruction set is used to obtain a standard instrument that can correctly execute all test instructions in the test instruction set.

[0054] It is understandable that, for the instrument under test, there is also instruction dependency when executing test instructions. Therefore, in one embodiment of this specification, the policy formulation constraint further includes: the order of issuing test instructions in the test policy satisfies the instruction issuance order condition.

[0055] Understandably, due to the limitations of meter performance, if the number of test commands executed simultaneously by the meter is too large, it will severely affect the accuracy of the executed commands. Therefore, in one embodiment of this specification, the policy formulation constraint further includes: the number of test commands involved in a single command issuance operation does not exceed a preset number. This can further reduce the range of crossover and mutation during the population optimization process, thereby improving the solution speed.

[0056] In one embodiment of this specification, the first total instruction execution accuracy is obtained based on the instruction execution accuracy corresponding to each instruction issuance operation in the test strategy, including: Each instruction issuance operation is assigned an adjustment coefficient based on the number of test instructions in each instruction issuance operation. The overall accuracy of the first instruction execution is obtained based on the adjustment coefficients corresponding to each instruction issuance operation and the instruction execution accuracy.

[0057] It is understandable that the overall accuracy of the first instruction execution can be obtained by averaging the execution accuracy of each instruction issued.

[0058] It is also understandable that for a single instruction issuance operation, the more test instructions involved, the more likely the meter is to make errors in executing those test instructions. Furthermore, if the meter executes only the erroneous test instructions, it is likely to execute correctly. Therefore, in this embodiment, when calculating the overall accuracy of the first instruction execution, an adjustment coefficient is assigned to each instruction issuance operation based on the number of test instructions in each operation.

[0059] The following assignment methods may be used, but are not limited to: When the number of test commands in the command issuance operation is no greater than the preset upper limit, the adjustment coefficient assigned is 1. When the number of test commands in the command issuance operation exceeds the preset upper limit, the more test commands there are in the command issuance operation, the greater the adjustment coefficient will be assigned to the command issuance operation.

[0060] The following examples illustrate this: Assuming a preset upper limit of 5, and further assuming the test strategy involves 4 command issuance operations: Command Issuance Operation 1, Command Issuance Operation 2, Command Issuance Operation 3, and Command Issuance Operation 4. Command Issuance Operation 1 involves 2 test commands, Command Issuance Operation 2 involves 4 test commands, Command Issuance Operation 3 involves 6 test commands, and Command Issuance Operation 4 involves 8 test commands. The command execution accuracy rate for Command Issuance Operation 1 is 0.75, the command execution accuracy rate for Command Issuance Operation 2 is 0.5, the command execution accuracy rate for Command Issuance Operation 3 is 0.75, and the command execution accuracy rate for Command Issuance Operation 4 is 0.5.

[0061] Furthermore, it is possible, but not limited to, assigning an adjustment factor of 1 to instruction issuance operation one, 1 to instruction issuance operation two, 1.1 to instruction issuance operation three, and 1.2 to instruction issuance operation four.

[0062] Furthermore, the formula for calculating the overall accuracy of the first instruction execution of the test strategy is as follows: The overall accuracy of the first instruction execution = (1*0.75 + 1*0.5 + 1.1*0.75 + 1.2*0.5) / 4.

[0063] It is understandable that during testing, the fewer the number of instruction issuance operations, the higher the testing efficiency and the simpler the testing strategy. Therefore, in one embodiment of this specification, before obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, strategy formulation constraints, the test instruction set, and the method of testing standard fixtures, the following steps are also included: Establish a fourth objective function that minimizes the number of instruction issuance operations; When obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm, a fourth objective function is also employed.

[0064] Please refer to the following. Figure 2 , Figure 2 A schematic flowchart of a gauge testing method provided in an embodiment of this specification is shown.

[0065] The instrument testing method may include at least: Step 202: Using the instrument testing strategy formulation method described in the above embodiment, a instrument testing strategy is formulated; Step 204: Test the meter under test based on the established meter test strategy to obtain the meter test results, which include the total execution time of the second instruction and the total accuracy of the second instruction execution. Step 206: Based on the total execution time of the second instruction, the total execution accuracy of the second instruction, and the total execution time of the first instruction and the total execution accuracy of the first instruction corresponding to the established instrument testing strategy, determine whether the instrument to be tested meets the requirements.

[0066] In other words, it can be understood that the total execution time and total accuracy of the second instruction are compared with the total execution time and total accuracy of the first instruction. If the total execution time and total accuracy of the second instruction can simultaneously reach the standards of the total execution time and total accuracy of the first instruction, then the instrument under test meets the requirements.

[0067] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the embodiments for the instrument testing method are basically similar to the embodiments for the test strategy formulation method, so the description is relatively simple; relevant parts can be referred to in the description of the test strategy formulation method embodiment.

[0068] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0069] Please refer to the following. Figure 3 , Figure 3 A schematic diagram of a fixture testing strategy formulation system provided in an embodiment of this specification is shown.

[0070] The instrument testing strategy formulation system 300 may include at least: a first acquisition module 301, a second acquisition module 302, an establishment module 303, a third acquisition module 304, and a formulation module 305; The first acquisition module 301 acquires a test instruction set and strategy formulation constraints, wherein the test instruction set includes multiple test instructions; The second acquisition module 302 uses a method of individually issuing all test instructions in the test instruction set to perform instrument testing in order to obtain a standard instrument; The establishment module 303 establishes a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage. The third acquisition module 304 obtains the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the method of testing the standard instrument, and uses a multi-objective genetic algorithm. The formulation module 305 formulates a fixture test strategy based on the Pareto optimal test strategy solution set. The third acquisition module 304 includes a first acquisition unit 3041, a second acquisition unit 3042, and a third acquisition unit 3043; The first acquisition unit 3041 initializes the population based on the test instruction set and policy formulation constraints to obtain a population including multiple test policies. The second acquisition unit 3042 tests the standard instrument based on multiple testing strategies in the current population to obtain the standard instrument test results corresponding to each of the multiple testing strategies in the current population. The standard instrument test results include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. The third acquisition unit 3043 optimizes the current population using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, so as to obtain a new population and return to the previous step until the preset conditions are met, so as to obtain the Pareto optimal test strategy solution set. The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.

[0071] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the test strategy formulation system embodiment is relatively simple in description because it is fundamentally similar to the test strategy formulation method embodiment; relevant parts can be referred to in the description of the test strategy formulation method embodiment.

[0072] Please see Figure 4 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this specification.

[0073] like Figure 4 As shown, the electronic device 400 may include at least one processor 401, at least one network interface 404, a user interface 403, a memory 405, and at least one communication bus 402.

[0074] The communication bus 402 can be used to realize the connection and communication of the above components.

[0075] The user interface 403 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0076] Among them, network interface 404 may include, but is not limited to, Bluetooth module, NFC module, Wi-Fi module, etc.

[0077] The processor 401 may include one or more processing cores. The processor 401 connects to various parts within the electronic device 400 using various interfaces and lines. It executes various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 405, and by calling data stored in the memory 405. Optionally, the processor 401 may be implemented using at least one hardware form of DSP, FPGA, or PLC. The processor 401 may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 401 and may be implemented as a separate chip.

[0078] The memory 405 may include RAM or ROM. Optionally, the memory 405 may include a non-transitory computer-readable medium. The memory 405 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 405 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 405 may also be at least one storage device located remotely from the aforementioned processor 401. As a computer storage medium, the memory 405 may include an operating system, a network communication module, a user interface module, and a test strategy formulation application or a fixture testing application. The processor 401 may be used to call the test strategy formulation application or fixture testing application stored in the memory 405 and execute the steps of the test strategy formulation method or fixture testing method mentioned in the foregoing embodiments.

[0079] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the embodiments of the test strategy formulation method or instrument testing method described above. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0080] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0081] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation can be combined arbitrarily.

[0082] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.

Claims

1. A method for formulating a testing strategy for a device, characterized in that, include: Obtain the test instruction set and strategy formulation constraints, wherein the test instruction set includes multiple test instructions; The standard instrument is obtained by issuing all test instructions in a separate test instruction set. Establish a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage; Based on the first objective function, the second objective function, the third objective function, the policy formulation constraints, the test instruction set, and the method of testing the standard instrument, a multi-objective genetic algorithm is used to obtain the Pareto optimal test policy solution set; Formulate instrument testing strategies based on the Pareto optimal test strategy solution set; The method of obtaining the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the testing of standard instruments, and using a multi-objective genetic algorithm, includes: Population initialization is performed based on the test instruction set and policy constraints to obtain a population that includes multiple test policies. The standard instrument is tested based on multiple test strategies in the current population to obtain the test results of the standard instrument corresponding to each of the multiple test strategies in the current population. The test results of the standard instrument include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. Based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, a multi-objective genetic algorithm is used to optimize the current population to obtain a new population, and then return to the previous step until the preset conditions are met, so as to obtain the Pareto optimal test strategy solution set; The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.

2. The method for formulating a testing strategy for a meter according to claim 1, characterized in that, The method of testing the instrument by issuing all test instructions in a separate test instruction set, before obtaining a standard instrument, also includes: Obtain the command issuance order conditions; The method of testing the meter by issuing all test instructions in a separate test instruction set to obtain a standard meter is constrained by the order of instruction issuance.

3. The method for formulating a testing strategy for a meter according to claim 1, characterized in that, The method of testing the instrument by issuing all test instructions in the test instruction set separately is used to obtain a standard instrument that can correctly execute all test instructions in the test instruction set.

4. The method for formulating a testing strategy for a meter according to claim 2, characterized in that, The constraints for formulating the strategy also include: the order in which test instructions are issued in the test strategy satisfies the instruction issuance order condition.

5. The method for formulating a testing strategy for a meter according to claim 1, characterized in that, The constraints for formulating the strategy also include: the number of test commands involved in a single command issuance operation shall not exceed a preset number.

6. The method for formulating a testing strategy for a meter according to claim 1, characterized in that: The total execution time of the first instruction in the standard instrument test results is the time required for the standard instrument to complete all test instructions involved in the test strategy. The overall execution accuracy of the first instruction in the standard instrument test results is obtained based on the execution accuracy of each instruction issued in the test strategy. The instruction coverage in the standard instrument test results is calculated based on the total number of test instructions involved in the test strategy and the total number of test instructions in the test instruction set.

7. The method for formulating a testing strategy for a meter according to claim 6, characterized in that, The overall execution accuracy of the first instruction is obtained based on the individual instruction execution accuracy of each instruction issued in the test strategy, including: Each instruction issuance operation is assigned an adjustment coefficient based on the number of test instructions in each instruction issuance operation. The overall accuracy of the first instruction execution is obtained based on the adjustment coefficients corresponding to each instruction issuance operation and the instruction execution accuracy.

8. The method for formulating a testing strategy for a meter according to claim 1, characterized in that, Before obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, strategy formulation constraints, the test instruction set, and the method of testing standard instruments, the following steps are also included: Establish a fourth objective function that minimizes the number of instruction issuance operations; When obtaining the Pareto optimal test strategy solution set using a multi-objective genetic algorithm, a fourth objective function is also employed.

9. A method for testing instruments, characterized in that, include: A meter testing strategy is formulated by using the meter testing strategy formulation method according to any one of claims 1 to 8; The instrument under test is tested based on the established instrument testing strategy to obtain the instrument test results, which include the total execution time of the second instruction and the total accuracy of the second instruction execution. Based on the total execution time of the second instruction, the total execution accuracy of the second instruction, and the total execution time and total execution accuracy of the first instruction corresponding to the established instrument testing strategy, determine whether the instrument under test meets the requirements.

10. A system for formulating a testing strategy for a meter, based on the method for formulating a testing strategy for a meter according to any one of claims 1 to 8, characterized in that, It includes a first acquisition module, a second acquisition module, an establishment module, a third acquisition module, and a specification module; The first acquisition module acquires a test instruction set and strategy formulation constraints, wherein the test instruction set includes multiple test instructions; The second acquisition module uses a method of issuing all test instructions in a separate test instruction set to test the instrument in order to obtain a standard instrument. The establishment module establishes a first objective function to minimize the total instruction execution time, a second objective function to maximize the total instruction execution accuracy, and a third objective function to maximize instruction coverage. The third acquisition module obtains the Pareto optimal test strategy solution set based on the first objective function, the second objective function, the third objective function, the strategy formulation constraints, the test instruction set, and the method of testing the standard instrument, and uses a multi-objective genetic algorithm. The formulation module formulates the fixture testing strategy based on the Pareto optimal test strategy solution set. The third acquisition module includes a first acquisition unit, a second acquisition unit, and a third acquisition unit; The first acquisition unit initializes the population based on the test instruction set and policy formulation constraints to obtain a population including multiple test policies. The second acquisition unit tests the standard instrument based on multiple testing strategies in the current population to obtain the standard instrument test results corresponding to each of the multiple testing strategies in the current population. The standard instrument test results include the total execution time of the first instruction, the total accuracy of the first instruction execution, and the instruction coverage. The third acquisition unit optimizes the current population using a multi-objective genetic algorithm based on the first objective function, the second objective function, the third objective function, the standard instrument test results corresponding to each of the multiple test strategies in the current population, and the policy formulation constraints, to obtain a new population, and returns to the previous step until the preset conditions are met, so as to obtain the Pareto optimal test strategy solution set. The constraints for formulating the strategy include: the test strategy includes multiple instruction issuance operations with a number of times less than the total number of test instructions in the test instruction set; it allows all test instructions involved in the test strategy to not cover all test instructions in the test instruction set; the test strategy does not perform repeated issuance of test instructions; and it allows the number of test instructions involved in a single instruction issuance operation to be greater than 1.