CN113050547A - Test stimulus generation method, test method, electronic device, and storage medium - Google Patents

Test stimulus generation method, test method, electronic device, and storage medium Download PDF

Info

Publication number
CN113050547A
CN113050547A CN202110243353.4A CN202110243353A CN113050547A CN 113050547 A CN113050547 A CN 113050547A CN 202110243353 A CN202110243353 A CN 202110243353A CN 113050547 A CN113050547 A CN 113050547A
Authority
CN
China
Prior art keywords
mayflies
male
female
value
population
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110243353.4A
Other languages
Chinese (zh)
Other versions
CN113050547B (en
Inventor
李铁峰
单丽
刘伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Macrosilicon Technology Co ltd
Original Assignee
Hefei Macrosilicon Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Macrosilicon Technology Co ltd filed Critical Hefei Macrosilicon Technology Co ltd
Priority to CN202110243353.4A priority Critical patent/CN113050547B/en
Publication of CN113050547A publication Critical patent/CN113050547A/en
Application granted granted Critical
Publication of CN113050547B publication Critical patent/CN113050547B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/416Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by control of velocity, acceleration or deceleration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/31From computer integrated manufacturing till monitoring
    • G05B2219/31412Calculate machining time, update as function of load, speed

Abstract

The invention discloses a test stimulus generation method, a test method, electronic equipment and a storage medium, wherein the test stimulus generation method comprises the following steps: the present position value of each male mayflies in the population is calculated separately; calculating the present position value of each mayflies in the female population respectively; wherein the position values of male mayflies or female mayflies represent a feasible solution to a test stimulus; selecting one male mayflies from a population of male mayflies, selecting one female mayflies from a population of female mayflies, performing a cross-calculation to obtain the present position values of two next-generation mayflies; updating the male mayfly population and female mayfly population according to the present position values of the two next-generation mayfly individuals, calculating the optimum position value of the present population; and adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number.

Description

Test stimulus generation method, test method, electronic device, and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of testing, and in particular relates to a test stimulus generation method, a test method, an electronic device, and a storage medium.
Background
With the comprehensive development of the manufacturing industry of the numerical control intelligent equipment, the track planner is taken as the most core component of the numerical control intelligent equipment, and the research and development of the track planner become essential important links of high-end manufacturing enterprises and scientific research units in China.
In the development period of the trajectory planner, the function test work of the trajectory planner occupies more than 80% of the development period of the whole product, at present, the function tests of the trajectory planner are all completed manually, the test excitation diversity of testers through manual setting is poor, the coverage of a test interval is small, so that the whole test process consumes much time, the efficiency is low, the development period is finally prolonged, and the cost is increased.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
The embodiment of the disclosure provides a test stimulus generation method, a test method, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a test stimulus generation method, including:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and female mayfly population according to the present position values of two next-generation mayfly individuals, calculating the present group optimum position value from the present position values of all male mayfly individuals of the updated male mayfly population and the present position values of all female mayfly individuals of the updated female mayfly population;
and adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number.
In some exemplary embodiments, in a case that the current number of iterations after adding 1 is less than the preset number of iterations, the method further includes:
the step of calculating the present position value of each male mayflies in the male mayflies population respectively is continued.
In some exemplary embodiments, after outputting the optimal location value of the current group as a test stimulus, the method further includes:
adding 1 to the number of currently generated test stimuli, setting 0 to the number of current iterations when the number of currently generated test stimuli after adding 1 is less than the preset number of test stimuli F, continuing the step of calculating the present-time position values of each male mayflies in the male mayfly population respectively.
In some exemplary embodiments, after outputting the optimal location value of the current group as a test excitation, before adding 1 to the number of currently generated test excitations, the method further includes:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of adding 1 to the number of the currently generated test excitation.
In some exemplary embodiments, in a case where the test stimulus output this time is the same as any one of the test stimuli output before, the method further includes:
resetting the initial values of speed, position, individual-optimal and male population-optimal positions of each said male mayflies in said population of males, and the initial values of speed and position of each said female mayflies in said population of females;
the reset initial value of speed of male mayflies is taken as the last speed value of said male mayflies, the reset initial value of position of male mayflies is taken as the last position value of said male mayflies, the reset initial value of the optimal-individual positions of male mayflies is taken as the last optimal-individual position value of said male mayflies, the reset initial value of the optimal-male-colony positions is taken as the last optimal-male-colony position value;
the reset initial value of the speed of the female mayflies is taken as the last speed value of said female dayflies, and the reset initial value of the position of the female mayflies is taken as the last position value of said female mayflies;
increasing at least one of the first socially positive attraction coefficient, the second socially positive attraction coefficient, the visibility coefficient of dayflies, the first random number, the third socially positive attraction coefficient, the second random number, used in calculating the current position value of said female dayflies, and the third random number used in calculating the current position value of two said next generation mayflies;
the step of calculating the present position value of each male mayflies in the male mayflies population respectively is continued.
In some exemplary embodiments, after cross-calculating the present position values of two next generation mayflies after said cross-calculating the selected male and selected female mayflies, the method further comprises:
cross-calculating said selected male mayflies and said selected female mayflies to obtain the present speed values of two said next generation mayflies;
in the event that the present position values of the two next-generation dayflies obtained this time of calculation are the same as the present position values of the two next-generation dayflies obtained the last time of calculation, and the present speed values of the two next-generation dayflies obtained this time of calculation are the same as the present speed values of the two next-generation dayflies obtained the last time of calculation, the step of resetting the initial speed value, initial position value, initial individual-optimum position value and initial male-population-optimum position value for each of the male mayflies in the population, and the initial speed value and initial position value for each of the female mayflies in the population continues.
In some exemplary embodiments, said calculating the present position value of each male mayflies in a population of male mayflies separately comprises:
the present position values of each male mayflies in a population are calculated based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of the male mayflies.
In some exemplary embodiments, said calculating the present position value of the male mayflies according to their last speed value, last position value, last individual optimal position value and last male population optimal position value comprises:
calculating the present speed values of the male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values;
the present position values of the male mayflies are calculated from the last position values and the present speed values of the male mayflies.
In some exemplary embodiments, said calculating the present speed values of the male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values comprises:
in that
Figure BDA0002961666090000041
In the case of (1), according to the formula
Figure BDA0002961666090000042
Calculating the current speed value of the ith male mayfly individual;
in that
Figure BDA0002961666090000043
In the case of (1), according to the formula
Figure BDA0002961666090000044
Calculating the current speed value of the ith male mayfly individual;
wherein f () is a fitness function,
Figure BDA0002961666090000045
the last position value of the ith male mayfly individual,
Figure BDA0002961666090000046
the last individual optimum position value for the ith male mayflies,
Figure BDA0002961666090000047
the speed values of the ith male mayflies, that is, the speed values of the ith male mayflies at time t,
Figure BDA0002961666090000048
the last speed value of the ith male mayflies, i.e. the speed value of the ith male mayflies at time t-1, a1Positive attraction coefficient for first social effect, a2A positive attraction coefficient for the second social effect, β is the visibility coefficient of mayflies,
Figure BDA0002961666090000049
the distance between the last position value of the ith male mayfly individual and the last individual optimum position value of the ith male mayfly individual,
Figure BDA00029616660900000410
the last position value of the ith male mayfly individual,
Figure BDA00029616660900000411
the distance between the last position value of the ith male mayfly and the last optimal position value of the current male colony, gbest1t-1For the optimal position value of the male population at the last time, D is the dancing coefficient, and r1 is the first random number.
In some exemplary embodiments, said calculating the present position value of each mayflies in a female population separately comprises:
the present position values of the female mayflies are calculated for each female mayflies in a population based on the last speed value and the last position value of the female mayflies and the last position values of the male mayflies that attract the female mayflies.
In some exemplary embodiments, said calculating the present position value of the female mayflies according to their last speed value and last position value, and the last position value of the male mayflies that attract said female mayflies comprises:
calculating the present speed values of the female mayflies based on the last speed values and the last position values of the female mayflies and the last position values of the male mayflies that attract said female mayflies;
the present position values of said female mayflies are calculated from the last position values and the present speed values of said female mayflies.
In some exemplary embodiments, in accordance with a formula
Figure BDA0002961666090000051
Calculating the current speed value of the jth mayfly individual;
wherein the content of the first and second substances,
Figure BDA0002961666090000052
the current speed value of the j-th female mayflies, i.e. the speed value of the j-th female mayflies at time t,
Figure BDA0002961666090000053
the last speed value of the jth female mayfly, i.e. the speed value of the jth female mayfly at time t-1, a3Is the third social interaction positive attraction coefficient, fl is the random walk coefficient, r2 is the second random number,
Figure BDA0002961666090000054
the distance between the last position value of the ith male mayfly and the last position value of the jth female mayfly,
Figure BDA0002961666090000055
the position value of the jth male mayflies, which was the last position value of the jth male mayflies at time t-1,
Figure BDA0002961666090000056
the value of the last position of the jth female mayfly, i.e., the value of the position of the jth female mayfly at time t-1.
In some exemplary embodiments, the cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies comprises:
calculating the position values of two said next-generation mayflies according to the formulas offset 1 ═ L × male + (1-L) × male and offset 2 ═ L × male + (1-L) × male;
wherein, offset 1 is the current position value of one of the next generation mayflies, offset 2 is the current position value of another next generation mayfly, mail is the current position value of the selected male mayfly, female is the current position value of the selected female mayfly, L is a third random number.
In some exemplary embodiments, said calculating the present group optimal position value from the present position values of all male mayflies of the updated male population and the present position values of all female mayflies of the updated female population comprises:
calculating the current optimal position values of the male mayflies of the current population according to the current position values of all the male mayflies of the updated male mayflies population;
calculating the current optimal position values of the mayflies population of the current mayflies population according to the updated current position values of all the mayflies population of the female mayflies population;
and determining the optimal position value of the current group according to the optimal position value of the current male group and the optimal position value of the current female group.
In a second aspect, an embodiment of the present disclosure provides a testing method, including:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and female mayfly population according to the present position values of two next-generation mayfly individuals, calculating the present group optimum position value from the present position values of all male mayfly individuals of the updated male mayfly population and the present position values of all female mayfly individuals of the updated female mayfly population;
adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number;
inputting the test excitation into a to-be-tested track planner and a corresponding reference model respectively; acquiring pulse parameters of the to-be-detected track planner and acquiring pulse parameters of the reference model;
and comparing the pulse parameters of the to-be-detected track planner with the pulse parameters of the reference model to obtain a comparison result.
In some exemplary embodiments, after comparing the pulse parameters of the trajectory planner to be tested and the pulse parameters of the reference model to obtain a comparison result, the method further includes:
adding 1 to the number of currently generated test stimuli, setting 0 to the number of current iterations when the number of currently generated test stimuli after adding 1 is less than the preset number of test stimuli F, continuing the step of calculating the present-time position values of each male mayflies in the male mayfly population respectively.
In some exemplary embodiments, after outputting the optimal location value of the current group as a test excitation, before inputting the test excitation into the trajectory planner to be tested and the corresponding reference model, respectively, the method further includes:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of respectively inputting the test excitation into the trajectory planner to be tested and the corresponding reference model.
In some exemplary embodiments, the pulse parameters include: the direction of the pulse; the comparison result comprises: pulse direction error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
according to the formula
Figure BDA0002961666090000071
Calculating the pulse direction error;
wherein, the direction _ error is the pulse direction error, the expected _ direction is the pulse direction of the reference model, and the actual _ direction is the pulse direction of the to-be-measured trajectory planner.
In some exemplary embodiments, the pulse parameters include: the number of pulses; the comparison result comprises: pulse number error grade;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse number error according to a formula number _ error ═ abs (all _ expected _ number-all _ actual _ number);
according to the formula
Figure BDA0002961666090000072
Calculating the error grade of the number of the pulses;
and the number _ error is the pulse number error, the all _ expected _ number is the pulse number of the reference model, the all _ actual _ number is the pulse number of the to-be-measured track planner, and the grade is the pulse number error grade.
In some exemplary embodiments, the pulse parameters include: the pulse frequency; the comparison result comprises: a pulse frequency error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse frequency error according to a formula freq _ error ═ abs (expected _ freq-actual _ freq);
wherein freq _ error is the pulse frequency error, expected _ freq is the pulse frequency of the reference model, and actual _ freq is the pulse frequency of the to-be-measured trajectory planner.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
one or more processors;
a memory having one or more programs stored thereon, the one or more programs being executable by the one or more processors to cause the one or more processors to implement any of the test stimulus generation methods described above, or any of the test methods described above;
one or more I/O interfaces connected between the processor and the memory and configured to enable information interaction between the processor and the memory.
In a fourth aspect, an embodiment of the present disclosure provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements any one of the above-mentioned test stimulus generation methods or any one of the above-mentioned test methods.
The method of generating test stimuli provided in the embodiments of the present disclosure employs the position values of male mayflies or the position values of female mayflies to represent a feasible solution to the test stimulus and seeks the group-optimal position values of the mayflies based on the intelligent algorithms, that is, the optimal solution to the test stimulus, the test stimuli obtained based on the intelligent algorithms are of great diversity and large coverage of the test interval, thereby reducing the time-consuming of the whole test process, improving efficiency, ultimately shortening the development cycle, reducing costs.
The testing method provided by the embodiments of the present disclosure obtains testing stimuli based on the mayflies intelligent algorithm, tests are carried out based on the obtained testing stimuli, because the testing stimuli obtained based on the mayflies intelligent algorithm are of better diversity and the coverage of the testing interval is large, a large-coverage test can be realized with fewer testing stimuli, and the testing time is saved.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
FIG. 1 is a block diagram of a trajectory planner provided in an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a test method provided in the related art;
FIG. 3 is a flow chart of a test stimulus generation method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of a testing method according to another embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device according to another embodiment of the disclosure;
FIG. 6 is a block diagram illustrating components of a storage medium according to another embodiment of the present disclosure;
fig. 7 is a block diagram of a test stimulus generation apparatus according to another embodiment of the present disclosure;
FIG. 8 is a block diagram of a testing device according to another embodiment of the present disclosure;
FIG. 9 is a block diagram illustrating a first component of a test system provided by an embodiment of the present disclosure;
fig. 10 is a block diagram of a second component of the test system according to the embodiment of the disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present disclosure, the test stimulus generation method, the test method, the electronic device, and the storage medium provided in the present disclosure are described in detail below with reference to the accompanying drawings.
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Description of technical terms
In the present disclosure, unless otherwise specified, the following technical terms should be understood in accordance with the following explanations:
the trajectory planning is a process of planning the position, speed and acceleration of a tail end point (namely an operation point or an end effector) of numerical control intelligent equipment such as a mechanical arm or a numerical control machine tool on the time course trajectory, and finally converting a position value into a motor pulse and direction, and the trajectory planner is software and hardware equipment for realizing the trajectory planning.
The track planner has important influence on the efficient and stable operation of numerical control intelligent equipment such as a mechanical arm or a numerical control machine tool, enables the end effector to move smoothly and stably through track planning, reduces impact and vibration, and has important significance in improving the stability, reliability and working efficiency of the numerical control intelligent equipment such as the mechanical arm or the numerical control machine tool.
Fig. 1 is a block diagram of a trajectory planner according to an embodiment of the present disclosure.
As shown in fig. 1, the trajectory planner includes: an acceleration and deceleration control module 101, an interpolation module 102 and a pulse generation module 103.
The acceleration and deceleration control module 101 is configured to output, according to the initial displacement, the target displacement, the velocity, the acceleration, the jerk, the interpolation period, and the like, a time-history trajectory of the position of the end point to time (that is, a position value of the end point changing with time) expressed in a floating point format in the process of moving the end point from the initial displacement to the target displacement;
the interpolation module 102 is configured to convert the time history track of the position of the end point represented in the floating point number format into a fixed point binary number format, and perform interpolation operation on the time history track of the position of the end point represented in the fixed point binary number format;
and the pulse generation module 103 is used for converting the position-to-time history track of the tail end point after the interpolation operation into a pulse direction and a pulse output, so that the tail end point moves from the initial displacement to the target displacement according to the output pulse direction and the pulse.
The functions of the acceleration and deceleration control module 101 are implemented by a first processor, the functions of the interpolation module 102 and the pulse generation module 103 are implemented by a Field Programmable logic Array (FPGA), and the first processor and the FPGA are connected by a bus and perform data communication through a bus interface.
The pulse tester is used for testing the output pulses to obtain the number and the frequency of the pulses, and recording the direction, the number and the frequency of the pulses.
Fig. 2 is a schematic diagram of a test method provided in the related art.
As shown in fig. 2, in the related art testing method, a tester needs to manually set a group of test excitations, input the test excitations into a trajectory planner, test output pulses by a pulse tester to obtain the number of pulses and the pulse frequency, and record the pulse direction, the number of pulses, and the pulse frequency. And (4) judging the accuracy of the pulse direction, the pulse number and the pulse frequency recorded by the pulse tester by a tester.
In the related testing method, all the functional tests of the trajectory planner are manually completed, the testing excitation diversity manually set by a tester is poor, and the coverage of a testing area is small, so that the whole testing process is time-consuming and low in efficiency, the development period is finally prolonged, and the cost is increased.
The embodiment of the mayflies is adopted to generate the test stimuli by the intelligent algorithm, so that the diversity of the test stimuli is improved, and the coverage of a test interval is improved, thereby reducing the time consumption of the whole test process, improving the efficiency, finally shortening the development period and reducing the cost.
Mayflies (mayfly) are insects belonging to the order mayflies, and are part of the order archaea. It is estimated that more than 3000 dayflies exist worldwide. Their name is derived from the month of february in which they occur mainly in the uk. After hatching from eggs, immature mayflies can be seen with the naked eye, which take years to grow into aquatic insects, until they rise to the water surface after they are ready for adults. One adult mayflies only survives for a few days until it fulfills the final goal of propagation. To attract females, most male adults gather in a group on the water surface several meters, and perform a wedding dance through a characteristic up-and-down motion pattern. Females fly into these male mayflies in order to mate with males in the air. Mating may last only a few seconds and when mating is complete, the females lay their eggs on the water and their cycle is complete.
Its inspiration derives from the social behavior of mayflies, particularly their mating process. It is hypothesized that after mayflies have hatched from eggs, they are already adults, and that mayflies which are most suitable for the environment survive, regardless of how long they live. The location of each mayfly in the search space represents a potential solution to the problem. The working principle of the intelligent mayflies algorithm is as follows:
initially, two groups of mayflies were randomly generated, representing male and female populations respectively. That is, each mayfly is randomly placed in the problem space as a candidate solution x ═ x (x) represented by a d-dimensional vector1,x2,……,xd) The performance is evaluated according to a predetermined objective function f (x). The speed v ═ v of mayflies1,v2,……,vd) Defined as the change in its position, the direction of flight of each dayfly is a dynamic interaction of the individual and social flight experience. In particular, each mayflies will adjust their trajectory towards the personal optimum position p of the current positionbestAnd the optimal position g obtained for any dayflies in the population in the positions thus farbest
In the disclosed embodiment, the personal optimal position pbestThe method is characterized in that each individual independently searches an optimal solution in a search space, the optimal solution is taken as a current individual extreme value, the current individual extreme value is shared with other individuals in the whole population, and the optimal individual extreme value is found to be taken as a current global optimal solution g of the whole populationbestAll individuals in the population find the current individual extreme value p according to the individualsbestCurrent global optimal solution g shared with the entire particle swarmbestTo adjust its speed and position.
In the disclosed embodiment, each dayfly is represented by a d-dimensional vector.
For example, the position of the ith male mayfly at time t is shown as
Figure BDA0002961666090000121
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies.
The speed of the ith male mayflies at time t is represented as
Figure BDA0002961666090000122
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies.
The individual optimal position of the ith individual male mayflies at time t is represented as
Figure BDA0002961666090000123
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies.
The optimal location of the population at time t for male mayflies is represented as
Figure BDA0002961666090000124
Similarly, the position of the jth female dayflies at time t is shown as
Figure BDA0002961666090000125
j-1, 2, 3, … …, N are male mayflies in a population of males individual number.
The speed of the jth female mayflies at time t is shown as
Figure BDA0002961666090000126
j-1, 2, 3, … …, N are the number of mayflies in a mayfly population.
The individual optimal position of the jth female mayflies at time t is represented as
Figure BDA0002961666090000131
j-1, 2, 3, … …, N are the number of mayflies in a mayfly population.
The optimal position of the population in female dayflies at time t is represented as
Figure BDA0002961666090000132
In some exemplary embodiments, d ═ 6, i.e., a 6-dimensional vector representation per mayflies.
For example, the position of the ith male mayfly at time t is shown as
Figure BDA0002961666090000133
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies. Here, the first and second liquid crystal display panels are,
Figure BDA0002961666090000134
a set of test stimuli required by the test trajectory planner corresponding to the positions of male mayflies,
Figure BDA0002961666090000135
represents the initial displacement in the position of a male mayfly individual,
Figure BDA0002961666090000136
represents the target displacement in the position of male mayflies,
Figure BDA0002961666090000137
representing male dayfliesThe speed in the position of the body is,
Figure BDA0002961666090000138
represents the acceleration in the position of a male mayfly individual,
Figure BDA0002961666090000139
represents the jerk in the position of the male mayflies,
Figure BDA00029616660900001310
represents the interpolated period in the position of male mayflies.
The speed of the ith male mayflies at time t is represented as
Figure BDA00029616660900001311
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies. Here, the first and second liquid crystal display panels are,
Figure BDA00029616660900001312
the speed of a set of test stimuli required by the test trajectory planner corresponding to the position of the male mayflies,
Figure BDA00029616660900001313
represents the speed of initial displacement in the position of a male mayflies,
Figure BDA00029616660900001314
represents the speed of target displacement in the position of male mayflies,
Figure BDA00029616660900001315
represents the speed in position of a male mayflies,
Figure BDA00029616660900001316
represents the speed of acceleration in the position of the male mayflies,
Figure BDA00029616660900001317
representing male dayfliesThe rate of jerk in the position of the body,
Figure BDA00029616660900001318
represents the speed of the interpolated cycle in the position of male mayflies.
The individual optimal position of the ith individual male mayflies at time t is represented as
Figure BDA00029616660900001319
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies. Here, the first and second liquid crystal display panels are,
Figure BDA00029616660900001320
representing a set of test stimuli required by the test trajectory planner for the individual optimal position,
Figure BDA00029616660900001321
representing the initial displacement in the optimal position of the individual,
Figure BDA00029616660900001322
representing the target displacement in the optimal position of the individual,
Figure BDA00029616660900001323
representing the velocity in the optimal position of the individual,
Figure BDA00029616660900001324
represents the acceleration in the optimal position of the individual,
Figure BDA00029616660900001325
representing the jerk in the optimal position of the individual,
Figure BDA00029616660900001326
representing the interpolation period in the individual optimal position.
The optimal position of the population for male dayflies at time t is represented as
Figure BDA00029616660900001327
Here, gbest1tRepresenting a set of test stimuli required by the test trajectory planner for the optimal location of the population,
Figure BDA00029616660900001328
representing the initial displacement in the optimal position of the population,
Figure BDA0002961666090000141
representing the target displacement in the optimal position of the population,
Figure BDA0002961666090000142
representing the velocity in the optimal position of the population,
Figure BDA0002961666090000143
representing the acceleration in the optimal position of the population,
Figure BDA0002961666090000144
representing the jerk in the optimal position of the population,
Figure BDA0002961666090000145
indicating the interpolation period in the optimal position of the population.
Similarly, the position of the jth female dayflies at time t is shown as
Figure BDA0002961666090000146
j-1, 2, 3, … …, N are the number of mayflies in a mayfly population. Here, the first and second liquid crystal display panels are,
Figure BDA0002961666090000147
a set of test stimuli required by the test trajectory planner corresponding to the positions of female dayflies,
Figure BDA0002961666090000148
representing the initial displacement in the position of a female mayfly individual,
Figure BDA0002961666090000149
to representTarget shifts in the position of female dayflies,
Figure BDA00029616660900001410
representing the speed in position of a female mayfly,
Figure BDA00029616660900001411
represents the acceleration in the position of a female mayfly individual,
Figure BDA00029616660900001412
representing the jerk in the position of a female mayfly individual,
Figure BDA00029616660900001413
represents the interpolated period in the position of a female mayfly.
The speed of the jth female mayflies at time t is shown as
Figure BDA00029616660900001414
j-1, 2, 3, … …, N are the number of mayflies in a mayfly population. Here, the first and second liquid crystal display panels are,
Figure BDA00029616660900001415
the speed of a set of test stimuli required by the test trajectory planner corresponding to the position of a female mayfly individual,
Figure BDA00029616660900001416
representing the velocity of the initial displacement in the position of a female mayfly individual,
Figure BDA00029616660900001417
representing the speed of target displacement in the position of a female mayfly individual,
Figure BDA00029616660900001418
representing the velocity in the position of a female mayfly,
Figure BDA00029616660900001419
to indicate a femaleThe speed of acceleration in the position of the dayflies,
Figure BDA00029616660900001420
represents the rate of jerk in the position of female dayflies,
Figure BDA00029616660900001421
represents the speed of the interpolation cycle in the position of female mayflies.
The individual optimal position of the jth female mayflies at time t is represented as
Figure BDA00029616660900001422
i-1, 2, 3, … …, M, the number of male mayflies in a population of male mayflies. Here, the first and second liquid crystal display panels are,
Figure BDA00029616660900001423
representing a set of test stimuli required by the test trajectory planner for the individual optimal position,
Figure BDA00029616660900001424
representing the initial displacement in the optimal position of the individual,
Figure BDA00029616660900001425
representing the target displacement in the optimal position of the individual,
Figure BDA00029616660900001426
representing the velocity in the optimal position of the individual,
Figure BDA00029616660900001427
represents the acceleration in the optimal position of the individual,
Figure BDA00029616660900001428
representing the jerk in the optimal position of the individual,
Figure BDA00029616660900001429
representing the interpolation period in the individual optimal position.
The optimal position of the population of female dayflies at time t is represented as
Figure BDA00029616660900001430
Here, gbest2tRepresenting a set of test stimuli required by the test trajectory planner for the optimal location of the population,
Figure BDA00029616660900001431
representing the initial displacement in the optimal position of the population,
Figure BDA00029616660900001432
representing the target displacement in the optimal position of the population,
Figure BDA0002961666090000151
representing the velocity in the optimal position of the population,
Figure BDA0002961666090000152
representing the acceleration in the optimal position of the population,
Figure BDA0002961666090000153
representing the jerk in the optimal position of the population,
Figure BDA0002961666090000154
indicating the interpolation period in the optimal position of the population.
Fig. 3 is a flowchart of a test stimulus generation method according to an embodiment of the present disclosure.
In a first aspect, referring to fig. 3, an embodiment of the present disclosure provides a test stimulus generation method, including:
step 300, calculating the present position value of each male mayflies in the male mayflies population respectively; wherein the position values of the male mayflies represent a feasible solution to a test stimulus.
In some exemplary embodiments, calculating the present location value of each male mayflies in a male mayfly population separately comprises:
the present position values of each male mayflies in a population are calculated based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of the male mayflies.
In some exemplary embodiments, calculating the present position value of the male mayflies according to their last speed value, last position value, last individual optimal position value and last male population optimal position value comprises:
calculating the present speed values of the male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values;
the present position values of the male mayflies are calculated from the last position values and the present speed values of the male mayflies.
In the disclosed embodiments, the aggregation of male mayflies clusters means that the position of each male mayflies is adjusted according to experience of oneself and of neighbors. Also, considering that male mayflies always perform dances several meters above the water surface, it is assumed that they cannot develop a fast speed and move constantly.
In the disclosed embodiment, in iteration 1, the last speed value of the i-th male mayflies is the initial speed value of the i-th male mayflies, the last position value of the i-th male mayflies is the initial position value of the i-th male mayflies, the last individual-optimal position value of the i-th male mayflies is the initial individual-optimal position value of the i-th male mayflies, and the last male-colony-optimal position value is the initial male-colony-optimal position value.
Starting from iteration 2, the last speed value of the i-th male mayflies is the speed value obtained in the previous iteration, the last position value of the i-th male mayflies is the position value obtained in the previous iteration, the last individual optimum position value of the i-th male mayflies is the individual optimum position value obtained in the previous iteration, and the last male population optimum position value is the male population optimum position value obtained in the previous iteration.
In some exemplary embodiments, the initial value of the position of the male dayflies can be set to a random value within a constraint interval corresponding to one test stimulus required by the test trajectory planner.
And the constraint interval corresponding to the test excitation comprises a value interval corresponding to each parameter in the test excitation. For example, the initial displacement is P, and the value interval of the initial displacement is set to Pmin≤P≤Pmax(ii) a The target displacement is T, and the value interval of the target displacement is set as Tmin≤T≤Tmax(ii) a The speed is V, and the value interval of the speed is set as Vmin≤V≤Vmax(ii) a The acceleration is A, and the value interval of the acceleration is set as Amin≤A≤Amax(ii) a The jerk is J, and the value interval of the jerk is set as Jmin≤J≤Jmax(ii) a The interpolation period is SC, and the value interval of the interpolation period is set to SCmin≤SC≤SCmax
In some exemplary embodiments, the initial value of the speed of the male dayflies can be set to 0.
For example, the speed of mayflies at time 0 in the i-th male mayflies is represented as
Figure BDA0002961666090000161
In the case of (1), let
Figure BDA0002961666090000162
Are all 0.
In some exemplary embodiments, the individual optimal position initial value for male dayflies can be set to the position initial value for male dayflies. For example, the initial value of the individual optimal position of the ith male mayfly
Figure BDA0002961666090000163
In some exemplary embodiments, the initial values of the optimal positions of the male population can be calculated from the values of the individual optimal positions of all male dayflies in a male mayfly population.
For example, the initial value of the optimal position of the male population may be calculated according to equation (1).
Figure BDA0002961666090000164
Where f () represents the fitness function, gbest10For the initial value of the optimal position for the male population,
Figure BDA0002961666090000165
the initial value of the individual optimum position for the 1 st male mayflies,
Figure BDA0002961666090000166
the initial value of the individual optimal position for the 2 nd male mayflies, … …,
Figure BDA0002961666090000167
the initial value of the individual optimal position for the mth male mayflies.
In some exemplary embodiments, in
Figure BDA0002961666090000168
In case of (1), calculating the current speed value of the i-th male mayfly according to formula (2); in that
Figure BDA0002961666090000169
In case of (1), calculating the current speed value of the i-th male mayfly according to formula (3); wherein f () is a fitness function,
Figure BDA0002961666090000171
the last position value of the ith male mayfly individual,
Figure BDA0002961666090000172
the last individual optimal position value for the ith male mayfly individual.
Figure BDA0002961666090000173
Wherein the content of the first and second substances,
Figure BDA0002961666090000174
the speed values of the ith male mayflies, that is, the speed values of the ith male mayflies at time t,
Figure BDA0002961666090000175
the last speed value of the ith male mayflies, i.e. the speed value of the ith male mayflies at time t-1, a1Positive attraction coefficient for first social interaction (e.g., a)1=1),a2Positive attraction coefficient for second social interaction (e.g., a)21.5), β is the visibility coefficient of dayflies (e.g. 2),
Figure BDA0002961666090000176
the distance between the last position value of the ith male mayfly individual and the last individual optimum position value of the ith male mayfly individual,
Figure BDA0002961666090000177
the last position value of the ith male mayfly individual,
Figure BDA0002961666090000178
the last individual optimum position value for the ith male mayflies,
Figure BDA0002961666090000179
the distance between the last position value of the ith male mayfly and the last optimal position value of the current male colony, gbest1t-1The optimal position value of the male population at the last time.
In the disclosed embodiments, in the calculation
Figure BDA00029616660900001710
When the temperature of the water is higher than the set temperature,
Figure BDA00029616660900001711
should be calculated according to the formula, i.e.
Figure BDA00029616660900001712
Wherein k is 1, 2, …, d,
Figure BDA00029616660900001713
is composed of
Figure BDA00029616660900001714
The data of the k-th dimension of (1),
Figure BDA00029616660900001715
is composed of
Figure BDA00029616660900001716
The data of the k-th dimension of (1),
Figure BDA00029616660900001717
is composed of
Figure BDA00029616660900001718
The k-th dimension data.
In the disclosed embodiments, in the calculation
Figure BDA00029616660900001719
When the temperature of the water is higher than the set temperature,
Figure BDA00029616660900001720
should be calculated according to the formula, i.e.
Figure BDA00029616660900001721
Wherein k is 1, 2, …, d,
Figure BDA00029616660900001722
is composed of
Figure BDA00029616660900001723
The data of the k-th dimension of (1),
Figure BDA00029616660900001724
is composed of
Figure BDA00029616660900001725
The data of the k-th dimension of (1),
Figure BDA00029616660900001726
is composed of
Figure BDA00029616660900001727
The k-th dimension data.
Figure BDA00029616660900001728
Where D is a dancing coefficient (e.g., 5) and r1 is a first random number (e.g., a random number between [ -1, 1 ]).
In some exemplary embodiments, this time position value of the i-th male mayfly is calculated according to formula (4).
Figure BDA00029616660900001729
Wherein the content of the first and second substances,
Figure BDA00029616660900001730
the present position value for the ith male mayfly individual,
Figure BDA00029616660900001731
the last position value of the ith male mayfly individual,
Figure BDA00029616660900001732
this speed value for the ith male mayflies.
In some exemplary embodiments, the fitness of the i-th male mayflies at time t is calculated according to equation (5).
Figure BDA0002961666090000181
Wherein the content of the first and second substances,
Figure BDA0002961666090000182
Figure BDA0002961666090000183
the number of times that the 1 st dimension data in the position of the ith male mayfly individual appears in the corresponding value range,
Figure BDA0002961666090000184
the number of times that the 2 nd dimension data in the position of the ith male mayflies occur in the corresponding value ranges, … …,
Figure BDA0002961666090000185
the number of times that the mth dimension data in the position of the ith male mayfly individual appears in the corresponding value range.
Wherein the number of occurrences of the 1 st dimension data in the position of the i-th male mayflies in the corresponding value interval is the number of male mayflies in which the 1 st dimension data is the same in the male population, the number of occurrences of the 2 nd dimension data in the position of the i-th male mayflies in the corresponding value interval is the number of male mayflies in which the 2 nd dimension data is the same in the male mayflies population, … …, and the number of occurrences of the M-th dimension data in the position of the i-th male mayflies in the corresponding value interval is the number of male mayflies in which the M-th dimension data is the same in the male mayflies population.
Step 301, calculating the present position value of each female dayflies in the female mayfly population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus.
In some exemplary embodiments, calculating the present position value of each mayfly individual in a female dayfly population separately comprises:
the present position values of the female mayflies are calculated for each female mayflies in a population based on the last speed value and the last position value of the female mayflies and the last position values of the male mayflies that attract the female mayflies.
In the embodiment of the present disclosure, in iteration 1, the last speed value of the j-th female mayflies is the initial speed value of the j-th female mayflies, the last position value of the j-th female mayflies is the initial position value of the j-th female mayflies, the last position value of the male mayflies which attract said female mayflies is the initial position value of the male mayflies which attract said female mayflies.
The last speed value of the j-th female mayflies is the speed value obtained in the previous iteration, and the last position value of the j-th female mayflies is the position value obtained in the previous iteration, starting from the 2 nd iteration, the last position value of the male mayflies which attract said female mayflies is the position value of the male mayflies which attract said female mayflies obtained in the previous iteration.
In some exemplary embodiments, the initial value of the position of the female dayflies can be set to a random value within a constraint interval corresponding to one test stimulus required by the test trajectory planner.
And the constraint interval corresponding to the test excitation comprises a value interval corresponding to each parameter in the test excitation. For example, the initial displacement is P, and the value interval of the initial displacement is set to Pmin≤P≤Pmax(ii) a The target displacement is T, and the value interval of the target displacement is set as Tmin≤T≤Tmax(ii) a The speed is V, and the value interval of the speed is set as Vmin≤V≤Vmax(ii) a The acceleration is A, and the value interval of the acceleration is set as Amin≤A≤Amax(ii) a The jerk is J, and the value interval of the jerk is set as Jmin≤J≤Jmax(ii) a The interpolation period is SC, and the value interval of the interpolation period is set to SCmin≤SC≤SCmax
In some exemplary embodiments, the initial value of the speed of the female dayflies can be set to 0.
For example, the speed of dayflies at time 0 in the j-th female is represented as
Figure BDA0002961666090000191
In the case of (1), let
Figure BDA0002961666090000192
Are all 0.
In some exemplary embodiments, calculating the present position value of the female dayflies according to the last speed value and the last position value of the female dayflies and the last position value of the male dayflies that attract the female includes:
calculating the present speed values of the female mayflies based on the last speed values and the last position values of the female mayflies and the last position values of the male mayflies that attract said female mayflies; the present position values of said female mayflies are calculated from the last position values and the present speed values of said female mayflies.
In the disclosed embodiments, unlike males, mayflies do not gather in clusters, and mayflies do flies to propagate in the male mayflies. Whereas the attraction processes of male and female dayflies are random, the attraction process of male and female dayflies is modeled as a deterministic process. That is, according to their robust attributes, the most elegant female mayflies should be attracted by the most elegant male mayflies, the second best female mayflies should be attracted by the second best male mayflies, and so on.
Therefore, in view of minimization, in some exemplary embodiments, the present speed values for the j-th female mayflies are calculated according to equation (6).
Figure BDA0002961666090000193
Wherein the content of the first and second substances,
Figure BDA0002961666090000194
the current speed value of the j-th female mayflies, i.e. the speed value of the j-th female mayflies at time t,
Figure BDA0002961666090000195
the last speed value of the jth female mayfly, i.e. the speed value of the jth female mayfly at time t-1, a3For the third social interaction positive attraction coefficient (e.g., 1.3), fl is a random walk coefficient (e.g., 1.0), and r2 is a second random number (e.g., [ -1, 1 [)]A random number in between),
Figure BDA0002961666090000201
the distance between the last position value of the ith male mayfly and the last position value of the jth female mayfly,
Figure BDA0002961666090000202
the position value of the jth male mayflies, which was the last position value of the jth male mayflies at time t-1,
Figure BDA0002961666090000203
the value of the last position of the jth female mayfly, i.e., the value of the position of the jth female mayfly at time t-1.
In the disclosed embodiments, in the calculation
Figure BDA0002961666090000204
When the temperature of the water is higher than the set temperature,
Figure BDA0002961666090000205
should be calculated according to the formula, i.e.
Figure BDA0002961666090000206
Wherein k is 1, 2, …, d,
Figure BDA0002961666090000207
is composed of
Figure BDA0002961666090000208
The data of the k-th dimension of (1),
Figure BDA0002961666090000209
is composed of
Figure BDA00029616660900002010
The data of the k-th dimension of (1),
Figure BDA00029616660900002011
is composed of
Figure BDA00029616660900002012
The k-th dimension data.
In some exemplary embodiments, this time position value for the j-th female dayfly is calculated according to equation (7).
Figure BDA00029616660900002013
Wherein the content of the first and second substances,
Figure BDA00029616660900002014
the present position value for the jth mayfly individual,
Figure BDA00029616660900002015
the last position value for the jth female mayfly,
Figure BDA00029616660900002016
this speed value for the j-th female mayflies.
Step 302, selecting one male mayflies from said male mayflies, selecting one female mayflies from said female mayflies, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies.
In some exemplary embodiments, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies comprises:
the position or speed values of the two next generation mayflies are calculated according to equations (8) and (9).
offspring1=L×male+(1-L)×female (8)
offspring2=L×female+(1-L)×male (9)
Among them, offset 1 is the current position value of one of the next generation mayflies, offset 2 is the current position value of another next generation mayfly, mail is the current position value of the selected male mayfly, female is the current position value of the selected female mayfly, and L is a third random number (e.g., a random number between [ -1, 1 ]).
Alternatively, offset 1 is the current speed value of one of the next generation mayflies, offset 2 is the current speed value of another next generation mayflies, male is the current speed value of the selected male mayflies, female is the current speed value of the selected female mayflies, and L is a random number (e.g. a random number between [ -1, 1 ]).
Step 303 updates the male and female mayfly populations according to the present position values of the two next generation mayflies, calculating the present group optimal position values according to the present position values of all male mayflies of the updated male mayfly population and the present position values of all female mayflies of the updated female mayfly population.
In some exemplary embodiments, updating the male and female mayflies populations according to the present position values of the two next generation mayflies comprises:
one of the next-generation mayflies is allocated to a male mayflies, the other next-generation mayflies are allocated to a female mayflies, one male mayflies are eliminated from the male mayflies, one female mayflies are eliminated from the female mayflies.
In some exemplary embodiments, the elimination of one male mayflies from a population of male mayflies comprises: the male mayflies individual with the largest fitness value were eliminated from the male mayflies population.
In some exemplary embodiments, the elimination of one female mayflies from a female mayflies population comprises: mayflies individuals with the largest fitness value are eliminated from the female mayflies population.
In some exemplary embodiments, calculating the present group optimal position value from the present position values of all male mayflies of the updated male mayflies and the present position values of all female mayflies of the updated female mayflies comprises:
calculating the current optimal position values of the male mayflies of the current population according to the current position values of all the male mayflies of the updated male mayflies population;
calculating the current optimal position values of the mayflies population of the current mayflies population according to the updated current position values of all the mayflies population of the female mayflies population;
and determining the optimal position value of the current group according to the optimal position value of the current male group and the optimal position value of the current female group.
In some exemplary embodiments, calculating the present male population optimal position values of the updated male mayflies population from the present position values of all male mayflies of the updated male mayflies population comprises:
calculating the present individual optimal position values of each male mayflies of the updated male mayflies population respectively;
the present optimal position values of the male mayflies population are calculated from the present individual optimal position values of all male mayflies of the updated male mayflies population.
In some exemplary embodiments, this individual optimal position value for the ith male mayfly is calculated according to equation (10).
Figure BDA0002961666090000221
Wherein the content of the first and second substances,
Figure BDA0002961666090000222
for this individual optimum position value of the ith male mayfly individual,
Figure BDA0002961666090000223
the last individual optimum position value for the ith male mayflies,
Figure BDA0002961666090000224
the current position value for the ith male mayfly individual.
In some exemplary embodiments, the present optimal location value for the male population is calculated according to equation (11).
Figure BDA0002961666090000225
Wherein, gbest1tFor the optimal position value of the male population at this time,
Figure BDA0002961666090000226
the present individual optimum position value for the 1 st male mayflies,
Figure BDA0002961666090000227
the current individual optimal position value for the 2 nd male mayflies, … …,
Figure BDA0002961666090000228
the current individual optimal position value for the mth male mayflies.
In some exemplary embodiments, calculating the present mayfly population optimal position values for the updated present mayfly population from the present position values of all mayflies of the updated female mayfly population comprises:
calculating the present individual optimal position values of each female mayflies of the updated female mayfly population respectively;
the present optimal position values of the female mayflies of the population are calculated from the present individual optimal position values of all the female mayflies of the updated female mayflies.
In some exemplary embodiments, the present individual optimal position values for the j-th female mayflies are calculated according to equation (12).
Figure BDA0002961666090000229
Wherein the content of the first and second substances,
Figure BDA00029616660900002210
for this individual optimal position value of the jth female mayflies,
Figure BDA0002961666090000231
the last individual optimal position value for the jth female mayfly individual,
Figure BDA0002961666090000232
the present position value of the jth female mayfly.
In some exemplary embodiments, the present optimal location value for the male population is calculated according to equation (13).
Figure BDA0002961666090000233
Wherein, gbest2tFor the optimal position value of the current female group,
Figure BDA0002961666090000234
the present individual optimum position value for the 1 st female mayflies,
Figure BDA0002961666090000235
the optimal position value for this individual for the 2 nd female mayflies, … …,
Figure BDA0002961666090000236
is the mother of the Nth female mayflySub-individual optimal position values.
In some exemplary embodiments, the optimal location value of the current population is determined according to equation (14).
Figure BDA0002961666090000237
Wherein pbest3tFor the optimal position value of this group, gbest1tFor optimal location value of this male population, gbest2tAnd obtaining the optimal position value of the current female group.
And 304, adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number L.
In some exemplary embodiments, assuming that the current iteration number is initialized to 0, in the 1 st iteration, the current iteration number is added by 1, that is, the initial value of the current iteration number is added by 1.
Starting from the 2 nd iteration, the current iteration number is added with 1, namely the current iteration number after the previous iteration is added with 1.
In some exemplary embodiments, in a case that the current number of iterations after adding 1 is less than the preset number of iterations L, the method further includes:
the step of calculating the present position value of each male mayflies in the male mayflies population respectively continues, namely steps 300-304 are continued.
In the embodiment of the present disclosure, each output test stimulus is obtained after L iterations, and therefore, in order to obtain a plurality of test stimuli, the step 300 and the step 304 need to be performed continuously, that is, in some exemplary embodiments, the method further includes:
and adding 1 to the number of the currently generated test excitations, and ending the flow under the condition that the number of the currently generated test excitations after the 1 is added is equal to the preset number F of the test excitations.
In some exemplary embodiments, the method further comprises:
in the case that the currently generated number of test stimuli after the addition of 1 is less than the preset number of test stimuli F, the step of calculating the present position value of each male mayflies in the population respectively continues with setting the current number of iterations to 0, i.e., with continuing with step 300-304.
In some exemplary embodiments, assuming that the number of currently generated test excitations is initialized to 0, in the 1 st iteration, the number of currently generated test excitations is added by 1, that is, the initial value of the number of currently generated test excitations is added by 1.
Starting from the 2 nd iteration, adding 1 to the number of the currently generated test excitations, namely adding 1 to the number of the currently generated test excitations after the previous iteration.
In the disclosed embodiment, starting with the acquisition of the 2 nd test stimulus, the last speed value of the ith male mayfly is the speed value obtained in the previous iteration, the last position value of the ith male mayfly is the position value obtained in the previous iteration, the last individual optimal position value of the ith male mayfly is the individual optimal position value obtained in the previous iteration, and the last male population optimal position value is the male population optimal position value obtained in the previous iteration; the last speed value of the j-th female mayflies is the speed value obtained in the previous iteration, the last position value of the j-th female mayflies is the position value obtained in the previous iteration, and the last position value of the male mayflies which attract said female mayflies is the position value of the male mayflies which attract said female mayflies obtained in the previous iteration.
That is, the mayflies intelligent algorithm is performed without repeatedly performing the initialization again, and the calculations are performed based on the initialization values.
In some exemplary embodiments, to ensure that the test stimuli output at different times are different, before adding 1 to the number of currently generated test stimuli, the method further comprises:
and under the condition that the test excitation output this time is different from the test excitation output before, continuing to execute the step of adding 1 to the number of the currently generated test excitation.
In some exemplary embodiments, in a case where the test stimulus output this time is the same as any one of the test stimuli output before, the method further includes:
resetting the initial value of speed, the initial value of position, the initial value of individual-optimal position and the initial value of male population optimum position for each male mayflies in a population of males, and the initial value of speed and the initial value of position for each female mayflies in a population of females;
the reset initial value of speed of male mayflies is taken as the last speed value of male mayflies, the reset initial value of position of male mayflies is taken as the last position value of male mayflies, the reset initial value of the individual-optimum position of male mayflies is taken as the last individual-optimum position value of male mayflies, the reset initial value of the male colony-optimum position is taken as the last male colony-optimum position value;
the original value of the speed of the re-set female mayflies is taken as the last speed value of the female dayflies, the original value of the position of the re-set female mayflies is taken as the last position value of the female mayflies;
increasing the first socially-acting positive attraction coefficient a for calculating the present position value of male mayflies1Second social interaction positive attraction coefficient a2The visibility coefficient β of mayflies, the first random number r1, the third socially-acting positive attraction coefficient a for calculating the present position value of a female mayflies3At least one of a second random number r2, and a third random number L for calculating the present position value of two next-generation mayflies;
the step of calculating the present position value of each male mayflies in the group respectively continues, i.e. steps 300-.
That is, in the event that the test stimulus output this time is the same as any of the previously output test stimuli, instead of iteratively calculating based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of male mayflies, and the last speed value and last position value of female mayflies to obtain new test stimuli, the intelligent algorithm for mayflies is restarted to perform the iterative calculations, i.e., to reset the initial values of the above-mentioned parameters and to increase the parameter values used to calculate the current position values.
In some exemplary embodiments, having cross-calculated the selected male mayflies and the selected female mayflies to obtain the present-time position values of the two next-generation mayflies, the method further comprises:
cross-calculating the values of this time of the two next generation mayflies by the selected male mayflies and the selected female mayflies;
when the present position values of the two next-generation dayflies obtained this time of calculation are different from the present position values of the two next-generation dayflies obtained the last time of calculation, or the present speed values of the two next-generation dayflies obtained this time of calculation are different from the present speed values of the two next-generation dayflies obtained the last time of calculation, the step of updating the male and female populations of the mayflies in accordance with the present position values of the two next-generation mayflies continues to be performed.
In some exemplary embodiments, the method further comprises, in the case that the present position values of two next-generation mayflies obtained this time of calculation are the same as the present position values of the two next-generation mayflies obtained the last time of calculation, and the present speed values of the two next-generation mayflies obtained this time of calculation are the same as the present speed values of the two next-generation mayflies obtained the last time of calculation:
the step of resetting the initial value of speed, initial value of position, initial value of individual-optimal position and initial value of male population of each of the male mayflies, and the initial values of speed and position of each of the female mayflies in the population is continued.
The method of generating test stimuli provided in the embodiments of the present disclosure employs the position values of male mayflies or the position values of female mayflies to represent a feasible solution to the test stimulus and seeks the group-optimal position values of the mayflies based on the intelligent algorithms, that is, the optimal solution to the test stimulus, the test stimuli obtained based on the intelligent algorithms are of great diversity and large coverage of the test interval, thereby reducing the time-consuming of the whole test process, improving efficiency, ultimately shortening the development cycle, reducing costs.
In some exemplary embodiments, the optimal positions of mayflies are sought based on the fitness function values, since the fitness function values employ the number of times the position values of the mayflies occur within the corresponding value interval, so the smaller the fitness function value, the less the number of times the values occur within the corresponding value interval are accounted for, i.e., the less the repetition rate of the position values of the mayflies, the better the diversity of the position values of the mayflies.
Fig. 4 is a flowchart of a testing method according to another embodiment of the disclosure.
In a second aspect, referring to fig. 4, another embodiment of the present disclosure provides a testing method, including:
step 400, calculating the present position value of each male mayflies in the male mayflies population respectively; wherein the position values of the male mayflies represent a feasible solution to a test stimulus.
The specific implementation process of step 400 is the same as that of step 300, and is not described herein again.
Step 401, calculating the present position value of each female dayflies in the female mayfly population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus.
The specific implementation process of step 401 is the same as that of step 301, and is not described herein again.
Step 402 selects one male mayflies from said male mayflies population, one female mayflies from said female mayflies population, the present position values of the selected male mayflies and the present position values of the selected female mayflies are cross-calculated to obtain the present position values of two next generation mayflies.
The specific implementation process of step 402 is the same as that of step 302, and is not described herein again.
Step 403, updating the male and female mayfly populations according to the present position values of the two next-generation mayflies, calculating the present group optimal position values according to the present position values of all male mayflies of the updated male mayfly population and the present position values of all female mayflies of the updated female mayfly population.
The specific implementation process of step 403 is the same as that of step 303, and is not described herein again.
And step 404, adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number.
The specific implementation process of step 404 is the same as that of step 304, and is not described herein again.
Step 405, inputting the test excitation into a to-be-tested trajectory planner and a corresponding reference model respectively; and acquiring pulse parameters of the to-be-detected track planner and acquiring pulse parameters of the reference model.
In some exemplary embodiments, the trajectory planner under test outputs pulse direction and pulses, and the pulse direction, number of pulses, and pulse frequency can be detected by the pulse tester.
The reference model can directly output the pulse direction, the pulse number and the pulse frequency.
In some exemplary embodiments, the pulse parameters include at least one of: pulse direction, number of pulses and pulse frequency.
In the embodiments of the present disclosure, the pulse direction refers to a change direction of the positional value of the end point. For example, in the case where the position value is increased from small to large (e.g., from an initial position value of 0 millimeter (mm) to an end position of 100mm), it is defined as a clockwise direction, and is represented by 0; in the case where the position value gradually decreases from large to small (e.g., from an initial position value of 100mm to an end position of 0mm), the counterclockwise direction is defined and is denoted by 1.
In the disclosed embodiment, the number of pulses refers to the number of pulses required to control the movement of the end point from the initial position to the end position.
In the disclosed embodiment, the pulse frequency refers to the frequency of pulses required to control the movement of the end point from the initial position to the end position.
And step 406, comparing the pulse parameters of the to-be-detected trajectory planner with the pulse parameters of the reference model to obtain a comparison result.
In some exemplary embodiments, the pulse parameters include: the direction of the pulse; the comparison result comprises: pulse direction error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse direction error according to formula (15);
Figure BDA0002961666090000281
wherein, the direction _ error is the pulse direction error, the expected _ direction is the pulse direction of the reference model, and the actual _ direction is the pulse direction of the to-be-measured trajectory planner.
In some exemplary embodiments, the pulse parameters include: the number of pulses; the comparison result comprises: pulse number error grade;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse number error according to a formula (16);
calculating the error grade of the number of pulses according to a formula (17);
number_error=abs(all_exp ected_number-all_actual_number) (16)
Figure BDA0002961666090000282
and the number _ error is the pulse number error, the all _ expected _ number is the pulse number of the reference model, the all _ actual _ number is the pulse number of the to-be-measured track planner, and the grade is the pulse number error grade.
In some exemplary embodiments, the pulse parameters include: the pulse frequency; the comparison result comprises: a pulse frequency error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse frequency error according to equation (18);
freq_error=abs(exp ected_freq-actual_freq) (18)
wherein freq _ error is the pulse frequency error, expected _ freq is the pulse frequency of the reference model, and actual _ freq is the pulse frequency of the to-be-measured trajectory planner.
In some exemplary embodiments, in a case that the current number of iterations after adding 1 is less than the preset number of iterations L, the method further includes:
the steps of calculating the present position value of each male mayflies in the male mayflies population respectively continue to be performed, i.e. steps 400-404 continue to be performed.
In the embodiment of the present disclosure, each output test excitation is obtained after L iterations, and therefore, in order to obtain a plurality of test excitations, the step 400 and 404 need to be executed continuously, that is, in some exemplary embodiments, after comparing the pulse parameter of the trajectory planner to be tested with the pulse parameter of the reference model to obtain a comparison result, the method further includes:
and adding 1 to the number of the currently generated test excitations, and ending the flow under the condition that the number of the currently generated test excitations after the 1 is added is equal to the preset number F of the test excitations.
In some exemplary embodiments, after comparing the pulse parameters of the trajectory planner to be tested and the pulse parameters of the reference model to obtain a comparison result, the method further includes:
adding 1 to the number of currently generated test stimuli, setting the current iteration number to 0 in the case that the number of currently generated test stimuli after adding 1 is less than the preset number of test stimuli F, continuing to perform the step of calculating the present-time position values of each male mayflies in the male mayfly population respectively, i.e. continuing to perform steps 400 and 406.
In some exemplary embodiments, assuming that the number of currently generated test excitations is initialized to 0, in the 1 st iteration, the number of currently generated test excitations is added by 1, that is, the initial value of the number of currently generated test excitations is added by 1.
Starting from the 2 nd iteration, adding 1 to the number of the currently generated test excitations, namely adding 1 to the number of the currently generated test excitations after the previous iteration.
In the disclosed embodiment, starting with the acquisition of the 2 nd test stimulus, the last speed value of the ith male mayfly is the speed value obtained in the previous iteration, the last position value of the ith male mayfly is the position value obtained in the previous iteration, the last individual optimal position value of the ith male mayfly is the individual optimal position value obtained in the previous iteration, and the last male population optimal position value is the male population optimal position value obtained in the previous iteration; the last speed value of the j-th female mayflies is the speed value obtained in the previous iteration, the last position value of the j-th female mayflies is the position value obtained in the previous iteration, and the last position value of the male mayflies which attract said female mayflies is the position value of the male mayflies which attract said female mayflies obtained in the previous iteration.
That is, the mayflies intelligent algorithm is performed without repeatedly performing the initialization again, and the calculations are performed based on the initialization values.
In some exemplary embodiments, to ensure that the test excitations output at different times are different, after outputting the optimal position value of the current group as one test excitation, before inputting the test excitation into the trajectory planner to be tested and the corresponding reference model, respectively, the method further includes:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of respectively inputting the test excitation into the trajectory planner to be tested and the corresponding reference model.
In some exemplary embodiments, in a case where the test stimulus output this time is the same as any one of the test stimuli output before, the method further includes:
resetting the initial value of speed, the initial value of position, the initial value of individual-optimal position and the initial value of male population optimum position for each male mayflies in a population of males, and the initial value of speed and the initial value of position for each female mayflies in a population of females;
the reset initial value of speed of male mayflies is taken as the last speed value of male mayflies, the reset initial value of position of male mayflies is taken as the last position value of male mayflies, the reset initial value of the individual-optimum position of male mayflies is taken as the last individual-optimum position value of male mayflies, the reset initial value of the male colony-optimum position is taken as the last male colony-optimum position value;
the original value of the speed of the re-set female mayflies is taken as the last speed value of the female dayflies, the original value of the position of the re-set female mayflies is taken as the last position value of the female mayflies;
increasing the first socially-acting positive attraction coefficient a for calculating the present position value of male mayflies1Second social interaction positive attraction coefficient a2The visibility coefficient β of mayflies, the first random number r1, a third socially active positive attractant series for calculating the present position value of a female mayfliesNumber a3At least one of a second random number r2, and a third random number L for calculating the present position value of two next-generation mayflies;
the step of calculating the present position value of each male mayflies in the group respectively continues, i.e. steps 400-404 continue to be performed.
That is, in the event that the test stimulus output this time is the same as any of the previously output test stimuli, instead of iteratively calculating based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of male mayflies, and the last speed value and last position value of female mayflies to obtain new test stimuli, the intelligent algorithm for mayflies is restarted to perform the iterative calculations, i.e., to reset the initial values of the above-mentioned parameters and to increase the parameter values used to calculate the current position values.
In some exemplary embodiments, having cross-calculated the selected male mayflies and the selected female mayflies to obtain the present-time position values of the two next-generation mayflies, the method further comprises:
cross-calculating the values of this time of the two next generation mayflies by the selected male mayflies and the selected female mayflies;
when the present position values of the two next-generation dayflies obtained this time of calculation are different from the present position values of the two next-generation dayflies obtained the last time of calculation, or the present speed values of the two next-generation dayflies obtained this time of calculation are different from the present speed values of the two next-generation dayflies obtained the last time of calculation, the step of updating the male and female populations of the mayflies in accordance with the present position values of the two next-generation mayflies continues to be performed.
In some exemplary embodiments, the method further comprises, in the case that the present position values of two next-generation mayflies obtained this time of calculation are the same as the present position values of the two next-generation mayflies obtained the last time of calculation, and the present speed values of the two next-generation mayflies obtained this time of calculation are the same as the present speed values of the two next-generation mayflies obtained the last time of calculation:
the step of resetting the initial value of speed, initial value of position, initial value of individual-optimal position and initial value of male population of each of the male mayflies, and the initial values of speed and position of each of the female mayflies in the population is continued.
The testing method provided by the embodiments of the present disclosure obtains testing stimuli based on the mayflies intelligent algorithm, tests are carried out based on the obtained testing stimuli, because the testing stimuli obtained based on the mayflies intelligent algorithm are of better diversity and the coverage of the testing interval is large, a large-coverage test can be realized with fewer testing stimuli, and the testing time is saved.
In a third aspect, referring to fig. 5, another embodiment of the present disclosure provides an electronic device, including:
one or more processors 501;
a memory 502 on which one or more programs are stored, the one or more programs being executable by the one or more processors to cause the one or more processors to implement any of the test stimulus generation methods described above, or any of the test methods described above;
one or more I/O interfaces 503 coupled between the processor and the memory and configured to enable information interaction between the processor and the memory.
The processor 501 is a device with data processing capability, and includes but is not limited to a Central Processing Unit (CPU) and the like; memory 502 is a device having data storage capabilities including, but not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), FLASH memory (FLASH); an I/O interface (read/write interface) 503 is connected between the processor 501 and the memory 502, and can realize information interaction between the processor 501 and the memory 502, which includes but is not limited to a data Bus (Bus) and the like.
In some embodiments, the processor 501, memory 502, and I/O interface 503 are interconnected by a bus 504, which in turn connects with other components of the computing device.
In a fourth aspect, referring to fig. 6, another embodiment of the present disclosure provides a storage medium having a program stored thereon, where the program is executed by a processor to implement any one of the test stimulus generation methods described above or any one of the test methods described above.
Fig. 7 is a block diagram of a test stimulus generation apparatus according to another embodiment of the present disclosure.
In a fifth aspect, referring to fig. 7, another embodiment of the present disclosure provides a test stimulus generating apparatus, including:
an individual position calculation module 701 for:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
a population update module 702 to:
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and the female mayfly population according to the present position values of the two next-generation mayfly individuals;
a group optimal location calculation module 703 configured to:
calculating the current group optimal position values from the current position values of all male mayflies of the updated male mayflies and the current position values of all female mayflies of the updated female mayflies;
a first loop iteration module 704 to:
and adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number.
In some exemplary embodiments, the loop iteration module 704 is further configured to:
under the condition that the current iteration number after adding 1 is smaller than the preset iteration number, sending a first notification message to the individual position calculation module 701;
the individual location calculation module 701 is further configured to:
the first reception notification message continues the step of calculating the present position value of each male mayflies in the population respectively.
In some exemplary embodiments, the loop iteration module 704 is further configured to:
adding 1 to the number of currently generated test stimuli, setting the number of current iterations to 0 when the number of currently generated test stimuli after the addition of 1 is less than the preset number F of test stimuli, and sending a first notification message to the individual position calculation module 701;
the individual location calculation module 701 is further configured to:
the first reception notification message continues the step of calculating the present position value of each male mayflies in the population respectively.
In some exemplary embodiments, the first loop iteration module 704 is further configured to:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of adding 1 to the number of the currently generated test excitation.
In some exemplary embodiments, the first loop iteration module 704 is further configured to:
sending a second notification message to the individual position calculation module 701 in a case where the test stimulus output this time is the same as any one of the test stimuli output before;
the individual location calculation module 701 is further configured to:
a second receipt notification message that resets the initial value of speed, the initial value of position, the initial value of individual optimum position and the initial value of male population optimum position for each of the male mayflies in the population of flies, and the initial value of speed and the initial value of position for each of the female mayflies in the population of flies;
the reset initial value of speed of male mayflies is taken as the last speed value of said male mayflies, the reset initial value of position of male mayflies is taken as the last position value of said male mayflies, the reset initial value of the optimal-individual positions of male mayflies is taken as the last optimal-individual position value of said male mayflies, the reset initial value of the optimal-male-colony positions is taken as the last optimal-male-colony position value;
the reset initial value of the speed of the female mayflies is taken as the last speed value of said female dayflies, and the reset initial value of the position of the female mayflies is taken as the last position value of said female mayflies;
increasing at least one of the first socially positive attraction coefficient, the second socially positive attraction coefficient, the visibility coefficient of dayflies, the first random number, the third socially positive attraction coefficient, the second random number, used in calculating the current position value of said female dayflies, and the third random number used in calculating the current position value of two said next generation mayflies;
the step of calculating the present position value of each male mayflies in the male mayflies population respectively is continued.
In some exemplary embodiments, the population update module 702 is further configured to:
cross-calculating said selected male mayflies and said selected female mayflies to obtain the present speed values of two said next generation mayflies;
when the current position values of the two next-generation dayflies obtained by the current calculation are the same as the current position values of the two next-generation dayflies obtained by the last calculation, and the current speed values of the two next-generation dayflies obtained by the current calculation are the same as the current speed values of the two next-generation dayflies obtained by the last calculation, a third notification message is sent to the individual position calculation module 701;
the individual location calculation module 701 is further configured to:
a third receipt notification message that continues the step of resetting the initial speed, initial position, initial individual-optimal and initial male population-optimal positions for each of the male mayflies in the population, and the initial speed and initial position values for each of the female mayflies in the population.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement said calculating the present position value of each male mayflies in a population of male dayflies individually in the following manner:
the present position values of each male mayflies in a population are calculated based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of the male mayflies.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement said calculating the present position values of the male mayflies from their last speed, last position, last individual optimal position and last male population optimal position values in the following manner:
calculating the present speed values of the male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values;
the present position values of the male mayflies are calculated from the last position values and the present speed values of the male mayflies.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement said calculating the present speed values of the male mayflies from their last speed values, last position values, last individual optimal position values and last male population optimal position values in the following manner:
in that
Figure BDA0002961666090000351
In the case of (1), according to the formula
Figure BDA0002961666090000352
Calculating the current speed value of the ith male mayfly individual;
in that
Figure BDA0002961666090000353
In the case of (1), according to the formula
Figure BDA0002961666090000354
Calculating the current speed value of the ith male mayfly individual;
wherein f () is a fitness function,
Figure BDA0002961666090000355
the last position value of the ith male mayfly individual,
Figure BDA0002961666090000356
the last individual optimum position value for the ith male mayflies,
Figure BDA0002961666090000357
the speed values of the ith male mayflies, that is, the speed values of the ith male mayflies at time t,
Figure BDA0002961666090000361
the last speed value of the ith male mayflies, i.e. the speed value of the ith male mayflies at time t-1, a1Positive attraction coefficient for first social effect, a2Is a positive attraction coefficient of the second social interaction, beta is is measured by a light-to-light ratio,
Figure BDA0002961666090000362
the distance between the last position value of the ith male mayfly individual and the last individual optimum position value of the ith male mayfly individual,
Figure BDA0002961666090000363
the last position value of the ith male mayfly individual,
Figure BDA0002961666090000364
the distance between the last position value of the ith male mayfly and the last optimal position value of the current male colony, gbest1t-1For the optimal position value of the male population at the last time, D is the dancing coefficient, and r1 is the first random number.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement said calculating the present position value of each female dayflies in a female population respectively, in the following manner:
the present position values of the female mayflies are calculated for each female mayflies in a population based on the last speed value and the last position value of the female mayflies and the last position values of the male mayflies that attract the female mayflies.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement said calculating the present position values of the female dayflies from their last speed and position values, and the last position values of the male dayflies that attract said female dayflies in the following manner:
calculating the present speed values of the female mayflies based on the last speed values and the last position values of the female mayflies and the last position values of the male mayflies that attract said female mayflies;
the present position values of said female mayflies are calculated from the last position values and the present speed values of said female mayflies.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to effect calculating the present speed values of said female dayflies by:
according to the formula
Figure BDA0002961666090000365
Calculating the current speed value of the jth mayfly individual;
wherein the content of the first and second substances,
Figure BDA0002961666090000371
the current speed value of the j-th female mayflies, i.e. the speed value of the j-th female mayflies at time t,
Figure BDA0002961666090000372
the last speed value of the jth female mayfly, i.e. the speed value of the jth female mayfly at time t-1, a3Is the third social interaction positive attraction coefficient, fl is the random walk coefficient, r2 is the second random number,
Figure BDA0002961666090000373
the distance between the last position value of the ith male mayfly and the last position value of the jth female mayfly,
Figure BDA0002961666090000374
the position value of the jth male mayflies, which was the last position value of the jth male mayflies at time t-1,
Figure BDA0002961666090000375
the value of the last position of the jth female mayfly, i.e., the value of the position of the jth female mayfly at time t-1.
In some exemplary embodiments, the individual position calculation module 701 is particularly adapted to implement the cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of the two next generation mayflies in the following manner:
calculating the position values of two said next-generation mayflies according to the formulas offset 1 ═ L × male + (1-L) × male and offset 2 ═ L × male + (1-L) × male;
wherein, offset 1 is the current position value of one of the next generation mayflies, offset 2 is the current position value of another next generation mayfly, mail is the current position value of the selected male mayfly, female is the current position value of the selected female mayfly, L is a third random number.
In some exemplary embodiments, the group optimal location calculation module 703 is specifically configured to:
calculating the current optimal position values of the male mayflies of the current population according to the current position values of all the male mayflies of the updated male mayflies population;
calculating the current optimal position values of the mayflies population of the current mayflies population according to the updated current position values of all the mayflies population of the female mayflies population;
and determining the optimal position value of the current group according to the optimal position value of the current male group and the optimal position value of the current female group.
The specific implementation process of the test stimulus generating device is the same as that of the test stimulus generating method in the foregoing embodiment, and is not described here again.
Fig. 8 is a block diagram of a testing apparatus according to another embodiment of the present disclosure.
In a sixth aspect, referring to fig. 8, another embodiment of the present disclosure provides a test apparatus comprising:
a test stimulus generation module 801 for:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and female mayfly population according to the present position values of two next-generation mayfly individuals, calculating the present group optimum position value from the present position values of all male mayfly individuals of the updated male mayfly population and the present position values of all female mayfly individuals of the updated female mayfly population;
adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number;
inputting the test excitation into a to-be-tested track planner and a corresponding reference model respectively;
a reference model module 802 to:
outputting pulse parameters of a reference model according to the test excitation;
a result comparing module 803 for:
acquiring pulse parameters of the to-be-detected track planner and acquiring pulse parameters of the reference model;
and comparing the pulse parameters of the to-be-detected track planner with the pulse parameters of the reference model to obtain a comparison result.
In some exemplary embodiments, further comprising:
a second loop iteration module 804 to:
adding 1 to the number of currently generated test excitations, setting the current iteration number to 0 and sending a fourth notification message to the test excitation generating module 801 when the number of currently generated test excitations added with 1 is smaller than the preset test excitation number F;
the test stimulus generation module 801 is further configured to:
the step of calculating the present position value of each male mayflies in the population respectively is continued upon receiving the fourth notification message.
In some exemplary embodiments, the test stimulus generation module 801 is further configured to:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of respectively inputting the test excitation into the trajectory planner to be tested and the corresponding reference model.
In some exemplary embodiments, the pulse parameters include: the direction of the pulse; the comparison result comprises: pulse direction error;
the result comparing module 803 is specifically configured to compare the pulse parameters of the to-be-measured trajectory planner with the pulse parameters of the reference model to obtain a comparison result in the following manner:
according to the formula
Figure BDA0002961666090000391
Calculating the pulse direction error;
wherein, the direction _ error is the pulse direction error, the expected _ direction is the pulse direction of the reference model, and the actual _ direction is the pulse direction of the to-be-measured trajectory planner.
In some exemplary embodiments, the pulse parameters include: the number of pulses; the comparison result comprises: pulse number error grade;
the result comparing module 803 is specifically configured to compare the pulse parameters of the to-be-measured trajectory planner with the pulse parameters of the reference model to obtain a comparison result in the following manner:
calculating the pulse number error according to a formula number _ error ═ abs (all _ expected _ number-all _ actual _ number);
according to the formula
Figure BDA0002961666090000392
Calculating the error grade of the number of the pulses;
and the number _ error is the pulse number error, the all _ expected _ number is the pulse number of the reference model, the all _ actual _ number is the pulse number of the to-be-measured track planner, and the grade is the pulse number error grade.
In some exemplary embodiments, the pulse parameters include: the pulse frequency; the comparison result comprises: a pulse frequency error;
the result comparing module 803 is specifically configured to compare the pulse parameters of the to-be-measured trajectory planner with the pulse parameters of the reference model to obtain a comparison result in the following manner:
calculating the pulse frequency error according to a formula freq _ error ═ abs (expected _ freq-actual _ freq);
wherein freq _ error is the pulse frequency error, expected _ freq is the pulse frequency of the reference model, and actual _ freq is the pulse frequency of the to-be-measured trajectory planner.
The specific implementation process of the testing apparatus is the same as that of the testing method of the foregoing embodiment, and is not described here again.
In the embodiment of the present disclosure, in order to implement a test of a trajectory planner, a reference model corresponding to the trajectory planner needs to be established, as shown in fig. 1, the trajectory planner includes three parts, namely an acceleration and deceleration control module 101, an interpolation module 102, and a pulse generation module 103.
The acceleration and deceleration control module 101 is implemented by using a first processor, the interpolation module 102 and the pulse generation module 103 are implemented by using a field programmable logic array, and the first processor and the field programmable logic array perform data communication through a bus interface.
In the embodiment of the present disclosure, since the acceleration and deceleration control module 101 is implemented by using a processor, and the testing apparatus in the embodiment of the present disclosure is also implemented by using a processor, when the reference module is established, in order to ensure the independence of the trajectory planner to be tested, the function of the acceleration and deceleration control module may be directly copied to the reference model.
In the embodiment of the present disclosure, the acceleration/deceleration control module 101 and the testing apparatus may be implemented by using the same processor, as shown in fig. 9, both the acceleration/deceleration control module 101 and the testing apparatus are implemented by using a first processor, in which case, the function of the acceleration/deceleration control module 101 in the first processor needs to be copied to a reference model module in the first processor; the acceleration/deceleration control module 101 and the testing apparatus may also be implemented by different processors, as shown in fig. 10, the acceleration/deceleration control module 101 is implemented by a first processor, and the testing apparatus is implemented by a second processor, in which case, the functions of the acceleration/deceleration control module 101 in the first processor need to be copied to the reference model module in the second processor.
In the embodiment of the present disclosure, the data format of the data output by the acceleration and deceleration control module 101 is a floating point number, and the interpolation module 102 and the pulse generation module 103 are both implemented by a field-programmable logic array, the field-programmable logic array uses a fixed-point binary number to replace the floating point number, and during the process of converting the data from the floating point number to the fixed-point binary number, the precision of the data may be reduced to some extent, thereby causing the problems of loss of the number of pulses output by the pulse generation module 103, and the like.
In order to provide an accurate reference model for a tester, the embodiment of the present disclosure establishes a reference model in which the number of pulses and the pulse frequency are calculated based on data in a floating point format output by the acceleration/deceleration control module 101, so that an ideal number of pulses and an actually measured number of pulses are compared, an ideal pulse frequency and an actually measured pulse frequency are compared, and an ideal pulse direction and an actually measured pulse direction are compared.
In the disclosed embodiment, the reference model may calculate the number of pulses according to equation (19) and the pulse frequency according to equation (20).
B=scale(P1-Pl-1) (19)
Figure BDA0002961666090000411
Wherein B is the number of pulses, freq is the pulseThe pulse frequency, scale, is the gear ratio, which is usually a constant representing how many pulses are required to complete a distance of 1mm, e.g. scale is 320, meaning that 1mm requires 320 pulses to complete, T is the interpolation period, P1For the shift value of the 1 st interpolation period, P1-1Is the shift value of the l-1 th interpolation period.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purposes of limitation. In some instances, features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics and/or elements described in connection with other embodiments, unless expressly stated otherwise, as would be apparent to one skilled in the art. Accordingly, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (22)

1. A test stimulus generation method, comprising:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and female mayfly population according to the present position values of two next-generation mayfly individuals, calculating the present group optimum position value from the present position values of all male mayfly individuals of the updated male mayfly population and the present position values of all female mayfly individuals of the updated female mayfly population;
and adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number.
2. The test excitation generation method according to claim 1, further comprising, in a case where the number of current iterations after adding 1 is smaller than the preset number of iterations:
the step of calculating the present position value of each male mayflies in the male mayflies population respectively is continued.
3. The test excitation generating method according to claim 1, wherein after outputting the optimal position value of the current group as a test excitation, the method further comprises:
adding 1 to the number of currently generated test stimuli, setting 0 to the number of current iterations when the number of currently generated test stimuli after adding 1 is less than the preset number of test stimuli F, continuing the step of calculating the present-time position values of each male mayflies in the male mayfly population respectively.
4. The test excitation generating method according to claim 3, wherein after outputting the optimal position value of the current group as a test excitation, before adding 1 to the number of currently generated test excitations, the method further comprises:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of adding 1 to the number of the currently generated test excitation.
5. The test stimulus generation method of claim 4, further comprising, in a case where the test stimulus output this time is the same as any one of the test stimuli output before, a step of:
resetting the initial values of speed, position, individual-optimal and male population-optimal positions of each said male mayflies in said population of males, and the initial values of speed and position of each said female mayflies in said population of females;
the reset initial value of speed of male mayflies is taken as the last speed value of said male mayflies, the reset initial value of position of male mayflies is taken as the last position value of said male mayflies, the reset initial value of the optimal position of male mayflies is taken as the last optimal position value of said male mayflies, the reset initial value of the optimal position of male colonies is taken as the last optimal position value of male colonies;
the reset initial value of the speed of the female mayflies is taken as the last speed value of said female dayflies, and the reset initial value of the position of the female mayflies is taken as the last position value of said female mayflies;
increasing at least one of the first socially positive attraction coefficient, the second socially positive attraction coefficient, the visibility coefficient of dayflies, the first random number, the third socially positive attraction coefficient, the second random number, used in calculating the current position value of said female dayflies, and the third random number used in calculating the current position value of two said next generation mayflies;
the step of calculating the present position value of each male mayflies in the male mayflies population respectively is continued.
6. A test stimulus generation method according to claim 5, which after cross-calculating the present position values of two next generation mayflies using the selected male mayflies and the selected female mayflies, the method further comprises:
cross-calculating said selected male mayflies and said selected female mayflies to obtain the present speed values of two said next generation mayflies;
in the event that the present position values of the two next-generation dayflies obtained this time of calculation are the same as the present position values of the two next-generation dayflies obtained the last time of calculation, and the present speed values of the two next-generation dayflies obtained this time of calculation are the same as the present speed values of the two next-generation dayflies obtained the last time of calculation, the step of resetting the initial speed value, initial position value, initial individual-optimum position value and initial male-population-optimum position value for each of the male mayflies in the population, and the initial speed value and initial position value for each of the female mayflies in the population continues.
7. A test stimulus generation method according to any one of claims 1 to 6, wherein said calculating respectively the present position value of each male mayflies in a population of male dayflies comprises:
the present position values of each male mayflies in a population are calculated based on the last speed value, last position value, last individual optimal position value and last male population optimal position value of the male mayflies.
8. A test stimulus generation method according to claim 7, wherein said calculating the present position values of the male mayflies according to their last speed, last position, last individual optimal position and last male population optimal position values comprises:
calculating the present speed values of the male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values;
the present position values of the male mayflies are calculated from the last position values and the present speed values of the male mayflies.
9. A test stimulus generation method according to claim 8, wherein said calculating the present speed values of male mayflies according to their last speed values, last position values, last individual optimal position values and last male population optimal position values comprises:
in that
Figure FDA0002961666080000031
In the case of (1), according to the formula
Figure FDA0002961666080000032
Calculating the current speed value of the ith male mayfly individual;
in that
Figure FDA0002961666080000033
In the case of (1), according to the formula
Figure FDA0002961666080000034
Calculating the current speed value of the ith male mayfly individual;
wherein f () is a fitness function,
Figure FDA0002961666080000035
the last position value of the ith male mayfly individual,
Figure FDA0002961666080000036
the last individual optimum position value for the ith male mayflies,
Figure FDA0002961666080000037
the speed values of the ith male mayflies, that is, the speed values of the ith male mayflies at time t,
Figure FDA0002961666080000041
the last speed value of the ith male mayflies, i.e. the speed value of the ith male mayflies at time t-1, a1Positive attraction coefficient for first social effect, a2A positive attraction coefficient for the second social effect, β is the visibility coefficient of mayflies,
Figure FDA0002961666080000042
the distance between the last position value of the ith male mayfly individual and the last individual optimum position value of the ith male mayfly individual,
Figure FDA0002961666080000043
the last position value of the ith male mayfly individual,
Figure FDA0002961666080000044
the distance between the last position value of the ith male mayfly and the last optimal position value of the current male colony, gbest1t-1For the optimal position value of the male population at the last time, D is the dancing coefficient, and r1 is the first random number.
10. A test stimulus generation method according to any one of claims 1 to 6, wherein said calculating respectively the present position value of each female dayflies in a female population comprises:
the present position values of the female mayflies are calculated for each female mayflies in a population based on the last speed value and the last position value of the female mayflies and the last position values of the male mayflies that attract the female mayflies.
11. A test stimulus generation method according to claim 10, wherein said calculating the present position values of the female mayflies according to the last speed and position values of the female mayflies and the last position values of the male mayflies that attract the female mayflies comprises:
calculating the present speed values of the female mayflies based on the last speed values and the last position values of the female mayflies and the last position values of the male mayflies that attract said female mayflies;
the present position values of said female mayflies are calculated from the last position values and the present speed values of said female mayflies.
12. The test stimulus generation method of claim 11, wherein according to a formula
Figure FDA0002961666080000045
Calculating the current speed value of the jth mayfly individual;
wherein the content of the first and second substances,
Figure FDA0002961666080000046
the current speed value of the j-th female mayflies, i.e. the speed value of the j-th female mayflies at time t,
Figure FDA0002961666080000047
the last speed value of the jth female mayfly, i.e. the speed value of the jth female mayfly at time t-1, a3Is the third social interaction positive attraction coefficient, fl is the random walk coefficient, r2 is the second random number,
Figure FDA0002961666080000051
the distance between the last position value of the ith male mayfly and the last position value of the jth female mayfly,
Figure FDA0002961666080000052
the position value of the jth male mayflies, which was the last position value of the jth male mayflies at time t-1,
Figure FDA0002961666080000053
the value of the last position of the jth female mayfly, i.e., the value of the position of the jth female mayfly at time t-1.
13. A test stimulus generation method according to any one of claims 1 to 6, wherein cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies comprises:
calculating the position values of two said next-generation mayflies according to the formulas offset 1 ═ L × male + (1-L) × male and offset 2 ═ L × male + (1-L) × male;
wherein, offset 1 is the current position value of one of the next generation mayflies, offset 2 is the current position value of another next generation mayfly, mail is the current position value of the selected male mayfly, female is the current position value of the selected female mayfly, L is a third random number.
14. A test stimulus generation method according to any one of claims 1 to 6, wherein said calculating the present group optimal position values from the present position values of all male mayflies of the updated male mayflies and the present position values of all female mayflies of the updated female mayflies comprises:
calculating the current optimal position values of the male mayflies of the current population according to the current position values of all the male mayflies of the updated male mayflies population;
calculating the current optimal position values of the mayflies population of the current mayflies population according to the updated current position values of all the mayflies population of the female mayflies population;
and determining the optimal position value of the current group according to the optimal position value of the current male group and the optimal position value of the current female group.
15. A method of testing, comprising:
the present position value of each male mayflies in the population is calculated separately; wherein the position values of the male mayflies represent a feasible solution to a test stimulus;
calculating the present position value of each mayflies in the female population respectively; wherein the position values of said female mayflies represent a feasible solution to a test stimulus;
selecting one male mayflies from said population of males, selecting one female mayflies from said population of females, cross-calculating the present position values of the selected male mayflies and the present position values of the selected female mayflies to obtain the present position values of two next generation mayflies;
updating the male mayfly population and female mayfly population according to the present position values of two next-generation mayfly individuals, calculating the present group optimum position value from the present position values of all male mayfly individuals of the updated male mayfly population and the present position values of all female mayfly individuals of the updated female mayfly population;
adding 1 to the current iteration number, and outputting the optimal position value of the current group as a test excitation under the condition that the current iteration number after the 1 is added is equal to the preset iteration number;
inputting the test excitation into a to-be-tested track planner and a corresponding reference model respectively; acquiring pulse parameters of the to-be-detected track planner and acquiring pulse parameters of the reference model;
and comparing the pulse parameters of the to-be-detected track planner with the pulse parameters of the reference model to obtain a comparison result.
16. The testing method of claim 15, wherein after comparing the pulse parameters of the trajectory planner to be tested with the pulse parameters of the reference model to obtain a comparison result, the method further comprises:
adding 1 to the number of currently generated test stimuli, setting 0 to the number of current iterations when the number of currently generated test stimuli after adding 1 is less than the preset number of test stimuli F, continuing the step of calculating the present-time position values of each male mayflies in the male mayfly population respectively.
17. The testing method according to claim 16, wherein after outputting the optimal position value of the current group as a testing stimulus, before inputting the testing stimulus into the trajectory planner to be tested and the corresponding reference model, respectively, the method further comprises:
and under the condition that the test excitation output this time is different from the test excitation output before, continuously executing the step of respectively inputting the test excitation into the trajectory planner to be tested and the corresponding reference model.
18. A test method according to any one of claims 15-17, wherein the pulse parameters include: the direction of the pulse; the comparison result comprises: pulse direction error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
according to the formula
Figure FDA0002961666080000071
Calculating the pulse direction error;
wherein, the direction _ error is the pulse direction error, the expected _ direction is the pulse direction of the reference model, and the actual _ direction is the pulse direction of the to-be-measured trajectory planner.
19. A test method according to any one of claims 15-17, wherein the pulse parameters include: the number of pulses; the comparison result comprises: pulse number error grade;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse number error according to a formula number _ error ═ abs (all _ expected _ number-all _ actual _ number);
according to the formula
Figure FDA0002961666080000072
Calculating the error grade of the number of the pulses;
and the number _ error is the pulse number error, the all _ expected _ number is the pulse number of the reference model, the all _ actual _ number is the pulse number of the to-be-measured track planner, and the grade is the pulse number error grade.
20. A test method according to any one of claims 15-17, wherein the pulse parameters include: the pulse frequency; the comparison result comprises: a pulse frequency error;
the comparing the pulse parameters of the to-be-measured trajectory planner and the pulse parameters of the reference model to obtain a comparison result comprises:
calculating the pulse frequency error according to a formula freq _ error ═ abs (expected _ freq-actual _ freq);
wherein freq _ error is the pulse frequency error, expected _ freq is the pulse frequency of the reference model, and actual _ freq is the pulse frequency of the to-be-measured trajectory planner.
21. An electronic device, comprising:
one or more processors;
memory having one or more programs stored thereon for execution by the one or more processors to cause the one or more processors to implement the test stimulus generation method of any of claims 1-14 or the test method of any of claims 15-20;
one or more I/O interfaces connected between the processor and the memory and configured to enable information interaction between the processor and the memory.
22. A storage medium having stored thereon a program which, when executed by a processor, implements a test stimulus generation method according to any one of claims 1 to 14, or a test method according to any one of claims 15 to 20.
CN202110243353.4A 2021-03-04 2021-03-04 Test stimulus generation method, test method, electronic device, and storage medium Active CN113050547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110243353.4A CN113050547B (en) 2021-03-04 2021-03-04 Test stimulus generation method, test method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110243353.4A CN113050547B (en) 2021-03-04 2021-03-04 Test stimulus generation method, test method, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113050547A true CN113050547A (en) 2021-06-29
CN113050547B CN113050547B (en) 2022-03-25

Family

ID=76510223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110243353.4A Active CN113050547B (en) 2021-03-04 2021-03-04 Test stimulus generation method, test method, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113050547B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020127623A1 (en) * 2000-07-31 2002-09-12 Maxygen, Inc. Biosensors, reagents and diagnostic applications of directed evolution
US20100014569A1 (en) * 2008-07-16 2010-01-21 International Business Machines Corporation Identifying An Optimized Test Bit Pattern For Analyzing Electrical Communications Channel Topologies
CN103530515A (en) * 2013-10-12 2014-01-22 沈阳航空航天大学 Benthic organism integrity evaluation index structural equation model establishing method
CN107429286A (en) * 2015-03-31 2017-12-01 基本解决方案公司 Bio-sensor system for quick detection analyte
DE102018214276A1 (en) * 2017-08-29 2019-02-28 Fanuc Corporation Machine learning apparatus, control system, machine learning control apparatus and method
CN109581203A (en) * 2018-11-07 2019-04-05 电子科技大学 Survey post-simulation method for diagnosing faults based on genetic algorithm
CN112069081A (en) * 2020-09-24 2020-12-11 中国人民解放军国防科技大学 Genetic algorithm-based directory controller test excitation generation method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020127623A1 (en) * 2000-07-31 2002-09-12 Maxygen, Inc. Biosensors, reagents and diagnostic applications of directed evolution
US20100014569A1 (en) * 2008-07-16 2010-01-21 International Business Machines Corporation Identifying An Optimized Test Bit Pattern For Analyzing Electrical Communications Channel Topologies
CN103530515A (en) * 2013-10-12 2014-01-22 沈阳航空航天大学 Benthic organism integrity evaluation index structural equation model establishing method
CN107429286A (en) * 2015-03-31 2017-12-01 基本解决方案公司 Bio-sensor system for quick detection analyte
DE102018214276A1 (en) * 2017-08-29 2019-02-28 Fanuc Corporation Machine learning apparatus, control system, machine learning control apparatus and method
CN109581203A (en) * 2018-11-07 2019-04-05 电子科技大学 Survey post-simulation method for diagnosing faults based on genetic algorithm
CN112069081A (en) * 2020-09-24 2020-12-11 中国人民解放军国防科技大学 Genetic algorithm-based directory controller test excitation generation method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JOEL SHAPIRO: "《BOLD-MRI demonstrates acute placental and fetal organ hypoperfusion with fetal brain sparing in response to phenylephrine but not ephedrine》", 《PLACENTA》 *
W.D. MACK: "《Measurement and modeling of emission spectra of Er-Yb co-doped fibers》", 《LEOS 2001. 14TH ANNUAL MEETING OF THE IEEE LASERS AND ELECTRO-OPTICS SOCIETY》 *
史春天: "《群体智能算法在图像分割中的应用综述》", 《计算机工程与应用》 *
周小飞: "《基于多种群遗传算法的可扩展有限状态机测试数据自动生成》", 《计算机应用与软件》 *

Also Published As

Publication number Publication date
CN113050547B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
Haji et al. Comparison of optimization techniques based on gradient descent algorithm: A review
US20210342699A1 (en) Cooperative execution of a genetic algorithm with an efficient training algorithm for data-driven model creation
Bernardo et al. Particle learning for sequential Bayesian computation
EP3786925A1 (en) Systems and methods for training a neural network to control an aircraft
CN111414977A (en) Weighted integration temperature sensitive point combination selection method for machine tool spindle thermal error modeling
KR102308751B1 (en) Method for prediction of precipitation based on deep learning
JP7447944B2 (en) Simulation device, simulation program and simulation method
Talal Comparative study between the (ba) algorithm and (pso) algorithm to train (rbf) network at data classification
CN113050547B (en) Test stimulus generation method, test method, electronic device, and storage medium
Vermeij et al. Inferring demographic processes from population size structure in corals
Joachimczak et al. Fine grained artificial development for body-controller coevolution of soft-bodied animats
CN112734759B (en) Method and device for determining trigger point of flying shooting
CN110069822A (en) A kind of sensor arrangement method of blade dynamic strain measure
CN113910221B (en) Mechanical arm autonomous motion planning method, device, equipment and storage medium
JP7398625B2 (en) Machine learning devices, information processing methods and programs
US11829883B2 (en) Executing a genetic algorithm on a low-power controller
Edvardsen Long-range navigation by path integration and decoding of grid cells in a neural network
JP2020052460A (en) Abnormality detection system and abnormality detection program
CN114580601A (en) Magnetic dipole target positioning method based on improved intelligent optimization algorithm
CN110851358A (en) Software reliability model parameter estimation method based on mixed wolf colony algorithm
CN113671832B (en) Magnetic bearing control method and device and electronic equipment
WO2023136118A1 (en) Information selection system, information selection method, and information selection program
CN113408038B (en) Terrain interpolation method and system based on numerical simulation
US20230385675A1 (en) Quantum reinforcement learning for target quantum system control
Rada-Vilela et al. Population Statistics for Particle Swarm Optimisation: Deception, Blindness and Disorientation in Noisy Problems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 230088 north, 9th floor, B1 building, animation base, 800 Wangjiang West Road, high tech Zone, Hefei City, Anhui Province

Applicant after: Hongjing Microelectronics Technology Co.,Ltd.

Address before: 230088 north, 9th floor, B1 building, animation base, 800 Wangjiang West Road, high tech Zone, Hefei City, Anhui Province

Applicant before: HEFEI MACROSILICON TECHNOLOGY CO.,LTD.

GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210629

Assignee: Anhui Xingtai Financial Leasing Co.,Ltd.

Assignor: Hongjing Microelectronics Technology Co.,Ltd.

Contract record no.: X2023980034867

Denomination of invention: Test incentive generation methods, testing methods, electronic devices, storage media

Granted publication date: 20220325

License type: Exclusive License

Record date: 20230420

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Test incentive generation methods, testing methods, electronic devices, storage media

Effective date of registration: 20230424

Granted publication date: 20220325

Pledgee: Anhui Xingtai Financial Leasing Co.,Ltd.

Pledgor: Hongjing Microelectronics Technology Co.,Ltd.

Registration number: Y2023980038963