A unit test method for railway frequency shift signal decoding algorithm

By constructing a test scenario library and generating frequency domain signal test data, the problem that the existing technology cannot perform unit testing of railway frequency shift signal decoding algorithms in the frequency domain is solved, and the effect of early detection of problems, reducing modification costs and ensuring driving safety is achieved.

CN116599537BActive Publication Date: 2025-03-14HARBIN KEJIA GENERAL MECHANICAL & ELECTRICAL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310563123.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-03-14
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

The existing testing methods cannot perform unit testing of railway frequency shift signal decoding algorithms in the frequency domain, and cannot construct test data of complex frequency domain signals by controlling the time domain signal input.

Method used

It provides a unit testing method for railway frequency shift signal decoding algorithm. By building a test scenario library, it generates a frequency domain signal amplitude sequence and scene parameters, modifyes the source file to retain only the functions of frequency domain signal input, generates a test script framework and imports test data, executes test cases and compares the actual results with the expected results.

Benefits of technology

It realizes testing of frequency shift decoding algorithms in the unit testing stage, detects problems early, reduces the cost of later modification, ensures maximum coverage of test scenarios, simulates various extreme and complex scenarios, improves the accuracy of the decoding algorithm, and ensures driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116599537B_ABST
    Figure CN116599537B_ABST
Patent Text Reader

Abstract

The invention discloses a unit test method for a railway frequency shift signal decoding algorithm, and relates to a test method for a railway signal decoding algorithm. The purpose is to overcome the problem that there is no unit test method for the railway frequency shift signal decoding algorithm in the frequency domain, and that the test data of complex frequency domain signals cannot be constructed by controlling the input of time domain signals. The specific steps are as follows: step 1, constructing a test scenario library; step 2, constructing test data using the scenarios in the test scenario library; step 3, modifying the source file of the railway frequency shift signal decoding algorithm program to be tested; step 4, generating a test script framework through the modified source file, importing the test data into the test script framework, generating a test case and executing it, and obtaining an actual test result; step 5, comparing the actual test result with the expected test result, and judging that the railway frequency shift signal decoding algorithm is reliable when the actual test result is consistent with the expected test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a testing method for a signal decoding algorithm. Background Art

[0002] The frequency-shift track circuit is divided into non-electrified sections and electrified sections. It will be affected by other signals during transmission and demodulation. Generally speaking, it can be divided into two categories: the signals brought by the electrified traction power supply system and the mutual influence of the track frequency-shift signals. These complex situations will seriously affect the judgment of the decoding algorithm. Therefore, before the product goes online, it is very important to conduct relevant scenario simulation tests on the frequency-shift decoding function of the locomotive signal, which can better guarantee the product quality and the reliability of the decoding algorithm, and ensure the driving safety after going online.

[0003] At present, existing test methods, such as encoders and integrated test benches, all send signals in the time domain under ideal conditions to perform basic functional tests on the frequency shift decoding algorithm, without considering other complex scenarios. Even if complex scenarios are considered, it is almost impossible to construct test data for complex frequency domain signals by controlling the input of time domain signals. Moreover, these test methods are all system tests, which can only be performed after the product code is fully developed and burned into the hardware. The cost of modifying problems found during the system testing phase is also relatively high. Summary of the invention

[0004] The purpose of the present invention is to overcome the problem that there is currently no unit testing method for railway frequency shift signal decoding algorithm in the frequency domain, and that test data of complex frequency domain signals cannot be constructed by controlling time domain signal input, and a unit testing method for railway frequency shift signal decoding algorithm is provided.

[0005] The present invention provides a unit test method for a railway frequency shift signal decoding algorithm, wherein the specific steps are as follows:

[0006] Step 1: Build a test scenario library, which includes multiple scenarios for testing.

[0007] The scenario includes the frequency domain signal feature information of the scenario, the corresponding scenario information, and the assertion information;

[0008] Step 2: Use the scenarios in the test scenario library to construct test data;

[0009] The test data includes frequency domain signal amplitude sequence, corresponding scene parameters and expected test results;

[0010] The frequency domain signal amplitude sequence is generated by the frequency domain signal characteristic information of the scene, the corresponding scene parameters are generated by the corresponding scene information, and the expected test results are generated by the assertion information;

[0011] Step 3: modify the source file of the railway frequency shift signal decoding algorithm program to be tested so that the functions in the source file only retain the functions of the frequency domain signal input;

[0012] Step 4: Generate a test script framework through the modified source file, import the test data into the test script framework, generate test cases and execute them to obtain actual test results;

[0013] The input parameters for test case execution include frequency domain signal amplitude sequence and related scenario parameters;

[0014] Step 5: Compare the actual test results with the expected test results, and when the actual test results are consistent with the expected test results, determine that the railway frequency shift signal decoding algorithm is reliable.

[0015] Furthermore, in step 1, the method for constructing a test scenario library includes:

[0016] Methods for building a test scenario library include:

[0017] Obtain frequency domain signal feature information of standard frequency-shifted signals in various scenarios, and put the frequency domain signal feature information, scenario information, and assertion information of the scenarios into the test scenario library;

[0018] Also, count the spectrum signals of the frequency-shifted signals after FFT transformation under various fault scenarios, and classify the spectrum signals according to different types of fault scenarios; capture the spectrum signal feature information of different types of fault scenarios, and if there are spectrum signals of new fault scenario categories, put the relevant spectrum signal feature information, scenario information and assertion information into the test scenario library;

[0019] And, predict new scenarios; and put the predicted spectrum signal feature information, scenario information and assertion information of the new scenarios into the test scenario library.

[0020] Furthermore, the method for predicting new scenes is as follows:

[0021] Analyze any scenario in the test scenario library to obtain the frequency spectrum characteristics of the fault frequency shift signal of the scenario;

[0022] Compare the frequency spectrum characteristics of the fault frequency shift signal with the frequency spectrum characteristics of the standard frequency shift signal to obtain the difference characteristics between the fault frequency shift signal and the standard frequency shift signal;

[0023] The fault frequency shift signals of other scenarios in the same category of fault scenarios are constructed through difference features, the spectrum features of the fault frequency shift signals of other scenarios are obtained, and the spectrum features of the fault frequency shift signals of other scenarios, related scenario information and assertion information are used as new scenarios.

[0024] Furthermore, the files generated by constructing the test data in step 2 include amplitude sequence files and parameter files:

[0025] The amplitude sequence file includes a frequency domain signal amplitude sequence; and the sequence number of the frequency domain signal amplitude sequence corresponds to different frequency points, and the value of the frequency domain signal amplitude sequence corresponds to the frequency domain energy value of the different frequency points;

[0026] The parameter file includes the scenario parameters and expected test results of the current scenario.

[0027] Furthermore, the construction process of the frequency domain signal amplitude sequence includes:

[0028] The steps for simulating the frequency domain signal waveform of the frequency domain energy of a single frequency point are as follows:

[0029] The axis where the center frequency point of the frequency domain signal is located is taken as the central axis, and the amplitude of the frequency domain signal is taken as the amplitude along the direction away from the central axis and symmetrically on both sides of the central axis, taking a value less than the energy value of the central axis; and the energy value of the central axis is the largest, and the amplitude gradually decreases on both sides away from the central axis.

[0030] Furthermore, the construction process of the frequency domain signal amplitude sequence also includes:

[0031] The steps to simulate the overlap of two frequency domain signal waveforms when they are close to each other are as follows:

[0032] Generate two frequency domain signal waveforms, and the two frequency domain signal waveforms have two overlapping waveform sequence points at adjacent frequency points;

[0033] Two amplitude calculations are performed at two overlapping waveform sequence points to obtain two amplitudes, and the larger value of the two amplitudes is taken as the amplitude after overlap.

[0034] Furthermore, the construction process of the frequency domain signal amplitude sequence also includes:

[0035] The simulation steps of the background noise waveform are as follows:

[0036] Assuming that the total number of frequency domain amplitude sequences is N, the remainder is taken by N and the set value in the nth cycle, and different ranges are assigned to the nth amplitude sequence according to the value of the remainder;

[0037] n=1,2,3……N。

[0038] Furthermore, the method for constructing the frequency domain signal amplitude sequence also includes:

[0039] Steps for adding frequency domain signal waveforms by setting frequency values ​​and their corresponding amplitudes;

[0040] Alternatively, a step of constructing a frequency domain signal waveform of arbitrary shape by superimposing multiple waveforms at adjacent positions;

[0041] Alternatively, add any number of waveforms to simulate any frequency domain signal waveform that occurs in the field.

[0042] Furthermore, the specific method in step three is:

[0043] Shield the time domain signal input and the time domain to frequency domain conversion process in the source file, so that the decoding algorithm function to be tested in the source file becomes a function of frequency domain signal input;

[0044] And, modify the source file to set the threshold value at each carrier frequency to a fixed value, and make the amplitude of each spectrum line in the designed effective data greater than the threshold value.

[0045] Furthermore, the specific method of step 4 is as follows:

[0046] Step 41: Import the modified source file and all header files into the test tool, and generate a test script framework, which does not contain any test cases;

[0047] Step 42: Import the test data into the test script framework, and automatically generate the final test execution script as a test case; import different test data to generate different test cases;

[0048] Furthermore, the test execution script extracts relevant parameters and automatically fills them into the test result table;

[0049] The relevant parameters include: serial number, test case name, test case function name, actual output and expected output;

[0050] Step 43: Execute the test, let the test tool return the actual output of each test case, compare the actual output with the expected output to obtain the actual test result of each test case, fill in the actual test result of each test case into the test result column in the test result table, and generate the final test result table.

[0051] The beneficial effects of the present invention are:

[0052] 1. The existing tests for frequency shift decoding algorithms are all based on system testing, without relevant unit testing methods. This method solves the problem that the current frequency shift decoding algorithm cannot be tested in units; the frequency shift decoding algorithm is tested in the unit testing stage, which can find problems as early as possible and reduce the cost of later modifications;

[0053] Second, by combining innovative methods such as building a standard signal model, using field data to update the scenario library, and predicting the scenario library, we can ensure maximum coverage of test scenarios;

[0054] 3. Since the frequency shift decoding algorithm decodes through frequency domain data, the frequency domain is directly used to construct data. Compared with the time domain, it can cover more scenarios and simulate various extreme and complex scenarios, better ensure the correctness of the decoding algorithm and ensure driving safety.

[0055] Fourth, the present invention is independent of hardware. After the code development is completed, the test can be run on the unit test tool. This is a test for the source code logic, so there is no need to wait for the hardware to be fully completed before running the test on the hardware;

[0056] 5. The present invention has strong extensibility and can be applied to unit testing of ZPW2000 signals, AC signals and other algorithms that require decoding;

[0057] 6. Design use cases in a data-driven way, separate data and use cases, and only need a small number of unit test cases. By modifying different test data to achieve the purpose of switching test cases, the reuse of test cases is improved, the design of test cases is simplified, the operation is convenient, the test data generation efficiency is high, manpower can be saved, and the unit testing cycle can be shortened. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is the principle flow chart of the present invention;

[0059] Figure 2 Schematic diagram of the waveform of the feedback image in the embodiment. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0062] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention. Specific implementation method 1

[0064] A unit test method for a railway frequency shift signal decoding algorithm in this embodiment includes step 1: building a test scenario library, where the test scenario library includes multiple scenarios for testing;

[0065] The scenario includes the frequency domain signal feature information of the scenario, the corresponding scenario information, and the assertion information;

[0066] Step 2: Use the scenarios in the test scenario library to construct test data;

[0067] The test data includes frequency domain signal amplitude sequence, corresponding scene parameters and expected test results;

[0068] The frequency domain signal amplitude sequence is generated by the frequency domain signal characteristic information of the scene, the corresponding scene parameters are generated by the corresponding scene information, and the expected test results are generated by the assertion information;

[0069] Step 3: modify the source file of the railway frequency shift signal decoding algorithm program to be tested so that the functions in the source file only retain the functions of the frequency domain signal input;

[0070] Step 4: Generate a test script framework through the modified source file, import the test data into the test script framework, generate test cases and execute them to obtain actual test results;

[0071] The input parameters for test case execution include frequency domain signal amplitude sequence and related scenario parameters;

[0072] Step 5: Compare the actual test results with the expected test results, and when the actual test results are consistent with the expected test results, determine that the railway frequency shift signal decoding algorithm is reliable. Specific implementation method 2

[0074] This implementation is a further explanation of the first implementation. In this implementation, in step one, the method for constructing a test scenario library includes:

[0075] Obtain frequency domain signal feature information of standard frequency-shifted signals in various scenarios, and put the frequency domain signal feature information, scenario information, and assertion information of the scenarios into the test scenario library;

[0076] Also, count the spectrum signals of the frequency-shifted signals after FFT transformation under various fault scenarios, and classify the spectrum signals according to different types of fault scenarios; capture the spectrum signal feature information of different types of fault scenarios, and if there are spectrum signals of new fault scenario categories, put the relevant spectrum signal feature information, scenario information and assertion information into the test scenario library;

[0077] And, predict new scenarios; and put the predicted spectrum signal feature information, scenario information and assertion information of the new scenarios into the test scenario library.

[0078] The other technical features of this embodiment are exactly the same as those of the first embodiment. Specific implementation method three

[0080] This embodiment is a further explanation of the second embodiment. In this embodiment, the method for predicting a new scene is as follows:

[0081] Analyze any scenario in the test scenario library to obtain the frequency spectrum characteristics of the fault frequency shift signal of the scenario;

[0082] Compare the frequency spectrum characteristics of the fault frequency shift signal with the frequency spectrum characteristics of the standard frequency shift signal to obtain the difference characteristics between the fault frequency shift signal and the standard frequency shift signal;

[0083] The fault frequency shift signals of other scenarios in the same category of fault scenarios are constructed through difference features, the spectrum features of the fault frequency shift signals of other scenarios are obtained, and the spectrum features of the fault frequency shift signals of other scenarios, related scenario information and assertion information are used as new scenarios.

[0084] The other technical features of this embodiment are exactly the same as those of the second embodiment. Specific implementation method four

[0086] This embodiment is a further explanation of the first, second or third embodiment. In this embodiment, the file generated by constructing the test data in step 2 includes an amplitude sequence file and a parameter file:

[0087] The amplitude sequence file includes a frequency domain signal amplitude sequence; and the sequence number of the frequency domain signal amplitude sequence corresponds to different frequency points, and the value of the frequency domain signal amplitude sequence corresponds to the frequency domain energy value of the different frequency points;

[0088] The parameter file includes the scenario parameters and expected test results of the current scenario.

[0089] The other technical features of this embodiment are exactly the same as those of embodiments one, two or three. Specific implementation method five

[0091] This implementation is a further explanation of the fourth implementation. In this implementation, the method for constructing the frequency domain signal amplitude sequence includes:

[0092] The frequency domain signal waveform simulation method for the frequency domain energy of a single frequency point is specifically as follows:

[0093] The axis where the center frequency point of the frequency domain signal is located is taken as the central axis, and the amplitude of the frequency domain signal is taken as the amplitude along the direction away from the central axis and symmetrically on both sides of the central axis, taking a value less than the energy value of the central axis; and the energy value of the central axis is the largest, and the amplitude gradually decreases on both sides away from the central axis.

[0094] The other technical features of this embodiment are exactly the same as those of embodiment 4. Specific implementation method 6

[0096] This implementation is a further explanation of the fourth implementation. In this implementation, the process of constructing the frequency domain signal amplitude sequence further includes:

[0097] The steps to simulate the overlap of two frequency domain signal waveforms when they are close to each other are as follows:

[0098] Generate two frequency domain signal waveforms, and the two frequency domain signal waveforms have two overlapping waveform sequence points at adjacent frequency points;

[0099] Two amplitude calculations are performed at two overlapping waveform sequence points to obtain two amplitudes, and the larger value of the two amplitudes is taken as the amplitude after overlap.

[0100] The other technical features of this embodiment are exactly the same as those of embodiment 4. Specific implementation method seven

[0102] This implementation is a further explanation of the fourth implementation. In this implementation, the process of constructing the frequency domain signal amplitude sequence further includes:

[0103] The simulation steps of the background noise waveform are as follows:

[0104] Assuming that the total number of frequency domain amplitude sequences is N, the remainder is taken by N and the set value in the nth cycle, and different ranges are assigned to the nth amplitude sequence according to the value of the remainder;

[0105] n=1,2,3……N。

[0106] The other technical features of this embodiment are exactly the same as those of embodiment 4. Specific implementation method eight

[0108] This implementation is a further explanation of the fourth implementation. In this implementation, the process of constructing the frequency domain signal amplitude sequence further includes:

[0109] Steps for adding frequency domain signal waveforms by setting frequency values ​​and their corresponding amplitudes;

[0110] Alternatively, a step of constructing a frequency domain signal waveform of arbitrary shape by superimposing multiple waveforms at adjacent positions;

[0111] Alternatively, add any number of waveforms to simulate any frequency domain signal waveform that occurs in the field.

[0112] The other technical features of this embodiment are exactly the same as those of embodiment 4. Specific implementation method nine

[0114] This embodiment is a further explanation of the first embodiment. In this embodiment, the specific method in step three is:

[0115] Shield the time domain signal input and the time domain to frequency domain conversion process in the source file, so that the decoding algorithm function to be tested in the source file becomes a function of frequency domain signal input;

[0116] And, modify the source file to set the threshold value at each carrier frequency to a fixed value, and make the amplitude of each spectrum line in the designed effective data greater than the threshold value.

[0117] The other technical features of this embodiment are exactly the same as those of the first embodiment. Specific implementation method 10

[0119] This embodiment is a further description of the first or ninth embodiment. In this embodiment, the specific method of step 4 is as follows:

[0120] Step 41: Import the modified source file and all header files into the test tool, and generate a test script framework, which does not contain any test cases;

[0121] Step 42: Import the test data into the test script framework, and automatically generate the final test execution script as a test case; import different test data to generate different test cases;

[0122] Furthermore, the test execution script extracts relevant parameters and automatically fills them into the test result table;

[0123] The relevant parameters include: serial number, test case name, test case function name, actual output and expected output;

[0124] Step 43: Execute the test, let the test tool return the actual output of each test case, compare the actual output with the expected output to obtain the actual test result of each test case, fill in the actual test result of each test case into the test result column in the test result table, and generate the final test result table.

[0125] The other technical features of this embodiment are exactly the same as those of embodiment one or nine.

[0126] Example

[0127] (1) Test scenario construction

[0128] Methods include:

[0129] a. Refer to and analyze the detailed design of the frequency shift decoding algorithm of the locomotive signal equipment to obtain the frequency domain signal characteristics and other relevant scenario information of the frequency shift standard signal (standard frequency shift signal, that is, the frequency shift signal corresponding to the general scenario, the general scenario is the non-fault scenario (the scenario corresponding to b below), the non-predicted scenario (the scenario corresponding to c below)) under various conditions (scenarios) (see the next paragraph for the specific scenario description), and put the characteristic information of the frequency domain signal, the relevant scenario information and the assertion information into the scenario library. Establish a standard signal model and determine the assertion standard of the frequency shift standard signal (for example: electrification mode, uncoded section, occasional standard frequency shift signal, the assertion standard is this situation, no matter what the last decoding result is, no matter what the light color is, the light will not be turned on).

[0130] The above scenario information includes scenarios in which the light colors in the previous cycle (including: red light, white light, green light, yellow light, red and yellow light, green and yellow light, double yellow light, double yellow flashing, red and yellow flashing, etc.) are different; scenarios in which the decoding in the previous cycle is different low-frequency values; scenarios in which the locomotive signal host is in electrified and non-electrified mode; scenarios in which the vehicle is running up and down and up and down conversion operation scenarios; test scenarios when the current low-frequency value is different; scenarios in which the locomotive is running in a coded section, an uncoded section and the two are converted to each other; scenarios in which the frequency shift signal is extremely strong, and the frequency shift signal is relatively weak and extremely weak; scenarios in which frequency shift and zpw2000 and AC counting signal are switched; scenarios in which other signals exist in coded sections and uncoded sections, and these signals include co-frequency signals, adjacent frequency signals, and intermodulation signals from the frequency perspective, large signal blocking from the power perspective, uplink and downlink link signals from the link perspective, including standard AC signals, standard frequency shift signals, and standard zpw signal scenarios on the link, and natural noise, artificial noise, and system internal noise from the noise perspective.

[0131] b. New locomotive frequency shift data returned from the site can be input at any time, and the spectrum of various fault data appearing on the site (including data of erroneous decoding, decoding delay, undecoded, etc.) after FFT transformation can be statistically analyzed and classified, and the spectrum signal characteristics and other related scenario information of different categories of fault scenarios can be captured. If there is a new category of spectrum signal, its related feature information, scenario information and assertion information will all be put into the scenario library, and the test data category of the scenario library can be updated at any time. If there is no new category of spectrum signal, the scenario library will not be updated.

[0132] c. By analyzing the scenarios in the current scenario library, predict the scenarios that have not occurred yet but may occur in the future (see the next paragraph for the prediction method). Add the predicted characteristic spectrum signal, relevant scenario information and assertion information of the new test scenario to the scenario library.

[0133] The above prediction method is as follows: for any scenario in the current scenario library, analyze the spectrum characteristics of its preconditions and its fault data, compare them with the standard signal, summarize the characteristics of the difference between the two, and predict other test scenarios of the same category based on the characteristics. (For example: a new test scenario is added to the scenario library as follows (there is a signal with a frequency of 494Hz and an amplitude of 1 / 2 of the amplitude of the lower sideband near the 495Hz frequency point of the lower sideband of the standard signal with a downlink frequency shift of 550Hz and a low frequency of 11Hz electrification mode). Immediately perform the same type of extended prediction on such scenarios, Extension 1: The proportion of the amplitude of the 494Hz signal near the lower sideband being less than the lower sideband is 9 / 10, 3 / 5, 3 / 10, 1 / 10... respectively. Extension 2: The proportion of the amplitude of the 494Hz signal near the lower sideband being greater than the lower sideband is 9 / 10, 3 / 5, 3 / 10, 1 / 10... respectively. Extension 3: The progressive adjacent frequency points (493Hz, 49 Extension 4: A test scenario similar to the above extension 1, 2, and 3 for the symmetrical adjacent frequency point 496Hz of its lower sideband. Extension 5: A test scenario similar to the above extension 1, 2, 3, and 4 for predicting the signal of this adjacent frequency point for standard signals such as the lower sideband left and right peaks (the left and right peaks at the lowest low-frequency distance from the lower sideband), the upper sideband and its left and right peaks (the left and right peaks at the lowest low-frequency distance from the upper sideband). Extension 6: For the non-electrified mode, the test scenarios of the above extensions 1, 2, 3, 4, and 5. Extension 7: Construct the above 6 test scenarios when the frequency points and low-frequency values ​​of the uplink and downlink are different.

[0134] Through the above three methods a, b, and c, first of all, the category of standard scenarios can be quickly obtained (including the decoding results of the locomotive signal for the standard frequency-shifted signals of 550Hz, 650Hz, 750Hz, and 850Hz received at low frequencies of 7, 8, and 8.5 to 30Hz respectively during the operation of conventional vehicles, and the decoding results refer to the translated low-frequency values). Secondly, the test scenarios that have occurred on site can be statistically classified to the maximum extent and the on-site scenarios can be obtained. Thirdly, by analyzing the existing scenario library, possible scenarios can be predicted and the test scenarios can be completed, so as to achieve maximum coverage of the test scenarios and ensure the test quality.

[0135] (2) Read existing test scenarios and test data structures

[0136] The test scenario is read from the scenario library, and the test data is constructed through the characteristic information of the read frequency domain signal, related scenario information and assertion information: the characteristic information of the frequency domain signal is used to simulate and restore the amplitude sequence of the frequency domain signal; the parameter information of different scenarios is generated using the related scenario information (the parameter information of the scenario is the specific parameter in the scenario information, for example: the scenario where the decoding in the previous cycle is different low-frequency values, then the specific decoding low-frequency value generated in the scenario is the parameter information of the corresponding scenario, and the specific frequency-shifted signal generated in the scenario of extremely strong signal, weak and extremely weak frequency-shifted signal is the parameter information of the corresponding scenario); the expected result of the test case is determined using the assertion information. Finally, a folder is generated, which contains the amplitude sequence files, parameter files and feedback pictures of the frequency domain signals of the on-site frequency-shifted signal and other non-standard signals after FFT transformation. Among them:

[0137] a. The characteristic information of the frequency domain signal includes: the center frequency and its amplitude, low frequency value, the amplitude of the upper sideband and its left and right peaks, the amplitude of the lower sideband and its left and right peaks, the frequency and amplitude of large-amplitude signals at other frequency points (signals with amplitudes exceeding most noises and lower than the standard signal amplitude or higher than the standard signal amplitude), the test case name, the test case expected test result data, etc.

[0138] b. The content in the amplitude sequence file: It is the amplitude sequence of the discrete frequency domain signal after FFT conversion of the frequency-shifted signal in the time domain. The amplitude sequence is used as the main input parameter of the test case. The sequence number of the amplitude sequence corresponds to different frequency points according to the specified algorithm; the value of the amplitude sequence corresponds to the frequency domain energy value of different frequency points.

[0139] c. Parameter file: contains all feature information of the current scene, other input parameters used as test cases, and assertion information of the current scene. It can assist in manual analysis and adjustment of the generated amplitude sequence files and feedback images.

[0140] d. Feedback image: It is a frequency domain signal graph generated according to the sequence data, which can assist manual analysis and check whether the frequency domain signal shape meets the test case requirements and make adjustments in real time.

[0141] e. For the waveform simulation of frequency domain energy of a single frequency point, the central frequency point is used as the central axis, and the values ​​are taken symmetrically on both sides. The amplitude is taken point by point along both sides away from the central axis, which is less than the central axis energy value. The value is the product of the exponential operation of the central axis energy value and the specified value. The number of sequence points for calculating the amplitude on both sides can be selected according to the actual situation. This method can not only make the amplitude close to the peak value at the point close to the central axis, but also quickly make the points on both sides reach a value close to 0. It can simulate the real frequency domain waveform very vividly. Add scattered signals with amplitudes of 1 / 6, 1 / 8, 1 / 10, 1 / 20 (set specific values ​​according to actual needs) of the central axis energy value at the positions of ±1.5H, ±2.5H, ±3.5H, ±4.5H (set specific values ​​according to actual needs) of the central frequency point.

[0142] f. When calculating the amplitudes of two waveform sequence points at adjacent frequency points, there will be overlapping sequence points. Two amplitude calculations will be performed at the same position. At this time, the two amplitudes of the same sequence point take the larger value to simulate the scenario where two waveforms overlap when they are close to each other.

[0143] g. For the frequency domain waveform of the time domain signal of the real scene after FFT conversion, there will be background noise at all frequency points. For the simulation of the background noise waveform, the method is: assuming that the total number of amplitude sequences is N, N cycles use 0 to N-1 and the set value (for example: 10) to take the remainder, and when the remainder is a different value, assign a value to the sequence. When the remainder is a different value, set a different random value range for the amplitude. For example: when the remainder is 5, the amplitude random range (18 to 30) can be taken, when the remainder is 4 or 6, the amplitude random range (12-18) can be taken, when the remainder is 3 or 7, the amplitude random range (4-12) can be taken, and when the remainder is 2 or 8, the amplitude random range (4-8) can be taken. And so on, irregular noise waveform simulation is performed. The advantage of this method is that it can simulate irregular background noise waveforms more randomly, and the range of background noise can be set by modifying the code parameters. It can flexibly simulate a variety of noise scenarios.

[0144] h. You can add frequency domain signal waveforms directly by setting the frequency value and its corresponding amplitude; you can construct frequency domain waveforms of any special shape by superimposing multiple waveforms at adjacent positions; you can also add any number of waveforms to simulate special signals that appear at any scene. It can achieve fine adjustment of frequency domain signals, which cannot be achieved by adjusting time domain signals.

[0145] (3) Obtain the source file under test and modify the source file

[0146] a. After the development code is successfully built, the test program is directly pushed to the specified path of the server.

[0147] After the frequency shift decoding algorithm is developed, unit testing activities can be performed directly on the code without waiting for all other codes to be developed and debugged and burned into the hardware.

[0148] b. Automatically analyze the source file and give the corresponding function list. The function list is mainly used for regression testing to compare whether there is any discrepancy between the functions input in the two tests.

[0149] c. Modify the source file so that the decoding algorithm function to be tested is completely transformed into a function of frequency domain signal input. The modification mainly involves the following aspects:

[0150] ① Since the data input of this test method is frequency domain data, the code related to time domain signal acquisition and Fourier transform of time domain signal in the source file needs to be commented out so that the source file can be completely converted into a function in the frequency domain.

[0151] ② The threshold used for amplitude comparison of spectral lines in the decoding algorithm is obtained by calculating the time domain signal. Therefore, the code needs to be modified to set the threshold at each carrier frequency to a fixed value so that the amplitude of each spectral line in the designed data is greater than the threshold, ensuring the intention and effectiveness of the test data design.

[0152] (4) Perform unit testing and output test result table

[0153] a. Import the modified source files and all header files into Cantata software and generate a test script framework, which does not contain any test cases.

[0154] b. Import the test data (including frequency domain amplitude sequence, corresponding scenario parameters, and assertion information) into the test script framework to automatically generate the final test execution script. Different test cases can be generated by importing different test data. At the same time, relevant parameters are automatically filled in the test result table. The test result table mainly includes the following items: serial number, test case name, test case function name, actual output, expected output, and test results. Except for the test results, all other items are automatically filled in in this step.

[0155] c. Execute the test and generate the final test result table.

[0156] ①After running the test, Cantata software will return the actual output of each test case.

[0157] ② Analyze and compare the actual output with the expected output, fill in the test result column of the test result table in ② with the results of each test case, and generate the final test result table.

[0158] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the features of the various dependent claims and herein may be combined in a manner different from that described in the original claims. It should also be understood that the features described in conjunction with the individual embodiments may be used in other embodiments.

Claims

1. A unit test method for railway frequency shift signal decoding algorithm, characterized in that: The specific steps are as follows: Step 1: Build a test scenario library, where the test scenario library includes multiple scenarios for testing; The scenario includes frequency domain signal feature information of the scenario, corresponding scenario information, and assertion information; Step 2: Use the scenarios in the test scenario library to construct test data; The test data includes a frequency domain signal amplitude sequence, corresponding scene parameters and expected test results; The frequency domain signal amplitude sequence is generated by the frequency domain signal feature information of the scene, the corresponding scene parameter is generated by the corresponding scene information, and the expected test result is generated by the assertion information; Step 3: modify the source file of the railway frequency shift signal decoding algorithm program to be tested so that the functions in the source file only retain the functions of the frequency domain signal input; Step 4: Generate a test script framework through the modified source file, import the test data into the test script framework, generate test cases and execute them to obtain actual test results; The input parameters when executing the test case include a frequency domain signal amplitude sequence and related scenario parameters; Step 5: Compare the actual test result with the expected test result, and when the actual test result is consistent with the expected test result, determine that the railway frequency shift signal decoding algorithm is reliable; The files generated by constructing the test data in step 2 include amplitude sequence files and parameter files: The amplitude sequence file includes a frequency domain signal amplitude sequence; and the sequence numbers of the frequency domain signal amplitude sequence correspond to different frequency points, and the values ​​of the frequency domain signal amplitude sequence correspond to the frequency domain energy values ​​of the different frequency points; The parameter file includes the scenario parameters and expected test results of the current scenario; The construction methods of frequency domain signal amplitude sequence include: The frequency domain signal waveform simulation method for the frequency domain energy of a single frequency point is specifically as follows: The axis where the center frequency of the frequency domain signal is located is taken as the central axis, and the amplitude of the frequency domain signal is symmetrically taken point by point on both sides of the central axis along the direction away from the central axis, and the value smaller than the energy value of the central axis is taken as the amplitude; and the energy value of the central axis is the largest, and the amplitude gradually decreases along the two sides away from the central axis; The construction process of the frequency domain signal amplitude sequence also includes: The steps to simulate the overlap of two frequency domain signal waveforms when they are close to each other are as follows: Generate two frequency domain signal waveforms, wherein the two frequency domain signal waveforms have two overlapping waveform sequence points at adjacent frequency points; Perform two amplitude calculations at two overlapping waveform sequence points to obtain two amplitudes, and take the larger value of the two amplitudes as the amplitude after overlap; The construction process of the frequency domain signal amplitude sequence also includes: The simulation steps of the background noise waveform are as follows: Assuming that the total number of frequency domain amplitude sequences is N, the remainder is taken by N and the set value in the nth cycle, and different ranges are assigned to the nth amplitude sequence according to the value of the remainder; n=1, 2, 3, ..., N; The construction process of the frequency domain signal amplitude sequence also includes: Steps for adding frequency domain signal waveforms by setting frequency values ​​and their corresponding amplitudes; Alternatively, a step of constructing a frequency domain signal waveform of arbitrary shape by superimposing multiple waveforms at adjacent positions; Alternatively, add any number of waveforms to simulate any frequency domain signal waveform that occurs in the field.

2. The unit test method of a railway frequency shift signal decoding algorithm according to claim 1, characterized in that: In step 1, the method of building a test scenario library includes: Obtain frequency domain signal feature information of standard frequency-shifted signals in various scenarios, and put the frequency domain signal feature information, scenario information, and assertion information of the scenario into the test scenario library; Also, count the spectrum signals of the frequency-shifted signals after FFT transformation under various fault scenarios, and classify the spectrum signals according to different types of fault scenarios; capture the spectrum signal feature information of different types of fault scenarios, and if there are spectrum signals of new fault scenario categories, put the relevant spectrum signal feature information, scenario information and assertion information into the test scenario library; And, predict new scenarios; and put the predicted spectrum signal feature information, scenario information and assertion information of the new scenarios into the test scenario library.

3. The unit test method of a railway frequency shift signal decoding algorithm according to claim 2, characterized in that: The method for predicting new scenarios is as follows: Analyze any scenario in the test scenario library to obtain the frequency spectrum characteristics of the fault frequency shift signal of the scenario; Compare the frequency spectrum characteristics of the fault frequency shift signal with the frequency spectrum characteristics of the standard frequency shift signal to obtain the difference characteristics between the fault frequency shift signal and the standard frequency shift signal; The fault frequency shift signals of other scenarios in the same category of fault scenarios are constructed through the difference features, the spectrum features of the fault frequency shift signals of other scenarios are obtained, and the spectrum features of the fault frequency shift signals of other scenarios, related scenario information and assertion information are used as new scenarios.

4. The unit test method of a railway frequency shift signal decoding algorithm according to claim 1, characterized in that: The specific method in step three is: Shield the time domain signal input and the time domain to frequency domain conversion process in the source file, so that the decoding algorithm function to be tested in the source file becomes a function of frequency domain signal input; And, modify the source file to set the threshold value at each carrier frequency to a fixed value, and make the amplitude of each spectrum line in the designed effective data greater than the threshold value.

5. A unit test method for railway frequency shift signal decoding algorithm according to claim 1 or 4, characterized in that: The specific method of step 4 is as follows: Step 41: Import the modified source file and all header files into the test tool, and generate a test script framework, which does not contain any test cases; Step 42: Import the test data into the test script framework and automatically generate the final test execution script as a test case; Importing different test data generates different test cases; Furthermore, the test execution script extracts relevant parameters and automatically fills them into the test result table; The relevant parameters include: serial number, test case name, test case function name, actual output and expected output; Step 43: Execute the test, let the test tool return the actual output of each test case, compare the actual output with the expected output to obtain the actual test result of each test case, fill in the actual test result of each test case into the test result column in the test result table, and generate the final test result table.

Citation Information

Patent Citations

  • UI automated test method, computing device and storage medium

    CN109144856A

  • Testing Radio-Frequency Performance of Wireless Communications Circuitry Using Fast Fourier Transforms

    US20140119421A1