CN114741301B - Method, system, electronic equipment and storage medium for testing USIM card STK menu - Google Patents

Method, system, electronic equipment and storage medium for testing USIM card STK menu Download PDF

Info

Publication number
CN114741301B
CN114741301B CN202210403356.4A CN202210403356A CN114741301B CN 114741301 B CN114741301 B CN 114741301B CN 202210403356 A CN202210403356 A CN 202210403356A CN 114741301 B CN114741301 B CN 114741301B
Authority
CN
China
Prior art keywords
command
result
usim card
node
iteratable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210403356.4A
Other languages
Chinese (zh)
Other versions
CN114741301A (en
Inventor
黄卫文
袁外平
孙奥
程冉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xinghan Intelligent Technology Co ltd
Original Assignee
Xinghan Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinghan Intelligent Technology Co ltd filed Critical Xinghan Intelligent Technology Co ltd
Priority to CN202210403356.4A priority Critical patent/CN114741301B/en
Publication of CN114741301A publication Critical patent/CN114741301A/en
Application granted granted Critical
Publication of CN114741301B publication Critical patent/CN114741301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The technical scheme of the invention provides a method, a system, electronic equipment and a storage medium for testing a USIM card STK menu, wherein the method comprises the following steps: acquiring an STK menu from a product demand configuration document, and generating an STK menu tree; assembling the expected result of the active SIM card command based on the attribute data of the tree nodes in the STK menu tree; according to a tree node path of the STK menu tree, storing item identifiers and expected results of tree nodes in a first iteratable object, wherein the item identifiers correspond to the expected results one by one; according to the item identifier of the node in the first iteratable object, sending a common command to the USIM card, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing an expected result with the actual result; recording a comparison process and a comparison result of the expected result and the actual result, and generating a test log according to the comparison process and the comparison result. By adopting the technical scheme, the testing efficiency of the STK menu, the testing coverage and the applicability of different menu backspace levels can be improved.

Description

Method, system, electronic equipment and storage medium for testing USIM card STK menu
Technical Field
The invention relates to the technical field of smart cards, in particular to a method, a system, electronic equipment and a storage medium for testing a USIM card STK menu.
Background
STK is called SIM Application Toolkit, which is a derived active interactive operating system of the SIM card on the passive operating system of the original SIM card. The mechanism provided by the method allows the application in the SIM card to interoperate with the mobile equipment ME supporting the application, namely, an active dialogue between the SIM card and the ME is supported, and an operator can realize the purpose of value-added service through the function.
The STK menu function implementation includes the following:
1. the terMINAL PROFILE command is used for initializing the SIM card when the user starts up, the ME sends the terMINAL PROFILE command to the SIM card, and the STK related function items supported by the ME are required to be described. Through this process the SIM card knows the capabilities of the ME and limits its command range as the case may be.
2. An active SIM card command may cause the SIM card to actively activate operations performed by the ME, including: displaying a text sent to the ME by the SIM card; sending a short message; establishing a voice call by using the number in the SIM card; sending an SS control or USSD character string; playback is performed through the earphone; a SIM card initialization request and notification of EF changes; the ME provides local information to the SIM card;
3. MENU selection, based on the SIM card providing a SET of MENUs with an active SIM card command (SET UP MENU), the user selected SIM card application MENU item is transferred to the SIM card with a ENVELOPE (MENU SELECTION) command.
The USIM card is an upgrade SIM card, and has STK function while improving the safety performance of the SIM card.
After the requirement of operator customization is developed, the STK menu of the USIM card needs to be tested, in the prior art, a tester manually sends an active SIM card command to interact with the USIM card to acquire the function realized by the STK menu, so as to verify whether the STK menu of the USIM card meets the requirement of customer requirements. However, this test validation is an extremely time-consuming, labor-intensive process, such as: 1. the active SIM card command is manually assembled, the data volume is large, static data is stored, errors are easy to occur in assembly, the subsequent updating and maintenance are not facilitated, a little is often changed, and a plurality of command data are required to be corrected, so that the maintenance cost is increased; 2. the method has the advantages that the tool for simulating the mobile phone to be manually clicked is made, when the menu level is complex and the number is huge, a leakage menu is easy to appear, the concerned instruction data value is not easy to present, byte errors are difficult to find, and the manual inspection fatigue test efficiency is low; 3. the automatic traversal method operates the USIM card to send the instruction to acquire the menu, and has higher efficiency than assembly instructions and manual operation tools, but has very limited applicability, and because the requirements of the customer demand menus are different, when the customer demand menus fall back to the menu staying at a certain level after completing execution instructions, the automatic traversal method cannot complete the automatic test of the demand menus.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a method, a system, electronic equipment and a storage medium for testing a USIM card STK menu, which can improve the testing efficiency, the testing coverage and the problem checking efficiency of the STK menu.
Examples provided by embodiments of the present invention and explanations of terms referred to in the drawings of the specification are as follows:
APDU (Application Protocol data unit) application protocol data unit is the information unit transferred between the smart card and the smart card reader.
The command APDU transmitted to the smart card consists of a command header and a command body, wherein the command header includes a command class, a command code (representing a specific command), and command parameters, and the command body includes the number of bytes of command data, the maximum number of bytes of command data, and expected response data.
The response APDU returned by the smart card consists of data and a status word, wherein the data comprises the response data and the status word comprises the return value of the execution command.
The following is a functional description of several command APDUs:
MENU SELECTION: when the mobile equipment ME receives MENU selection from one MENU item defined by the SETUP MENU active SIM card command sent by the SIM card or when the user needs to obtain help information for a certain MENU item, the ME can transmit the item identifier of the selected MENU item to the SIM card through Envelope (MENU SELECTION);
FETCH: the active SIM card command content is used for receiving the command content transmitted to the ME by the SIM card;
TERMINAL RESPONSE: and returning the information after the ME executes the active SIM card command to the SIM card.
The active SIM card command is one of STK menu functions, the STK menu function is sent to the mobile equipment ME by the SIM card, the APDU structure is TLTLV, wherein T is the command type, L is the total length of the command, and the subsequent TLV is the command content part comprising the marks, the lengths and the attribute data of each item.
The item identifier, which is a unique ID configured for each item object in the menu, can be used as a directory path to find a certain item object.
The product demand configuration document is a document which is written into by technical support responsible personnel according to the rule formulated by a company aiming at all demands of an STK menu by an operator. Including but not limited to STK menus.
In a first aspect, an embodiment of the present invention provides a method for testing a STK menu of a USIM card, including:
acquiring an STK menu from a product demand configuration document, and generating an STK menu tree;
assembling an expected result of the active SIM card command based on attribute data of tree nodes in the STK menu tree;
according to the tree node path of the STK menu tree, storing item identifiers of tree nodes and the expected results in a first iteratable object, wherein the item identifiers are in one-to-one correspondence with the expected results;
According to the item identifier of the node in the first iteratable object, sending a common command to a USIM card, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing the expected result with the actual result;
and recording a comparison process and a comparison result of the expected result and the actual result, and generating a test log according to the comparison process and the comparison result.
In a second aspect, an embodiment of the present invention provides a system for testing a STK menu of a USIM card, including:
the first processing module is used for acquiring an STK menu from the product demand configuration document and generating an STK menu tree;
the second processing module is used for assembling the expected result of the active SIM card command based on the attribute data of the tree nodes in the STK menu tree;
a third processing module, configured to store, according to a tree node path of the STK menu tree, item identifiers of tree nodes and the expected results in a first iteratable object, where the item identifiers are in one-to-one correspondence with the expected results;
a fourth processing module, configured to send a common command to a USIM card according to an item identifier of a node in the first iteratable object, obtain an actual result of the active SIM card command fed back by the USIM card, and compare the expected result with the actual result;
And the fifth processing module is used for recording a comparison process and a comparison result of the expected result and the actual result and generating a test log according to the comparison process and the comparison result.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes a processor, a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, where the programs are executed by the processor to implement the method for testing a USIM card STK menu according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where program instructions executable by a processor are stored, where the program instructions are configured to perform a method for implementing the method for testing a STK menu of a USIM card according to the first aspect.
The embodiment of the invention at least comprises the following beneficial effects: through a series of operations such as automatically acquiring the STK menu, generating a STK menu tree, assembling the expected result of the active SIM card command, generating a first iteratable object, sending the actual result of the ordinary command active SIM card command, and comparing, the automatic test of the STK menu is realized, and the efficiency of the test of the STK menu is improved; the program automatically generates an active SIM card command meeting the standard specification, so that the requirement compliance test of the STK menu can be met, and the standard specification compliance verification of the active SIM card command can be performed, thereby improving the breadth of the STK menu test; the complicated task is automated, so that the accuracy of STK menu test can be improved, and the product stability and the robustness of the USIM card can be improved; by recording each testing process and outputting the formatted test log, the efficiency of troubleshooting the problem can be improved when the problem occurs, and the method is beneficial to the quality audit of the product in the later period.
Drawings
Fig. 1 is a schematic diagram of a method for testing a STK menu of a USIM card according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of an STK menu tree according to an embodiment of the present invention.
FIG. 3 is an example of a data storage structure according to an embodiment of the present invention.
Fig. 4 is an example of a process of interaction between a mobile equipment ME and a USIM card according to an embodiment of the present invention.
Fig. 5 is a flowchart of an embodiment of the invention for obtaining an actual result of an active SIM card command.
FIG. 6 is an example of a test log according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a system for testing a STK menu of a USIM card according to an embodiment of the present invention.
Fig. 8 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that if an orientation description such as upper, lower, front, rear, left, right, etc. is referred to in the specification and claims and the above-described drawings, the orientation or positional relationship indicated is based on the orientation or positional relationship shown in the drawings, only for convenience of describing the present invention and simplifying the description, and does not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention.
At least one meaning is one or more, a plurality of meaning is two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and greater than, less than, within, etc. are understood to include the present number. The description first and second are only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implying the number of technical features indicated or the precedence of technical features indicated.
In the description of the present invention, step numbers are merely identifiers made for convenience of description or ease of reference, and are not to be construed as limiting the order of operation of the steps.
Referring to fig. 1, an embodiment of the present invention provides a method for testing a USIM card STK menu, including, but not limited to, the following steps:
step S101: and acquiring an STK menu from the product demand configuration document, and generating an STK menu tree.
The product requirement configuration document is a document written by technical support responsible personnel for the complete requirements of the operator for the USIM card STK menu according to the rules set by the company, including but not limited to the STK menu.
In this embodiment, the STK menu configuration information in the configuration document required by the operator product is automatically read and analyzed, and the data required to be tested and verified in the STK menu is obtained, which includes attribute data of the active SIM card command. The STK menu is a hierarchical structure, and can extract item identifiers of each item object according to the containing or parallel relation among the item objects to generate a STK menu tree, wherein the node path of the tree consists of the item identifiers.
As an example, the following table shows an STK menu requirement:
Figure SMS_1
the table lists the items in the menu: item 1-Item10, the functionality provided by the partial Item object, and the backspace level attribute of the partial Item object, where the root of the Menu is "XH Menu", the first layer has four submenus: item1, item 2, item 4, item 7, the second layer has submenus and sub-items belonging to the first layer: item 3, item 5, item 6, item 8, item 9, the third layer has sub-items belonging to the second layer: item 10.
As one example, an example of a product demand profile is provided below, including:
<SetUpMenuCommandType="25" CommandQualifier="00" AlphaID="XH Menu">
<Item ItemID="01" ItemTextString="Item 1" CommandType="21" CommandQualifier="00" DCS="04" TextString="Welcome to XH" BackLevel="01"/>
<Item ItemID="02" ItemTextString="Item 2" CommandType="24" CommandQualifier="00">
<Item ItemID="01" ItemTextString="Item 3" CommandType="13" CommandQualifier="01" TP_MTI="01" TP_MR="00" TPDA_TON/NPI="81" TP_DA="1234" TP_PID="00" TP_DCS="04" UD="Test 1" BackLevel="01"/>
</Item>
<Item ItemID="03" ItemTextString="Item 4" CommandType="24" CommandQualifier="00">
<Item ItemID="01" ItemTextString="Item 5" CommandType="12" CommandQualifier="00" TON/NPI="0F" USSDTextString="*111#" BackLevel="02"/>
<Item ItemID="02" ItemTextString="Item 6" CommandType="10" CommandQualifier="00" TON/NPI="81" DiallingNumberString="123456" BackLevel="02"/>
</Item>
<Item ItemID="04" ItemTextString="Item 7" CommandType="24" CommandQualifier="00">
<Item ItemID="01" ItemTextString="Item 8" CommandType="23" CommandQualifier="00" TextString="Enter Code:" ResponseMinLenght="01" ResponseMaxLenght="08" VariableID="a1" VariableValue="Auto">
<Item CommandType="12" CommandQualifier="00" TON/NPI="0F" USSDTextString="*123*[$a1]#" BackLevel="01"/>
</Item>
<Item ItemID="02" ItemTextString="Item 9" CommandType="24" CommandQualifier="00">
<Item ItemID="01" ItemTextString="Item 10" CommandType="15" CommandQualifier="00" URL="http://www.china-xinghan.com" BackLevel="03"/>
</Item>
</Item>
</SetUpMenu>
wherein, according to STK menu requirement, the attribute data of the active SIM card command is configured: item identifier, command qualifier, alpha identifier, item text string, data encoding scheme, text string, alpha identifier, USSD string, response length, URL, etc. Corresponding to the STK menu requirement provided by the above example, item 1-Item10 in the product requirement configuration document is Item text string, a unique Item identifier ItemID with the same level is configured for each Item object, a backset level attribute backset level is also configured for part of the Item objects, and the function of each Item object is realized by sending an active SIM card command to the mobile equipment ME through the USIM card.
As an example, fig. 2 provides a schematic diagram of a STK menu tree, wherein each tree node is represented by an item identifier of an item object in the STK menu, except for the root node.
Step S102: based on the attribute data of tree nodes in the STK menu tree, the expected result of the active SIM card command is spliced.
In some embodiments, step S102 may include:
presetting an active SIM card command function, and assembling command types and attribute data according to a standard specification document to obtain an expected result of the active SIM card command.
The coding structure of the active SIM card command is divided into two parts, namely a command head and command data, wherein the command head consists of a command type and a command total length, the command data consists of various attribute data, different active SIM card commands are used for executing different operations, so that the attribute data for describing the properties of the active SIM card commands are different, and the command type of the active SIM card commands is denoted by D0.
In this embodiment, item identifiers of the STK menu tree nodes are sequentially extracted, attribute data corresponding to the item identifiers are extracted from a product requirement configuration document, and then the command type and the attribute data are automatically assembled through a preset active SIM card command function to obtain an active SIM card command pointed by the item identifiers in each tree node. The assembly standard is in accordance with the proactive SIM card command structure of the standard specification documents 3gpp TS 1114 and ETSI TS 102223. And the function script automatically generates an active SIM card command meeting the standard specification, so that the requirement compliance test of the STK menu can be met, and the standard specification compliance verification of the active SIM card command can be performed.
As an example, the following provides the expected results of the active SIM card command assembled in this embodiment, including:
SET UP MENU:
D03681030125008202818285075848204D656E758F07014974656D20318F07024974656D20328F07034974656D20348F07044974656D2037
SELECT ITEM:
D01A81030124008202818285064974656D20328F07014974656D2033
D02381030124008202818285064974656D20348F07014974656D20358F07024974656D2036
D02381030124008202818285064974656D20378F07014974656D20388F07024974656D2039
D01B81030124008202818285064974656D20398F08014974656D2031 30
DISPLAY TEXT:
D0198103012181820281028D0E0457656C636F6D6520746F205848
SEND SHORT MESSAGE:
D01A8103011301820281830B12010004812143000406546573742031
SEND USSD:
D0118103011200820281830A060FAA582C3602
D0148103011200820281830A090FAA986CA68AC56223
SET UP CALL:
D00F810301100082028183060481214365
GET INPUT:
D01B8103012300820281828D0C04456E74657220436F64653A91020108
LAUNCH BROWSER:
D027810301150082028182311C687474703A2F2F7777772E6368696E612D78696E6768616E2E636F6D
step S103: according to the tree node path of the STK menu tree, the item identifiers of the tree nodes and the expected results are stored in the first iteratable object, wherein the item identifiers are in one-to-one correspondence with the expected results.
The tree node path may be determined according to the traversal sequence of the STK menu tree, and the first iteratable object may be a data structure, such as a tuple, a list, a linked list, and the like, for storing data and being iteratable.
In some embodiments, step S103 may include:
step S201: traversing from the root node to the leaf node according to the node path of the STK menu tree to obtain the item identifier.
Step S202: and acquiring a corresponding expected result according to the item identifier.
Step S203: each item identifier and each desired result are stored in turn in the second iteratively-able object.
In this embodiment, the previous traversal is adopted, the traversal is performed from the root node to the leaf node along the node path, and then the root node is returned to continue to traverse to the next leaf node along the node path until all the leaf nodes are accessed, and the traversal is finished. When each node is accessed, reading the item identifier, extracting the expected result of the assembled active SIM card command matched with the item identifier, and sequentially storing the item identifier and the expected result of each node as elements in a second iteratable object according to the access sequence of the nodes on each path, wherein the second iteratable object can be a data structure which is used for storing data and can be iterated, such as a group, a list, a linked list and the like. The number of nodes of the second iteratable object is equal to the traversed tree node path length.
Step S204: and sequentially nesting and storing the second iteratable object as an element in the first iteratable object.
Based on steps S201 to S203, the second iteratable object stores the item identifier and the expected result of each node on a certain tree node path, so, according to the leaf node order, the second iteratable object is nested and stored as an element into the first iteratable object in sequence, so that the first iteratable object can cover the item identifier of each node on the STK menu tree and the expected result corresponding to the item identifier. The number of nodes of the first iteratable object is equal to the number of leaf nodes of the STK menu tree.
As an example, fig. 3 is an example of a data storage structure provided in this embodiment, where the first iteratable object is an array B and the second iteratable object is an array a, and this example is described based on the STK menu tree of the above example:
firstly, traversing from the next node Item 1 of STK menu tree root node, which is leaf node, there is an expected result "D0198103012181820281028D0E0457656C636F6D6520746F2 05848" of active SIM card command DISPLAY TEXT corresponding to Item identifier "0x01" of the node being stored in A [0], A being stored in B [0 ];
Next, the traversal path is Item 2 through Item 3, corresponding to Item identifiers "0x02" and "0x01" of the node, respectively, with the desired results "D01a810 30124008202818285064974656D20328F070149746 56D2033" and "D01a810301130 1820281830B12010004812143000406546573742031" of the two proactive SIM card commands SELECT ITEM and SEND SHORT MESSAGE being stored in a [0] and a [1], a being stored in B [1 ];
then, the traversing paths are Item 4 to Item 5, corresponding to Item identifiers "0x03" and "0x01" of the node respectively, with two active SIM card commands SELECT ITEM and the expected results of SEND USSD, "D02381030124008202818285064974656D20348F07014974656D20358F07024974656D2036" and "D0118103011200820281830A060FAA582C3602" stored in A [0] and A [1], A stored in B [2 ];
then, the traversal paths are Item 4 to Item 6, corresponding to Item identifiers "0x03" and "0x02" of the node, respectively, with two expected results "D02381030124008202818285064974656D20348F07014974656D20358F07024974656D2036" and "D00F810301100082028183060481214365" of the active SIM card command SELECT ITEM and SET UP CALL being stored in A [0] and A [1], A being stored in B [3 ];
Then, the traversal paths are Item 7 to Item 8, corresponding to Item identifiers "0x04" and "0x01" of the nodes, respectively, with three expected results of active SIM card commands SELECT ITEM, GET INPUT and SEND USSD, "D02381030124008202818285064974656D20378F07014974656D20388F07024974656D2039", "D01B8103012300820281828D0C04456E74657220436F64653A91020108" and "D0148103011200820281830A090FAA986CA68AC56223" stored in A [0], A [1] and A [2], A stored in B [4 ];
the last traversal paths Item 7 through Item 9 through Item 10, corresponding to Item identifiers "0x04", "0x02" and "0x01" of the nodes, respectively, have the expected results of three active SIM card commands SELECT ITEM, SELECT ITEM and LAUNCH BROWSER "D02381030124008202818285064974656D20378F07014974656D20388F07024974656D2039", "D01B81030124008202818285064974656D20398F08 014974656D20 3130" and "D027810301150082028182311C687474703A2F2F7777772E6368696E 61D 78696E6768616E2E636F6D" stored in A [0], A [1] and A [2], A stored in B [5 ].
Step S104: and sending a common command to the USIM card according to the item identifier of the node in the first iteratable object, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing the expected result with the actual result.
After the mobile equipment stores the expected results of the active SIM card commands sent by the USIM card in order to realize the functions of each item of the STK menu, the mobile equipment can acquire the actual results of the active SIM card commands fed back by the USIM card by automatically sending the common commands to the USIM card, and compare the actual results with the expected results, so that the test and verification of the functions of each item of the STK menu are realized.
In some embodiments, step S104 may include:
step S301: traversing the first iteratable object, and sequentially reading the second iteratable object in each node.
Step S302: and traversing the second iteratable object, sequentially sending a common command to the USIM card according to the item identifiers of all the nodes, and acquiring the actual result of the active SIM card command fed back by the USIM card, wherein the common command comprises a MENU SELECTION command, a FETCH command and a TERMINAL RESPONSE command.
Step S303: and sequentially comparing the expected result of each node with the obtained actual result.
As an example, fig. 4 is an example of a process of interaction between the mobile equipment ME and the USIM card provided in the present embodiment, and is described based on the above example:
traversing array B, reading array A in B [0], traversing array A, obtaining item identifier '0 x 01' in A [0], automatically sending MENU SELECTION command with the selected item identifier equal to '0 x 01' and FETCH command to USIM card, obtaining actual result of active SIM card command, comparing with expected result of DISPLAY TEXT in A [0], and automatically sending TERMINAL RESPONSE command with result value equal to 0x00 to USIM card.
Continuing to traverse the array B, reading the array A in the B [1], traversing the array A, obtaining the item identifier '0 x 02' in the A [0], automatically sending a MENU SELECTION command with the selected item identifier equal to '0 x 02' and automatically sending a FETCH command to the USIM card, obtaining the actual result of the active SIM card command, and comparing with the expected result of SELECT ITEM in the A [0 ]; acquiring item identifier "0x01" in A1, automatically sending TERMINAL RESPONSE command with identifier equal to 0x01 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SEND SMS in A1, and automatically sending TERMINAL RESPONSE command with result value equal to 0x00 to USIM card.
Continuing to traverse the array B, reading the array A in the B2, traversing the array A, obtaining the item identifier '0 x 03' in the A0, automatically sending the MENU SELECTION command with the selected item identifier equal to '0 x 03' and automatically sending the FETCH command to the USIM card, obtaining the actual result of the active SIM card command, and comparing with the expected result of SELECT ITEM in the A0; acquiring item identifier '0 x 01' in A1, automatically sending TERMINAL RESPONSE command with identifier equal to 0x01 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SEND USSD in A1, automatically sending TERMINAL RESPONSE command with result value equal to 0x00 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SELECT ITEM in A0, and automatically sending TERMINAL RESPONSE command with result value equal to 0x10 to USIM card.
Continuing to traverse the array B, reading the array A in the B [3], traversing the array A, obtaining the item identifier '0 x 03' in the A [0], automatically sending the MENU SELECTION command with the selected item identifier equal to '0 x 03' and the FETCH command to the USIM card, obtaining the actual result of the active SIM card command, and comparing with the expected result of SELECT ITEM in the A [0 ]; acquiring item identifier '0 x 02' in A1, automatically sending TERMINAL RESPONSE command with identifier equal to 0x02 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SET UP CALL in A1, automatically sending TERMINAL RESPONSE command with result value equal to 0x00 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SELECT ITEM in A0, and automatically sending TERMINAL RESPONSE command with result value equal to 0x10 to USIM card.
Continuing to traverse the array B, reading the array A in the B [4], traversing the array A, obtaining the item identifier '0 x 04' in the A [0], automatically sending the MENU SELECTION command with the selected item identifier equal to '0 x 04' and the FETCH command to the USIM card, obtaining the actual result of the active SIM card command, and comparing with the expected result of SELECT ITEM in the A [0 ]; acquiring item identifier '0 x 01' in A1, automatically transmitting TERMINAL RESPONSE command with identifier equal to 0x01 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of GET INPUT in A1, automatically transmitting TERMINAL RESPONSE command with result value equal to 0x00 and FETCH command to USIM card, acquiring actual result of active SIM card command, comparing with expected result of SEND in A2, and automatically transmitting TERMINAL RESPONSE command with result value equal to 0x00 to USIM card.
Continuing to traverse the array B, reading the array A in the B [5], traversing the array A, obtaining the item identifier '0 x 04' in the A [0], automatically sending the MENU SELECTION command with the selected item identifier equal to '0 x 04' and the FETCH command to the USIM card, obtaining the actual result of the active SIM card command, and comparing with the expected result of SELECT ITEM in the A [0 ]; acquiring an item identifier '0 x 02' in A1, automatically sending TERMINAL RESPONSE commands with the identifier of the selected item equal to 0x02 and automatically sending FETCH commands to the USIM card, acquiring an actual result of the active SIM card commands, and comparing the actual result with an expected result of SELECT ITEM in A1; acquiring item identifier 0x01 in A2, automatically transmitting TERMINAL RESPONSE command with selected item identifier equal to 0x01 and automatically transmitting FETCH command to USIM card, acquiring actual result of active SIM card command, and comparing with expected result of LAUNCH BROWSER in A2; automatically sending TERMINAL RESPONSE command with result value equal to 0x00 and automatically sending FETCH command to USIM card, obtaining actual result of active SIM card command, comparing with SELECT ITEM expected result in A1, and finally automatically sending TERMINAL RESPONSE command with result value equal to 0x10 to USIM card.
In some embodiments, step S104 may further include:
step S401: traversing the first iteratable object and reading the second iteratable object in the current node.
Step S402: and when traversing the head node of the second iteratable object, sending a FETCH command and a MENU SELECTION command corresponding to the item identifier to the USIM card, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing the actual result with an expected result in the head node.
Step S403: judging whether the expected result of the current node in the second iteratable object comprises a backspacing layer attribute value, if not, sending a TERMINAL RESPONSE command with the result value equal to 0x00 to the USIM card, if so, judging whether the backspacing layer attribute value is equal to 0x01, and executing the following steps:
step S4031: if the value of the backspacing layer attribute is equal to 0x01, updating the current node to be the next node, sending a FETCH command and a TERMINAL RESPONSE command corresponding to the item identifier in the current node to the USIM card, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing the actual result with an expected result in the current node.
Step S4032: if the value of the backset level attribute is not equal to 0x01, a TERMINAL RESPONSE command and a FETCH command with the result value equal to 0x00 are sent, the actual result of the active SIM card command fed back by the USIM card is obtained, the expected result corresponding to the current node is obtained according to the value of the backset level attribute as an index, the expected result is compared with the actual result, and a TERMINAL RESPONSE command with the result value equal to 0x10 is sent to the USIM card.
The attribute of the backspacing layer is one of the attributes of each item object in the STK menu, which is equivalent to indicating to which layer the item object of the layer can roll back if it rolls back. The problem of low automatic test applicability caused by the fact that STK menu rollback levels are different is solved, the consistency and repeatability of the test are improved, and regression test is convenient to conduct. Note that the backoff level is 0x01 as the starting layer, but in the example provided in this embodiment, the array is 0 as the starting index, so when the value of the backoff level attribute is equal to 0x01, according to step S4032, the expected result stored in the node a [0] with the index of 0 should be obtained as the comparison object of the actual result obtained when accessing the current node.
As an example, referring to fig. 5, a flowchart for obtaining an actual result of an active SIM card command provided in this embodiment specifically includes the following steps:
step S411: and traversing the whole menu tree at the beginning of the root node of the STK menu tree to be tested, when traversing to the leaf node, storing the item identifier of each node from the root node to the leaf node in sequence and the expected result of the corresponding assembled active SIM card command into an iteratable object A, and nesting and storing the item identifier and the expected result into an iteratable object B as an element to execute the next step.
Step S412: and sending a TERMINAL PROFILE command, responding to the state word of 91XX, automatically sending a FETCH command, analyzing and grabbing the active SIM card command, and automatically sending a TERMINAL RESPONSE command with the result value equal to 0x00 according to the command type, thereby completing the initialization process of the starting-up SIM card and executing the next step.
Step S413: traversing all elements B (0) and B (n) in the object B, acquiring the current elements B (0) and B (n), traversing the elements B (n), namely traversing the object A (0) and A (n), acquiring an item identifier of a first node, automatically sending a MENU SELECTION command, responding to a state word of 91XX, automatically sending a FETCH command, analyzing and grabbing an active SIM card command, comparing the active SIM card command with the active SIM card command stored in the first node in the current element of the object A, and executing the next step if the object B is traversed; if so, the process ends.
Step S414: judging whether the current node of the current element of the object A has a backspace level attribute or not, and if so, executing step S415; if not, step S416 is performed.
Step S415: acquiring the value of the backspace level attribute and judging whether the value is equal to 0x01, if yes, executing step S417; if not, step S418 is performed.
Step S416: according to the command type, a TERMINAL RESPONSE command with a result value equal to 0x00 is automatically transmitted, and the process returns to step S413.
Step S417: continuing traversing the next node of the current element of the object A, acquiring an item identifier, automatically sending SELECT ITEM command, responding to the state word of 91XX, automatically sending a FETCH command, analyzing and grabbing the active SIM card command, comparing the command with the active SIM card command stored in the current node of the current element of the object A, and returning to the step S414.
Step S418: according to the command type, automatically sending TERMINAL RESPONSE command with result value equal to 0x00, responding to 91XX status word, automatically sending FETCH command and analyzing and grabbing active SIM card command, according to the value of backspacing level as index, obtaining active SIM card command stored in the node of the current element of object A for comparison, then selecting one of two processing schemes for execution, if the number of instructions to be processed is more in starting SIM initialization, executing step S419; if the back-off level requirement is not clear or is not configured, the second alternative back-off is to step S412.
Step S419: according to the command type, a TERMINAL RESPONSE command with a result value equal to 0x10 is automatically transmitted, and the process returns to step S413.
Step S105: recording a comparison process and a comparison result of the expected result and the actual result, and generating a test log according to the comparison process and the comparison result.
In some embodiments, a data comparison function and a log output function are preset, and in the process of traversing the first iteratable object, the comparison process and the comparison result are recorded in the test log in sequence, and the test log is output after the traversing is finished. Therefore, the output test log can be formatted, each test process is recorded, once problems occur, the efficiency of problem investigation is improved, and the method is also beneficial to the quality audit of the later-stage products.
As an example, as shown in fig. 6, a test log example provided for the present embodiment, based on the STK menu requirement provided in the above example, a complete interaction procedure of the mobile equipment ME and the USIM card is recorded from the start-up initialization, including a command sent by the ME to the USIM card, a response status word of the USIM card and an active SIM card command sent by the USIM card, and a comparison result of an actual result of the active SIM card command and an expected result of the active SIM card command is recorded.
In some embodiments, a structure parsing function is preset to parse the actual result of the active SIM card command to obtain instruction data corresponding to each item of attribute data.
The instruction data refers to an item identifier, a command qualifier, an Alpha identifier, an item text string, a data coding scheme, a text string, an Alpha identifier, a USSD string, a response length, a URL, and the like, which are included in the actual result.
The embodiment of the invention at least comprises the following beneficial effects: the efficiency of STK menu test is improved, and the quality of products is ensured; the product stability and the robustness of the USIM card are improved; the requirement compliance test of the STK menu is met, and the compliance verification of the standard specification of the active SIM card command can be carried out; the complicated tasks are automated, the accuracy is improved, and the product trust degree is increased; the problem of low applicability of automatic test caused by non-uniform backspacing level of the STK menu is solved, the consistency and repeatability of the test are improved, and the regression test is convenient to carry out; the output test log is formatted, each test process is recorded, once problems occur, the efficiency of problem investigation is improved, and the later product quality audit is facilitated.
Referring to fig. 7, an embodiment of the present invention provides a system schematic diagram for testing a USIM card STK menu, including but not limited to:
a first processing module 101, configured to obtain an STK menu from a product requirement configuration document, and generate an STK menu tree;
the second processing module 102 is configured to assemble an expected result of the active SIM card command based on attribute data of tree nodes in the STK menu tree;
a third processing module 103, configured to store, according to a tree node path of the STK menu tree, item identifiers of tree nodes and desired results in the first iteratable object, where the item identifiers are in one-to-one correspondence with the desired results;
A fourth processing module 104, configured to send a common command to the USIM card according to the item identifier of the node in the first iteratable object, obtain an actual result of the active SIM card command fed back by the USIM card, and compare the expected result with the actual result;
and a fifth processing module 105, configured to record a comparison process and a comparison result of the expected result and the actual result, and generate a test log according to the comparison process and the comparison result.
An embodiment of the present invention provides an electronic device, as shown in fig. 8, including a memory 201 and a processor 202; a memory 201 for storing one or more computer programs; the processor 202 is configured to implement the method for testing the STK menu of the USIM card according to the embodiment of the present invention when executing the program stored in the memory 201.
The embodiment of the invention provides a computer readable storage medium, wherein instructions are stored in the computer readable storage medium, and when the computer readable storage medium runs on a computer, the computer is caused to execute the method for testing the STK menu of the USIM card.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for electronic device and computer readable storage medium embodiments, the description is relatively simple as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method for testing a USIM card STK menu, comprising:
acquiring an STK menu from a product demand configuration document, and generating an STK menu tree;
assembling an expected result of the active SIM card command based on attribute data of tree nodes in the STK menu tree;
according to the tree node path of the STK menu tree, storing item identifiers of tree nodes and the expected results in a first iteratable object, wherein the item identifiers are in one-to-one correspondence with the expected results;
according to the item identifier of the node in the first iteratable object, sending a common command to a USIM card, acquiring an actual result of the active SIM card command fed back by the USIM card, and comparing the expected result with the actual result;
and recording a comparison process and a comparison result of the expected result and the actual result, and generating a test log according to the comparison process and the comparison result.
2. The method for testing a USIM card STK menu according to claim 1, wherein assembling the desired result of the active SIM card command based on the attribute data of the nodes in the STK menu tree comprises:
presetting an active SIM card command function, and obtaining the expected result of the active SIM card command according to a standard specification document, an assembly command type and the attribute data.
3. The method of claim 1, wherein said storing the item identifier of the tree node and the desired result in the first iteratable object according to the tree node path of the STK menu tree comprises:
traversing from a root node to a leaf node according to the node path of the STK menu tree to obtain the item identifier;
acquiring the corresponding expected result according to the item identifier;
sequentially storing each item identifier and each desired result in a second iteratable object
And taking the second iteratable object as an element to be sequentially nested and stored in the first iteratable object.
4. A method for testing a STK menu of a USIM card according to claim 3, wherein said sending a normal command to the USIM card according to the item identifier of the node in the first iteratable object, obtaining an actual result of the active SIM card command fed back by the USIM card, and comparing the expected result with the actual result, comprises:
traversing the first iteratable object, and sequentially reading the second iteratable object in each node;
traversing the second iteratable object, and sequentially sending the common command to the USIM card according to the item identifiers of all nodes to acquire the actual result of the active SIM card command fed back by the USIM card, wherein the common command comprises a MENU SELECTION command, a FETCH command and a TERMINAL RESPONSE command;
And comparing the expected result of each node with the obtained actual result in turn.
5. The method of testing a USIM card STK menu according to claim 4, wherein the sending a normal command to a USIM card according to the item identifier of the node in the first iteratable object, obtaining an actual result of the active SIM card command fed back by the USIM card, and comparing the expected result and the actual result, further comprises:
traversing the first iteratable object, and reading the second iteratable object in the current node;
when traversing the head node of the second iteratable object, sending a FETCH command and a MENU SELECTION command corresponding to the item identifier to the USIM card, acquiring the actual result of the active SIM card command fed back by the USIM card, and comparing the actual result with the expected result in the head node;
judging whether the attribute data of the current node in the second iteratable object comprises a backspacing layer attribute, if not, sending a TERMINAL RESPONSE command with a result value equal to 0x00 to the USIM card, if so, judging whether the value of the backspacing layer attribute is equal to 0x01, and executing the following steps:
If the value of the backspacing layer attribute is equal to 0x01, updating the current node to be the next node, sending a FETCH command and a TERMINAL RESPONSE command corresponding to the item identifier in the current node to the USIM card, acquiring the actual result of the active SIM card command fed back by the USIM card, and comparing the actual result with the expected result in the current node;
and if the value of the backspacing layer attribute is not equal to 0x01, transmitting a TERMINAL RESPONSE command and a FETCH command with the result value equal to 0x00, acquiring the actual result of the active SIM card command fed back by the USIM card, acquiring the expected result corresponding to the current node according to the value of the backspacing layer attribute as an index, comparing the expected result with the actual result, and transmitting a TERMINAL RESPONSE command with the result value equal to 0x10 to the USIM card.
6. The method for testing a USIM card STK menu according to claim 1, wherein the generating a test log according to the comparison process and the comparison result comprises:
and presetting a data comparison function and a log output function, sequentially recording the comparison process and the comparison result in the test log in the process of traversing the first iteratable object, and generating the test log after the traversing is finished.
7. The method for testing a USIM card STK menu of claim 1, further comprising:
and presetting a structure analysis function for analyzing the actual result of the active SIM card to obtain instruction data corresponding to each item of attribute data.
8. A system for testing a USIM card STK menu, comprising:
the first processing module is used for acquiring an STK menu from the product demand configuration document and generating an STK menu tree;
the second processing module is used for assembling the expected result of the active SIM card command based on the attribute data of the tree nodes in the STK menu tree;
a third processing module, configured to store, according to a tree node path of the STK menu tree, item identifiers of tree nodes and the expected results in a first iteratable object, where the item identifiers are in one-to-one correspondence with the expected results;
a fourth processing module, configured to send a common command to a USIM card according to an item identifier of a node in the first iteratable object, obtain an actual result of the active SIM card command fed back by the USIM card, and compare the expected result with the actual result;
and the fifth processing module is used for recording a comparison process and a comparison result of the expected result and the actual result and generating a test log according to the comparison process and the comparison result.
9. An electronic device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising a method for performing the test USIM card STK menu of any one of claims 1-7.
10. A computer readable storage medium, characterized in that a program instruction is stored that is executable by a processor for performing the method of testing a USIM card STK menu as claimed in any one of claims 1-7.
CN202210403356.4A 2022-04-18 2022-04-18 Method, system, electronic equipment and storage medium for testing USIM card STK menu Active CN114741301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210403356.4A CN114741301B (en) 2022-04-18 2022-04-18 Method, system, electronic equipment and storage medium for testing USIM card STK menu

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210403356.4A CN114741301B (en) 2022-04-18 2022-04-18 Method, system, electronic equipment and storage medium for testing USIM card STK menu

Publications (2)

Publication Number Publication Date
CN114741301A CN114741301A (en) 2022-07-12
CN114741301B true CN114741301B (en) 2023-04-28

Family

ID=82281754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210403356.4A Active CN114741301B (en) 2022-04-18 2022-04-18 Method, system, electronic equipment and storage medium for testing USIM card STK menu

Country Status (1)

Country Link
CN (1) CN114741301B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193569A (en) * 2017-05-31 2017-09-22 福建三元达科技有限公司 The multilevel menu management system and management method of embedded system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800038B (en) * 2017-11-16 2024-03-29 北京握奇智能科技有限公司 STK menu implementation method and device
CN113220568B (en) * 2021-04-26 2022-10-04 星汉智能科技股份有限公司 Method, device and medium for testing USIM card file system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193569A (en) * 2017-05-31 2017-09-22 福建三元达科技有限公司 The multilevel menu management system and management method of embedded system

Also Published As

Publication number Publication date
CN114741301A (en) 2022-07-12

Similar Documents

Publication Publication Date Title
US11714792B2 (en) Creating data in a data store using a dynamic ontology
US9218269B2 (en) Testing multiple target platforms
CN111176983B (en) Code conflict resolution system, method, device, equipment and medium
CN113297086A (en) Test case generation method and device, electronic equipment and storage medium
CN114741301B (en) Method, system, electronic equipment and storage medium for testing USIM card STK menu
CN117499287A (en) Web testing method, device, storage medium and proxy server
CN115793924A (en) Method, device and equipment for maintaining bank front-end dynamic menu
CN114328180A (en) Interface automation test method, system, electronic equipment and storage medium
US9081631B2 (en) Method for executing a toolkit action in an IC card
CN113138912B (en) Interface testing method and system, client and server
CN115129355B (en) Page repair method, system and computer equipment thereof
CN115544994B (en) Data pushing method, device, electronic equipment and readable storage medium
CN113377555A (en) Interface parameter analysis method, system, equipment and computer program product
US7984187B2 (en) System and method for constructing transactions from electronic content
CN115114052A (en) Method and device for intelligently providing database microservice
CN115291945A (en) Terminal function compatibility control method, device, equipment and medium
CN117194586A (en) Contract element form change identification and highlighting method, system and equipment
CN117057915A (en) File processing method, device, equipment and readable storage medium
CN113918458A (en) Script processing method, server and storage medium
CN117573130A (en) Code processing method, device, electronic equipment and storage medium
CN115658552A (en) Test data recommendation method and device, storage medium and electronic equipment
CN117493032A (en) Method and device for realizing API call link, electronic equipment and storage medium
CN114610592A (en) Data change risk verification method and device based on rule configuration
CN115495371A (en) Interface testing method and device
CN115438145A (en) Method and device for adding enterprise detail internal chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant