Method, device and medium for processing smart card data

By using a visualized configuration and batch generation method for smart card data processing, the problems of cumbersome manual operations and data errors in the personalization process of smart card mass production have been solved. This has enabled convenient and automatic generation and export of parameters, improving production efficiency and accuracy.

CN123159368APending Publication Date: 2026-11-24ZHUHAI RUICHENG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611663871.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-27
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, the personalization process of smart card mass production relies on manual input and calculation of personalization parameters, which leads to frequent data errors, low debugging efficiency, and difficulty in avoiding parameter matching errors.

Method used

A smart card data processing method is provided, which generates a configuration tree structure through a visual configuration page, supports batch automatic generation and export of personalized parameters, including an input configuration tree structure, an independent parameter configuration interface and an output configuration tree structure, to realize the visual configuration and batch generation of parameters.

Benefits of technology

It improves the convenience and accuracy of personalized parameter operation of smart cards, reduces human error, and ensures the accuracy of parameter data in mass production scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159368A_ABST
    Figure CN123159368A_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for processing smart card data. It includes: responding to a batch generation request for personalized smart card data and visually displaying a personalized data generation configuration page; upon receiving a batch data generation instruction, performing loop processing according to the total generation configuration item; during a single loop, obtaining a complete set of personalized smart card data according to the generation rules and the input configuration tree structure, and filtering it according to the output configuration tree structure to form a set of target output personalized smart card data; after the loop ends, exporting each set of target output personalized smart card data. This invention can improve the accuracy of personalized data and the consistency of data under mass production, flexibly select input and output fields based on the tree structure to adapt to diverse production needs, is easy to operate and use, lowers the threshold for operators, and avoids parameter matching errors during batch operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method, device and medium for processing smart card data. Background Technology

[0002] During the smart card development and debugging phase, engineers need to debug the business files within the card and the interactive messages based on the Subscriber Identity Module Application Toolkit (STK). The card's service files include the Elementary File of Abbreviated DiallingNumber (EF-ADN) and the Elementary File of Short Message Service (EF-SMS). Due to storage space limitations, specific encoding is required for data storage of these service files. EF-ADN follows the ETSI TS 31.101 specification. Its name field can use GSM 7-bit default alphabet or UCS2 (Universal Character Set 2) encoding, while the number field can use BCD (Binary-Coded Decimal) encoding. When using UCS2, it can be further compressed using the UCS2 format. EF-SMS primarily uses GSM 7-bit encoding. During debugging, the service files involve at least one of the following encoding methods: ASCII, GSM 7-bit, UCS2, and BCD. The service files need to be encoded and decoded to verify whether the service data storage conforms to the protocol specifications. Meanwhile, the STK active commands and terminal response messages used for interaction between the smart card and the terminal follow the ETSI protocol and are encapsulated in a nested TLV structure. During debugging, message encoding, decoding, and parsing must be completed to verify the card's protocol interaction functions. After the smart card's service functions are verified, the process moves to the mass production and personalization stage, where network access identity parameters are generated and written for each smart card, serving as the basis for the smart card's legitimate network access and identity authentication.

[0003] Existing format conversion tools can perform one-way data format conversion, providing single conversion capabilities between hexadecimal and ASCII, UCS2, and BCD encoding or decoding. Different encoding and decoding functions are distributed across multiple independent tools, requiring engineers to use the corresponding independent tools to perform data encoding, decoding, and reading operations for phonebooks and SMS service files. During the smart card and terminal interaction debugging phase, packet capture tools are used to convert binary data into hexadecimal for display. In the smart card mass production and personalization phase, staff manually input and calculate personalized network access parameters and manually maintain the smart card's binding mapping relationship.

[0004] However, in actual operation, because various encoding and decoding methods are deployed in multiple independent tools, engineers need to frequently switch between different tools and repeatedly copy and paste data during debugging, which is cumbersome and prone to human error. In the scenario of debugging smart card STK interactive commands, packet capture tools only output hexadecimal strings, which cannot intuitively display the instruction type, field length, and business parameters corresponding to the message TLV layer structure. It is necessary to manually consult the protocol document to interpret the message semantics, resulting in low debugging efficiency. In the mass production and personalization of smart cards, the generation and verification of personalized network access parameters rely on manual input and calculation, which is prone to data errors. Incorrect parameters written into the card will cause the smart card to malfunction. At the same time, it is difficult for staff to intuitively manage the binding mapping relationship between multiple sets of parameters corresponding to the same smart card, and parameter matching errors are prone to occur during batch data operations. Summary of the Invention

[0005] This invention provides a method, device, and medium for processing smart card data to solve the problem that data errors are easily generated in the mass production and personalization process of smart cards due to reliance on manual input and calculation of personalized parameters. It enables the visual configuration and batch automatic generation and export of personalized parameters of smart cards, thereby improving the ease of operation of personalized parameters of smart cards.

[0006] According to one aspect of the present invention, a method for processing smart card data is provided, the method comprising: In response to the batch generation request of smart card personalized data, the personalized data generation configuration page is displayed visually; The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. Upon receiving a batch data generation instruction, the target total quantity set for the total generation configuration item is obtained as the loop count, and loop processing is executed. During a single loop execution, the smart card data fields to be generated are selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data. Based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalized data is filtered to form a set of target output smart card personalized data. After the loop ends, export the personalized smart card data for each group of target outputs.

[0007] According to another aspect of the present invention, a smart card data processing apparatus is provided, the apparatus comprising: The Personalized Data Response Module is used to respond to batch generation requests for smart card personalized data and to provide a visual display of the personalized data generation configuration page. The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. The batch data loop processing module is used to obtain the target total quantity set for the total quantity configuration item as the loop count when a batch data generation instruction is received, and then perform loop processing. The personalized data generation and filtering module is used to generate, in a single loop execution process, the smart card data fields to be generated selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, to obtain a complete set of smart card personalized data, and to filter the set of smart card personalized data according to the smart card data fields to be exported selected in the output configuration tree structure, to form a set of target output smart card personalized data. The batch data export module is used to export the personalized data of each group of target output smart cards after the loop ends.

[0008] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the smart card data processing method according to any embodiment of the present invention.

[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the smart card data processing method according to any embodiment of the present invention.

[0010] The technical solution of this invention, in response to a batch generation request for personalized smart card data, provides a visual display of the personalized data generation configuration page; upon receiving a batch data generation instruction, it performs loop processing according to the total generation amount; in each loop, according to the configured generation rules, it generates a complete set of personalized smart card data based on the input configuration tree structure, and filters a set of target output personalized smart card data based on the output configuration tree structure; after the loop ends, it exports each set of target output personalized smart card data. This solves the problems of cumbersome manual operation and error-prone calculation in personalized smart card production, realizes automatic batch generation and export of personalized parameters, improves the convenience of configuration operation, and helps ensure the accuracy of parameter data in batch production scenarios.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart of a smart card data processing method according to Embodiment 1 of the present invention; Figure 2 This is a diagram illustrating the data processing interaction of a smart card according to Embodiment 1 of the present invention; Figure 3 This is a flowchart of a smart card data processing method according to Embodiment 2 of the present invention; Figure 4 This is a flowchart of a smart card data processing method according to Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of a smart card data processing device according to Embodiment 4 of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device that implements the smart card data processing method of the present invention. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0016] Example 1 Figure 1 This is a flowchart of a smart card data processing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the mass production stage of smart cards, where personalized network access parameters for smart cards are automatically generated in large quantities. This method can be executed by a smart card data processing device, which can be implemented in hardware and / or software, and is generally configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes: S110: In response to the batch generation request of smart card personalized data, the personalized data generation configuration page is displayed visually.

[0017] The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. Specifically, when a user needs to generate personalized data for a smart card in batches, they initiate a batch generation request. The system responds to this request by displaying the personalized data generation configuration page to the user in a visual format.

[0018] The smart card data fields include the integrated circuit card identification code, the International Mobile Subscriber Identity Code, the Personal Identification Code, the Personal Identification Code decoding key, other keys, and the administrator code; the Personal Identification Code includes the first Personal Identification Code and the second Personal Identification Code, the Personal Identification Code decoding key includes the first Personal Identification Code decoding key and the second Personal Identification Code decoding key, and other keys include the user authentication key, the operator authentication key, the over-the-air download key, and the application key. The system includes: an Integrated Circuit Card Identifier (ICCID) for uniquely identifying a smart card; an International Mobile Subscriber Identity (IMSI) for uniquely identifying a user within a mobile communication network; a Personal Identification Number (PIN) for verifying user identity, comprising a first PIN (PIN1) and a second PIN (PIN2); a Personal Identification Number Unlock Key for unlocking locked PINs, comprising a first PIN Unlock Key 1 (PUK1) and a second PIN Unlock Key 2 (PUK2), with PUK1 and PUK2 used to unlock PIN1 and PIN2 respectively; and an Authentication Key (Ki) for authenticating users within the mobile communication network, verifying their legitimacy. The Operator Authentication Key (OPC) is obtained by cryptographic computation of Ki and the Operator Variant Algorithm Configuration Field (OP). Ki and OPC jointly participate in network authentication to verify the user's legitimacy. The Over-The-Air Key (OTAKey) provides encryption and integrity protection for the operator's remote and secure management of the SIM card, thereby ensuring the security of OTA data transmission. The Application Key (App Key) is used for encryption and access control of specific applications on the smart card. The Administrative Code (ADM) is used to perform management operations on the smart card, including at least one of writing data, modifying configuration, and unlocking; its permissions are higher than the Personal Identification Code (PIC).

[0019] For example, a personal identification number (PIN) is used to verify a user's identity when using a smart card. For instance, PIN1 is used for authentication in everyday scenarios such as turning on a phone and making calls; PIN2 is used for authentication in scenarios requiring higher permissions, such as accessing specific files. When a user enters the wrong PIN a preset number of times, the PIN is locked and must be unlocked using the corresponding PIN decoding key.

[0020] For integrated circuit card identification codes and international mobile subscriber identification codes, the generation rules that can be configured in the independent parameter configuration interface include step increment rules, and an initial value can also be configured in the independent parameter configuration interface as the starting value of the step increment rule; Specifically, when a user selects the Integrated Circuit Card Identification Code or International Mobile Subscriber Identity Code in the input configuration tree structure, the configurable generation rules provided for this field in the independent parameter configuration interface include a step-increment rule. This step-increment rule is used to generate corresponding data sequentially, incrementing according to a preset initial value and increment step size, during batch generation.

[0021] For Personal Identification Code, Personal Identification Code Decoding Key, and Administrator Code, the configurable generation rules in the independent parameter configuration interface include fixed value rules and random generation rules; the configurable generation formats in the independent parameter configuration interface include any one of decimal ASCII encoding format, hexadecimal ASCII encoding format, and hexadecimal number format.

[0022] Specifically, users can configure generation rules for each field in PIN1, PIN2, PUK1, PUK2, and ADM in the independent parameter configuration interface, and choose either a fixed value rule or a random generation rule for each field.

[0023] Furthermore, in the independent parameter configuration interface, after configuring the generation rules, users can configure the generation format for the above fields, choosing any one of the following: decimal ASCII encoding format, hexadecimal ASCII encoding format, or hexadecimal number format, as the unified generation format for the above fields.

[0024] For example, when a user configures a fixed value rule for PIN1, this field uses the user-configured fixed value as the value of PIN1; when a user configures a random generation rule for ADM, this field generates a random value during the batch generation process. After configuring the generation rules, the generation format is configured for PIN1, PIN2, PUK1, PUK2, and ADM. When the user selects "DEC ASCII", the above fields will be represented in decimal ASCII encoding format.

[0025] For other keys, the generation rules that can be configured in the independent parameter configuration interface include fixed key rules and random key generation rules.

[0026] Specifically, for Ki, OPC, OTA Key, and App Key, when the user selects a random key generation rule, the key field will randomly generate a key value during the batch generation process; when the user selects a fixed key rule, the key field will use the fixed key value configured by the user.

[0027] The personalized data generation configuration page also includes an order adjustment control that matches the output configuration tree structure and a key encryption configuration interface; the order adjustment control is used to adjust the arrangement order of each node in the output configuration tree structure, and the key encryption configuration interface is used to select the fields that need to be encrypted in the target smart card data fields to be exported. The target smart card data fields are key fields, that is, the personal identification code decoding key and other keys contained in the smart card data fields.

[0028] The personalized data generation configuration page also has independent input data area and output data area; the input data area is used to receive batch write data to be written to the smart card.

[0029] Accordingly, after visually displaying the personalized data generation configuration page, the method further includes: S1101, In response to the verification conversion trigger command, perform a validity check on the batch write data received in the input data area.

[0030] Specifically, when a user triggers a verification and conversion command, the system performs a validity check on the batch write data received in the input data area. This validity check determines whether the batch write data conforms to preset format requirements or data rules. For example, the validity check may include data length verification, data format verification, and field integrity verification.

[0031] S1102. When verification fails, output a failure message; when verification passes, reverse the format of the batch write data and output the reverse-converted data to the output data area for display according to the preset output field configuration.

[0032] In this embodiment, if the batch card writing data fails the validity check, the system outputs a failure message; if the batch card writing data passes the validity check, the system performs a reverse format conversion on the batch card writing data, converting the batch card writing data from the smart card storage format to a readable format, and outputs the data obtained after reverse conversion to the output data area for display according to the preset output field configuration, so that users can view and verify it.

[0033] S120. Upon receiving a batch data generation instruction, obtain the target total quantity set for the total generation configuration item as the loop count, and perform loop processing.

[0034] Specifically, after the user completes the input tree configuration, output tree configuration, independent parameter configuration, and total generation configuration on the personalized data generation configuration page, they can trigger a batch data generation command by clicking the generate button. Upon receiving the batch data generation command, the system retrieves the target total quantity set by the user from the total generation configuration item. This target total quantity is used as the loop count for this processing iteration, and the loop processing is executed according to this loop count to generate a set of smart card personalized data in each loop.

[0035] For example, if the total number of generated data is configured to be 10, the system will use this as the loop count for this cycle and execute the cycle 10 times to generate 10 sets of target output smart card personalized data.

[0036] S130. During a single loop execution, the smart card data fields to be generated are selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data. Based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalized data is filtered and processed to form a set of target output smart card personalized data.

[0037] In an optional implementation of this embodiment, when the user selects the integrated circuit card identification code in the input configuration tree structure, and simultaneously sets a preset increment step size (e.g., fixed at 1) and an initial value for the integrated circuit card identification code in the step increment rule configured for the integrated circuit card identification code in the independent parameter configuration interface, during a single loop execution, the smart card data fields to be generated, selected in the input configuration tree structure, are generated according to the generation rules configured in the independent parameter configuration interface, to obtain a complete set of smart card personalized data. The specific operation performed can be as follows: S1301. In the process of generating the integrated circuit card identification code in the current cycle, if the current cycle is determined to be the first cycle, the initial value of the integrated circuit card identification code is determined as the target base value of the integrated circuit card identification code in the current cycle; otherwise, the target base value of the integrated circuit card identification code in the current cycle is obtained based on the base value of the integrated circuit card identification code generated in the previous cycle and the preset incremental step size.

[0038] The current loop round refers to the loop processing round that is currently being executed, which corresponds to the generation of a set of smart card personalized data. The first round is the first round of loop processing. The integrated circuit card identification code consists of a target base value and a verification value calculated based on the target base value.

[0039] Specifically, the target base value of the integrated circuit card identification code in the first round of the loop processing is the initial value input by the user. In each subsequent round, the target base value of the integrated circuit card identification code generated is increased by a preset step size based on the previous round. This facilitates the calculation of the verification value for each round and ensures that the batch-generated integrated circuit card identification codes are different from each other and are ordered.

[0040] S1302. Obtain the current numeric value at the current data position in the target base value in order from right to left; S1303. Determine whether the current data position is an odd or even position. If the current data position is an odd position, execute S1304; if the current data position is an even position, keep the current numerical value unchanged and execute S1306.

[0041] S1304. Multiply the current numerical value by 2 and determine whether the product is a two-digit number. If yes, proceed to S1305; otherwise, use the product as the new current numerical value and proceed to S1306. S1305. Add the units digit and tens digit of the two-digit number together and use the sum as the new current number value; S1306. After adding the current numerical value to the currently maintained cumulative sum, the result of the addition is used to update the new cumulative sum, wherein the cumulative sum is initialized to 0. S1307. Determine whether the processing of all numbers in the target base value has been completed: if yes, execute S1308; otherwise, return to execute S1302.

[0042] S1308. Calculate the one-bit check value corresponding to the current cumulative summation value based on the Rune algorithm.

[0043] Specifically, return to execution S1302, retrieve the current numeric value at the next data position in the target base value from right to left, and repeat the processing of S1303 to S1306 until all numbers in the target base value have been processed, obtaining the final accumulated sum. A check value corresponding to the accumulated sum is then calculated based on the Rune algorithm.

[0044] For example, the sum of the accumulated values ​​is modulo 10 to obtain the remainder; the remainder is subtracted from 10 to obtain the check value; if the check value is 10, then the check value is set to 0.

[0045] S1309. Append the check value to the end of the target base value to obtain the integrated circuit card identification code for the current cycle, which serves as a smart card personalization data.

[0046] Specifically, when a user selects only the IC card identification code in the input configuration tree structure, the complete set of smart card personalization data obtained after each cycle will only include that IC card identification code. However, when a user selects both the IC card identification code and the first and second personal identification codes in the personal identification code section of the input configuration tree structure, the complete set of smart card personalization data obtained after each cycle will simultaneously include the IC card identification code, the first personal identification code, and the second personal identification code.

[0047] The check value is appended to the end of the target base value to obtain the integrated circuit card identification code for the current cycle.

[0048] In another optional implementation of this embodiment, after the user selects the integrated circuit card identification code in the output configuration tree structure, the set of smart card personalized data is filtered according to the smart card data fields to be exported selected in the output configuration tree structure to form a set of target output smart card personalized data, which may include: S1310. Detect whether the total number of bytes of the integrated circuit card identification code reaches the preset total number of bytes. If not, use the preset value to perform half-byte padding on the last bit of the integrated circuit card identification code to obtain an integrated circuit card identification code that meets the total number of bytes requirement.

[0049] The preset total number of bytes is fixed at 10 bytes. For example, after obtaining the integrated circuit card identification code "8945707257251104220" for the current cycle, if the total number of bytes of the integrated circuit card identification code is detected to be 9.5 bytes and the preset value is F, a half-byte F is added to the end to obtain "8945707257251104220F" to meet the total number of bytes requirement, and subsequent BCD reversal processing is performed.

[0050] S1311. In the obtained integrated circuit card identification code, the high and low half-bytes are swapped in units of each byte to obtain the BCD-reversed integrated circuit card identification code, which is output as a target smart card personalization data.

[0051] For example, the filled integrated circuit card identification code is "8945707257251104220F". The high and low half-bytes are swapped in units of each byte to get "985407277552114022F0", which is the integrated circuit card identification code after BCD flipping, to ensure that the smart card can correctly read the integrated circuit card identification code.

[0052] Similarly, when the user only selects the integrated circuit card identification code in the output configuration tree structure, the complete set of target output smart card personalization data obtained after each cycle will only include that integrated circuit card identification code. When the user selects both the integrated circuit card identification code and the first and second personal identification codes in the personal identification code in the output configuration tree structure, the complete set of target output smart card personalization data obtained after each cycle will simultaneously include the integrated circuit card identification code, the first personal identification code, and the second personal identification code.

[0053] In a specific example, the user selects the integrated circuit card identification code in both the input configuration tree structure and the output configuration tree structure on the personalized data generation configuration page, and sets its initial value to "892420156058898501" in the independent parameter configuration interface, while setting the total generation configuration item to 10.

[0054] During the first iteration of the loop, the target base value "892420156058898501" is processed digit by digit from right to left, resulting in a cumulative sum of 77. A check value of 3 is calculated using the Rune algorithm and appended to the end of the target base value to obtain the integrated circuit card identification code "8924201560588985013" for the first loop.

[0055] Assuming the preset total number of bytes is fixed at 10 bytes, and the detected total number of bytes is 9.5 bytes, which is less than 10 bytes, a half-byte F is added to the end of the code using a preset value F to make it meet the total number of bytes requirement. The padded integrated circuit card identification code is then grouped into two-bit sets, with the high and low half-bytes swapped, ultimately generating a byte sequence "984202510685985810F3" that conforms to the smart card storage format. This sequence is then output as a target of the smart card's personalized data.

[0056] In another optional implementation of this embodiment, the set of smart card personalized data is filtered according to the smart card data fields to be exported selected in the output configuration tree structure to form a set of target output smart card personalized data, which may further include: Based on the smart card data fields to be exported, the group of smart card personalization data is filtered to obtain the filtered smart card data fields.

[0057] Specifically, based on the smart card data fields to be exported selected by the user in the output configuration tree structure, the personalized smart card data of the current cycle is filtered, retaining the smart card data fields to be exported and removing the smart card data fields that do not need to be exported, thus obtaining the filtered smart card data fields.

[0058] Sort the smart card data fields according to the current configuration node arrangement order in the output configuration tree structure to obtain the sorted smart card data fields. Specifically, the node arrangement order in the output configuration tree structure can be adjusted using the order adjustment control; the system obtains the currently configured node arrangement order in the output configuration tree structure, sorts each filtered smart card data field according to the currently configured node arrangement order, so that the order of each filtered smart card data field is consistent with the currently configured node arrangement order, and obtains each sorted smart card data field.

[0059] In each sorted smart card data field, the key fields selected in the key encryption configuration interface are encrypted, while the other unselected key fields are output in plaintext, forming a set of target output smart card personalized data.

[0060] Specifically, in each sorted smart card data field, identify each key field belonging to other key types; for the key fields that have been selected in the key encryption configuration interface, encrypt them according to the preset encryption algorithm; combine the encrypted key fields, the key fields that keep the plaintext output, and other non-key fields to form a set of target output smart card personalized data for the current cycle.

[0061] S140. After the loop ends, export the personalized data of the smart card for each group of target outputs.

[0062] Specifically, after completing all iterations according to the target total quantity, the system obtains multiple sets of target output smart card personalized data corresponding to each iteration. These multiple sets of target output smart card personalized data are then exported to obtain the smart card personalized data generated in this batch.

[0063] The technical solution of this invention, in response to a batch generation request for personalized smart card data, provides a visual display of the personalized data generation configuration page; upon receiving a batch data generation instruction, it performs loop processing according to the total generation amount; in each loop, according to the configured generation rules, it generates a complete set of personalized smart card data based on the input configuration tree structure, and filters a set of target output personalized smart card data based on the output configuration tree structure; after the loop ends, it exports each set of target output personalized smart card data. This solves the problems of cumbersome manual operation and error-prone calculation in personalized smart card production, realizes automatic batch generation and export of personalized parameters, improves the convenience of configuration operation, and helps ensure the accuracy of parameter data in batch production scenarios.

[0064] Figure 2 This is a processing interaction diagram of smart card data applicable to Embodiment 1 of the present invention, such as... Figure 2 As shown, after a user initiates a batch generation request for smart card personal data, the system displays a personal data generation configuration page in the form of a visual page. After the user completes various configurations on the personal data generation configuration page, the batch data generation command is triggered.

[0065] The input configuration tree structure includes multiple nodes with checkboxes, each corresponding to a smart card data field. Users select the smart card data fields to be generated in this batch by checking the nodes. The output configuration tree structure also includes multiple nodes with checkboxes, each corresponding to a smart card data field. Users select the smart card data fields to be exported in this batch by checking the nodes. Users configure the total quantity of personalized smart card data required for this batch generation in the total generation configuration item. The system iterates using the target total quantity as the loop count. In each loop, the selected fields to be generated are generated according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of personalized smart card data. This data is then filtered according to the selected export fields in the output configuration tree structure to form a target set of personalized smart card data for output. After the loop ends, the system exports all sets of target personalized smart card data.

[0066] Example 2 Figure 3This is a flowchart illustrating a smart card data processing method according to Embodiment 2 of the present invention. This embodiment is a specific implementation of the STK message parsing and debugging process. Specifically, the smart card data processing method in this embodiment further includes the STK message parsing and debugging process. Figure 3 As shown, the method includes: S310, in response to command parsing requests in smart card development and debugging scenarios, provides a visual display of the command parsing page; wherein, the command parsing page includes a command input box and a parsing tree display interface.

[0067] Specifically, when a user needs to parse input commands during smart card development and debugging, a command parsing request is initiated. In response to this request, the system displays the command parsing page to the user in a visual format.

[0068] S320. When a command parsing instruction is received, the command to be parsed is obtained from the command input box, wherein the command to be parsed is a hexadecimal instruction stream of a TLV data structure; The TLV data structure consists of three parts: tag, length, and value. The tag is used to identify the data type, the length is used to indicate the number of bytes occupied by the value, the value is the actual data content, and the value can be nested within the TLV data structure.

[0069] Specifically, the command parsing interface is equipped with a command input box. When the user triggers a command parsing instruction, the system responds to the command parsing instruction and obtains the command to be parsed from the command input box.

[0070] S330. From the hexadecimal instruction stream, obtain the current processing byte corresponding to the tag attribute one by one.

[0071] The currently processed byte is initialized to the first byte of the hexadecimal instruction stream.

[0072] Specifically, according to the fixed order of the TLV data structure, the tag, length, and value are read sequentially from the hexadecimal instruction stream; the current processing byte is initialized to the first byte of the hexadecimal instruction stream, that is, the first byte is the first tag in the TLV data structure.

[0073] S340. Obtain the target tag corresponding to the currently processed byte, and query the preset protocol rules to determine whether the value corresponding to the target tag is internally nested with a TLV data structure; The protocol rules define the tag value, tag name, and structural attributes corresponding to each tag; the structural attributes are used to characterize whether nested lower-level TLV data structures are allowed within the value range of the tag.

[0074] Specifically, using the target tag as the query condition, the pre-configured protocol rules are queried to determine whether the value corresponding to the target tag contains a nested TLV data structure. If the value corresponding to the target tag contains a nested TLV data structure, the value needs to be recursively parsed.

[0075] In a specific example, the hexadecimal instruction stream "D0108103010101820281829205013F002FE2" is parsed to obtain the target tag D0 corresponding to the currently processed byte. Based on the target tag, the protocol rules based on ETSI TS 102223 are queried, and it is found that the tag name corresponding to the target tag D0 is an active command. At the same time, the structural attributes corresponding to the tag D0 are read, and it is determined that the internal nested lower-level TLV data structure of the value corresponding to the target tag is determined. Then, the recursive parsing of the value corresponding to the target tag is continued.

[0076] S350. In the hexadecimal instruction stream, continue to obtain the next byte of the currently processed byte as the length judgment byte. The length in the TLV includes the length judgment byte and the length value. The length judgment byte is used to determine the encoding method of the length value and the number of bytes occupied by the length value.

[0077] S360. Determine whether the highest bit of the length judgment byte is 0 or 1. If it is 0, use the value of the length judgment byte as the length value; if it is 1, continue to obtain the value of the next byte of the length judgment byte in the hexadecimal instruction stream as the length value.

[0078] For example, if the length judgment byte is 0x10, which corresponds to 00010000 in binary and the highest bit is 0, then the length value is 0x10, which means that the value of the target tag D0 occupies a total of 16 bytes.

[0079] S370. Continue to obtain at least one byte that matches the length value from the hexadecimal instruction stream, as the value corresponding to the target tag.

[0080] For example, continuing from the previous example, if the length of the target label is 16 bytes, then 16 consecutive bytes “8103010101820281829205013F002FE2” will be read from the instruction stream as the value corresponding to the target label D0.

[0081] S380. Based on the judgment result of whether the value corresponding to the target label is internally nested with a TLV data structure, perform regular or recursive parsing on the value corresponding to the target label to obtain the parsing result that matches the target label.

[0082] For example, continuing from the previous example, "8103010101820281829205013F002FE2" is recursively parsed because it contains a nested TLV data structure, yielding sub-tags 81, 82, and 92. For sub-tag 81, whose value does not contain a nested TLV, the value of 81 is parsed in a regular manner.

[0083] S390. Determine whether the complete processing of the hexadecimal instruction stream is complete: if yes, execute S3100; otherwise, return to execute S330.

[0084] Specifically, after parsing each TLV data structure, the process returns to execution S330 to read the current processing byte of the next tag in the current hexadecimal instruction stream, until the complete processing of the hexadecimal instruction stream is completed.

[0085] S3100. After processing, the parsing results of each tag are organized into a tree structure diagram, and the tree structure diagram is displayed in the parsing tree display interface.

[0086] The tree structure consists of multiple label nodes, each of which contains a label element, a length element, and a value element. The value element contains a single value or nested label nodes.

[0087] The parsing tree display interface provides the ability to edit the values ​​of each label node in the tree structure diagram.

[0088] Accordingly, after displaying the tree structure diagram in the parsing tree display interface, the method further includes: S3101, In response to the instruction to modify the target value element in the target label node of the tree structure diagram, starting from the target label node, recalculate the true length of the value of each upstream label node level by level upwards in the tree structure diagram.

[0089] Specifically, the parse tree allows users to modify the value elements of any tag node. When a user-triggered modification instruction is received for the target value element under the target tag node, the tree traverses all upstream ancestor tag nodes upwards from the target tag node that has been modified, recalculating the true length of the value range of each upstream tag node at each level.

[0090] S3102. Determine whether the actual length corresponding to the currently calculated target upstream label node is greater than the preset length threshold: if so, encode the length field of the target upstream label node according to the preset encoding rules to obtain multiple length fields corresponding to the target upstream label node; otherwise, directly use the actual length as the length field of the target upstream label node.

[0091] The preset encoding rule is the long format encoding rule in the BER-TLV encoding rule, that is, the length field contains two bytes, the highest bit of the first byte is 1, and the next byte is the actual length corresponding to a target upstream tag node.

[0092] Specifically, starting from the target tag node that has been modified, it is determined whether the actual length of the value corresponding to the target tag is greater than a preset length threshold. If it is greater than the preset length threshold, the length value is encoded in long format, and all length fields of the upstream tag nodes of the target are updated level by level. If the actual length of the value corresponding to the target tag is less than the preset length threshold, then according to the short format encoding rule, the actual length is directly used as the length field of the upstream tag node of the target, that is, the length field occupies 1 byte.

[0093] S3103. Reorganize the updated hexadecimal instruction stream according to the length field corresponding to each tag node, and output the update result.

[0094] Specifically, the length field of each tag node is updated and the original tag and value are updated again to generate a new hexadecimal instruction stream and output it.

[0095] The technical solution of this invention, in response to command parsing requests in smart card development and debugging scenarios, visualizes the command parsing page; it sequentially obtains the current processing byte corresponding to a tag attribute from the hexadecimal instruction stream; it obtains the target tag corresponding to the current processing byte and queries preset protocol rules, automatically determining whether the tag nests a TLV and performing corresponding parsing, thus reducing the professional knowledge threshold for engineers; based on the judgment result of whether the value corresponding to the target tag internally nests a TLV data structure, it performs regular or recursive parsing on the value corresponding to the target tag to obtain the parsing result matching the target tag. The parsing results of each tag obtained after processing are organized into a tree structure diagram, which is displayed in the parsing tree display interface, solving the problem of long product development and testing cycles and helping to improve the debugging efficiency of development and testing personnel.

[0096] In a specific example, the system receives a hexadecimal command stream "D0108103010101820281829205013F002FE2" input by the user through the user interface. It identifies the first byte as 0xD0 and determines the command as an "active command" based on preset protocol rules. Subsequently, it obtains the length field 0x10, confirming that the subsequent value occupies 16 bytes. Following the TLV structure, it recursively decomposes the subsequent structure: encountering a sub-label of 0x81 (Command details), it parses the subsequent bytes to obtain the command code 0x01, command type 0x01, and command qualifier 0x01; encountering a sub-label of 0x82 (Deviceidentities), it analyzes to obtain the starting device 0x81 and the destination device 0x82; encountering a sub-file of 0x92 (File list), it parses to obtain the number of files 0x01 and the file 3F002FE2.

[0097] Example 3 Figure 4 This is a flowchart of a smart card data processing method provided in Embodiment 3 of the present invention. This embodiment is a refinement based on the above embodiments. Specifically, the smart card data processing method in this embodiment further includes an encoding conversion process. Figure 4 As shown, the method includes: S410: In response to the batch generation request of smart card personalized data, the personalized data generation configuration page is displayed visually.

[0098] S420. Upon receiving a batch data generation instruction, obtain the target total quantity set for the total generation configuration item as the loop count, and perform loop processing.

[0099] S430. During a single loop execution, the smart card data fields to be generated are selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data. Based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalized data is filtered and processed to form a set of target output smart card personalized data.

[0100] S440. After the loop ends, export the personalized data of the smart card for each group of target outputs.

[0101] S450 responds to encoding conversion requests in smart card message debugging scenarios by visually displaying the encoding conversion configuration page, which includes a data input area, multiple conversion type selection controls, and a conversion result output area.

[0102] The data input area is used to receive or input data to be converted, the conversion type selection control is an interactive control for users to select the specific encoding conversion direction, and the conversion result output area is used to display the conversion result.

[0103] Specifically, in the smart card message debugging scenario, when a user initiates an encoding conversion request, an encoding conversion configuration page is displayed to the user visually. On the encoding conversion configuration page, the user can enter the data to be converted in the data input area, issue a confirmation conversion command under the conversion type control, and view the conversion result in the conversion result output area.

[0104] S460. Upon receiving a confirmation conversion instruction, obtain the target conversion type selected by the conversion type selection control and at least one piece of data to be converted that has been entered into the data input area.

[0105] The target conversion type is the conversion direction selected by the user in the conversion type selection control, and the data input area includes at least one piece of data to be converted entered by the user.

[0106] In this embodiment, after the user completes data input and selects the conversion type on the encoding conversion configuration page, they trigger a confirmation conversion instruction by clicking the conversion button. Upon receiving the confirmation conversion instruction, the system obtains the target conversion type currently selected by the user, and simultaneously retrieves one or more pieces of data to be converted from the data input area.

[0107] S470. In the pre-configured set of transformation logics, obtain the target transformation logic that matches the target transformation type, and use the target transformation logic to transform each data to be transformed into the matching target transformation data.

[0108] The pre-configured set of conversion logic includes bidirectional conversion logic between strings and ASCII encoding, bidirectional conversion logic between strings and GB2312 encoding, packing and unpacking logic between strings and 7-bit encoding, packing and unpacking logic between GSM / CDMA 8-bit and 7-bit encoding, bidirectional conversion logic between strings and UCS2, bidirectional conversion logic between UCS2 encoding 80 format and 81 / 82 format, bidirectional conversion logic between strings and BCD encoding, conversion logic between PLMN and SIM / OPLMN format, DES / 3DES / AES encryption conversion logic, and data separation logic.

[0109] The ASCII and GB2312 conversion logic is used for viewing and editing text data; the 7-bit encoding packing and unpacking logic is used for encoding and decoding SMS content under the GSM or CDMA standards. GSM and CDMA are two mobile communication standards, and their SMS content is usually compressed and transmitted using 7-bit encoding, that is, each character is represented by 7 binary bits. Packing saves transmission space, and unpacking restores the compressed data to the original characters. The bidirectional conversion logic between the string and UCS2 encoding is used for encoding and decoding Chinese data. UCS2 is a character encoding method that uses 2 bytes to represent one character, with each character occupying a fixed 2 bytes, and can represent various characters including Chinese characters. For example, when reading data from a smart card, the UCS2 encoding is converted into a readable string for the user to view; when writing data to the smart card, the user-edited string is converted into UCS2 encoding and written to the smart card. The UCS2 and its 80 / 81 / 82 format conversion logic is used for encoding and decoding data using UCS2 encoding, such as contact names in a phone book. The UCS2 80 format is the standard UCS2 format; the UCS2 81 format extracts the high-order bytes of all characters as a common base address, storing only the low-order bytes of each character; the UCS2 82 format calculates a 16-bit base address, storing each character as an offset relative to that base address. When storage space needs to be saved, the 80 format is compressed into the 81 or 82 format; when reading is needed, the 81 or 82 format is decompressed back to the 80 format.

[0110] The bidirectional conversion logic between the string and BCD encoding is used for encoding and decoding digital data such as telephone numbers and integrated circuit card identification codes. BCD encoding is a method of representing one decimal digit using 4 binary bits. The bidirectional conversion logic includes converting a digital string to BCD encoding and converting BCD encoding to a digital string. The conversion logic between PLMN and SIM / OPLMN formats is used for encoding and decoding network identification data. PLMN stands for Public Land Mobile Network, composed of a mobile country code and a mobile network code; SIM format is the format for storing network identifiers in a smart card; OPLMN is the operator network list format. The conversion logic includes converting PLMN encoding to SIM card storage format or OPLMN format, and restoring SIM card storage format or OPLMN format back to PLMN encoding. The DES / 3DES / AES encryption conversion logic is used for calculating the key verification value. Specifically, after receiving the key data, according to the user-selected DES / 3DES or AES algorithm, the key data is encrypted using preset data, and the preset length bytes in the encryption result are used as the key verification value to verify the correctness of the key. The data separation logic is used to split composite data into multiple independent data according to preset rules. The preset rules include finding delimiters by byte and truncating data segments by preset length; the system splits the input composite data into multiple independent data segments according to the delimiters and segment lengths configured by the user, so that each data segment can be viewed and processed separately.

[0111] Specifically, from the pre-configured set of conversion logics, the target conversion logic selected by the user is obtained, and the target conversion logic is used to convert each piece of data to be converted into matching target conversion data.

[0112] S480. Display the transformation data of each target in the transformation result output area.

[0113] Specifically, after the encoding conversion is completed, the system will display the converted data of each target in the conversion result output area for users to view and copy.

[0114] The technical solution of this invention, in response to encoding conversion requests in smart card message debugging scenarios, provides a visual display of the encoding conversion configuration page; acquires the target conversion type selected through the conversion type selection control and at least one piece of data to be converted input into the data input area; uses target conversion logic to convert each piece of data to be converted into matching target conversion data, providing a unified encoding conversion; and displays each piece of target conversion data in the conversion result output area, improving the convenience of configuration operations. This significantly reduces the operational complexity of smart card message debugging and improves the efficiency and accuracy of encoding conversion.

[0115] It should be noted that the encoding conversion process in this embodiment is related to the STK message parsing and debugging process in Embodiment 2. During the STK message parsing and debugging process, the encoding method of some parsed tag values ​​can be determined according to the protocol specification and decoded. The encoding method includes at least one of ASCII, UCS2, 7-bit encoding, and BCD. Accordingly, the conversion logic between ASCII encoding and strings, the conversion logic between UCS2 encoding and strings, the conversion logic between UCS2 encoding 80 format and 81 / 82 format, the packing and unpacking logic between 7-bit encoding and strings, and the conversion logic between BCD encoding and strings in the pre-configured conversion logic set can be used to perform encoding conversion on the parsed tag values ​​during the STK message parsing and debugging process, converting the tag values ​​into readable strings, thereby reusing the encoding conversion capability in the parsing and debugging scenario.

[0116] Example 4 Figure 5 This is a schematic diagram of a smart card data processing device provided in Embodiment 4 of the present invention. Figure 5 As shown, the device includes: a personalized data response module 510, a batch data loop processing module 520, a personalized data generation and filtering module 530, and a batch data export module 540.

[0117] The personalized data response module 510 is used to respond to batch generation requests for smart card personalized data and to provide a visual display of the personalized data generation configuration page; The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. The batch data loop processing module 520 is used to obtain the target total quantity set for the total quantity configuration item as the loop count when a batch data generation instruction is received, and to perform loop processing. The personalized data generation and filtering module 530 is used to generate, in a single loop execution process, the smart card data fields to be generated selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, to obtain a complete set of smart card personalized data, and to filter the set of smart card personalized data according to the smart card data fields to be exported selected in the output configuration tree structure, to form a set of target output smart card personalized data. The batch data export module 540 is used to export the personalized data of each group of target output smart cards after the loop ends.

[0118] The technical solution of this invention, in response to a batch generation request for personalized smart card data, provides a visual display of the personalized data generation configuration page; upon receiving a batch data generation instruction, it performs loop processing according to the total generation amount; in each loop, according to the configured generation rules, it generates a complete set of personalized smart card data based on the input configuration tree structure, and filters a set of target output personalized smart card data based on the output configuration tree structure; after the loop ends, it exports each set of target output personalized smart card data. This solves the problems of cumbersome manual operation and error-prone calculation in personalized smart card production, realizes automatic batch generation and export of personalized parameters, improves the convenience of configuration operation, and helps ensure the accuracy of parameter data in batch production scenarios.

[0119] Based on the above embodiments, the personalized data generation configuration page also includes an order adjustment control that matches the output configuration tree structure and a key encryption configuration interface; the order adjustment control is used to adjust the arrangement order of each node in the output configuration tree structure, and the key encryption configuration interface is used to select the fields that need to be encrypted in the target smart card data fields to be exported, where the target smart card data fields belong to the key fields.

[0120] Correspondingly, the personalized data generation and filtering module 530 may specifically include: The personalized data filtering unit is used to filter the group of smart card personalized data according to the smart card data fields to be exported, and obtain each filtered smart card data field. The data field sorting unit is used to sort each filtered smart card data field according to the current configuration node arrangement order in the output configuration tree structure, so as to obtain each sorted smart card data field. The target personalized data output unit is used to encrypt each key field selected in the key encryption configuration interface in each sorted smart card data field, while keeping the other unselected key fields in plaintext output, forming a set of target output smart card personalized data.

[0121] Based on the above embodiments, the personalized data generation configuration page also includes independent input data area and output data area; the input data area is used to receive batch write data to be written to the smart card. Accordingly, the device may further include: an input data area verification unit, used for: After visually displaying the personalized data generation configuration page, in response to the verification conversion trigger command, the legality verification of the batch card writing data received in the input data area is performed. When verification fails, a failure message is output; when verification passes, the batch write data is reverse formatted and the reverse-formatted data is output to the output data area for display according to the preset output field configuration.

[0122] Based on the above embodiments, the smart card data fields include an integrated circuit card identification code, an international mobile subscriber identification code, a personal identification code, a personal identification code decoding key, other keys, and an administrator code; the personal identification code includes a first personal identification code and a second personal identification code, the personal identification code decoding key includes a first personal identification code decoding key and a second personal identification code decoding key, and other keys include a user authentication key, an operator authentication key, an over-the-air download key, and an application key. For integrated circuit card identification codes and international mobile subscriber identification codes, the generation rules that can be configured in the independent parameter configuration interface include step increment rules, and an initial value can also be configured in the independent parameter configuration interface as the starting value of the step increment rule; For Personal Identification Code, Personal Identification Code Decoding Key, and Administrator Code, the configurable generation rules in the independent parameter configuration interface include fixed value rules and random generation rules; the configurable generation formats in the independent parameter configuration interface include any one of decimal ASCII encoding format, hexadecimal ASCII encoding format, and hexadecimal number format.

[0123] For other keys, the generation rules that can be configured in the independent parameter configuration interface include fixed key rules and random key generation rules.

[0124] Based on the above embodiments, when the integrated circuit card identification code is selected in the input configuration tree structure, the step increment rule configured for the integrated circuit card identification code in the independent parameter configuration interface includes a preset increment step size and an initial value of the integrated circuit card identification code. Correspondingly, the personalized data generation and filtering module 530 may further include: The integrated circuit card identification code target base value determination unit is used to determine the initial value of the integrated circuit card identification code as the target base value of the integrated circuit card identification code in the current cycle if the current cycle is determined to be the first cycle; otherwise, the target base value of the integrated circuit card identification code in the current cycle is obtained based on the base value of the integrated circuit card identification code generated in the previous cycle and the preset incremental step size. The integrated circuit card identification code verification value generation unit is used for: Retrieve the current numeric value at the current data position in the target base value in order from right to left; If the current data position is an odd number, multiply the current number value by 2 and determine whether the product result is a two-digit number. If so, add the units and tens digits of the two-digit number together and use the sum as the new current number value; otherwise, use the product as the new current number value. If the current data position is an even number, then keep the current numeric value unchanged; After adding the current numerical value to the currently maintained cumulative sum, the result is used to update the new cumulative sum, where the cumulative sum is initialized to 0. The process returns to the previous step, sequentially retrieving the current digit value at each data position in the target base value from right to left, until all digits in the target base value have been processed. Then, a checksum corresponding to the current accumulated sum is calculated using the Rune algorithm. This checksum is appended to the end of the target base value to obtain the integrated circuit card identification code for the current loop round, serving as a piece of smart card personalization data.

[0125] Based on the above embodiments, the integrated circuit card identification code is selected in the output configuration tree structure; Correspondingly, the personalized data generation and filtering module 530 may further include: The integrated circuit card identification code acquisition unit is used to acquire the integrated circuit card identification code contained in the target output smart card personal data according to the field format configuration information corresponding to the output configuration tree structure after each cycle of forming a set of target output smart card personal data; The integrated circuit card identification code detection and filling unit is used to detect whether the total number of bytes of the integrated circuit card identification code reaches the preset total number of bytes. If not, the last digit of the integrated circuit card identification code is padded with half a byte using the preset value to obtain an integrated circuit card identification code that meets the total number of bytes requirement. The integrated circuit card identification code format reversal processing unit is used to perform high and low half-byte swapping on a byte-by-byte basis in the filled integrated circuit card identification code to obtain the BCD-reversed integrated circuit card identification code, which is then output as a target of smart card personalization data.

[0126] Based on the above embodiments, a command parsing and response module may also be included, used for: In response to command parsing requests in smart card development and debugging scenarios, the command parsing page is visualized; the command parsing page includes a command input box and a parsing tree display interface. When a command parsing instruction is received, the command to be parsed is obtained from the command input box. The command to be parsed is a hexadecimal instruction stream of a TLV data structure. From the hexadecimal instruction stream, obtain one current processing byte corresponding to the tag attribute in sequence, wherein the current processing byte is initialized to the first byte of the hexadecimal instruction stream; Obtain the target tag corresponding to the currently processed byte, query the preset protocol rules, and determine whether the value corresponding to the target tag contains a nested TLV data structure; In the hexadecimal instruction stream, continue to obtain the next byte after the currently processed byte as the length judgment byte; If the highest bit of the length judgment byte is 0, then the value of the length judgment byte is used as the length value; if the highest bit of the length judgment byte is 1, then the value of the next byte after the length judgment byte in the hexadecimal instruction stream is obtained as the length value. Continue to acquire at least one byte that matches the length value from the hexadecimal instruction stream, as the value corresponding to the target label; Based on the judgment result of whether the value corresponding to the target label is nested within a TLV data structure, the value corresponding to the target label is parsed in a regular or recursive manner to obtain the parsing result that matches the target label. Return to the operation of retrieving the current processing byte corresponding to the tag attribute from the hexadecimal instruction stream one by one, until the complete processing of the hexadecimal instruction stream is completed; After processing, the parsing results of each tag are organized into a tree structure diagram, which is then displayed in the parsing tree display interface. The tree structure consists of multiple label nodes, each of which contains a label element, a length element, and a value element. The value element contains a single value or nested label nodes.

[0127] Based on the above embodiments, the parsing tree display interface provides the function of editing the values ​​of each label node in the tree structure diagram; Correspondingly, the command parsing response module can also be used for: After displaying the tree structure diagram in the parsing tree display interface, in response to the modification instruction of the target value element in the target label node in the tree structure diagram, starting from the target label node, the true length of the value of each upstream label node is recalculated level by level upward along the tree structure diagram. If the actual length corresponding to the target upstream label node currently being calculated is greater than the preset length threshold, then the length field of the target upstream label node is encoded according to the preset encoding rules to obtain multiple length fields corresponding to the target upstream label node. If the actual length corresponding to the target upstream label node currently being calculated is less than or equal to the preset length threshold, then the actual length is directly used as the length field of the target upstream label node. Based on the length field corresponding to each tag node, reorganize to generate an updated hexadecimal instruction stream and output the update result.

[0128] Based on the above embodiments, it may further include an encoding conversion response module, used for: In response to encoding conversion requests in smart card message debugging scenarios, the encoding conversion configuration page is visualized; the encoding conversion configuration page includes a data input area, multiple conversion type selection controls, and a conversion result output area; Upon receiving a confirmation conversion instruction, obtain the target conversion type selected through the conversion type selection control and at least one piece of data to be converted that has been entered into the data input area; From the pre-configured set of transformation logics, obtain the target transformation logic that matches the target transformation type, and use the target transformation logic to transform each piece of data to be transformed into the matching target transformation data; The transformed data for each target will be displayed in the output area of ​​the transformation results.

[0129] The smart card data processing device provided in the embodiments of the present invention can execute the smart card data method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0130] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0131] Example 5 Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0132] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory 12 or a random access memory 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 12 or loaded from storage unit 18 into the random access memory 13. The random access memory 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, read-only memory 12, and random access memory 13 are interconnected via a bus 14. An input / output interface 15 is also connected to the bus 14.

[0133] Multiple components in electronic device 10 are connected to input / output interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0134] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performing a smart card data processing method as described in any embodiment of the present invention, i.e.: In response to the batch generation request of smart card personalized data, the personalized data generation configuration page is displayed visually; The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. Upon receiving a batch data generation instruction, the target total quantity set for the total generation configuration item is obtained as the loop count, and loop processing is executed. During a single loop execution, the smart card data fields to be generated are selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data. Based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalized data is filtered to form a set of target output smart card personalized data. After the loop ends, export the personalized smart card data for each group of target outputs.

[0135] In some embodiments, a smart card data processing method as described in any embodiment of the present invention can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by processor 11, one or more steps of the smart card data processing method described above as described in any embodiment of the present invention can be performed. Alternatively, in other embodiments, processor 11 can be configured by any other suitable means (e.g., by means of firmware) to perform a smart card data processing method as described in any embodiment of the present invention.

[0136] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in a computer program product comprising one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0137] The computer programs included in the computer program product for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, partially on a remote machine as a standalone software package, or entirely on a remote machine or server.

[0138] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0139] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0140] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0141] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0142] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for processing smart card data, characterized in that, The method includes: In response to the batch generation request of smart card personalized data, the personalized data generation configuration page is displayed visually; The personalized data generation configuration page includes an input configuration tree structure, an independent parameter configuration interface, an output configuration tree structure, and a total generation configuration item. Both the input and output configuration tree structures include multiple nodes with checkboxes, with each node corresponding to a smart card data field. The independent parameter configuration interface is used to configure the generation rules or format of the smart card data fields that have been checked in the input configuration tree structure. It also allows configuring initial values ​​for the checked smart card data fields. The total generation configuration item is used to configure the total number of personalized smart card data fields that need to be generated in batches. Upon receiving a batch data generation instruction, the target total quantity set for the total generation configuration item is obtained as the loop count, and loop processing is executed. During a single loop execution, the smart card data fields to be generated are selected in the input configuration tree structure according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data. Based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalized data is filtered to form a set of target output smart card personalized data. After the loop ends, export the personalized smart card data for each group of target outputs.

2. The method according to claim 1, characterized in that, The personalized data generation configuration page also includes an order adjustment control that matches the output configuration tree structure and a key encryption configuration interface; the order adjustment control is used to adjust the arrangement order of each node in the output configuration tree structure, and the key encryption configuration interface is used to select the fields that need to be encrypted in the target smart card data fields to be exported. The target smart card data fields belong to the key fields. Accordingly, based on the smart card data fields to be exported selected in the output configuration tree structure, the set of smart card personalization data is filtered to form a set of target output smart card personalization data, including: Based on the smart card data fields to be exported, the group of smart card personalization data is filtered to obtain each filtered smart card data field; Sort the smart card data fields according to the current configuration node arrangement order in the output configuration tree structure to obtain the sorted smart card data fields. In each sorted smart card data field, the key fields selected in the key encryption configuration interface are encrypted, while the other unselected key fields are output in plaintext, forming a set of target output smart card personalized data.

3. The method according to claim 1, characterized in that, The personalized data generation configuration page also has independent input data areas and output data areas; the input data area is used to receive batch write data to be written to the smart card. Accordingly, after visually displaying the personalized data generation configuration page, the method further includes: In response to the verification conversion trigger command, perform a validity check on the batch write data received in the input data area; When verification fails, a failure message is output; when verification passes, the batch write data is reverse formatted and the reverse-formatted data is output to the output data area for display according to the preset output field configuration.

4. The method according to claim 1, characterized in that, The smart card data fields include the integrated circuit card identification code, the International Mobile Subscriber Identity Code, the Personal Identification Code, the Personal Identification Code decoding key, other keys, and the administrator code; the Personal Identification Code includes the first Personal Identification Code and the second Personal Identification Code, the Personal Identification Code decoding key includes the first Personal Identification Code decoding key and the second Personal Identification Code decoding key, and other keys include the user authentication key, the operator authentication key, the over-the-air download key, and the application key. For integrated circuit card identification codes and international mobile subscriber identification codes, the generation rules that can be configured in the independent parameter configuration interface include step increment rules, and an initial value can also be configured in the independent parameter configuration interface as the starting value of the step increment rule; For Personal Identification Code, Personal Identification Code Decoding Key, and Administrator Code, the configurable generation rules in the independent parameter configuration interface include fixed value rules and random generation rules; the configurable generation formats in the independent parameter configuration interface include any one of decimal ASCII encoding format, hexadecimal ASCII encoding format, and hexadecimal number format. For other keys, the generation rules that can be configured in the independent parameter configuration interface include fixed key rules and random key generation rules.

5. The method according to claim 4, characterized in that, When the integrated circuit card identification code is selected in the input configuration tree structure, the step increment rule configured for the integrated circuit card identification code in the independent parameter configuration interface includes the preset increment step size and the initial value of the integrated circuit card identification code. Accordingly, during a single loop execution, the smart card data fields selected in the input configuration tree structure are generated according to the generation rules configured in the independent parameter configuration interface, resulting in a complete set of smart card personalized data, specifically including: In the process of generating the integrated circuit card identification code in the current cycle, if the current cycle is determined to be the first cycle, the initial value of the integrated circuit card identification code is determined as the target base value of the integrated circuit card identification code in the current cycle; otherwise, the target base value of the integrated circuit card identification code in the current cycle is obtained based on the base value of the integrated circuit card identification code generated in the previous cycle and the preset incremental step size. Retrieve the current numeric value at the current data position in the target base value in order from right to left; If the current data position is an odd number, multiply the current number value by 2 and determine whether the product result is a two-digit number. If so, add the units and tens digits of the two-digit number together and use the sum as the new current number value; otherwise, use the product as the new current number value. If the current data position is an even number, then keep the current numeric value unchanged; After adding the current numerical value to the currently maintained cumulative sum, the result is used to update the new cumulative sum, where the cumulative sum is initialized to 0. Return to the execution and process the current number value at the current data position in the target base value in the order from right to left, until all numbers in the target base value have been processed. Then, calculate the one-bit check value corresponding to the current accumulated sum value based on the Rune algorithm. The check value is appended to the end of the target base value to obtain the integrated circuit card identification code for the current cycle, which serves as a piece of smart card personalization data.

6. The method according to claim 5, characterized in that, The integrated circuit card identification code is selected in the output configuration tree structure; Accordingly, based on the smart card data fields to be exported selected in the output configuration tree structure, the set of personalized smart card data is filtered to form a set of target output personalized smart card data, specifically including: After each cycle of forming a set of target output smart card personalized data, the integrated circuit card identification code contained in the target output smart card personalized data is obtained according to the field format configuration information corresponding to the output configuration tree structure. The total number of bytes in the integrated circuit card identification code is checked to see if it reaches the preset total number of bytes. If not, the last byte of the integrated circuit card identification code is padded with a preset value to obtain an integrated circuit card identification code that meets the total number of bytes requirement. In the obtained integrated circuit card identification code, the high and low half-bytes are swapped in each byte to obtain the BCD-reversed integrated circuit card identification code, which is then output as a target of the smart card personalization data.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: In response to command parsing requests in smart card development and debugging scenarios, the command parsing page is visualized; the command parsing page includes a command input box and a parsing tree display interface. When a command parsing instruction is received, the command to be parsed is obtained from the command input box. The command to be parsed is a hexadecimal instruction stream of a TLV data structure. From the hexadecimal instruction stream, obtain one current processing byte corresponding to the tag attribute in sequence, wherein the current processing byte is initialized to the first byte of the hexadecimal instruction stream; Obtain the target tag corresponding to the currently processed byte, query the preset protocol rules, and determine whether the value corresponding to the target tag contains a nested TLV data structure; In the hexadecimal instruction stream, continue to obtain the next byte after the currently processed byte as the length judgment byte; If the highest bit of the length judgment byte is 0, then the value of the length judgment byte is used as the length value; if the highest bit of the length judgment byte is 1, then the value of the next byte after the length judgment byte in the hexadecimal instruction stream is obtained as the length value. Continue to acquire at least one byte that matches the length value from the hexadecimal instruction stream, as the value corresponding to the target label; Based on the judgment result of whether the value corresponding to the target label is nested within a TLV data structure, the value corresponding to the target label is parsed in a regular or recursive manner to obtain the parsing result that matches the target label. Return to the operation of retrieving the current processing byte corresponding to the tag attribute from the hexadecimal instruction stream one by one, until the complete processing of the hexadecimal instruction stream is completed; After processing, the parsing results of each tag are organized into a tree structure diagram, which is then displayed in the parsing tree display interface. The tree structure consists of multiple label nodes, each of which contains a label element, a length element, and a value element. The value element contains a single value or nested label nodes.

8. The method according to claim 7, characterized in that, The parsing tree display interface provides the ability to edit the values ​​of each label node in the tree structure diagram; Accordingly, after displaying the tree structure diagram in the parsing tree display interface, the method further includes: In response to a modification instruction on the target value element in the target label node of the tree structure diagram, starting from the target label node, the true length of the value of each upstream label node is recalculated level by level upwards along the tree structure diagram. If the actual length corresponding to the target upstream label node currently being calculated is greater than the preset length threshold, then the length field of the target upstream label node is encoded according to the preset encoding rules to obtain multiple length fields corresponding to the target upstream label node. If the actual length corresponding to the target upstream label node currently being calculated is less than or equal to the preset length threshold, then the actual length is directly used as the length field of the target upstream label node. Based on the length field corresponding to each tag node, reorganize to generate an updated hexadecimal instruction stream and output the update result.

9. The method according to any one of claims 1-6, characterized in that, The method further includes: In response to encoding conversion requests in smart card message debugging scenarios, the encoding conversion configuration page is visualized; the encoding conversion configuration page includes a data input area, multiple conversion type selection controls, and a conversion result output area; Upon receiving a confirmation conversion instruction, obtain the target conversion type selected through the conversion type selection control and at least one piece of data to be converted that has been entered into the data input area; From the pre-configured set of transformation logics, obtain the target transformation logic that matches the target transformation type, and use the target transformation logic to transform each piece of data to be transformed into the matching target transformation data; The transformed data for each target will be displayed in the output area of ​​the transformation results.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the smart card data processing method according to any one of claims 1-9.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for processing smart card data as described in any one of claims 1-9.