A method and device for generating a test case for the validity of a train number in an onboard system

By determining the number of digits and character arrangement type of the train number, and generating test cases for the validity of the train number, the problem of low efficiency in train number testing is solved, and the number of test cases is reduced and efficiency is improved.

CN119705543BActive Publication Date: 2025-09-30CASCO SIGNAL LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411860525.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-09-30
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In the prior art, the train number test is inefficient and incomplete, mainly because the number of train numbers is huge and needs to be manually input one by one, resulting in cumbersome input operations.

Method used

By determining the number of digits and character arrangement type of the train number, enumeration and boundary value equivalence class are used to select the test case value of the train number, and valid and invalid test cases of the train number are generated to reduce the number of test cases.

Benefits of technology

On the premise of ensuring test integrity and correctness, the number of test cases is greatly reduced, and test efficiency is improved by about 86%. The generated method entries are clear and easy to read, guiding test execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119705543B_ABST
    Figure CN119705543B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for generating a test case for the validity of a train number of an on-board system. The method comprises: determining the number of digits in the train number of the on-board system; determining the character selection for each digit based on the arrangement type of the characters corresponding to each digit and the rules for the validity of the train number; if the arrangement type of the characters corresponding to the digits is an enumeration type, selecting each character corresponding to the digit one by one as the test case value for the digit; if the arrangement type of the characters corresponding to the digits is a continuous type, selecting the boundary value and equivalence class value of the characters corresponding to the digit as the test case value for the digit based on the boundary value and the equivalence class; and combining the test case values ​​corresponding to each digit in the order of the digits to form a plurality of test cases for valid train numbers of the on-board system. The present invention significantly reduces the number of test cases and greatly improves the efficiency of testing the validity of train numbers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of rail transportation, and in particular relates to a method and device for generating a test case for the validity of a train number in an on-board system. Background Art

[0002] Currently, the validity test for train numbers in the city's onboard systems primarily relies on a list of train numbers provided by each project, which lists all valid train numbers according to the city's train number rules, resulting in a very large number of train numbers. Furthermore, because train numbers in existing technologies require manual entry of each one on the DMI (Driving Driver Interface), and because these numbers are largely composed of a combination of letters and numbers, entering the train number on the DMI requires switching between letter and number keys. Therefore, completing the test for all train numbers takes a long time, making it very inefficient.

[0003] Furthermore, the train number lists provided by various projects currently do not list invalid train numbers, and in order to reflect the combination of numbers in the digital area, the existing train number testing efficiency is low and the test combination is incomplete. Summary of the Invention

[0004] The purpose of the present invention is to solve the above-mentioned problems and to provide a method and device for generating test cases for the validity of the train number of an on-board system, so as to greatly reduce the number of test cases while ensuring the integrity and correctness of the test according to the rules for the validity and invalidity of the train number, thereby improving the test efficiency and quality of the on-board train number validity test.

[0005] To achieve the above-mentioned purpose, the present invention provides a method for generating a test case for the validity of a vehicle-mounted system train number, which includes: determining the number of digits in the vehicle-mounted system train number; determining the character selection for each digit according to the arrangement type of the characters corresponding to each digit and the rules for the validity of the train number; if the arrangement type of the characters corresponding to the digits is an enumeration type, selecting each character corresponding to the digit one by one as the test case value for the digit; if the arrangement type of the characters corresponding to the digits is a continuous type, selecting the boundary value and equivalence class value of the characters corresponding to the digit as the test case value for the digit based on the boundary value and the equivalence class; and combining the test case values ​​corresponding to each digit in the order of the digits to form a number of test cases for which the vehicle-mounted system train number is valid.

[0006] Optionally, the number of digits of the vehicle system train number includes the first to eighth digits or the first to ninth digits.

[0007] Optionally, the rule requirements for the validity of the train number include a first rule requirement, a second rule requirement and a third rule requirement, the first rule requirement applies to the 9-digit on-board system train number, and the second rule requirement and the third rule requirement apply to the 8-digit on-board system train number.

[0008] Optionally, the first rule requirements include: the first digit is fixed to the first number; the second digit is fixed to the first letter; the third digit is fixed to any letter in the first letter set; the fourth digit is any letter in the second letter set or any number in the first number set; and the fifth to ninth digits are fixed to numbers.

[0009] Optionally, the second rule requirements include: the first digit is fixed to the first letter; the second digit is fixed to any letter in the first letter set; the third digit is any letter in the second letter set; and the fourth to eighth digits are fixed to any number in the first number set.

[0010] Optionally, the third rule requirements include: the first digit is fixed to the first letter; the second digit is fixed to any letter in the first letter set; and the third to eighth digits are fixed to any number in the first number set.

[0011] Optionally, the first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; and the first number set is {0-9}.

[0012] Optionally, the generation method also includes: determining the character selection for each digit according to the rule requirements for invalid train numbers, forming several test cases in which the on-board system train numbers are invalid; wherein the rule requirements for invalid train numbers include the fourth rule requirements, the fifth rule requirements and the sixth rule requirements.

[0013] Optionally, the fourth rule requirement applies to the 9-digit on-board system train number, and the fourth rule requirement includes: the first digit is not the first digit, and the rule requirements for the second to ninth digits in the first rule requirement are met; or the first digit is the first digit, the second digit is not the first letter, and the rule requirements for the third to ninth digits in the first rule requirement are met; or the first digit is the first digit, the second digit is the first letter, the third digit is a letter in the non-first letter set, and the rule requirements for the fourth to ninth digits in the first rule requirement are met; or the first digit is the first digit, the second digit is the first letter, the third digit is any letter in the first letter set, the fourth digit is any letter in the second letter set, and the fifth to ninth digits are non-digits; or the first digit is the first digit, the second digit is the first letter, the third digit is a letter in the first letter set, the fourth digit is any digit in the first digit set, and the fifth to ninth digits are non-digits.

[0014] Optionally, the fifth rule requirement applies to the 8-digit on-board system train number, and the fifth rule requirement includes: the first digit is not the first letter, and the rule requirements for the second to eighth digits in the second rule requirement are met; or the first digit is the first letter, the second digit is a letter in the non-first letter set, and the rule requirements for the third to eighth digits in the second rule requirement are met; or the first digit is the first letter, the second digit is any letter in the first letter set, the third digit is a number, and the fourth to eighth digits are any numbers in the first number set; or the first digit is the first letter, the second digit is any letter in the first letter set, the third digit is any letter in the second letter set, and the fourth to eighth digits are not all numbers.

[0015] Optionally, the sixth rule requirement applies to the 8-digit on-board system train number, and the sixth rule requirement includes: the first digit is not the first letter, and the rule requirements for the second to eighth digits in the third rule requirement are met; or the first digit is the first letter, the second digit is a letter in the non-first letter set, and the rule requirements for the third to eighth digits in the third rule requirement are met; or the first digit is the first letter, the second digit is any letter in the first letter set, and the third to eighth digits are not all numbers; or the first digit is the first letter, the second digit is any letter in the first letter set, and the third to eighth digits are empty.

[0016] Optionally, the first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; and the first number set is {0-9}.

[0017] Optionally, the method for generating the validity of the vehicle system train number is applicable to the urban vehicle train number.

[0018] The present invention also provides a device for generating a test case for the validity of a vehicle-mounted system train number, which includes: a digit confirmation module, used to determine the number of digits in the vehicle-mounted system train number; a character selection module, used to determine the character selection for each digit according to the arrangement type of the character corresponding to each digit and the rule requirements for the validity of the train number; wherein, if the arrangement type of the character corresponding to the digit is an enumeration type, each character corresponding to the digit is selected one by one as the test case value of the digit; if the arrangement type of the character corresponding to the digit is a continuous type, based on the boundary value and the equivalence class, the boundary value and equivalence class value of the character corresponding to the digit are selected as the test case value of the digit; a test case generation module, used to combine the test case values ​​corresponding to each digit in the order of the digits to form a number of test cases in which the vehicle-mounted system train number is valid.

[0019] Optionally, the character selection module is further used to determine the character selection for each digit according to the rule requirement of invalid train number, so as to form several test cases in which the train number of the vehicle system is invalid.

[0020] Compared with the prior art, the method and device for generating on-board system train number validity test cases provided by the present invention determine the character selection for each digit of the train number by limiting the valid and invalid rule requirements for each digit of the test case. Only 129 test cases for train number validity need to be generated. While ensuring the integrity and correctness of the test, the number of test cases is significantly reduced compared to the number of test cases in the prior art (936), greatly improving the test efficiency. Compared with the existing test method, the test efficiency of the on-board train number validity test is improved by about 86%. At the same time, the generation method provided by the present invention has clear and easy-to-read entries, which can better guide the test execution of the on-board system train number. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic block diagram of a device for generating a test case for train number validity of an on-board system of the present invention;

[0022] Figure 2 The present invention is a test flow chart of a test case for the validity of the train number of the vehicle system generated based on the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the appended Figure 1 ~Attached Figure 2 , the technical solutions, structural features, objectives achieved and effects in the embodiments of the present invention are described in detail.

[0024] It should be noted that the drawings are in a very simplified form and use non-precise proportions. They are only used to conveniently and clearly assist in explaining the embodiments of the present invention, and are not used to limit the conditions for the implementation of the present invention. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in the present invention without affecting the efficacy and purpose that can be achieved by the present invention.

[0025] It should be noted that, in the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only the elements explicitly listed, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0026] In view of the huge number of test train numbers in the validity test of the on-board system train number in the prior art, and the problem of test omissions. In order to reduce test cases and improve test efficiency, the present invention provides a method for generating a test case for the validity of the on-board system train number, which is applicable to the urban on-board train number. The generation method comprises: determining the number of digits of the on-board system train number; wherein the number of digits of the on-board system train number includes the first to eighth digits or the first to ninth digits. This is because when the number of characters inputted in the train number is less than 8 characters, the train number belongs to the national railway train number format, which does not meet the requirements of the urban train number in the present invention.

[0027] Furthermore, the character selection for each digit is determined based on the arrangement type of the characters corresponding to each digit and the valid train number requirements. Specifically, if the arrangement type of the characters corresponding to the digit is an enumeration type, each character corresponding to the digit is selected one by one as the test case value for the digit; if the arrangement type of the characters corresponding to the digit is a continuous type, based on the boundary value and equivalence class, the boundary value and equivalence class value of the characters corresponding to the digit are selected as the test case value for the digit; finally, the test case values ​​corresponding to each digit are combined in the order of the digits to form several test cases for which the onboard system train number is valid.

[0028] Among them, the rule requirements for the validity of the train number include the first rule requirement, the second rule requirement and the third rule requirement. The first rule requirement is applicable to the 9-digit on-board system train number, and the second rule requirement and the third rule requirement are applicable to the 8-digit on-board system train number.

[0029] Furthermore, the first rule requires that: the first digit is fixed to be the first digit; the second digit is fixed to be the first letter; the third digit is fixed to be any letter in the first letter set; the fourth digit is any letter in the second letter set or any number in the first number set; and the fifth to ninth digits are fixed to be numbers. Specifically, in this embodiment, the first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; and the first number set is {0-9}.

[0030] In a specific embodiment, the test case value of the first digit of the test case is 0, and the test case value of the second digit is S. Since the character sorting type in the first letter set is an enumeration type, they need to be listed one by one. In this embodiment, the third digit lists the characters A, B, Y, and J as the test case values ​​of the third digit; and the character sorting types of the second letter set and the first number set are both continuous types. Therefore, considering the boundary value and the equivalence class, for the first number set, the fifth to ninth digits select 0, 1, 9 (or 1, 8, 9) as the test case values ​​of the fifth to ninth digits; for the second letter set, the fifth to ninth digits select A, B, Z (or A, Y, Z) as the test case values ​​of the fifth to ninth digits; and then according to the first rule requirement, a 9-digit vehicle system train number is formed as a valid test case, as shown in Table 1:

[0031]

[0032] Table 1. Example test cases generated according to the first rule

[0033] Furthermore, the second rule requires that: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; the third digit is fixed to be any letter in the second letter set; and the fourth to eighth digits are fixed to be any digit in the first digit set. Specifically, in this embodiment, the first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; and the first digit set is {0-9}.

[0034] In a specific embodiment, the test case value of the first digit of the test case is S. Since the character sorting type in the first letter set is an enumeration type, it is necessary to list them one by one. In this embodiment, the second digit lists the characters A, B, Y, and J as the test case value of the second digit; and the character sorting types of the second letter set and the first number set are both continuous types. Therefore, considering the boundary value and the equivalence class, for the second letter set, the third digit selects A, B, Z (or A, Y, Z) as the test case value of the third digit; for the first number set, the fifth to ninth digits select 0, 1, 9 (or 1, 8, 9) as the test case values ​​of the fourth to eighth digits; and then according to the second rule requirement, an 8-digit vehicle system train number is formed as a valid test case, as shown in Table 2:

[0035]

[0036] Table 2. Example test cases generated according to the second rule

[0037] Furthermore, the third rule requires that: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; and the third to eighth digits are fixed to be any digit in the first digit set. Specifically, in this embodiment, the first letter is the Arabic numeral 0; the first letter is S; and the first digit set is {0-9}.

[0038] In a specific embodiment, the test case value of the first digit of the test case is S. Since the character sorting type in the first letter set is an enumeration type, it is necessary to list them one by one. In this embodiment, the second digit lists the characters A, B, Y, and J as the test case values ​​of the second digit; and the character sorting type of the first digital set is a continuous type. Therefore, considering the boundary value and the equivalence class, for the first digital set, the third to eighth digits are selected as 0, 1, 9 (or 1, 8, 9) as the test case values ​​of the third to eighth digits; and then according to the third rule, an 8-digit vehicle system train number is formed as a valid test case, as shown in Table 3:

[0039]

[0040]

[0041] Table 3. Example test cases generated according to the third rule

[0042] In order to ensure the integrity of the train number validity test, the generation method also includes: determining the character selection for each digit according to the rule requirements for invalid train number, forming several test cases in which the on-board system train number is invalid; wherein, the rule requirements for invalid train number include the fourth rule requirement, the fifth rule requirement and the sixth rule requirement.

[0043] The fourth rule is applicable to the 9-digit vehicle system train number, and the fourth rule includes:

[0044] The first digit is not the first digit (i.e., a digit other than "0" or a letter), and meets the requirements of the second to ninth digits in the first rule requirement;

[0045] Or the first digit is the first number (i.e., the Arabic numeral "0"), the second digit is not the first letter (i.e., a digit or a letter other than "S"), and the requirements for the third to ninth digits of the first rule are met;

[0046] Or the first digit is the first digit (i.e., the Arabic numeral "0"), the second digit is the first letter (i.e., the letter "S"), the third digit is a letter in the set of non-first letters (i.e., not in {A, B, C, D, E, F, M, X, L, W, T, Y, J}), and the requirements of the fourth to ninth digits of the first rule are met;

[0047] Or the first digit is the first digit (i.e., the Arabic numeral "0"), the second digit is the first letter (i.e., the letter "S"), the third digit is any letter in the first letter set (i.e., one of {A, B, C, D, E, F, M, X, L, W, T, Y, J}), the fourth digit is any letter in the second letter set, and the fifth to ninth digits are non-digits (i.e., each digit is a letter);

[0048] Or the first digit is the first digit (i.e., the Arabic numeral "0"), the second digit is the first letter (i.e., the Arabic numeral "0"), the third digit is a letter in the first letter set (i.e., one of {A, B, C, D, E, F, M, X, L, W, T, Y, J}), the fourth digit is any digit in the first digit set, and the fifth to ninth digits are non-digits (i.e., each digit can be selected as a letter).

[0049] Based on the fourth rule above, a test case is generated where the 9-digit vehicle system train number is invalid, as shown in Table 4:

[0050] First Second place Third place Fourth place Fifth place Sixth place Seventh Eighth place Ninth place Expected results 1 S A A 0 0 0 0 0 Invalid train number A S B B 1 1 1 1 1 Invalid train number 0 M A 0 0 0 0 0 0 Invalid train number 0 S 9 Z 9 9 9 9 9 Invalid train number 0 S G 0 0 0 0 0 0 Invalid train number 0 S C C A 9 9 9 9 Invalid train number 0 S D 9 1 2 3 4 Y Invalid train number

[0051] Table 4. Example test cases generated according to the fourth rule

[0052] Furthermore, the fifth rule is applicable to the 8-digit vehicle system train number, and the fifth rule includes:

[0053] The first digit is not the first letter (i.e., a number or a letter other than "S"), and the second to eighth digits of the second rule are met;

[0054] Or the first digit is the first letter (i.e., the letter "S"), the second digit is a letter not in the set of first letters (i.e., not in {A, B, C, D, E, F, M, X, L, W, T, Y, J}), and the requirements of the third to eighth digits of the second rule requirement are met;

[0055] Or the first digit is the first letter (i.e., the letter "S"), the second digit is any letter in the first set of letters (i.e., one of {A, B, C, D, E, F, M, X, L, W, T, Y, J}), the third digit is a number, and the fourth to eighth digits are any numbers in the first set of numbers;

[0056] Or the first digit is the first letter (that is, the letter "S"), the second digit is any letter in the first letter set (that is, one of {A, B, C, D, E, F, M, X, L, W, T, Y, J}), the third digit is any letter in the second letter set, and the fourth to eighth digits are not all numbers (that is, each digit can be selected as a letter).

[0057] Based on the fifth rule above, a test case is generated where the 8-digit vehicle system train number is invalid, as shown in Table 5:

[0058]

[0059]

[0060] Table 4. Example test cases generated according to the fifth rule

[0061] Furthermore, the sixth rule is applicable to the 8-digit vehicle system train number, and the sixth rule includes:

[0062] The first digit is not the first letter (i.e., a number or a letter other than "S"), and the requirements for the second to eighth digits in the third rule are met;

[0063] Or the first digit is the first letter (i.e., the letter "S"), the second digit is a letter not in the set of first letters (i.e., not in {A, B, C, D, E, F, M, X, L, W, T, Y, J}), and the requirements of the third to eighth digits of the third rule are met;

[0064] Or the first digit is the first letter (i.e., the letter "S"), the second digit is any letter in the first letter set (i.e., one of {A, B, C, D, E, F, M, X, L, W, T, Y, J}), and the third to eighth digits are not all numbers (i.e., each digit can be a letter);

[0065] Or the first digit is the first letter, the second digit is any letter in the set of first letters, and the third to eighth digits are empty (ie, do not exist).

[0066] Based on the sixth rule above, a test case is generated where the 8-digit vehicle system train number is invalid, as shown in Table 6:

[0067] First Second place Third place Fourth place Fifth place Sixth place Seventh Eighth place Expected results 0 A 0 0 0 0 0 0 Invalid train number D J 1 1 1 1 1 1 Invalid train number S 0 9 9 9 9 9 9 Invalid train number S Z 0 0 0 0 0 0 Invalid train number S Y A 1 1 1 1 1 Invalid train number S Y 1 1 1 1 1 Z Invalid train number

[0068] Table 6. Example test cases generated according to the requirements of the sixth rule

[0069] Another embodiment of the present invention also provides a device for generating a test case for the validity of a train number in a vehicle-mounted system, such as Figure 1 As shown, the generating device 10 includes: a digit confirmation module 11, used to determine the number of digits of the on-board system train number; a character selection module 12, used to determine the character selection for each digit according to the arrangement type of the characters corresponding to each digit and the valid rules for the train number; wherein, if the arrangement type of the characters corresponding to the digit is an enumeration type, each character corresponding to the digit is selected one by one as the test case value of the digit; if the arrangement type of the characters corresponding to the digit is a continuous type, then based on the boundary value and the equivalence class, the boundary value and the equivalence class value of the characters corresponding to the digit are selected as the test case value of the digit; a test case generating module 13, used to combine the test case values ​​corresponding to each digit in the order of the digits to form a number of test cases in which the on-board system train number is valid.

[0070] Furthermore, the character selection module 12 is further configured to determine the character selection for each digit according to the rule requirement of invalid train number, so as to form a plurality of test cases in which the train number of the vehicle system is invalid.

[0071] Regarding the specific limitations of the device for generating the validity test case of the vehicle-mounted system train number, please refer to the limitations of the method for generating the validity test case of the vehicle-mounted system train number above, which will not be repeated here. Each module in the above-mentioned device for generating the validity test case of the vehicle-mounted system train number can be fully or partially implemented by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0072] The 9-character train number generated based on the present invention is a valid test case and the validity of the onboard train number is verified by combining the onboard functions, such as Figure 2 As shown, including:

[0073] Example 1: Test case where a 9-character train number is valid: 0SAA99999

[0074] S1. After the vehicle system is powered on and a brake test is performed, the tester is required to enter the driver number on the DMI. After the brake test is completed and the correctness of the driver number entered by the driver is verified, the vehicle number input and verification phase begins (i.e., step S2).

[0075] S2. After completing the driver number input, the tester enters the train number input interface. The tester uses the DMI button to enter the 9-character train number 0SAA99999 digit by digit. If letters or numbers are required during the input process, the tester needs to press the letter / number switch key to complete the input of letters and numbers. When the train number input is completed, press the "Confirm" button.

[0076] S3. The vehicle system determines whether the train number is valid; if the train number is valid, execute step S41; if the train number is invalid, execute step S42;

[0077] S41: The train number is valid, indicating that the verification has passed. The DMI interface jumps to the train number input interface, the train number validity verification is completed, and the vehicle selection and marshaling interface is entered;

[0078] S42: The train number is invalid, indicating that the verification has failed and the system remains at the train number input interface (unable to enter the next registration step). The system needs to re-enter the train number to complete the validity verification.

[0079] In summary, the method and device for generating a vehicle-mounted system train number validity test case provided by the present invention determine the character selection for each digit by limiting the valid rule requirements and invalid rule requirements for the train number of each digit in the test case. Only 129 test cases for the validity of the train number need to be generated. Under the premise of ensuring the integrity and correctness of the test, the number of test cases is greatly reduced compared with the number of test cases in the prior art (936), and the test efficiency is greatly improved. Compared with the existing test method, the test efficiency of the vehicle-mounted train number validity test is improved by about 86%.

[0080] Although the present invention has been described in detail through the above preferred embodiments, it should be understood that the above description is not intended to limit the present invention. After reading the above description, various modifications and substitutions of the present invention will become apparent to those skilled in the art. Therefore, the scope of protection of the present invention should be defined by the appended claims.

Claims

1. A method for generating a test case for the validity of a train number in a vehicle-mounted system, characterized in that: include: Determine the number of digits of the train number in the onboard system; The number of digits of the train number of the onboard system includes the first to the eighth digit or the first to the ninth digit; Determine the character selection for each digit based on the arrangement type of the characters corresponding to each digit and the valid rules and requirements for the train number; If the arrangement type of the characters corresponding to the number of digits is an enumeration type, each character corresponding to the number of digits is selected one by one as the test case value of the number of digits; If the arrangement type of the characters corresponding to the digit is a continuous type, then based on the boundary value and the equivalence class, the boundary value and the equivalence class value of the characters corresponding to the digit are selected as the test case value of the digit; Combine the test case values ​​corresponding to each digit in the order of digits to form several test cases with valid vehicle system train numbers; The valid rules and requirements for the train number include a first rule requirement, a second rule requirement, and a third rule requirement. The first rule requirement applies to a 9-digit onboard system train number, and the second rule requirement and the third rule requirement apply to an 8-digit onboard system train number. The first rule requirements include: the first digit is fixed to be the first number; the second digit is fixed to be the first letter; the third digit is fixed to be any letter in the first letter set; the fourth digit is any letter in the second letter set or any number in the first number set; and the fifth to ninth digits are fixed to be numbers; The second rule requirements include: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; the third digit is fixed to be any letter in the second letter set; and the fourth to eighth digits are fixed to be any number in the first number set; The third rule requirements include: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; and the third to eighth digits are fixed to be any number in the first number set.

2. The generation method according to claim 1, wherein: The first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; the first number set is {0-9}.

3. The generation method according to claim 1, wherein: Also includes: According to the rule requirements for invalid train numbers, the character selection for each digit is determined to form several test cases in which the train numbers of the on-board system are invalid; wherein the rule requirements for invalid train numbers include the fourth rule requirement, the fifth rule requirement and the sixth rule requirement.

4. The generation method according to claim 3, wherein: The fourth rule is applicable to the 9-digit vehicle system train number, and the fourth rule includes: The first digit is not the first digit and meets the requirements of the second to ninth digits in the first rule requirement; Or the first digit is the first number, the second digit is not the first letter, and the requirements for the third to ninth digits of the first rule are met; Or the first digit is the first number, the second digit is the first letter, the third digit is a letter in the set of non-first letters, and the requirements of the fourth to ninth digits in the first rule requirements are met; or the first digit is the first number, the second digit is the first letter, the third digit is any letter in the first letter set, the fourth digit is any letter in the second letter set, and the fifth to ninth digits are non-digits; Or the first digit is the first number, the second digit is the first letter, the third digit is a letter in the first letter set, the fourth digit is any digit in the first number set, and the fifth to ninth digits are non-digits.

5. The generation method according to claim 3, wherein: The fifth rule is applicable to the 8-digit vehicle system train number, and the fifth rule includes: The first digit is not the first letter, and the second to eighth digits of the second rule are met; Or the first digit is the first letter, the second digit is a letter in the set of non-first letters, and the requirements of the third to eighth digits in the second rule requirement are met; or the first digit is the first letter, the second digit is any letter in the first alphabetical set, the third digit is a number, and the fourth to eighth digits are any numbers in the first numerical set; Or the first digit is the first letter, the second digit is any letter in the first letter set, the third digit is any letter in the second letter set, and the fourth to eighth digits are not all numbers.

6. The generation method according to claim 3, wherein: The sixth rule is applicable to the 8-digit vehicle system train number, and the sixth rule includes: The first digit is not the first letter, and the requirements for the second to eighth digits in the third rule are met; Or the first digit is the first letter, the second digit is a letter in the set of non-first letters, and the third to eighth digits of the third rule requirement are met; or the first digit is the first letter, the second digit is any letter in the set of first letters, and the third to eighth digits are not all numbers; Or the first digit is the first letter, the second digit is any letter in the set of first letters, and the third to eighth digits are empty.

7. The generation method according to claim 4, 5 or 6, wherein: The first letter is the Arabic numeral 0; the first letter is S; the first letter set is {A, B, C, D, E, F, M, X, L, W, T, Y, J}; the second letter set is {AZ}; the first number set is {0-9}.

8. The generation method according to claim 1, wherein: The method for generating the validity of the vehicle system train number is applicable to the urban vehicle train number.

9. A device for generating a test case for the validity of a train number in a vehicle-mounted system, characterized in that: include: The digit confirmation module is used to determine the number of digits of the train number in the onboard system; The number of digits of the train number of the onboard system includes the first to the eighth digit or the first to the ninth digit; A character selection module is used to determine the character selection for each digit based on the arrangement type of the characters corresponding to each digit and the valid rule requirements for the train number; wherein, if the arrangement type of the characters corresponding to the digit is an enumeration type, each character corresponding to the digit is selected one by one as the test case value of the digit; if the arrangement type of the characters corresponding to the digit is a continuous type, based on the boundary value and the equivalence class, the boundary value and the equivalence class value of the characters corresponding to the digit are selected as the test case value of the digit; wherein, the valid rule requirements for the train number include a first rule requirement, a second rule requirement and a third rule requirement, the first rule requirement is applicable to a 9-digit on-board system train number, and the second rule requirement and the third rule requirement are applicable to an 8-digit on-board system train number; The first rule requirements include: the first digit is fixed to be the first number; the second digit is fixed to be the first letter; the third digit is fixed to be any letter in the first letter set; the fourth digit is any letter in the second letter set or any number in the first number set; and the fifth to ninth digits are fixed to be numbers; The second rule requirements include: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; the third digit is fixed to be any letter in the second letter set; and the fourth to eighth digits are fixed to be any number in the first number set; The third rule requirement includes: the first digit is fixed to be the first letter; the second digit is fixed to be any letter in the first letter set; and the third to eighth digits are fixed to be any number in the first number set; The test case generation module is used to combine the test case values ​​corresponding to each digit in the order of digits to form several test cases with valid vehicle system train numbers.

10. The generating device according to claim 9, wherein The character selection module is also used to determine the character selection for each digit according to the rule requirements for invalid train number, so as to form several test cases in which the train number of the vehicle system is invalid.