Aircraft safety control algorithm test case generation method and system
By generating test cases for the security control algorithm through an iterative method, the problems of low efficiency and low accuracy in the existing technology are solved, and efficient and accurate verification of the security control algorithm is achieved to ensure the safety of the aircraft.
Patent Information
- Application Number
- CN202310474313.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing aircraft safety control algorithms generate test cases with low efficiency and low accuracy. In particular, the manual operation is cumbersome in the division and verification of safety control zones for medium and long-range missiles, resulting in insufficient and incomplete verification and potential safety hazards in flight tests.
A test case generation method for aircraft security control algorithms is adopted. The test positions on both sides of the midpoint of the security control zone boundary are generated iteratively. The perturbation direction is determined by the absolute value of the difference between latitude and longitude. A large number of test cases are automatically generated to ensure coverage and accuracy.
It improves the efficiency and accuracy of generating test cases for security control algorithms, enabling efficient verification of the correctness of security control algorithms, reducing manual operations, and improving design quality and security.
Smart Images

Figure CN116804873B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of guidance and control system design technology, and in particular to a method and system for generating test cases for aircraft safety control algorithms. Background Technology
[0002] Safety control is a crucial aspect of aircraft design, possessing veto power and directly impacting the success or failure of flight tests. Therefore, the design and verification of safety control algorithms are an indispensable part of flight test procedures. While various models currently conduct this work, it is generally carried out hastily before deployment, using test cases that are often generated by ad-hoc programs or manually selected. For medium- and long-range missiles, due to their long range and large safety control channels, the safety control area often needs to be divided into dozens of quadrilaterals / pentagons for assembly. Due to the large amount of data, tedious manual operations, and time constraints, this work places immense pressure on designers, leading to insufficient and incomplete verification, and posing potential safety risks to flight tests. Considering the highly repetitive nature of this work, generating test cases using highly versatile programs can reduce repetitive work, improve design efficiency, and ensure design quality.
[0003] In the actual aircraft design process, the safety control work begins with coordinating and determining the data source for the safety control zone with relevant management. Then, based on the safety control plan, the safety control zone is divided according to certain rules, forming several safety control sub-zones and no-fly zones. A safety control data packet is then created according to a specific format and loaded onto the missile. After takeoff, the aircraft parses the safety control data packet, inputting the missile's current position information and the safety control zone data into the safety control algorithm, which outputs safety control commands. Based on various project scenarios, it is known that various safety control sub-zones or no-fly zones are essentially polygons. The safety control algorithm uses certain rules to determine whether the aircraft's position is inside or outside the polygon. When the aircraft is inside the safety control zone and outside the no-fly zone, it flies normally; when the aircraft is outside the safety control zone or inside the no-fly zone, it executes safety controls to ensure no major safety incidents occur. Safety control test cases generate a series of position points located on both sides of each edge of the safety control zone polygon or no-fly zone polygon, inputting these as the aircraft's position into the safety control algorithm. The algorithm's output is then observed to determine if it meets expectations. However, existing security control algorithm test cases are usually selected manually, which is inefficient and inaccurate. Summary of the Invention
[0004] This invention provides a method and system for generating test cases for aircraft security control algorithms, which can solve the technical problems of low efficiency and low accuracy in the existing technology of manually selecting and generating test cases for security control algorithms.
[0005] According to one aspect of the present invention, a method for generating test cases for an aircraft security control algorithm is provided. The method includes: for any set edge AB of a security control sub-region, initializing a first security control test point P using the arithmetic mean of the latitude and longitude of two points A and B on the set edge AB. AB1 Location; initialize latitude and longitude perturbation step size and initial convergence threshold; calculate the first security control test point P. AB1 The lateral position relative to the line connecting points A and B; determining the absolute values of the longitude and latitude differences between points A and B; when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P. AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the latitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral location; the first security control test point P AB1 The convergence threshold Z of the latitude perturbation setting factor n_t P, as the second security control test point AB2 The initial latitude ensures the second security test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the latitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft security control algorithm are generated; when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the longitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral location; the first security control test point P AB1 The convergence threshold Z of the longitude perturbation setting factor n_t P, as the second security control test point AB2 The initial longitude ensures the second security control test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the longitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated.
[0006] Furthermore, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 latitude φ c1 (t) can be determined according to φ c1 (t)=φ c1 (t0)-3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 (t0) is the first security control test point P. AB1 The initial latitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. λ1 is the longitude of point A, and λ2 is the longitude of point B.
[0007] Furthermore, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 (t+1)=φ c1 (t)+eps×sign(Z n The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 latitude φ c1 (t+1).
[0008] Furthermore, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the second security control test point P... AB2 The initial latitude can be determined according to φ c1 ′(t0)=φ c1 +3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 The first security control test point P is the output. AB1 Latitude.
[0009] Furthermore, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 ′(t+1)=φ c1 ′(t)+eps×sign(Z n The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 latitude φ c1 ′(t+1).
[0010] Furthermore, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 Longitude λ c1 (t) can be determined according to λ c1 (t)=λ c1 (t0)+3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 (t0) is the first security control test point P. AB1 The initial longitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. φ1 is the latitude of point A, and φ2 is the latitude of point B.
[0011] Furthermore, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 (t+1)=λ c1(t)-eps×sign(Z n ×sign(φ2-φ1) gradually perturbs the first security test point P according to the latitude and longitude perturbation step size. AB1 Longitude λ c1 (t+1).
[0012] Furthermore, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the second security control test point P... AB2 The initial longitude can be determined based on λ. c1 ′(t0)=λ c1 -3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 The first security control test point P is the output. AB1 Longitude.
[0013] Furthermore, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 ′(t+1)=λ c1 ′(t)-eps×sign(Z n ×sign(φ2-φ1) gradually perturbs the second security control test point P according to the latitude and longitude perturbation step size. AB2 Longitude λ c1 ′(t+1).
[0014] According to another aspect of the present invention, a test case generation system for aircraft safety control algorithms is provided, characterized in that the test case generation system for aircraft safety control algorithms uses the test case generation method for aircraft safety control algorithms described above to generate test cases for aircraft safety control algorithms.
[0015] This invention provides a method for generating test cases for aircraft security control algorithms. This method generates test cases by comparing the absolute values of the latitude and longitude differences between two points on the security control boundary, traversing different branches, perturbing longitude or latitude, and iteratively generating test cases on both sides of the security control boundary. Compared with existing technologies, this method uses an iterative method to generate test positions at arbitrary distances to both sides of the midpoint of the security control zone boundary. These positions, as input, can fully verify the correctness of the security control algorithm, efficiently verifying the algorithm. This method can automatically generate a large number of security control algorithm test cases with strong coverage. These test cases, as input, can fully and efficiently verify the correctness of the security control algorithm, greatly improving the generation efficiency and accuracy of algorithm test cases. Attached Figure Description
[0016] The accompanying drawings, which form part of this specification, are provided to further illustrate embodiments of the invention and, together with the textual description, explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0017] Figure 1 A flowchart of a method for generating test cases for aircraft safety control algorithms according to a specific embodiment of the present invention is shown;
[0018] Figure 2 A schematic diagram of the overall security control zone provided according to a specific embodiment of the present invention is shown;
[0019] Figure 3 This diagram illustrates a security control zone divided into several security control sub-zones according to a specific embodiment of the present invention.
[0020] Figure 4 A schematic diagram of the structure of the security control sub-region 1 provided according to a specific embodiment of the present invention is shown. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0023] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0024] like Figures 1 to 4 As shown, according to a specific embodiment of the present invention, a method for generating test cases for an aircraft security control algorithm is provided. This method includes: for any set edge AB of a security control sub-region, initializing a first security control test point P using the arithmetic mean of the latitude and longitude of two points A and B on the set edge AB. AB1 Location; initialize latitude and longitude perturbation step size and initial convergence threshold; calculate the first security control test point P. AB1 The lateral position relative to the line connecting points A and B; determining the absolute values of the longitude and latitude differences between points A and B; when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the latitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral location; the first security control test point P AB1 The convergence threshold Z of the latitude perturbation setting factor n_t P, as the second security control test point AB2 The initial latitude ensures the second security test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the latitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft security control algorithm are generated; when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the longitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral location; the first security control test point P AB1 The convergence threshold Z of the longitude perturbation setting factor n_t P, as the second security control test point AB2 The initial longitude ensures the second security control test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the longitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated.
[0025] This configuration provides a method for generating test cases for aircraft security control algorithms. This method compares the absolute values of the latitude and longitude differences between two points on the security control boundary, traversing different branches, perturbing longitude or latitude, and iteratively generating test cases on both sides of the security control boundary. Compared with existing technologies, the aircraft security control algorithm test case generation method provided by this invention uses an iterative method to generate test positions at arbitrary distances to both sides of the midpoint of the security control zone boundary. These positions, as input, can fully verify the correctness of the security control algorithm, efficiently verifying the algorithm. This method can automatically generate a large number of security control algorithm test cases with strong coverage. These test cases, as input, can fully and efficiently verify the correctness of the security control algorithm, greatly improving the generation efficiency and accuracy of algorithm test cases. As a specific embodiment of this invention, the convergence threshold is generally set to 3 to 5 times the convergence threshold.
[0026] Specifically, in this invention, such as Figure 2 The region shown is divided into Figure 3 The diagram shows multiple convex polygons, each representing a security control sub-region. Each sub-region has multiple edges, and two test cases need to be generated for each edge, one on each side. Figure 4 The security control sub-region 1 shown has four edges: AB, BC, CD, and DA. For edge AB, it is necessary to generate an edge located approximately at the midpoint of AB, at a distance of approximately Z from line AB. nt P AB1 and P AB2 For two points, for edge BC, we need to generate a point approximately at the midpoint of BC, at a distance of approximately Z from line BC. nt P BC1 and P BC2 Two location points. This method generates eight test locations based on the known latitude and longitude of four points A, B, C, and D.
[0027] For any defined edge AB of the security control sub-region, calculate and obtain the test point P. AB1 and P AB2 The specific process is as follows.
[0028] First, for any set edge AB of the security control sub-zone, the latitude and longitude of two points A and B on the set edge AB need to be initialized using the arithmetic mean. AB1 The location. In this invention, the first security control test point P AB1 The initial position is (φ) c1 (t0), λ c1 (t0)), where, φ1 is the latitude of point A, φ2 is the latitude of point B, λ1 is the longitude of point A, and λ2 is the longitude of point B.
[0029] After obtaining the first security control test point PAB1 After determining the location, the latitude and longitude perturbation step size and the initial convergence threshold can be initialized; the first security control test point P can be calculated. AB1 The lateral position relative to the line connecting A and B. Among them, the first security control test point P... AB1 The lateral position relative to the line AB is the solution for the first security control test point P. AB1 The distance Z between the given edge AB and the given edge n First security control test point P AB1 The distance Z between the given edge AB and the given edge n The formula for solving (i.e., lateral position) is: In the formula, the Earth's radius R e =6378137m. The formulas for calculating each vector are as follows:
[0030]
[0031]
[0032]
[0033]
[0034] Where, φ P λ is the latitude of the first security control test point. P Here is the longitude of the first security control test point. The following calculations of the lateral position are all based on... Solve the problem.
[0035] Furthermore, after calculating and obtaining the first security control test point P... AB1 After determining the lateral position relative to the line connecting points A and B, the absolute values of the longitude and latitude differences between the two points can be determined, thus identifying the perturbation longitude or latitude.
[0036] In this invention, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the latitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1The latitude, longitude, and lateral position; the lateral position refers to the first security control test point P. AB1 The distance Z between the given edge AB and the given edge n ; The first security control test point P AB1 The convergence threshold Z of the latitude perturbation setting factor n_t P, as the second security control test point AB2 The initial latitude ensures the second security test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the latitude of the second security control test point P. AB2 The lateral position relative to the AB line refers to the second security control test point P. AB2 The distance Z between the given edge AB and the given edge n ′, until the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated. In this invention, the second safety control test point P... AB2 The distance Z between the given edge AB and the given edge n The formula for solving ′ is: In the formula, the Earth's radius R e =6378137m. The formulas for calculating each vector are as follows:
[0037]
[0038]
[0039]
[0040] Where, φ P λ is the latitude of the second security control test point. P The longitude of the second security control test point.
[0041] As a specific embodiment of the present invention, when the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 latitude φ c1 (t) can be determined according to φ c1(t)=φ c1 (t0)-3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 (t0) is the first security control test point P. AB1 The initial latitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. λ1 is the longitude of point A, and λ2 is the longitude of point B.
[0042] When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 (t+1)=φ c1 (t)+eps×sign(Z n The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 latitude φ c1 (t+1).
[0043] When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the second security control test point P... AB2 The initial latitude can be determined according to φ c1 ′(t0)=φ c1 +3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 The first security control test point P is the output. AB1 Latitude.
[0044] When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 ′(t+1)=φ c1 ′(t)+eps×sign(Z n The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 latitude φ c1 ′(t+1).
[0045] In this invention, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the longitude of the first security control test point P. AB1Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral location; the first security control test point P AB1 The convergence threshold Z of the longitude perturbation setting factor n_t P, as the second security control test point AB2 The initial longitude ensures the second security control test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the longitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated.
[0046] As a specific embodiment of the present invention, when the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 Longitude λ c1 (t) can be determined according to λ c1 (t)=λ c1 (t0)+3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 (t0) is the first security control test point P. AB1 The initial longitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. φ1 is the latitude of point A, and φ2 is the latitude of point B.
[0047] When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 (t+1)=λ c1 (t)-eps×sign(Z n×sign(φ2-φ1) gradually perturbs the first security test point P according to the latitude and longitude perturbation step size. AB1 Longitude λ c1 (t+1).
[0048] When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the second security control test point P AB2 The initial longitude can be determined based on λ. c1 ′(t0)=λ c1 -3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 The first security control test point P is the output. AB1 Longitude.
[0049] When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 ′(t+1)=λ c1 ′(t)-eps×sign(Z n ×sign(φ2-φ1) gradually perturbs the second security control test point P according to the latitude and longitude perturbation step size. AB2 Longitude λ c1 ′(t+1).
[0050] According to another aspect of the present invention, a test case generation system for aircraft safety control algorithms is provided, which generates test cases for aircraft safety control algorithms using the test case generation method for aircraft safety control algorithms as described above.
[0051] This configuration provides a test case generation system for aircraft security control algorithms. This system generates test cases by comparing the absolute values of the latitude and longitude differences between two points on the security control boundary, traversing different branches, perturbing longitude or latitude, and iteratively generating test cases on both sides of the security control boundary. Compared with existing technologies, the aircraft security control algorithm test case generation method provided by this invention utilizes an iterative method to generate test positions at arbitrary distances to both sides of the midpoint of the security control zone boundary. These positions, as input, can fully verify the correctness of the security control algorithm, efficiently verifying the algorithm. This system can automatically generate a large number of security control algorithm test cases with strong coverage. These test cases, as input, can fully and efficiently verify the correctness of the security control algorithm, greatly improving the generation efficiency and accuracy of algorithm test cases.
[0052] To gain a further understanding of the present invention, the following description is provided in conjunction with... Figures 1 to 4 The method for generating test cases for the aircraft safety control algorithm provided by this invention is described in detail.
[0053] like Figures 1 to 4 As shown in the figure, a method for generating test cases for aircraft security control algorithms is provided according to a specific embodiment of the present invention. The method specifically includes the following steps.
[0054] Step 1: For any designated edge AB of the security control sub-zone, initialize the first security test point P using the arithmetic mean of the latitude and longitude of two points A and B on the designated edge AB. AB1 The location. In this invention, the first security control test point P AB1 The initial position is (φ) c1 (t0), λ c1 (t0)), where,
[0055] Step 2: Initialize the latitude and longitude perturbation step size eps = 0.00001 (test point position accuracy, eps = 0.00001 corresponds to meter-level accuracy). Perturbating the latitude and longitude by this value will move the position by approximately 1 meter. Initialize the convergence threshold Z. n_t (Test case lateral position thresholds, such as 30m, 50m, etc.). Calculate the first security control test point P. AB1 The lateral position relative to the AB line (left negative, right positive). Among them, the first security control test point P... AB1 The lateral position relative to the line AB is the solution for the first security control test point P. AB1 The distance Z between the given edge AB and the given edge n .
[0056] Step 3: Determine the magnitude of the absolute values of the longitude and latitude differences between points A and B. If the absolute value of the longitude difference is greater than the absolute value of the latitude difference, proceed to branch 2; if the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, proceed to branch 1 and enter the iterative loop of the test case generation method.
[0057] Step four, in this embodiment, if the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P is initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P after relocation AB1 latitude φ c1 (t) can be determined according to φ c1 (t)=φ c1 (t0)-3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 (t0) is the first security control test point P. AB1 The initial latitude, Z n-tThe convergence threshold is eps, the latitude and longitude perturbation step size is eps, and the sign function is the sign determination function. λ1 is the longitude of point A, and λ2 is the longitude of point B.
[0058] Step 5: Gradually perturb the first security control test point P according to the latitude and longitude perturbation step size eps. AB1 Calculate the latitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral position. In this embodiment, it can be determined based on φ. c1 (t+1)=φ c1 (t)+eps×sign(Z n The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 latitude φ c1 (t+1).
[0059] Step 6, connect the first security control test point P AB1 The convergence threshold Z of the latitude perturbation setting factor n_t P, as the second security control test point AB2 The initial latitude ensures the second security test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t In this embodiment, the second security control test point P AB2 The initial latitude can be determined according to φ c1 ′(t0)=φ c1 +3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 The first security control test point P is the output. AB1 Latitude.
[0060] Step 7: Gradually perturb the second security control test point P according to the latitude and longitude perturbation step size eps. AB2 Calculate the latitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold.n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated. In this embodiment, test cases can be generated based on φ. c1 ′(t+1)=φ c1 ′(t)+eps×sign(Z n The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 latitude φ c1 ′(t+1).
[0061] In summary, this invention provides a method for generating test cases for aircraft security control algorithms. This method generates test cases by comparing the absolute values of the difference between the latitude and longitude of two points on the security control boundary, taking different branches, perturbing the longitude or latitude, and iteratively generating test cases on both sides of the security control boundary. Compared with existing technologies, the aircraft security control algorithm test case generation method provided by this invention uses an iterative method to generate test positions at arbitrary distances to both sides of the midpoint of the security control zone boundary. These positions, as inputs, can fully verify the correctness of the security control algorithm, efficiently verifying the security control algorithm. This method can automatically generate a large number of security control algorithm test cases with strong test case coverage. These test cases, as inputs, can fully and efficiently verify the correctness of the security control algorithm, greatly improving the generation efficiency and accuracy of algorithm test cases.
[0062] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0063] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore should not be construed as limiting the scope of protection of this invention.
[0064] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating test cases for an aircraft safety control algorithm, characterized in that, The method for generating test cases for the aircraft safety control algorithm includes: For any set edge AB of the security control sub-zone, initialize the first security control test point P using the arithmetic mean of the latitude and longitude of two points A and B on the set edge AB. AB1 Location; Initialize the latitude and longitude perturbation step size and the initial convergence threshold; Calculate the first security control test point P AB1 Lateral position relative to the line AB; Determine the magnitude of the absolute values of the longitude difference and the absolute values of the latitude difference between points A and B; When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the latitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral position of the first security control test point P; AB1 The convergence threshold Z of the latitude perturbation setting factor n_t P, as the second security control test point AB2 The initial latitude ensures the second security test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the latitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated. When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move further away from the set edge AB to ensure the first security test point P AB1 The distance Z between the given edge AB and the given edge n Greater than the initial convergence threshold Z n_t The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 Calculate the longitude of the first security control test point P. AB1 Relative to the lateral position of the AB line, up to the first security control test point P AB1 The distance Z between the given edge AB and the given edge n Less than the initial convergence threshold Z n_t Output the first security control test point P AB1 The latitude, longitude, and lateral position of the first security control test point P; AB1 The convergence threshold Z of the longitude perturbation setting factor n_t P, as the second security control test point AB2 The initial longitude ensures the second security control test point P. AB2 Located on the line connecting AB and the first security control test point P AB1 On the opposite side, and the second security control test point P AB2 The distance Z between the given edge AB and the given edge n ′ is greater than the convergence threshold Z n_t The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 Calculate the longitude of the second security control test point P. AB2 Relative to the lateral position of the AB line, up to the second security control test point P AB2 The distance Z between the given edge AB and the given edge n Z' is less than the convergence threshold. n_t Output the second security control test point P AB2 Based on the latitude, longitude, and lateral position, test cases for the aircraft safety control algorithm are generated.
2. The method for generating test cases for aircraft security control algorithms according to claim 1, characterized in that, When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 latitude φ c1 (t) can be determined according to φ c1 (t)=φ c1 (t0)-3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 (t0) is the first security control test point P. AB1 The initial latitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. λ1 is the longitude of point A, and λ2 is the longitude of point B.
3. The method for generating test cases for aircraft safety control algorithms according to claim 2, characterized in that, When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 (t+1)=φ c1 (t)+eps×sign(Z n The first security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB1 latitude φ c1 (t+1).
4. The method for generating test cases for aircraft safety control algorithms according to claim 3, characterized in that, When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, the second security control test point P AB2 The initial latitude can be determined according to φ c1 ′(t0)=φ c1 +3×Z n-t ×eps×sign(Z n The result is obtained by calculating φ × sign(λ2-λ1), where φ c1 The first security control test point P is the output. AB1 Latitude.
5. The method for generating test cases for aircraft safety control algorithms according to claim 4, characterized in that, When the absolute value of the longitude difference is greater than the absolute value of the latitude difference, it can be determined according to φ. c1 ′(t+1)=φ c1 ′(t)+eps×sign(Z n The second security control test point P is gradually perturbed according to the latitude and longitude perturbation step size. AB2 latitude φ c1 ′(t+1).
6. The method for generating test cases for aircraft security control algorithms according to any one of claims 1 to 5, characterized in that, When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the first security control test point P will be initialized. AB1 Move to a location further away from the set edge AB, and the first security test point P after the move. AB1 Longitude λ c1 (t) can be determined according to λ c1 (t)=λ c1 (t0)+3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 (t0) is the first security control test point P. AB1 The initial longitude, Z n-t The convergence threshold is eps, where eps is the latitude and longitude perturbation step size. φ1 is the latitude of point A, and φ2 is the latitude of point B.
7. The method for generating test cases for aircraft safety control algorithms according to claim 6, characterized in that, When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 (t+1)=λ c1 (t)-eps×sign(Z n ×sign(φ2-φ1) gradually perturbs the first security test point P according to the latitude and longitude perturbation step size. AB1 Longitude λ c1 (t+1).
8. The method for generating test cases for aircraft safety control algorithms according to claim 7, characterized in that, When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, the second security control test point P AB2 The initial longitude can be determined based on λ. c1 ′(t0)=λ c1 -3×Z n-t ×eps×sign(Z n The result is obtained by calculating λ × sign(φ2-φ1), where λ c1 The first security control test point P is the output. AB1 Longitude.
9. The method for generating test cases for aircraft safety control algorithms according to claim 8, characterized in that, When the absolute value of the longitude difference is less than or equal to the absolute value of the latitude difference, it can be determined according to λ. c1 ′(t+1)=λ c1 ′(t)-eps×sign(Z n ×sign(φ2-φ1) gradually perturbs the second security control test point P according to the latitude and longitude perturbation step size. AB2 Longitude λ c1 ′(t+1).
10. A test case generation system for aircraft safety control algorithms, characterized in that, The aircraft security control algorithm test case generation system uses the aircraft security control algorithm test case generation method as described in any one of claims 1 to 9 to generate test cases for the aircraft security control algorithm.
Citation Information
Patent Citations
Geofence generation method and device
CN105718465A
Specular reflection point calculation method and system based on step-length-variable gradient descent method
CN110780322A