Unmanned aerial vehicle training and parallel program particle swarm test case generation method
By combining path feature classification with PSO hierarchical evolution strategy and multi-population particle swarm optimization algorithm for co-evolution, the problems of low coverage and low efficiency in multi-path coverage testing of UAV training parallel programs are solved, achieving efficient and accurate test data generation and improving the integrity and reliability of software testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-06
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies struggle to effectively generate multi-path coverage test cases for parallel training programs for drones, resulting in low test coverage, low efficiency, and an inability to meet high reliability requirements.
We employ path feature classification and PSO hierarchical evolution strategy, identify aggregated and divergent path pairs through mutation path similarity analysis, and combine inner and outer multi-swarm particle swarm algorithm for co-evolution to generate efficient test cases.
It enables accurate and efficient generation of test data for parallel training programs for UAVs, significantly improving test coverage and efficiency. It can effectively detect deep defects in multi-process collaboration and enhance the integrity and reliability of software testing.
Smart Images

Figure CN121658390B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the interdisciplinary field of software testing and intelligent optimization algorithms, and specifically to the multi-path coverage testing requirements of UAV training parallel programs, and particularly to a method for generating particle swarm test cases for UAV training parallel programs. Background Technology
[0002] With the widespread application of unmanned aerial vehicle (UAV) technology in key areas such as military reconnaissance, logistics transportation, and agricultural plant protection, the complexity and reliability requirements of their training systems are increasing. Modern UAV training programs typically employ parallel computing architectures (such as those based on MPI and OpenMP parallel programming models) to handle computationally intensive tasks such as high-concurrency flight data, real-time environmental perception, and multi-agent collaborative decision-making. However, the inherent nondeterminism, complexity of inter-process communication, and resource contention inherent in parallel programs make their defects more insidious and unreproducible. Such defects can lead to serious malfunctions during training, such as loss of flight attitude control, incorrect flight path planning, and interruption of multi-aircraft communication. In realistic combat training scenarios, these defects can not only cause huge economic losses but may even lead to casualties and major safety accidents, thus placing extremely high demands on the reliability of UAV training parallel programs.
[0003] Software testing is a crucial step in ensuring the safe and reliable operation of UAV training systems. It not only verifies the correctness of flight control algorithms but also assesses their robustness under extreme conditions. A UAV training system lacking sufficient testing cannot guarantee its reliability, directly impacting training effectiveness and flight safety.
[0004] Test case generation is a core step in software testing, and its quality directly determines test coverage and effectiveness. For parallel programs used in UAV training, the large input space and complex execution path combinations make traditional manual test case design methods insufficient to meet coverage requirements. Efficient test case generation techniques can automatically generate test data with high coverage, significantly improving testing efficiency. Especially for parallel programs, it is necessary to generate test cases that can trigger specific process interaction sequences, cover different communication modes, and expose timing-related defects. However, existing test case generation methods (such as random testing and symbolic execution) have significant shortcomings in dealing with the non-deterministic behavior of parallel programs, making it difficult to effectively generate test data for complex paths and state spaces. Therefore, there is an urgent need to introduce more intelligent and adaptive test case generation strategies.
[0005] Parallel programs are programs that can simultaneously utilize multiple processors or computing cores to collaboratively complete computational tasks. Message Passing Interface (MPI) is the most widely used programming model in parallel programming, achieving data exchange and collaborative computation through explicit message passing between processes. An MPI program consists of multiple independent processes, each with its own address space, interacting with each other through communication primitives such as send and receive. Due to the characteristics of parallelism, communication, and synchronization, the complexity of testing parallel programs is far greater than that of serial programs. Existing models are not suitable for generating test data for parallel programs; therefore, researching models for generating path coverage test data for parallel programs is of great significance.
[0006] Particle Swarm Optimization (PSO) is inspired by the collective intelligence of birds foraging. Each particle in the algorithm represents a candidate solution, possessing position and velocity attributes. It dynamically adjusts its state by tracking its historical best position (pbest) and the group's global best position (gbest), searching for the optimal solution in the solution space. PSO is conceptually simple, has few parameters, and is easy to implement, and has been widely used for generating test data for serial programs. However, the standard PSO algorithm suffers from limitations such as decreased search efficiency and susceptibility to local optima when dealing with high-dimensional complex problems. To address this, a co-evolutionary strategy has been developed, employing a "divide and conquer" approach to decompose complex optimization problems into multiple interconnected subproblems. These subpopulations evolve in parallel and cooperate to solve the overall problem. Each subpopulation is responsible for optimizing a portion of the decision variables, achieving collaborative optimization through inter-population information exchange. The multi-population PSO algorithm based on co-evolution effectively overcomes the limitations of standard PSO and demonstrates significant performance in solving large-scale software testing applications.
[0007] Software testing is a crucial step in ensuring software quality and reliability. It involves executing programs to discover defects and verify functional correctness. Traditional testing methods rely on manually designing test cases, which is inefficient and struggles to guarantee adequate coverage. Mutation testing, a fault-based testing method, generates mutants by introducing small changes (mutations) into the source program. Mutation operators systematically alter program conditions, operators, and variables, creating mutated branches. Test data needs to cover these mutated branches to ensure the ability to detect different program behaviors. It has proven effective in revealing potential software defects. In recent years, intelligent optimization algorithms such as genetic algorithms and particle swarm optimization have been introduced into the field of automatic test data generation. They utilize heuristic search to automatically find test inputs, achieving good results in single-path coverage testing of serial programs. However, multi-path coverage testing of parallel programs still faces challenges. Summary of the Invention
[0008] To address the shortcomings of incomplete path coverage and low test data generation efficiency in existing parallel program testing, this invention provides a particle swarm optimization (PSO) test case generation method for UAV training parallel programs. Through path feature classification and PSO hierarchical evolution strategy, it achieves accurate and efficient generation of test data.
[0009] A method for generating particle swarm test cases for parallel training programs of unmanned aerial vehicles includes the following steps:
[0010] S1: Determine aggregated and divergent path pairs based on the similarity of variant paths;
[0011] S1.1: Instrument the source code to generate variant paths, and quantify the degree of similarity between paths by calculating the similarity between paths;
[0012] S1.2: Based on the path similarity, determine the aggregated path pairs with high similarity and the divergent path pairs with low similarity respectively;
[0013] S2: Generate a multi-task mathematical model for path pairs to cover multi-path test cases;
[0014] S3: Solving mathematical models based on the co-evolutionary execution of inner and outer multi-population particle swarm optimization algorithm;
[0015] Specifically, the inner particle swarm co-evolution strategy is for a single mutation path and its multi-process sub-paths; the outer particle swarm co-evolution strategy is for aggregated and divergent path pairs: including particle orientation guidance and position update strategy based on aggregated path pairs, and particle fitness evaluation and optimal replacement strategy based on divergent path pairs.
[0016] S4: Based on step S3, the inner and outer particle swarm optimization algorithm is iterated. When test data that satisfies the coverage of the mutation path is generated or the maximum number of iterations is reached, the iteration is terminated and the test data is output.
[0017] Furthermore, step S1.2, which determines high-similarity aggregated path pairs and low-similarity divergent path pairs based on path similarity, is specifically executed as follows:
[0018] First, from the similarity matrix Extract the pairing combinations between target paths And construct a set of all path pairings. ,in To avoid repetition;
[0019] Subsequently, based on similarity For sets Sort the elements in descending order to obtain an ordered set with path similarity from high to low. ;
[0020] from Starting with the first element, select highly similar pairings between paths, assuming... for The first element, which combines paths Recorded as aggregated path pairs, then No longer paired with other paths; from Delete all containing or Pairing combinations, updated Next, continue from Select the first element as a highly similar partner path for pairing and combination; until... ;
[0021] Next, based on similarity For sets Sort the elements in ascending order to obtain an ordered set with path similarity from low to high. .
[0022] From ordered sets Starting with the first element, select low similarity pairings between paths, assuming for The first element, which groups the paths. This is denoted as a divergent path pair, and then... No longer paired with other paths; from Delete all containing or Pairing combinations, updated Then, continue from Select the first element as the low-similarity collaborative path for pairing and combination; until... .
[0023] Furthermore, the inner particle swarm co-evolution strategy for a single mutation path and its multi-process sub-paths in step S3 is specifically implemented as follows:
[0024] The primary task of the inner particle swarm optimization is to find test data that covers the entire path of a target.
[0025] Inner-layer particle swarm This represents a cooperative group and Sub-particle swarm, The main task is to find a path that covers the target. The test data; among which Defined as a collaborative group, responsible for generating paths that cover the target. Test data, sub-particle swarm Each process is responsible for generating the corresponding subpaths. The test data, Represented as the first The first target path Sub-paths Indicates the use of covering the first The first target path A swarm of sub-particles, among which For the first Individual particle swarms;
[0026] cooperative groups With sub-particle group Their ultimate goal is the same: to find coverage through particle information exchange and co-evolution. Test data;
[0027] Set the main process Range , containing variables , for Includes the number of input variables; other subprocesses. Range Include variables , for The number of input variables included;
[0028] Main steps of inner-layer particle swarm co-evolution:
[0029] (1) Initialize each sub-particle swarm of particles, of which Represented as inner-shell particle swarm The Middle The number of particles in each sub-particle group; each sub-particle group evolves in parallel within its own process in order to optimize its own sub-objective; if the execution reaches a message passing statement waiting for information from other processes, the evolution is paused;
[0030] (2) Each subprocess particle swarm Each iteration After that, from his own Select from particles High fitness particles Transmitted to the cooperative group Pause Particle Swarm The evolution awaits the cooperation of groups. The message;
[0031] (3) Particle swarm The transmitted particles are combined in a certain way to obtain new particles as cooperative groups. The initial particles; Continue evolving, if the generated path satisfies the requirement of covering the target path. The test data or the maximum number of iterations is reached, terminating all particle swarms. Evolution; Execution step (6);
[0032] (4) When the cooperative group Each iteration After that, from the cooperative group number of particles Select High fitness particles Based on the partial variables of each subprocess, high-fitness particles are transferred to the particle swarm of each subprocess. ;pause The evolution awaits the sub-particle swarm. The message;
[0033] (5) Each sub-particle group New particles are obtained, randomly replacing the original particles, and the process is updated. Continue with step (2);
[0034] (6) Output the target path Test data;
[0035] It should be noted that in step (3), the sub-particle swarm Provided High fitness particles , forming a particle swarm The initial particle combination method is as follows: sub-particle swarm Information is exchanged and transmitted to the collaborating groups. particles If only contains Some variables, and particles Comparison, missing Some variables in ;therefore, The missing variable values need to be obtained from other sub-particle groups. High fitness particles The values of variables or the main process's own variables are obtained to satisfy the cooperative group. Medium variables The required complete variables;
[0036] Particle swarm optimization for each process Provided High fitness particles Both need to be with other processes The missing variable values are supplemented through permutations and combinations among the individual particles, ultimately resulting in... All variable values contained in the particle.
[0037] Furthermore, the particle orientation guidance and position update strategy based on aggregated path pairs in step S3 is specifically implemented as follows:
[0038] Knowledge transfer and collaboration strategies among highly similar tasks are comprehensively applied to all particle swarm optimization tasks. ;
[0039] Assuming the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform high-similarity partner pairing; target path cooperative groups and target path cooperative groups High similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows:
[0040] Suppose aggregated path pairs ;
[0041] On the target path In the middle, set the target path particle swarm Each evolution generation, from Select from the particles A high-fitness particle is passed to a highly similar cooperative path. particle swarm and use a high fitness particle set Save this A high-fitness particle; when continuously with During the iterative process of the generation cycle, it is continuously updated. Select the one with the highest fitness value from the previous multiple iterations. One particle;
[0042] When particle swarm Evolved to At that time, the position of a certain particle was The particle velocity is , This represents the individual best position in the particle's history (pbest). Particle swarm The global historical best position (gbest);
[0043] Define decision parameters Used for control particle swarm Should a highly similar collaborative path be adopted? particle swarm The high-fitness particles that are passed on are:
[0044]
[0045] in For the target path and similarity, For integers, introduce This is to prevent premature convergence caused by frequent particle exchanges between particle swarms;
[0046] Randomly generated based on a random function ;
[0047] when Particle Swarm Use collaborative paths particle swarm High-fit particles are transferred to update particle velocities; conversely, low-fit particles are transferred to update particle velocities. , Update particle velocity using traditional methods;
[0048] The specific implementation method is as follows:
[0049] (1) When At this time, the particle velocity and position updates are the same as those in traditional PSO, expressed by the following formula:
[0050]
[0051]
[0052] It is inertial weight. and It is the acceleration constant. and yes Random values within the interval;
[0053] (2) When At that time, the improved particle velocity update formula is expressed as:
[0054]
[0055] in, It is the acceleration constant. yes Random values within the interval.
[0056] When the generated path satisfies the target path coverage The test data or the maximum number of iterations reached, all particle swarms Stop knowledge transfer and collaboration between highly similar tasks.
[0057] Furthermore, the particle fitness evaluation and optimal replacement strategy based on divergent path pairs in step S3 is specifically implemented as follows:
[0058] Knowledge transfer and collaboration strategies among low-similarity tasks are comprehensively applied to all particle swarm optimization tasks. ;
[0059] Assuming the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform low-similarity partner pairing; target path cooperative groups and target path cooperative groups Low-similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows:
[0060] Let the divergent path pair be the full path. or subpath ;
[0061] For the target path cooperative groups Each evolution Algebra will sort all particles' fitness values in ascending order and select... Low-fit particles are passed to low-similarity cooperative paths. cooperative groups ;
[0062] set up for Low fitness particles: First, for new particles Conduct based on The objective function calculates the fitness value; if the new particle's fitness value is better than the path... The original cooperative group One (or some) particles (or several particles) in the middle. If the fitness value is [value], then use [it]. Replace the original particles ;
[0063] Similarly, divergent path pairs In the middle, sub-path particle swarm The same strategy was adopted, towards the path particle swarm Migrating particles.
[0064] When the generated path satisfies the target path coverage The test data or the maximum number of iterations reached, all particle swarms Stop knowledge transfer and collaboration between tasks with low similarity.
[0065] The beneficial effects of this invention are:
[0066] (1) This invention introduces variation path similarity analysis to identify and classify aggregated and divergent path pairs in UAV training parallel programs. This mechanism can accurately locate key interaction paths in parallel programs and potential defects of similarity and difference, providing a scientific basis for the efficient allocation of subsequent test resources, and fundamentally solving the problems of blindness and lack of focus in the path coverage of parallel programs in traditional testing methods.
[0067] (2) To address the challenge of multi-path coverage in parallel UAV training programs, this invention designs a well-defined two-layer multi-swarm particle swarm optimization structure. The inner-layer particle swarm focuses on the accurate generation of test data through multi-swarm collaborative optimization of a single path; the outer-layer particle swarm coordinates the global optimization of multi-path coverage and dynamically adjusts the search strategy based on path pair features. This two-layer collaborative mechanism significantly improves the efficiency of test data generation and effectively overcomes the bottleneck of slow convergence speed in parallel program testing using traditional methods.
[0068] (3) By constructing a multi-task mathematical model oriented towards the characteristics of parallel UAV training programs, this invention achieves a precise mapping between testing requirements and optimization objectives. This model can simultaneously take into account multiple objectives such as multi-path coverage, optimization of the number of test cases, and detection of defects specific to parallel programs, ensuring that the generated test case set not only meets the basic coverage requirements but also effectively exposes deep defects in multi-process collaboration, thereby significantly improving the integrity and reliability of UAV training software testing and providing strong technical support for flight control algorithm verification and multi-aircraft collaborative training scenarios with high reliability requirements. Attached Figure Description
[0069] Figure 1 This is a flowchart illustrating the overall process of generating multi-group PSO test cases for a parallel UAV training program according to the present invention.
[0070] Figure 2 This is an example program for implementing the present invention;
[0071] Figure 3 An example of a multi-population particle swarm optimization algorithm co-evolutionary process; Detailed Implementation
[0072] The technical solution studied in this invention is a method for generating particle swarm test cases for parallel training programs of unmanned aerial vehicles (UAVs), which includes the following steps:
[0073] S1: Determine convergent and divergent path pairs based on mutation path similarity.
[0074] S1.1: Instrument the source code to generate variant paths, and quantify the degree of similarity between paths by calculating the similarity between them.
[0075] Let the parallel MPI program under test be... ,in The number of processes. For the first One process;
[0076] Based on the original method, some mutated branches are inserted into each process of the program under test, among which... Represents a process The One variant branch;
[0077] In process In this context, based on the original method, it is possible to generate sub-paths that contain only mutated branches, denoted as... Only the mutated branch is selected as the node; other statements are not considered.
[0078] The paths of all processes constitute the complete path of a parallel program. ,in For the first The first target path There are several sub-paths. The set of target paths is... , The number of target paths.
[0079] For any two target paths and The Processes subpath and Their similarity It can be represented as:
[0080] (1)
[0081] In the formula, express and Number of intersection nodes; for and The maximum length. Based on equation (1), Each process along the target path A subpath was constructed between the subpaths The similarity matrix is denoted as .
[0082] The target path can be calculated from the similarity of sub-paths. and similarity Based on equation (1), we can obtain:
[0083] (2)
[0084] Based on equation (2) A network was built between the target paths Similarity matrix :
[0085]
[0086] This invention designs a partner pairing mechanism based on the similarity between target paths. The goal of this mechanism is to match a "high similarity path" for each target path to improve the efficiency of target path coverage; and to match a "low similarity path" to enhance diversity, thereby avoiding the evolutionary algorithm from getting stuck in local optima.
[0087] S1.2: Based on the path similarity, determine the aggregated path pairs with high similarity and the divergent path pairs with low similarity.
[0088] First, from the similarity matrix
[0089]
[0090] Extract the pairing combinations between target paths And construct a set of all path pairings. ,in To avoid repetition;
[0091] Subsequently, based on similarity For sets Sort the elements in descending order to obtain an ordered set with path similarity from high to low. .
[0092] from Starting with the first element, select highly similar pairings between paths, assuming... for The first element, which groups the paths. Recorded as aggregated path pairs, then No longer paired with other paths; from Delete all containing or Pairing combinations, updated Then, continue from Select the first element as a highly similar partner path for pairing and combination; until... .
[0093] Next, based on similarity For sets Sort the elements in ascending order to obtain an ordered set with path similarity from low to high. .
[0094] From ordered sets Starting with the first element, select low similarity pairings between paths, assuming for The first element, which groups the paths. This is denoted as a divergent path pair, and then... No longer paired with other paths; from Delete all containing or Pairing combinations, updated Then, continue from Select the first element as the low-similarity collaborative path for pairing and combination; until... .
[0095] It should be noted that, considering the characteristics of MPI parallel programs, the method for determining the pairing relationship between aggregated and divergent paths applies not only to the pairing of all paths but also to the target sub-paths within each process.
[0096] S2: Generate a multi-task mathematical model for path pairs, covering multi-path test cases.
[0097] Define MPI program The input is ,in for The number of input variables included. For the range of values. Process Input , For the range of values, the MPI program The input is From the properties of each process in an MPI parallel program, it can be seen that the process... It contains some or all of the variables. , .
[0098] When a certain input variable Execute parallel programs The traversal path is denoted as ; The set of all executable paths in .
[0099] For parallel programs, this invention transforms the problem of generating test data covering multiple paths into a multi-task optimization problem. From Take path Given the target path, then, based on equation (2), the path is... and similarity For the objective function For the set of executable paths of A path can be constructed Objective function .
[0100] Coverage path Objective function:
[0101] (3)
[0102] in, This represents the number of parallel program processes. For process Target subpath and the path of crossing The similarity. Moreover, To cover subpaths The objective function is denoted as:
[0103] (4)
[0104] Obviously, when each process's subpath objective function The larger the value, the longer the total path. objective function The larger the value.
[0105] Therefore, the coverage path The problem of generating test data can be transformed into a function. The maximization problem can be mathematically represented as:
[0106] (5)
[0107] in This is the input field for the test data.
[0108] The mathematical model for the subpaths of all processes is as follows:
[0109] (6)
[0110] The value range of the task corresponding to each process. They are not the same.
[0111] When the objective function of all subpaths hour, Explain the traversal path With the target path The same, at this time To cover the target path The test data.
[0112] In the traditional co-evolutionary particle swarm optimization algorithm, based on decision variables... The number of variables involved is such that the evolutionary population is divided into multiple subpopulations, each optimizing one decision component. During the evolutionary process, all subpopulations use the same fitness function to evaluate the particles. If traditional methods are used to solve the above path coverage test data generation problem, then, in order to evaluate the particle's performance, each subpopulation needs to obtain information from the other populations to construct a complete set of decision variables. This allows for evaluation using a fitness function. However, this requires frequent communication between multiple processes, resulting in significant communication overhead.
[0113] Based on the design principles of parallel algorithms, it is known that each process in a parallel program is responsible for processing some or all of the input variables. Therefore, to effectively utilize the advantages of the co-evolutionary particle swarm optimization algorithm while avoiding its massive communication overhead, this invention employs multiple subpopulations and a cooperative community to co-evolve based on the correlation between input variables and the paths of each process. Each subpopulation evolves independently to optimize the portion of input variables related to a specific process path.
[0114] Therefore, for MPI programs Path set The problem of generating test data covering multiple paths is transformed into a function. To solve the maximization problem, the multi-task mathematical model established in this chapter is as follows:
[0115] (7)
[0116] Among them, the first Sub-tasks Responsible for optimizing the target path .
[0117] S3: Mathematical model for solving problems based on co-evolutionary Particle Swarm Optimization algorithm with multiple populations in both inner and outer layers.
[0118] To solve the optimization model of equation (7), the outer multi-population particle swarm algorithm co-evolution method can be adopted.
[0119] This invention designs a two-layer co-evolutionary multi-swarm particle swarm optimization algorithm. Its core lies in decomposing the multi-path coverage problem into two layers: an outer layer particle swarm responsible for covering multiple target paths, with each particle swarm responsible for its own target path, cooperating and evolving through information exchange to complete multi-task optimization. The inner layer particle swarm is responsible for covering one target path, with each particle swarm co-evolving to cover its own sub-path target task. This research, by designing a "two-layer structure, multi-swarm division of labor and co-evolutionary particle swarm optimization algorithm," achieves accurate coverage of multiple complete parallel paths (including multi-process paths) in parallel programs, automatically and efficiently generating corresponding test data, ultimately improving the completeness and execution efficiency of software testing.
[0120] Parallel Programs ,Task Responsible for optimizing the target path ,for Subtask problem, defined particle swarm The task is to solve the evolution problem in parallel. The corresponding particle swarm is Among them, particle swarm Used to optimize subpaths , Particle swarm The One particle, This represents the number of particles. Generally, Size depends on process Input variables and process size are determined.
[0121] Considering each process The input variables differ for the optimized subpath. The variables of the initial particle swarm are determined by the process. The input variables are determined.
[0122] Based on equation (3), for parallel programs Any target path The objective function is used as a particle swarm optimization. fitness function:
[0123] (8)
[0124] Based on equation (4), for process subpath The objective function is used as a particle swarm optimization. Fitness function:
[0125] (9)
[0126] (I) Inner Particle Swarm Co-evolution Strategy for Single Mutation Paths and Their Multi-Process Sub-Paths
[0127] The primary task of the inner particle swarm optimization is to find test data that covers the entire path of a target.
[0128] Inner-layer particle swarm This represents a cooperative group and Sub-particle swarm, The main task is to find a path that covers the target. The test data; among which Defined as a collaborative group, responsible for generating paths that cover the target. Test data, sub-particle swarm Each process is responsible for generating the corresponding sub-paths. The test data.
[0129] cooperative groups With sub-particle group Their ultimate goal is the same: to find coverage through particle information exchange and co-evolution. The test data.
[0130] Set the main process Range , containing variables , for Includes the number of input variables; other subprocesses. Range Include variables , for Includes the number of input variables. Generally, That is The number of variables of the particles is less than or equal to The number of variables in a particle.
[0131] Main steps of inner-layer particle swarm co-evolution:
[0132] (1) Initialize each particle swarm of Each particle swarm evolves in parallel within its own process in order to optimize its own sub-objective; if it encounters a message passing statement waiting for information from other processes, the evolution is paused.
[0133] (2) Each subprocess particle swarm Each iteration After that, from his own Selecting from particles High fitness particles Transmitted to the cooperative group ; Pause Particle Swarm The evolution awaits the cooperation of groups. The message;
[0134] (3) Particle swarm The transmitted particles are combined in a certain way to obtain new particles as cooperative groups. The initial particles; Continue evolving, if the generated path satisfies the requirement of covering the target path. The test data or the maximum number of iterations is reached, terminating all particle swarms. Evolution; Execution step (6);
[0135] (4) When the cooperative group Each iteration After that, from his own Selecting from particles High fitness particles Based on the partial variables of each subprocess, high-fitness particles are transferred to the particle swarm of each process. ; suspend itself The evolution awaits the sub-particle swarm. The message;
[0136] (5) Each sub-particle group New particles are obtained, randomly replacing the original particles, and the process is updated. Continue with step (2);
[0137] (6) Output the target path Test data
[0138] It should be noted that in step (3), the sub-particle swarm Provided High fitness particles , forming a particle swarm The initial particle combination method is as follows: sub-particle swarm Between them, information is exchanged and transmitted to the cooperative groups. particles If only contains Some variables, and particles Comparison, missing Some variables in .therefore, The missing variable values need to be obtained from other sub-particle groups. High fitness particles The values of variables or the main process's own variables are obtained to satisfy the cooperative particle swarm. Medium variables The required complete variables; and because there is overlap between variables from different processes, the particle swarm optimization for each process... Provided High fitness particles Both need to be with other processes The missing variable values are supplemented through permutations and combinations among the individual particles, ultimately resulting in... All variable values contained in the particle.
[0139] In steps (1), (2), and (4), during the evolution of the main process particle swarm and the various sub-process particle swarms, it is sometimes necessary to wait for the evolution results of each other's particle swarms. This is because the parallel nature of MPI programs means that each process is executed in parallel. Generally, the main process and each sub-process have an asynchronous characteristic of "stopping and starting". When the main process and each sub-process are executing, they need to wait for each other to send and receive messages. For example, when the main process is executing, the sub-process may not be executing, and the sub-process waits for the message sent by the main process. Therefore, each particle swarm evolves according to the execution of the corresponding process.
[0140] (II) Outer Particle Swarm Cooperative Evolutionary Strategies for Converging and Diverging Path Pairs
[0141] Outer Particle Swarm Responsible for finding the entire path covering multiple targets. The task of obtaining test data.
[0142] In real-world testing scenarios, it's often necessary to generate test data simultaneously for multiple target program paths. If we consider the coverage of each target path as an independent optimization task, the idea of multi-task optimization naturally arises. Multi-task optimization aims to accelerate algorithm convergence and improve the quality of solutions by sharing information or knowledge among multiple tasks (i.e., target paths) processed in parallel. The effect of multi-swarm information interaction and collaboration is particularly significant when there is some correlation between tasks.
[0143] While the outer particle swarm optimizes its own target paths, they can collaborate and exchange particle swarm information to efficiently find test data covering their respective target paths. Step S1 yields aggregated and divergent path pairs. During the evolutionary process of generating test data covering multiple paths, the interaction of aggregated path pairs mainly involves exchanging particles with high fitness values. The aim is to share high-quality particles within a similar problem space, thereby improving the efficiency of path coverage. In contrast, the interaction of divergent path pairs involves exchanging particles with significantly different fitness values. The purpose is to introduce entirely new genes from a swarm of particles with large differences, increasing population diversity and effectively preventing the algorithm from getting trapped in local optima.
[0144] (1) Particle orientation guidance and position update strategy based on aggregated path pairs
[0145] Knowledge transfer and collaboration strategies among highly similar tasks are comprehensively applied to all particle swarm optimization tasks. Assume the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform high-similarity partner pairing; target path cooperative groups and target path cooperative groups High similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows:
[0146] Suppose aggregated path pairs ;
[0147] On the target path In the middle, set the target path particle swarm Each evolution generation, from Select from the particles A high-fitness particle is passed to a highly similar cooperative path. particle swarm and use a high fitness particle set Save this A high-fitness particle; when continuously with During the iterative process of the generation cycle, it is continuously updated. Select the one with the highest fitness value from the previous multiple iterations. One particle.
[0148] When particle swarm Evolved to At that time, the position of a certain particle was The particle velocity is , This represents the individual best position in the particle's history (pbest). Particle swarm The global historical best position (gbest).
[0149] Among a group of highly similar target paths, high-fitness particles from highly similar paths often have high value for the evolution of the other path. However, frequent exchanges of particles among highly similar particle swarms can lead to premature convergence of the particle swarm, causing it to get trapped in local optima. Therefore, it is necessary to define decision parameters. Used for control particle swarm Should a highly similar collaborative path be adopted? particle swarm The high-fitness particles that are passed on are represented as:
[0150] (10)
[0151] in For the target path and similarity, For integers, introduce To prevent premature convergence caused by frequent particle exchanges between particle swarms, the intensity of communication between highly similar particle swarms is limited to ensure that each particle swarm retains sufficient autonomy to explore the unknown search space, thereby effectively avoiding the predicament of getting trapped in local optima.
[0152] Randomly generated based on a random function .
[0153] when Particle Swarm Use collaborative paths particle swarm High-fit particles are transferred to update particle velocities; conversely, low-fit particles are transferred to update velocities. The particle velocity is updated using a traditional method. The specific implementation is as follows:
[0154] when At that time, the particle velocity and position updates are the same as those in traditional PSO, indicating that...
[0155] for:
[0156] (11)
[0157] (12)
[0158] In equation (11), It is inertial weight. and It is the acceleration constant. and yes Random values within the interval.
[0159] when Then, the particle velocity update formula of the improved equation (11) is expressed as:
[0160] (13)
[0161] In equation (13), It is the acceleration constant. yes Random values within the interval.
[0162] Equation (13) adds a new term compared to the traditional equation (11). Particle swarm Evolved to In the past, from the set of high fitness particles Randomly select a high-fitness particle from the list, and the position of this particle is denoted as... For collaboration paths Particle Swarm exist The position of high-fitness particles in a generation. The purpose of adding this new item is to enable particles to update themselves not only by learning from their own and the group's experience, but also by drawing on the exploration results of their collaborating partners.
[0163] It should be noted that, High-fitness particles transferred in, It will not be directly stored in a high-fitness particle set. Because while the two target paths are similar, they are not exactly the same. Therefore, a particle with a high fitness value on one target path may not be equally good on its own. Thus, a local fitness evaluation is needed for that particle. After the local evaluation, a new fitness value is obtained, which then needs to be compared with previously stored high-fitness particles. The comparison is only made if the fitness of the newly received high-fitness particle is greater than or equal to... Only when the adaptive value is found will it be replaced and used for subsequent speed updates.
[0164] When the generated path satisfies the target path coverage The test data or the maximum number of iterations reached, all particle swarms Stop knowledge transfer and collaboration between highly similar tasks.
[0165] (2) Particle fitness evaluation and optimal replacement strategy based on divergent path pairs
[0166] Existing multi-task optimization algorithms generally focus on information sharing between highly similar tasks, but these methods often overlook the potential value from low-similarity particles. In fact, a particle with a low fitness value in one particle swarm may be a particle with a high fitness value in another particle swarm, which can help improve the evolutionary efficiency of that particle swarm.
[0167] Knowledge transfer and collaboration strategies among low-similarity tasks are comprehensively applied to all particle swarm optimization tasks. ;
[0168] Assuming the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform low-similarity partner pairing; target path cooperative groups and target path cooperative groups Low-similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows:
[0169] Let the divergent path pair be the full path. or subpath ;
[0170] For the target path cooperative groups Each evolution Algebra will sort all particles' fitness values in ascending order and select... Low-fit particles are passed to low-similarity cooperative paths. cooperative groups .
[0171] set up for Low fitness particles: First, for new particles Conduct based on The objective function is used to calculate the fitness value. If the new particle's fitness value is better than the path... The original cooperative group One (or some) particles If the fitness value is [value], then use [it]. Replace the original particles This mechanism ensures that only those on the target path... Only migrating particles with higher fitness values in a particle swarm will be integrated into the swarm.
[0172] Similarly, divergent path pairs In the middle, sub-path particle swarm The same strategy was adopted, towards the path particle swarm Migrating particles.
[0173] When the generated path satisfies the target path coverage The test data or the maximum number of iterations reached, all particle swarms Stop knowledge transfer and collaboration between tasks with low similarity.
[0174] The following example program illustrates the implementation process of this invention:
[0175] Figure 2 (a) is the source code of the program under test; Figure 2 (b) shows the new program after inserting the mutated branch.
[0176] 1. Identify convergent and divergent path pairs based on the similarity of variant paths;
[0177] 1.1 Instrument the source code to generate mutation paths, and quantify the degree of similarity between paths by calculating the similarity between paths;
[0178] like Figure 1 The example program shown is the MPI parallel program under test. The program input is It contains 27 mutation branches to generate mutation branch paths:
[0179] ,in , , , ;
[0180] ,in , , , ;
[0181] ,in , , , ;
[0182] ,in , , ,
[0183] ;
[0184] For the target path and subpath and Based on equation (1), the sub-path similarity can be obtained:
[0185]
[0186] process 4 sub-paths Calculate the similarity between them and construct a matrix. The same method is used to obtain the process. and Neutron path similarity matrix and .
[0187] For the full path and Their subpath similarities are respectively , , , The path can be obtained based on formula (2). and Similarity:
[0188]
[0189] Similarly, the similarity between these four target paths can be obtained, and a matrix can be constructed. :
[0190]
[0191] 1.2 Based on the path similarity, we determine the aggregated path pairs with high similarity and the divergent path pairs with low similarity.
[0192] For the target path The process of assigning aggregated path pairs is as follows:
[0193] First, based on the similarity matrix Construct a set of pairs:
[0194]
[0195] Subsequently, based on the similarity between target path groups, the set is... Arrange the elements in descending order to obtain the set. :
[0196] Table 1. Target path group similarity sorted in descending order
[0197]
[0198] First select the first element. As highly similar collaborative path pairings, then delete the set. All contained in The pairing. At this time, the updated Next, the first element. As a pairing of highly similar collaborative paths.
[0199] The final pairing of highly similar collaborative paths is as follows and .
[0200] Similarly, highly similar collaborative paths are paired for each of the sub-paths.
[0201] Subsequently, the target path The process of allocating divergent path pairs is as follows:
[0202] For sets Based on the similarity between target path groups, the set is... Sort in ascending order to get the set. :
[0203] Table 2. Target path group similarity sorted in ascending order.
[0204]
[0205] First select the first element. As low-similarity collaborative path pairings, then the set is deleted. All contained in The pairing. At this time, the updated Next, the first element. As a pairing of low-similarity collaborative paths.
[0206] The final low-similarity cooperative path pairings are: and .
[0207] Similarly, low-similarity cooperative path pairing is performed on all sub-paths.
[0208] The collaboration paths are shown in Table 3 below:
[0209] Table 3 Collaboration Path Pairs
[0210]
[0211] 2. Co-evolution based on inner and outer layer multi-population particle swarm optimization algorithm
[0212] 2.1 Inner Particle Swarm Co-evolution of a Single Mutation Path and Its Multi-Process Sub-Paths
[0213] by Figure 1 Example of Max-triangle program, selecting target path:
[0214]
[0215] Particle swarm cooperative groups Responsible for generating the target path coverage Test data, particle swarm Each is responsible for generating the covered subpaths. The test data, among which particle size One particle, Scale set One particle.
[0216] Particle swarms Each iteration After that, calculate the particles. The fitness values are shown in Table 4, where The variable is , The variable is , The variable is .
[0217] Table 4. Particle states when the particle swarm evolves to generation 3
[0218]
[0219] Select High fitness particles Transmitted to cooperative groups The particles are shown in Table 5.
[0220] Table 5 High Fitness Particle Set
[0221]
[0222] Based on particle swarm optimization Provided A group of high-fitness particles forms a cooperative community. The initial particle process is as follows:
[0223] Select respectively , and The first high-fitness particle in the process. , , To build a group of cooperative groups The initial particles, in which cooperative groups The variable is .
[0224] for High fitness particles , The particle variable is , Only variables , pass on When, missing variables Therefore, from Extracting variables The value is 86, from Extracting variables The value is 128, therefore, particle Passed to ,form new particles .
[0225] Similarly, for and The above method can be used to obtain the group particles of the cooperative group. , .
[0226] Continue to use high fitness particle sets , and Other high-fitness particles in the middle, each time from , and By selecting a high fitness particle, 24 cooperative group particles can be generated, as shown in Table 6.
[0227] Table 6 Cooperative Group Particles
[0228]
[0229] Particle Scale The 24 newly formed particles in Table 6 and their interactions with... The original particles were aimed at the target. The fitness value is calculated based on equation (7), and the top 26 particles with the highest fitness values are selected for updating. It continues to evolve.
[0230] In cooperative groups Evolutionary stages, each iteration generation, To Particle Swarm transfer High fitness particles .
[0231] Particle swarm optimization contains only some variables , Transmitted particles After calculating the fitness value, the particle is in the particle swarm. The fitness value of the original particles is 0. To improve the diversity of the particle swarm, particles whose fitness value is also 0 are... Replace it.
[0232] exist Particle swarm optimization contains only some variables , Transmitted particles The fitness value is calculated to be 1, and the original particle is replaced.
[0233] exist The particle swarm contains only some variables. , Transmitted particles The fitness value is calculated to be 1. Table 4 shows that the particle swarm optimization at this point... The original five particles were all in the range (128, 128), and the particle swarm had fallen into a local optimum. At this point, a new particle... Replacing the original particle can provide To find a new search direction, we need to break free from local optima.
[0234] 2.2 Cooperative Evolution of Outer Particle Swarm Paths for Converging and Diverging Path Pairs
[0235] 2.2.1 Given For aggregated path pairs:
[0236] When path cooperative groups Each evolution generation, from oneself Selecting from particles A high-fitness particle is passed to a highly similar cooperative path. cooperative groups Assuming Evolved to generation, High fitness particles Send to .
[0237] After receiving, for The objective function is used to calculate the new particle. In cooperative groups The fitness value is 0.375, which will affect the new particles. The fitness value, and the cooperative group Stored high fitness particle set The fitness values of the particles in the system are compared. Since the new particle has a higher fitness value, it will replace the old particle, thus updating the system. and for subsequent use The particle velocity is updated.
[0238] Based on the PSO evolutionary model, we assume a cooperative community group. The current position of a particle is Current velocity of the particle The individual optimal position of a particle Global optimal position of particle swarm Optimal position for partners .
[0239] Random numbers are generated based on random functions. .set up Decision parameters Therefore, it can be concluded that Update based on equation (11) correspond Particle velocity:
[0240]
[0241] in ,
[0242]
[0243]
[0244] Ultimately obtainable .
[0245] Then update the particle position based on equation (12):
[0246]
[0247] in , The updated position of the particle can be obtained: .
[0248] Similarly, when cooperative groups... Each evolution generation, from oneself Selecting from particles A high-fitness particle is passed to a highly similar cooperative path. cooperative groups ,and This information will be used to update particle velocity and position.
[0249] 2.2.2 Known Subpath For aggregated path pairs:
[0250] When path particle swarm Each evolution generation, from oneself Selecting from particles A high-fitness particle is passed to a highly similar cooperative path. particle swarm Assuming evolution to... generation, High fitness particles Send to .
[0251] After receiving, for The objective function is used to calculate the new particle. In particle swarm The fitness value is 0.667, which will affect the new particles. fitness value and particle swarm Stored high fitness particle set The fitness values of the particles in the system are compared. Since the new particle has a higher fitness value, it replaces the old particle, thus updating the system. and for subsequent use The particle velocity is updated.
[0252] Based on the PSO evolutionary model, assuming particle swarm optimization... The current position of a particle is Current velocity of the particle The optimal position of an individual particle Global optimal position of particle swarm Optimal position for partners .
[0253] Random numbers are generated based on random functions. .set up Decision parameters Therefore, it can be concluded that Update based on equation (13) correspond Particle velocity:
[0254]
[0255] in ,
[0256] ,
[0257] ,
[0258] ,
[0259] Ultimately obtainable .
[0260] Then update the particle position based on equation (12):
[0261]
[0262] in , The updated position of the particle can be obtained: .
[0263] Similarly, when particle swarms Each evolution generation, from oneself Selecting from particles A high-fitness particle is passed to a highly similar cooperative path. particle swarm ,and This information will be used to update particle velocity and position.
[0264] Particle Swarm exist iterate on the basis Generation, recorded as From oneself Selecting from particles As a high-fitness particle, it is passed on to the particle swarm. .
[0265] After receiving, for The objective function is used to calculate the new particle. In particle swarm The fitness value in the middle is 0, so the new particle will be... fitness value and particle swarm Stored high fitness particle set Particles in The fitness values are compared, and since the old particles have higher fitness values, they are not updated. .
[0266] At this time, the particle swarm In Based on the PSO evolutionary model, it is assumed that the particle swarm... The current position of a particle is Current velocity of the particle The optimal position of an individual particle Global optimal position of particle swarm Optimal position for partners .
[0267] Random numbers are generated based on random functions. .set up Decision parameters Therefore, it can be concluded that Update based on equations (13) and (12) correspond Particle velocity and position:
[0268]
[0269]
[0270] Ultimately obtainable , .
[0271] 2.2.3 Known For divergent path pairs:
[0272] When path cooperative groups Each evolution generation, choice Low fitness particles Passed to low-similarity collaborative paths cooperative groups .
[0273] cooperative groups After receiving new particles, targeting The objective function is used to calculate the fitness values of the new particles. Of the seven new particles, only two are truly new. , The fitness value of the new particle is higher than that of the original particle (67,4,37,1) and (90,94,128,114), so the original particle is replaced with the new particle.
[0274] 2.3 Test Case Output
[0275] Cooperative groups evolved to the 196th generation. Received from A set of high-fitness particles: Particle swarm A set of high-fitness particles: Particle swarm A set of high-fitness particles: They combine to form 24 cooperative groups of particles and inherit the cooperative groups from the previous evolution. The two particles with the highest fitness values were selected, thus generating a cooperative group of 26 particles. Test data (118, 114, 121, 128) was successfully found, covering the selected target path in the example. .
[0276] This invention achieves a precise mapping between testing requirements and optimization objectives by constructing a multi-task mathematical model tailored to the characteristics of parallel UAV training programs. This model simultaneously considers multiple objectives, including multi-path coverage, optimization of the number of test cases, and detection of defects specific to parallel programs. It ensures that the generated test case set not only meets basic coverage requirements but also effectively exposes deep-seated defects in multi-process collaboration, thereby significantly improving the integrity and reliability of UAV training software testing. This provides strong technical support for flight control algorithm verification with high reliability requirements and multi-UAV collaborative training scenarios.
Claims
1. A method for generating particle swarm test cases for parallel training programs of unmanned aerial vehicles, characterized in that, Includes the following steps: S1: Determine aggregated and divergent path pairs based on the similarity of variant paths; S1.1: Instrument the source code to generate variant paths, and quantify the degree of similarity between paths by calculating the similarity between paths; S1.2: Based on the path similarity, determine the aggregated path pairs with high similarity and the divergent path pairs with low similarity respectively; S2: Generate a multi-task mathematical model for path pairs, covering multi-path test cases; S3: Solving mathematical models based on the co-evolutionary execution of inner and outer multi-population particle swarm optimization algorithm; Specifically, the inner particle swarm co-evolution strategy is for a single mutation path and its multi-process sub-paths; the outer particle swarm co-evolution strategy is for aggregated and divergent path pairs: including particle orientation guidance and position update strategy based on aggregated path pairs, and particle fitness evaluation and optimal replacement strategy based on divergent path pairs. S4: Based on step S3, the inner and outer particle swarm optimization algorithm is iterated. When test data that satisfies the coverage of the mutation path is generated or the maximum number of iterations is reached, the iteration is terminated and the test data is output. Step S1.2 specifically includes: First, from the similarity matrix Extract the pairing combinations between target paths And construct a set of all path pairings. ,in To avoid repetition; Subsequently, based on similarity For sets Sort the elements in descending order to obtain an ordered set with path similarity from high to low. ; from Starting with the first element, select highly similar pairings between paths, assuming... for The first element, which combines paths Recorded as aggregated path pairs, then No longer paired with other paths; from Delete all containing or Pairing combinations, updated Next, continue from Select the first element as a highly similar partner path for pairing and combination; until... ; Next, based on similarity For sets Sort the elements in ascending order to obtain an ordered set with path similarity from low to high. ; From ordered sets Starting with the first element in the list, select low similarity pairings between paths, assuming... for The first element, which combines paths This is denoted as a divergent path pair, and then... No longer paired with other paths; from Delete all containing or Pairing combinations, updated Next, continue from Select the first element as the low-similarity collaborative path for pairing and combination; until... .
2. The method according to claim 1, characterized in that, The inner particle swarm co-evolution strategy for a single mutation path and its multi-process sub-paths in step S3 is specifically as follows: The inner particle swarm optimization is used to find test data that covers the entire path of a target. Inner-layer particle swarm This represents a cooperative group and Sub-particle swarm, In order to find the target path The test data; among which As a collaborative group, it is responsible for generating paths that cover the target area. Test data, sub-particle swarm Each process is responsible for generating the corresponding subpaths. The test data, Represented as the first The first target path Sub-paths Indicates the use of covering the first The first target path A swarm of sub-particles, among which For the first Individual particle swarms; cooperative groups With sub-particle group Their ultimate goal is the same: to find coverage through particle information exchange and co-evolution. Test data; Set the main process Range , containing variables , for Includes the number of input variables; other child processes. Range Include variables , for The number of input variables included; The inner particle swarm co-evolution steps include: (1) Initialize each sub-particle swarm of particles, of which Represented as inner-shell particle swarm The Middle The number of particles in each sub-particle group; each sub-particle group evolves in parallel within its own process in order to optimize its own sub-objective; if the execution reaches a message passing statement waiting for information from other processes, the evolution is paused; (2) Each subprocess particle swarm Each iteration After that, from his own Select from particles High fitness particles Transmitted to the cooperative group ; Pause Particle Swarm The evolution awaits the cooperation of groups. The message; (3) Particle swarm The transmitted particles are combined in a certain way to obtain new particles, which then form a cooperative group. The initial particles; Continue evolving, if the generated path satisfies the requirement of covering the target path. The test data or the maximum number of iterations is reached, terminating all particle swarms. Evolution; Execution step (6); (4) When the cooperative group Each iteration After that, from the cooperative group number of particles Select High fitness particles Based on the partial variables of each subprocess, high-fitness particles are transferred to the particle swarm of each subprocess. ; pause The evolution awaits the sub-particle swarm. The message; (5) Each sub-particle group New particles are obtained, randomly replacing the original particles, and the process is updated. Continue with step (2); (6) Output the target path The test data.
3. The method according to claim 2, characterized in that, In step (3), the sub-particle swarm Provided High fitness particles , forming a particle swarm The initial particle combination method is as follows: sub-particle swarm Information is exchanged and transmitted to the collaborating groups. particles If only contains Some variables, and particles Comparison, missing Some variables in ;therefore, The missing variable values need to be obtained from other sub-particle groups. High fitness particles The values of variables or the main process's own variables are obtained to satisfy the cooperative group. Medium variables The required complete variables; Particle swarm optimization for each process Provided High fitness particles Both need to be with other processes The missing variable values are supplemented through permutations and combinations among the individual particles, ultimately resulting in... All variable values contained in the particle.
4. The method according to claim 1, characterized in that, The particle orientation guidance and position update strategy based on aggregated path pairs in step S3 is as follows: Knowledge transfer and collaboration strategies among highly similar tasks are comprehensively applied to all particle swarm optimization tasks. ; Assuming the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform high-similarity partner pairing; target path cooperative groups and target path cooperative groups High similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows: Suppose aggregated path pairs ; On the target path In the middle, set the target path particle swarm Each evolution generation, from Select from the particles A high-fitness particle is passed to a highly similar cooperative path. particle swarm and use a high fitness particle set Save this A high-fitness particle; when continuously with During the iterative process of the generation cycle, it is continuously updated. Select the one with the highest fitness value from the previous multiple iterations. One particle; When particle swarm Evolved to At that time, the position of a certain particle was The particle velocity is , This represents the individual best position in the particle's history (pbest). Particle swarm The global historical best position (gbest); Define decision parameters Used for control particle swarm Should a highly similar collaborative path be adopted? particle swarm The high-fitness particles that are passed on are: in For the target path and similarity, For integers, introduce This is to prevent premature convergence caused by frequent particle exchanges between particle swarms; Randomly generated based on a random function ; when Particle Swarm Use collaborative paths particle swarm High-fit particles are transferred to update particle velocities; conversely, low-fit particles are transferred to update particle velocities. , Update particle velocity using traditional methods; The specific implementation method is as follows: (1) When At this time, the particle velocity and position updates are the same as those in traditional PSO, expressed by the following formula: It is inertial weight. and It is the acceleration constant. and yes Random values within the interval; (2) When At that time, the improved particle velocity update formula is: in, It is the acceleration constant. yes Random values within the interval.
5. The method according to claim 1, characterized in that, The particle fitness evaluation and optimal replacement strategy based on divergent path pairs in step S3 is as follows: Knowledge transfer and collaboration strategies among low-similarity tasks are comprehensively applied to all particle swarm optimization tasks. ; Assuming the target path Corresponding particle swarm With the target path Corresponding particle swarm Perform low-similarity partner pairing; target path cooperative groups and target path cooperative groups Low-similarity pairing is also performed between them, and the specific knowledge transfer operation is as follows: Let the divergent path pair be the full path. or subpath ; For the target path cooperative groups Each evolution Algebra will sort all particles' fitness values in ascending order and select... Low-fit particles are passed to low-similarity cooperative paths. cooperative groups ; set up for Low fitness particles: First, for new particles Conduct based on The objective function calculates the fitness value; if the new particle's fitness value is better than the path... The original cooperative group Several particles The fitness value is then used. Replace the original particles ; Divergent path pairs In the middle, sub-path particle swarm The same strategy was adopted, towards the path particle swarm Migrating particles.
Citation Information
Patent Citations
Path coverage test data generation method based on SA-BKA hybrid optimization mechanism
CN120596370A
Robot path planning algorithm based on particle swarm optimization algorithm and dynamic window method
CN121453082A