Film card monitoring method supporting STK menu operation SIM card log collection
By implementing the STK menu operation on the film card, it supports the transparent transmission and monitoring of interactive instructions between the terminal device and the SIM card, and configures the log cache area, which solves the problems of inconvenient connection of monitoring equipment and insufficient functions of the film card in the existing technology, and realizes flexible Log collection and storage.
Patent Information
- Application Number
- CN202310187904.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, there are identification problems and insufficient durability of the collection line when the monitoring equipment connects the SIM card and the terminal device. The film card lacks the menu operation function, log clearing and collection timing setting capabilities, resulting in inconvenient log collection.
By implementing STK menu operations on the foil card, it supports transparent transmission and monitoring of interactive commands between terminal equipment and SIM cards, configures log cache and collection settings, and provides menu operations to facilitate log collection and storage.
It realizes the transparent transmission and monitoring of interactive instructions between the SIM card and the terminal device by the film card, supports STK menu operation, can set and cancel INS collection of APDU, configure the log buffer area, clear and start/stop log collection, and solves the problem of existing technology. The problem of inconvenience in log collection.
Smart Images

Figure CN118540732A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of film cards, and in particular to a film card monitoring method supporting STK menu operation SIM card log collection. Background Art
[0002] When operators test SIM card functions and find problems, card vendors usually use monitoring equipment to collect the logs of the interaction between the SIM card and the terminal device to analyze the problem more intuitively. Some card vendors have also designed film cards to collect logs to collect interaction logs. However, both existing methods have some inconveniences in use.
[0003] For monitoring devices:
[0004] (1) When the monitoring device connects the SIM card to the terminal device through the acquisition line, there is a situation where the terminal device does not recognize the card;
[0005] (2) The acquisition line is not durable, especially when placed in a well-sealed mobile phone, it is easy to break, resulting in unrecognizable;
[0006] (3) In some special cases, it is impossible to go to the customer site. If the monitoring equipment is mailed to the customer, it will be inconvenient both in terms of cost and implementation.
[0007] For existing foil cards:
[0008] (1) It does not have menu operation function;
[0009] (2) The collected logs need to be cleared using PC software;
[0010] (3) It is impossible to set the timing of log collection;
[0011] (4) When there are many scenes to be collected, the log volume is large and the storage space is limited. Summary of the invention
[0012] In view of the above analysis, the embodiment of the present invention aims to provide a film card monitoring method that supports STK menu operation SIM card log collection, so as to solve the problem of inconvenience in log collection in the existing method.
[0013] The present invention provides a film card monitoring method supporting STK menu operation SIM card log collection, the method comprising:
[0014] Step S1: stick the mold card on the SIM card and put it into the terminal device;
[0015] Step S2: the film card monitors the APDU command issued by the terminal device;
[0016] Step S3: If the film card monitors that the terminal device sends a menuselect event command and selects the film card menu, the active command monitoring flag is set, and the fetch command and the terminal response command are processed by the film card instead of being executed by the SIM card; until the terminalresponse returns 9000, the fetch and terminalresponse commands are transparently transmitted to the SIM card for processing.
[0017] On the basis of the above scheme, the present invention also makes the following improvements:
[0018] Furthermore, the method further comprises:
[0019] Step S4: If the film card monitors that the terminal device issues a terminal profile command, the status word and active command type returned by the SIM card are monitored:
[0020] If the SIM card is monitored to return the setupmenu active command, the film card will add the film card menu to the setupmenu menu and then return it to the terminal device.
[0021] Furthermore, the step S4 further includes:
[0022] If the SIM card status word returns to 9000 and the setupmenu active command is not monitored, the film card organizes the film card setupmenu menu, sets the film card menu mark, modifies the SIM card status word to 91XX, and returns the response data to the terminal device; then waits for the terminal device to issue a fetch command to retrieve the response data and the execution result terminalresponse.
[0023] Further, the step S3 performs:
[0024] Step S31: If the film card monitors that the terminal device issues a menuselect event command and selects the film card menu, the film card sets an active command monitoring flag and organizes the Level 2 menu in the film card menu; then, the film card returns response data to the terminal device in the card mode and jumps to step S2;
[0025] Otherwise, determine whether the active command monitoring flag is set.
[0026] If it is set, then determine whether the fetch command or terminalresponse command is monitored. If it is monitored, execute the corresponding function according to the film card menu operated by the user in the terminalresponse command. Then, determine whether the status word returned by the film card in the card mode is 9000.
[0027] If not, return response data to the terminal device in card mode and jump to step S2;
[0028] If yes, clear the active command monitoring flag (i.e., clear the active command monitoring flag); then, return the response data to the terminal device in the card mode, and jump to step S2;
[0029] If not monitored, jump to step S32;
[0030] If not set, jump to step S32;
[0031] Step S32: Determine whether the film card menu mark is set, and the current APDU instruction is a terminalresponse instruction.
[0032] If yes, return response data to the terminal device in card mode and jump to step S2;
[0033] If not, determine whether log collection has been started.
[0034] If it is started, APDU recording is performed according to the INS list and the buffer area number, and then the process jumps to step S33;
[0035] If not started, jump directly to step S33.
[0036] Furthermore, the step S3 further performs:
[0037] Step S33: Determine whether the menu creation flag is set.
[0038] If it is set, then determine whether the fetch command is received.
[0039] If received, the backup response data is written into the response data area to be returned; then, it is determined again whether to start log collection.
[0040] If it is started, the response data log is recorded according to the INS list and the cache area number, and then the response data is returned to the terminal device in the card mode, and the process jumps to step S2;
[0041] If not started, return response data to the terminal device in card mode and jump to step S2;
[0042] If no fetch instruction is received, execute step S34;
[0043] If not set, execute step S34;
[0044] Step S34: the film card switches to the card reader mode, forwards the APDU command to the SIM card, and obtains the response data returned by the SIM card; then, it is determined whether the log collection has been started.
[0045] If it has been started, the response data is recorded according to the INS list and the cache area number, and then the process jumps to step S4;
[0046] If not started, jump directly to step S4.
[0047] Further, the step S4 performs:
[0048] If the film card monitors that the terminal device issues a terminalprofile command, jump to step S41; otherwise, jump to step S42;
[0049] Step S41: Determine whether the status word is 9000.
[0050] If yes, clear the setup menu flag (i.e., clear the setup menu flag), organize the film card setupmenu menu, modify the status word to 91XX, and set the film card menu flag; then, return the response data to the terminal device in the card mode, and jump to step S2;
[0051] If not, set the setup menu flag and monitor the SIM card's response to the fetch command in card reader mode.
[0052] If the response is a setupmenu active command, then add a film card menu to the setupmenu menu, clear the menu flag, modify the status word, increase the length of the film card menu, and back up the response data; then, return the status word to the terminal device in the card mode, and jump to step S2;
[0053] Otherwise, back up the response data; then, return the status word to the terminal device in the card mode and jump to step S2.
[0054] Further, the step S4 further performs:
[0055] Step S42: Determine whether the menu creation flag is set.
[0056] If it is not set, the response data is returned to the terminal device in the card mode, and the process jumps to step S2;
[0057] If set, jump to step S41.
[0058] Furthermore, the film card menu is configured and performs the following functions:
[0059] Set the INS menu of the collected APDU;
[0060] Menu for allocating the number and size of log buffers;
[0061] Clear the log buffer menu;
[0062] Log cache area code menu;
[0063] Start and stop log collection menu.
[0064] Furthermore, the method further comprises:
[0065] After completing the configuration through menu operation, the film card monitors and records the log according to the configuration;
[0066] When the log collection is completed, remove the SIM card with the film card from the terminal device, and use the PC software to send a log reading command to read the recorded logs.
[0067] Furthermore, the film card interacts with the SIM card in the card reader mode and interacts with the terminal device in the card mode.
[0068] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0069] The film card monitoring method supporting STK menu operation SIM card log collection provided by the present invention uses the film card to transparently transmit and monitor the interaction instructions between the SIM card and the interrupt device, and can support the following functions:
[0070] The film card transparently transmits the interactive instructions between the terminal device and the SIM card, and records them according to the configuration;
[0071] The film card supports STK menu;
[0072] You can set or cancel the INS of the APDU to be collected through the STK menu. All are collected by default.
[0073] The number and size of the log buffer area can be set through the STK menu. The film card has a default configuration when it leaves the factory. The default configuration is used before it is set.
[0074] The logs of the specified buffer area can be cleared through the STK menu;
[0075] You can start and stop log collection through the STK menu. Log collection is enabled by default.
[0076] The cache area number for the collected logs can be set;
[0077] The corresponding log stored in the film card can be read through APDU instructions.
[0078] The above monitoring method of the film card effectively solves the problem of inconvenience in collecting logs in the existing method.
[0079] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0081] Figure 1 A flowchart of a film card monitoring method supporting STK menu operation SIM card log collection provided by an embodiment of the present invention;
[0082] Figure 2 A schematic diagram of a film card menu provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0083] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0084] A specific embodiment of the present invention discloses a film card monitoring method that supports STK menu operation SIM card log collection. The film card supports two modes of ISO7816: card reader and card. The film card interacts with the SIM card in the card reader mode and interacts with the terminal device in the card mode. The film card can be used to transparently transmit the APDU instructions for the interaction between the SIM card and the terminal device. In addition, the film card can also monitor and record the required APDU instructions according to the default configuration or the configuration set by the menu.
[0085] The flowchart of the film card monitoring method is as follows Figure 1 As shown, the film card monitoring method includes the following steps:
[0086] Step S1: Paste the film card on the SIM card and put it into the terminal device; the film card can transparently transmit the interactive APDU instructions to ensure the normal interaction between the terminal device and the SIM card, and record the log according to the current configuration;
[0087] Step S2: the film card monitors the APDU command issued by the terminal device;
[0088] Step S3: If the film card monitors that the terminal device issues a menuselect event command and selects the film card menu, the active command monitoring flag is set, and the fetch command and the terminal response command are processed by the film card instead of being executed by the SIM card; until the terminalresponse returns 9000, the fetch and terminalresponse commands are transparently transmitted to the SIM card for processing;
[0089] Step S4: If the film card monitors that the terminal device issues a terminal profile command, the status word and active command type returned by the SIM card are monitored:
[0090] If the SIM card is monitored to return the setupmenu active command, the film card adds the film card menu in the setupmenu menu and returns it to the terminal device. Here, the film card menu specifically refers to the menu required for the film card to collect logs. The menu can be one or more, which can be set according to needs.
[0091] If the SIM card status word returns to 9000 and the setupmenu active command is not monitored, the film card organizes the film card setupmenu menu, sets the film card menu mark, modifies the SIM card status word to 91XX, and returns the response data to the terminal device; then waits for the terminal device to issue a fetch command to retrieve the response data (the "response data" at this time includes the film card menu) and the execution result terminalresponse.
[0092] Preferably, in this embodiment, step S3 specifically performs the following operations:
[0093] Step S31: If the film card monitors that the terminal device issues a menuselect event command and selects the film card menu, the film card sets an active command monitoring flag and organizes the Level 2 menu in the film card menu; then, the film card returns response data to the terminal device in the card mode and jumps to step S2;
[0094] Otherwise, determine whether the active command monitoring flag is set.
[0095] If it is set, then determine whether the fetch command or terminalresponse command is monitored. If it is monitored, execute the corresponding function according to the film card menu operated by the user in the terminalresponse command. Then, determine whether the status word returned by the film card in the card mode is 9000.
[0096] If not, return response data to the terminal device in card mode and jump to step S2;
[0097] If yes, it means the menu interaction is over, the terminal device is not needed to fetch data, and the active command monitoring flag is cleared; then, the response data is returned to the terminal device in the card mode, and the process jumps to step S2;
[0098] If not monitored, jump to step S32;
[0099] If not set, jump to step S32;
[0100] Step S32: determine whether the film card menu flag is set, and the current APDU instruction is a terminalresponse instruction (when the film card menu flag is set, and the APDU instruction is terminalresponse, only a response is established for the film card menu).
[0101] If yes, return response data to the terminal device in card mode and jump to step S2;
[0102] If not, determine whether log collection has been started.
[0103] If it is started, APDU recording is performed according to the INS list and the buffer area number, and then the process jumps to step S33;
[0104] If not started, jump directly to step S33;
[0105] Step S33: Determine whether the menu creation flag is set.
[0106] If it is set, then determine whether the fetch command is received.
[0107] If received, the backup response data is written into the response data area to be returned; then, it is determined again whether to start log collection.
[0108] If it is started, the response data log is recorded according to the INS list and the cache area number, and then the response data is returned to the terminal device in the card mode, and the process jumps to step S2;
[0109] If not started, return response data to the terminal device in card mode and jump to step S2;
[0110] If no fetch instruction is received, execute step S34;
[0111] If not set, execute step S34;
[0112] Step S34: the film card switches to the card reader mode, forwards the APDU command to the SIM card, and obtains the response data returned by the SIM card; then, it is determined whether the log collection has been started.
[0113] If it has been started, the response data is recorded according to the INS list and the cache area number, and then the process jumps to step S4;
[0114] If not started, jump directly to step S4;
[0115] It should be noted that, generally, during the initialization phase of power-on, the terminal device sends a terminalprofile command, and by executing the above operation, the film card menu can be returned to the terminal device. Preferably, in this embodiment, step S4 specifically performs the following operations:
[0116] Step S41: The film card monitors whether the terminal device issues a terminal profile command.
[0117] If yes, jump to step S42;
[0118] Otherwise, jump to step S43;
[0119] Step S42: Determine whether the status word is 9000.
[0120] If yes, clear the setup menu flag (when the "setup menu flag" is set, it means that the SIM card menu is set), organize the film card setupmenu menu, modify the status word to 91XX, and set the film card menu flag; then, return the response data to the terminal device in the card mode, and jump to step S2;
[0121] If not, set the setup menu flag and monitor the SIM card's response to the fetch command in card reader mode.
[0122] If the response is a setupmenu active command, then add a film card menu to the setupmenu menu, clear the menu flag, modify the status word, increase the length of the film card menu, and back up the response data; then, return the status word to the terminal device in the card mode, and jump to step S2;
[0123] Otherwise, back up the response data; then, return the status word to the terminal device in the card mode, and jump to step S2;
[0124] Step S43: Determine whether the menu creation flag is set.
[0125] If it is not set, the response data is returned to the terminal device in the card mode, and the process jumps to step S2;
[0126] If set, jump to step S42.
[0127] In the above step S3, when the active command monitoring flag is set, the film card executes the relevant process in the film card menu and executes the corresponding function according to the selected menu. Specifically, the following functions can be configured and executed:
[0128] (1) Set the INS menu for the collected APDU
[0129] --Can clear INS and monitor all interactive APDU instructions
[0130] --You can set the INS that needs to monitor APDU. Once set, only the APDU instructions of the set INS will be recorded
[0131] --Can read the set INS list
[0132] (2) Menu for allocating the number and size of log buffers
[0133] --Supports users to set the number of buffers and the size of each buffer. If the value entered by the user exceeds the maximum value of the entire buffer, the user will be prompted to modify it
[0134] --Supports users to read the current number of cache areas and the size of each cache area
[0135] --Can support users to read which cache area the current cache area is
[0136] (3) Clear log buffer menu
[0137] --Can clear the current cache area
[0138] --Users can enter the cache area code to be cleared and clear it
[0139] (4) Log cache area code menu
[0140] --Can read the cache area code currently used
[0141] --You can set the cache area number to be used currently
[0142] (5) Start and stop log collection menu
[0143] --Can read the current log collection switch status, factory default is on
[0144] --You can stop the current log collection
[0145] --Can start the collection of current log
[0146] After the configuration is completed through menu operation, the film card monitors and records the logs according to the configuration. After the log collection is completed, the SIM card with the film card is removed from the terminal device, and the PC software is used to send a command to read the logs to read the recorded logs. For example, the film card menu is as follows Figure 2 shown.
[0147] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0148] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A film card monitoring method supporting STK menu operation SIM card log collection, characterized in that: The method comprises: Step S1: stick the mold card on the SIM card and put it into the terminal device; Step S2: the film card monitors the APDU command issued by the terminal device; Step S3: If the film card monitors that the terminal device sends a menuselect event command and selects the film card menu, the active command monitoring flag is set, and the fetch command and the terminal response command are processed by the film card instead of being executed by the SIM card; until the terminalresponse returns 9000, the fetch and terminalresponse commands are transparently transmitted to the SIM card for processing.
2. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 1 is characterized in that: The method further comprises: Step S4: If the film card monitors that the terminal device issues a terminal profile command, the status word and active command type returned by the SIM card are monitored: If the SIM card is monitored to return the setupmenu active command, the film card will add the film card menu to the setupmenu menu and then return it to the terminal device.
3. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 2 is characterized in that: The step S4 further comprises: If the SIM card status word returns to 9000 and the setupmenu active command is not monitored, the film card organizes the film card setupmenu menu, sets the film card menu mark, modifies the SIM card status word to 91XX, and returns the response data to the terminal device; then waits for the terminal device to issue a fetch command to retrieve the response data and the execution result terminalresponse.
4. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 3 is characterized in that: The step S3 performs: Step S31: If the film card monitors that the terminal device issues a menuselect event command and selects the film card menu, the film card sets an active command monitoring flag and organizes the Level 2 menu in the film card menu; then, the film card returns response data to the terminal device in the card mode and jumps to step S2; Otherwise, determine whether the active command monitoring flag is set. If it is set, then determine whether the fetch command or terminalresponse command is monitored. If it is monitored, execute the corresponding function according to the film card menu operated by the user in the terminalresponse command. Then, determine whether the status word returned by the film card in the card mode is 9000. If not, return response data to the terminal device in card mode and jump to step S2; If yes, clear the active command monitoring flag; then, return the response data to the terminal device in the card mode and jump to step S2; If not monitored, jump to step S32; If not set, jump to step S32; Step S32: Determine whether the film card menu mark is set, and the current APDU instruction is a terminalresponse instruction. If yes, return response data to the terminal device in card mode and jump to step S2; If not, determine whether log collection has been started. If it is started, APDU recording is performed according to the INS list and the buffer area number, and then the process jumps to step S33; If not started, jump directly to step S33.
5. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 4 is characterized in that: The step S3 further performs: Step S33: Determine whether the menu creation flag is set. If it is set, then determine whether the fetch command is received. If received, the backup response data is written into the response data area to be returned; then, it is determined again whether to start log collection. If it is started, the response data log is recorded according to the INS list and the cache area number, and then the response data is returned to the terminal device in the card mode, and the process jumps to step S2; If not started, return response data to the terminal device in card mode and jump to step S2; If no fetch instruction is received, execute step S34; If not set, execute step S34; Step S34: the film card switches to the card reader mode, forwards the APDU command to the SIM card, and obtains the response data returned by the SIM card; then, it is determined whether the log collection has been started. If it has been started, the response data is recorded according to the INS list and the cache area number, and then the process jumps to step S4; If not started, jump directly to step S4.
6. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 5 is characterized in that: The step S4 performs: Step S41: The film card monitors whether the terminal device issues a terminal profile command. If yes, jump to step S42; Otherwise, jump to step S43; Step S42: Determine whether the status word is 9000. If yes, clear the setup menu flag, organize the film card setupmenu menu, modify the status word to 91XX, and set the film card menu flag; then, return the response data to the terminal device in the card mode, and jump to step S2; If not, set the setup menu flag and monitor the SIM card's response to the fetch command in card reader mode. If the response is a setupmenu active command, then add a film card menu to the setupmenu menu, clear the menu flag, modify the status word, increase the length of the film card menu, and back up the response data; then, return the status word to the terminal device in the card mode, and jump to step S2; Otherwise, back up the response data; Then, in the card mode, the status word is returned to the terminal device and the process jumps to step S2.
7. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 6 is characterized in that: The step S4 further performs: Step S423: Determine whether the menu creation flag is set. If it is not set, the response data is returned to the terminal device in the card mode, and the process jumps to step S2; If set, jump to step S42.
8. The film card monitoring method supporting STK menu operation SIM card log collection according to any one of claims 1-7, characterized in that: The film card menu configures and performs the following functions: Set the INS menu of the collected APDU; Menu for allocating the number and size of log buffers; Clear the log buffer menu; Log cache area code menu; Start and stop log collection menu.
9. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 8, characterized in that: The method further comprises: After completing the configuration through menu operation, the film card monitors and records the log according to the configuration; When the log collection is completed, remove the SIM card with the film card from the terminal device, and use the PC software to send a log reading command to read the recorded logs.
10. The film card monitoring method supporting STK menu operation SIM card log collection according to claim 8, characterized in that: The film card interacts with the SIM card in the card reader mode and interacts with the terminal device in the card mode.
