Communication transmission method, command registration method and device
By identifying and adapting transmission strategies in the smart card operating system, the problems of unclear layering and single transmission methods in the ISO7816-3 protocol are solved, the speed and performance of smart card communication are improved, and the needs of multiple scenarios are met.
Patent Information
- Application Number
- CN202410499497.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-04-24
AI Technical Summary
The existing ISO7816-3 international standard communication protocol has problems such as unclear layering and single transmission mode in smart card communication transmission, resulting in low communication rate and performance of smart card, which cannot meet the differentiated transmission needs of special scenarios.
When receiving commands in the COS of the smart card operating system, the registered command information is used to identify the target attribute information and adapt the target transmission policy to process it according to the attribute information, including merged sending and receiving policies, pre-buffering policies, priority processing policies and multi-threaded transmission Strategy to achieve flexible transmission methods.
It improves the speed and performance of smart card communication transmission, meets the communication needs in different scenarios, realizes the precise identification and processing of commands, and has wide applicability.
Smart Images

Figure CN119071368A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication transmission, and in particular to a communication transmission method, a command registration method and a device. Background Art
[0002] At present, the international standard communication protocol ISO7816-3 is mainly used for smart card communication transmission. Compared with the existing protocols, the 7816 protocol has unclear layering, the data transmission and reception direction is tightly coupled with the application, and the command can only be communicated and transmitted after the application is specifically executed. In addition, the processing and transmission method of the command is relatively simple, which cannot meet the differentiated transmission method of special scenarios. In this way, the communication transmission rate and performance of the smart card are reduced, which cannot meet the communication needs of special scenarios and has limitations. Summary of the invention
[0003] The present disclosure is proposed in view of the above problems. The present disclosure provides a communication transmission method, a command registration method and a device.
[0004] According to a first aspect of the present disclosure, a communication transmission method is provided, which is applied to a smart card operating system COS, and includes: receiving a first command, the first command carrying at least command header information; determining target attribute information of the first command based on registered command information and command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; the command identifier is part of the information in the command header; determining a target transmission strategy adapted to the target attribute information, and forwarding the first command according to the target transmission strategy.
[0005] In addition, according to the method of the first aspect of the present disclosure, the attribute information includes at least one of the following: command type, large data volume information, time consumption, priority; the command identifier includes at least one of the following: instruction byte, class byte; registered command information is stored in a preset form; the preset form includes at least one of the following: table form, key-value pair form, data set form.
[0006] In addition, according to the method of the first aspect of the present disclosure, the registered command information includes: registered command information of at least one application; the registered command information is maintained by the COS based on the registration request of each application.
[0007] In addition, according to the method of the first aspect of the present disclosure, the method also includes: receiving a registration request from any application through a registration interface set in COS; the registration request carries attribute information and command identifier of the command to be registered; the command to be registered is customized by the application developer of the application; based on the registration request, creating or updating the registered command information corresponding to the application.
[0008] In addition, according to the method of the first aspect of the present disclosure, the target attribute information of the first command is determined based on the registered command information and the command header information, including: calling the query interface set in the COS; using the query interface to query the command header information in the registered command information, and confirming the attribute information corresponding to the command header information as the target attribute information.
[0009] In addition, according to the method of the first aspect of the present disclosure, the target attribute information of the first command is determined based on the registered command table and the command header information, including: determining the target application of the command header information based on the correspondence between the class byte and the application identifier and the class byte in the command header information; determining the target attribute information based on the registered command information and the command header information corresponding to the target application.
[0010] In addition, according to the method of the first aspect of the present disclosure, the target transmission strategy adapted to the target attribute information is determined, including: when the target attribute information indicates that the first command is a preset target type, determining that the target transmission strategy is a combined sending and receiving strategy; wherein the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined; or, the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined, and the response sending process of the instruction is combined.
[0011] In addition, according to the method of the first aspect of the present disclosure, a target transmission strategy adapted to the target attribute information is determined, including: when the target attribute information indicates that the first command carries a large data block, determining that the target transmission strategy is a pre-buffer strategy; the pre-buffer strategy indicates that a receiving buffer pool is allocated in advance for the data part of the first command.
[0012] In addition, according to the method of the first aspect of the present disclosure, determining the target transmission strategy adapted to the target attribute information includes: when the target attribute information indicates that the first command is a high priority, determining the target transmission strategy as a priority processing strategy; the priority processing strategy indicates that the first command is processed first.
[0013] In addition, according to the method of the first aspect of the present disclosure, the target transmission strategy adapted to the target attribute information is determined, including: when the target attribute information indicates that the first command is a time-consuming command, determining the target transmission strategy as a multi-threaded transmission strategy; the multi-threaded transmission strategy indicates multi-threaded transmission of the first command.
[0014] According to a second aspect of the present disclosure, a command registration method is provided, which is applied to a smart card operating system COS, and the method includes: receiving a registration request from any application through a registration interface set in COS; the registration request carries attribute information and a command identifier of a command to be registered; the command to be registered is customized by an application developer of the application; based on the registration request, creating or updating registered command information corresponding to the application.
[0015] According to the third aspect of the present disclosure, a command registration method is provided, which is applied to any application, and includes: receiving a command to be registered that is customized by an application developer; sending a registration request to a smart card operating system COS, wherein the registration request carries attribute information and a command identifier of the command to be registered.
[0016] According to the fourth aspect of the present disclosure, a communication transmission device is provided, which includes: a receiving unit, configured to receive a first command, the first command carrying at least command header information; a determination unit, configured to determine target attribute information of the first command based on registered command information and command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; the command identifier is part of the information in the command header; and a forwarding unit, configured to determine a target transmission strategy adapted to the target attribute information, and forward the first command according to the target transmission strategy.
[0017] According to a fifth aspect of the present disclosure, a command registration device is provided, which is applied to a smart card operating system COS, and the device includes: a receiving unit, configured to receive a registration request from any application through a registration interface set in COS; the registration request carries attribute information and a command identifier of a command to be registered; the command to be registered is customized by an application developer of the application; and a processing unit, configured to create or update registered command information corresponding to the application based on the registration request.
[0018] According to the sixth aspect of the present disclosure, a command registration device is provided, which is applied to any application, and includes: a receiving unit, configured to receive a command to be registered that is customized by an application developer; a sending unit, configured to send a registration request to a smart card operating system COS, and the registration request carries attribute information and a command identifier of the command to be registered.
[0019] According to a seventh aspect of the present disclosure, an electronic device is provided, comprising: a memory for storing computer-readable instructions; and a processor for executing the computer-readable instructions so that the electronic device executes the above communication transmission method.
[0020] According to an eighth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided for storing computer-readable instructions. When the computer-readable instructions are executed by a processor, the processor executes the communication transmission method as described above.
[0021] According to a ninth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to implement the communication transmission method as described above.
[0022] As will be described in detail below, according to the communication transmission method, command registration method and device of the embodiment of the present disclosure, the smart card operating system COS can receive a first command, compare the command header information carried in the first command with the registered command information to identify and determine the target attribute information of the first command, and forward the command according to the adapted target transmission strategy based on the target attribute information. Among them, the registered command information can be registered with the COS. And the registered command can be customized to meet differentiated transmission requirements. At the same time, the registered command information stores the command identifier and attribute information. The command identifier is part of the information in the command header information. In this way, the attribute information of the received command can be directly identified and determined according to the registered command information, and forwarded according to the transmission strategy adapted to the attribute information. There is no need to perform processing after the application performs parsing after receiving the command, which simplifies the process of smart card communication transmission. In this way, the COS of the smart card not only realizes the accurate identification and processing of the command, but also can meet the communication requirements in different scenarios through flexible transmission strategies, improves the rate and performance of smart card communication transmission, and has wide applicability.
[0023] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0025] Figure 1 is a flowchart illustrating a communication transmission method according to an embodiment of the present disclosure.
[0026] Figure 2 It is a code diagram for registering an interface in COS according to an embodiment of the present disclosure.
[0027] Figure 3 The corresponding storage of the command identifier and the attribute information is exemplified.
[0028] Figure 4 This exemplarily indicates that target attribute information is queried in the registered information.
[0029] Figure 5 is an overall device diagram illustrating communication transmission according to an embodiment of the present disclosure.
[0030] Figure 6is an overall device diagram illustrating command registration according to an embodiment of the present disclosure.
[0031] Figure 7 2 is another overall device diagram illustrating command registration according to an embodiment of the present disclosure.
[0032] Figure 8 is a hardware block diagram illustrating an electronic device according to an embodiment of the present disclosure.
[0033] Fig. 9 is a schematic diagram illustrating a computer-readable storage medium according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present disclosure more obvious, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0035] At present, smart cards mainly use the ISO / 7816-3 international standard communication protocol for communication. However, when using the ISO / 7816-3 protocol for communication, the following problems may occur:
[0036] First, the layering of the ISO7816-3 protocol is unclear. Compared with protocols such as the Transmission Control Protocol / Internet Protocol (TCP / IP), the ISO7816-3 protocol has unclear layering in design. This leads to the tight coupling of the sending and receiving direction of data frames and the subsequent transmission process with application commands, making the layered and modular design of smart card software difficult. This tight coupling not only increases the complexity of software development, but also makes the interaction between the underlying driver / communication protocol stack of the system and the upper-level application frequent.
[0037] Secondly, the transmission method of the ISO7816-3 protocol is relatively fixed and single. Compared with the Universal Serial Bus (USB) communication protocol, which provides multiple transmission methods such as control transmission, interrupt transmission, batch transmission, and synchronous transmission to adapt to different application scenarios, the ISO7816-3 protocol adopts a unified processing method for all instructions, which lacks flexibility. This makes the protocol unable to provide the best or most suitable transmission method when facing special application scenarios (such as the three major scenarios of 5G: enhanced mobile broadband, massive machine-type communications, high-reliability and low-latency communications, etc.). This limitation may limit the application of smart cards in certain specific scenarios.
[0038] In summary, in the prior art, due to the limitations of the communication protocol of the ISO / 7816-3 international standard, when a smart card is communicating, the command can only be communicated if it is parsed and executed by a specific application, and the communication transmission method is relatively single and fixed and cannot be widely used.
[0039] Therefore, the present application proposes a communication transmission method, which can directly identify and determine the attribute information of the received command based on the registered command information, and forward it according to the transmission strategy adapted to the attribute information. In this way, the COS of the smart card not only realizes the accurate identification and processing of the command, but also meets the communication needs in different scenarios through flexible transmission strategies. First, the present disclosure provides a communication transmission method. Please refer to Figure 1 , Figure 1 FIG. 1 is a flow chart of a communication transmission method according to an embodiment of the present disclosure. Figure 1 As shown, the method is applied to a smart card operating system cos, and the method comprises:
[0040] In step S101, a first command is received, where the first command carries at least command header information.
[0041] In the disclosed embodiment, the COS of the smart card receives a first command sent by an external device. The first command may be an Application Protocol Data Unit (APDU) instruction. The first command includes at least command header information. It should be noted that receiving the first command may be receiving complete command information (such as: the case of CASE1 and CASE2 when the command is an APDU instruction), or receiving the first command may be just receiving command header information. (such as: the case of CASE3 and CASE4 when the command is an APDU instruction), and the command header information includes at least a command identifier, which may include but is not limited to at least one information such as an instruction code, additional parameters, etc. In other words, the first command at least includes the command header information necessary for identifying and processing the command.
[0042] In step S102, target attribute information of the first command is determined based on the registered command information and the command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; the command identifier is part of the information in the command header.
[0043] In the disclosed embodiment, the command identifier is part of the information in the command header information, and the registered information is used to record the registered command identifier and the attribute information corresponding to the command identifier. The command identifier is a unique identifier for each command, which is used to identify the type of the command in the command header information. Therefore, the attribute information corresponding to the command identifier can be retrieved from the registered information by relying on the command identifier in the command header information of the received first command as an index.
[0044] Specifically, the COS of the smart card can compare the command header information of the received first command with the registered command information. Once a matching command identifier is found, the COS of the smart card can extract the target attribute information corresponding to the command identifier from the registered command information. The attribute information can be information used to characterize the command communication transmission mode. The attribute information can include but is not limited to at least one of: command type, large data volume information, time consumption, priority, etc.
[0045] In step S103, a target transmission strategy adapted to the target attribute information is determined, and the first command is forwarded according to the target transmission strategy.
[0046] In the disclosed embodiment, the COS of the smart card can determine the adapted target transmission strategy according to the above-determined target attribute information, and forward the processing according to the target transmission strategy. Among them, the target attribute information includes but is not limited to at least one of the following: command type, large data volume information, time consumption, priority. The target transmission strategy includes but is not limited to at least one of the following: combined sending and receiving strategy, pre-buffering strategy, priority processing strategy and multi-threading strategy. The target attribute information provides the COS with detailed information about the first command, so that the COS of the smart card can adapt the target transmission strategy according to at least one information such as the type, data volume, timeliness requirement and priority of the target attribute information. This ensures that the smart card can select the most appropriate transmission method according to the characteristics and requirements of different commands, thereby improving the efficiency and reliability of communication and meeting the special needs of various application scenarios. It should be noted that the target attribute information can correspond to one or more target transmission strategies. The method of selecting the target transmission strategy based on the target attribute information is not limited here, and can be flexibly adjusted according to actual needs and application scenarios.
[0047] As mentioned above, the COS of the smart card can directly identify and determine the attribute information of the received command based on the registered command information, and forward it according to the transmission strategy adapted to the attribute information. There is no need for the application to perform analysis after receiving the command before processing, which simplifies the process of smart card communication transmission. In this way, the COS of the smart card not only realizes the accurate identification and processing of commands, but also meets the communication needs in different scenarios through flexible transmission strategies, improves the rate and performance of smart card communication transmission, and has wide applicability. Below, the attribute information, command identifier and registered command information mentioned in the above communication transmission method will be specifically explained.
[0048] According to an embodiment of the present disclosure, the attribute information includes at least one of the following: command type, large data volume information, time consumption, and priority.
[0049] Specifically, the command type may be the category of the operation or function executed by the command. The large data volume information may be the amount of data involved in the command transmission. The time consumption degree may be the length of time required for the command execution. The priority may be the importance and urgency of the command in the smart card system.
[0050] Exemplarily, the registered command information stores the command identifier and attribute information in a table, as shown in Table 1 below:
[0051]
[0052]
[0053] If the command is an APDU instruction, the command identifier may include at least one of an instruction byte and a class byte, the instruction byte is Ins, and the class byte is at least one of a CASE type, data volume information, time consumption, priority, etc. The attribute information includes but is not limited to at least one of a command type, large data volume information, time consumption, priority, etc. The above information may be encoded to represent specific attribute information corresponding to different command identifiers.
[0054] In a specific embodiment, the registered command information of the APDU instruction can be stored in the following manner:
[0055] Case: CASE type, with a value range of 0 to 3, representing CASE1 / 2 / 3 / 4 respectively; command types include CASE1, CASE2, CASE3, and CASE4, representing four cases, namely, pure commands without data, commands to read data, commands to write data, and commands to read and write data.
[0056] MassData: large data volume information, indicating the amount of data attached to this instruction. The value range is 0 to 3, where 0 indicates a small amount of data and 3 indicates a large amount of data.
[0057] LongTime: time consumption, indicating the execution time level of this instruction, with a value range of 0 to 3, where 0 means the shortest execution time and 3 means the longest execution time;
[0058] Priority: Priority, indicating the execution priority of this instruction, ranging from 0 to 3, 0 is the lowest priority and 3 is the highest priority.
[0059] According to the embodiment of the present disclosure, the command identifier includes at least one of the following: an instruction byte and a class byte.
[0060] Specifically, the command identifier is used to identify and distinguish different commands. The command identifier may include but is not limited to at least one of an instruction byte and a class byte. In a specific embodiment, when the command is an APDU instruction, the instruction byte may be Ins, and the class byte may be at least one of the category of CASE, data volume information, time consumption, priority, etc.
[0061] The instruction byte (Ins of the APDU instruction) is the core part of the command identification, which directly corresponds to a specific command or operation. Each instruction byte represents a unique command or function, allowing the smart card operating system (COS) to accurately identify and execute the corresponding operation. The class byte (at least one of the CASE type, data volume information, time consumption, priority, etc. of the APDU instruction) is used to further distinguish and identify different command groups or applications. It can provide a classification mechanism that enables COS to divide commands according to the application or function group to which they belong. The existence of the class byte enables the smart card to support multiple applications and ensure that the commands in each application do not interfere with each other.
[0062] Therefore, through the combination of instruction bytes and class bytes, smart cards can accurately identify and classify different commands. This helps ensure the correct execution of commands and improves the reliability and security of smart card communications. At the same time, it also provides a solid foundation for smart card multi-application support.
[0063] The registered command information corresponding to the command identifier and attribute information can be stored in a preset form; the preset form includes at least one of the following: a table form, a key-value pair form, and a data set form.
[0064] In the embodiment of the present disclosure, the registered command information is used to record the registered command identifier and the attribute information corresponding to the command identifier. The registered command information is stored according to a preset form. The preset form includes but is not limited to at least one of a table form, a key-value pair form, a data set form, etc.
[0065] Specifically, the table format is suitable for situations where structured data needs to be displayed. The advantages are that the data is clearly organized, easy to read and understand; it supports operations such as sorting, filtering and calculating data. For example: storing registered command information in a spreadsheet (Excel) or structured query language (SQL) database, each row represents a command, and each column represents a certain attribute of the command (such as command name, parameters, description, etc.). Key-value pair format: suitable for situations where you need to quickly find the corresponding value according to the key (key), with the advantages of fast search speed and small space occupation; easy to expand and modify. For example: storing registered command information in a data format exchange (JSON) file, with the name of each command as the key and the detailed information of the command (such as parameters, execution logic, etc.) as the value. Data collection format: suitable for situations where a large amount of similar or related data needs to be stored, with the advantages of being able to flexibly add, delete or modify data; it supports operations such as traversing, searching and statistics on the collection. For example: storing command objects in a programming language (Java), each object contains the properties and methods of the command.
[0066] It should be noted that, in the embodiment of the present disclosure, the registered command information includes: registered command information of at least one application;
[0067] Registered command information is maintained by COS based on registration requests from each application.
[0068] In the embodiment of the present disclosure, the registered command information is registered and maintained based on the command information of the application, wherein the maintenance includes but is not limited to at least one of creation and update, etc. The registered command information includes at least the registered command information of one application.
[0069] Specifically, in the COS of the smart card, the registered command information can be established and maintained based on the registration request submitted by each application when accessing or using the smart card. The registered command information includes the registered command information of at least one application. The innovative function of maintenance can be that when a new application needs to register its command information with COS, COS will perform a creation operation. It can be understood that adding the command information of the new application to the storage system of COS may involve at least one operation such as generating new records, adding new key-value pairs, or adding new objects to the data set. The update function of maintenance can be that when a registered application needs to modify its command information (such as the parameters of the command have changed, or the execution logic of the command has been updated, etc.), COS will perform an update operation. This includes but is not limited to modifying existing records, updating the values in key-value pairs, or replacing objects in a data set, etc. in at least one operation.
[0070] Based on the above-mentioned registered command information, the method for determining the registered command information according to the embodiment of the present disclosure will be described in detail below.
[0071] The method for determining registered command information according to an embodiment of the present disclosure includes:
[0072] Through the registration interface set in COS, a registration request from any application is received; the registration request carries the attribute information and command identifier of the command to be registered; the command to be registered is customized by the application developer of the application;
[0073] Based on the registration request, create or update the registered command information corresponding to the application.
[0074] In the disclosed embodiment, in COS, application developers can send the customized commands in their own applications to COS for registration through the registration interface publicly set by COS. These commands to be registered can be designed and determined by the application developer according to actual business needs, including attribute information of the command (such as command type, large data volume information, time consumption, priority, etc.) and command identifier (an identifier used to uniquely identify the command). When the application developer submits a registration request through the registration interface, the request carries all necessary information or partial information of the command to be registered. After receiving this request, COS will parse and verify the command identifier and attribute information in the request. Based on the necessary information or partial information in the registration request, COS will create a new registered command information entry and add it to the registered command information corresponding to the application, or if the command identifier already exists in the registered command information, it will update the attribute information of the original command. In this way, COS can know and correctly handle all registered commands in the application.
[0075] For example, Figure 2 : is a code diagram for registering an interface in COS according to an embodiment of the present disclosure. Figure 2 As shown: You can use the code in the figure to set the registration interface in COS.
[0076] Exemplarily, in a specific embodiment, the command is an APDU instruction, and the command identifier is an instruction byte (Ins) and a class byte (CASE type). The attribute information includes but is not limited to at least one of a command type, a data size, a time length, and a priority. The registered command information can store the command identifier and the attribute information accordingly. Figure 3 The corresponding storage of the command identifier and the attribute information is exemplified.
[0077] like Figure 3 As shown:
[0078] Define command type, data size, duration, priority and other attribute information;
[0079] The registered command information may store command identifiers and attribute information correspondingly, wherein the registered command information may be registered and determined by the application developer.
[0080] The above specifically describes the attribute information, command identifier and registered command information required for communication transmission. The following describes how to determine the target attribute information of the first command based on the registered command information and command header information according to an embodiment of the present disclosure.
[0081] As follows, according to an embodiment of the present disclosure, a method for determining target attribute information of a first command based on registered command information and command header information includes:
[0082] Call the query interface set in COS;
[0083] The query interface is used to query the command header information in the registered command information, and the attribute information corresponding to the command header information is confirmed as the target attribute information.
[0084] In the embodiment of the present disclosure, the query interface set in the COS can be called, and the command header information can be queried in the registered command information, and the target attribute information can be confirmed according to the attribute information corresponding to the command header.
[0085] Specifically, COS can call the query interface: use the Application Programming Interface (API) or Software Development Kit (SDK) provided by COS to build a query request and call the query interface. The request contains the command header information that determines the query. Once the query request is sent, COS will return a response. This response can contain registered command information that matches the query condition command header information. This can be queried based on the command identifier in the command header information to get a response. COS can parse this response and find the attribute information that matches the command header information with the registered command information, thereby determining that these attribute information are target attribute information.
[0086] In an embodiment of the present disclosure, another method for determining target attribute information is also provided.
[0087] As follows, according to another embodiment of the present disclosure, a method for determining target attribute information of a first command based on a registered command table and command header information includes:
[0088] Determine the target application of the command header information based on the correspondence between the class byte and the application identifier and the class byte in the command header information;
[0089] The target attribute information is determined based on the registered command information and command header information corresponding to the target application.
[0090] In the disclosed embodiment, the COS of the smart card can establish a correspondence table between a class byte and an application identifier. The class byte is a field in the command header information, which is used to identify the application or application category to which the command belongs. The application identifier is an identifier that uniquely identifies a specific application.
[0091] In the disclosed embodiment, first, when the COS of the smart card receives a command, it parses the command header information to obtain the class byte. Then, the COS of the smart card can search for the corresponding application identifier in the correspondence table between the class byte and the application identifier according to the class byte in the command header information. The target application is determined based on the queried application identifier. Then, the COS of the smart card will query the attribute information corresponding to the command header information in the registered command information corresponding to the target application, and determine this information as the target attribute information.
[0092] Exemplarily, when the command is an APDU instruction and the command identifier is an application identifier AID, the target attribute information of the first command can be determined in the registered command information according to the AID, such as Figure 4 As shown: You can use Figure 4 The target attribute information is queried in the registered information.
[0093] One way is: when each functional component in COS calls the query interface to obtain the target attribute information of the instruction when needed, it relies on the instruction type query function (a function containing the application identifier AID) to query the registered information APDU instruction type and obtain the instruction type in the target attribute information.
[0094] Another way is: when each functional component in COS calls the query interface to obtain the target attribute information of the instruction when needed, it relies on another instruction type query function (including the function of the logical channel, the function obtains the application identifier AID from the logical channel management module through the parameter "logical channel", and the logical channel management module is responsible for the binding management of the logical channel and the application). Among them, the logical channel can be understood as the correspondence between the class byte and the application identifier, and the application identifier AID can be obtained based on the logical channel. Based on the application representation AID, the instruction type in the target attribute information is found in the registered information APDU instruction type.
[0095] As described above, the target attribute information of the first command can be determined by using the registered command table and the command header information. The following will specifically describe a method for determining a target transmission strategy adapted to target attribute information according to an embodiment of the present disclosure.
[0096] As follows, the target attribute information determined according to any of the above embodiments can be used to determine the target transmission strategy using the following method:
[0097] When the target attribute information indicates that the first command is a preset target type, determining that the target transmission strategy is a combined sending and receiving strategy;
[0098] The combined sending and receiving strategy indicates that the data receiving process of the instruction is combined; or the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined, and the response sending process of the instruction is combined.
[0099] In an embodiment of the present disclosure, if the target attribute information indicates that the first command is a preset target type, the target transmission strategy can be determined as a combined sending and receiving strategy based on the preset target type. Wherein, the preset target types include: a first type and a second type; the first type corresponds to a first combined strategy; the first combined strategy indicates that the data receiving process of the instruction is combined; the second type corresponds to a second combined strategy, and the second combined strategy indicates that the data receiving process of the instruction is combined, and the response sending process of the instruction is combined. The combined sending and receiving strategy can indicate that the instruction data is received and processed in a combined manner, or it can indicate that both the instruction data reception is combined and processed, and the instruction response sending is combined and processed.
[0100] Specifically, the merging strategy indicates that the process of receiving and merging the data of the instruction is as follows: when the COS of the smart card receives the first command, it will temporarily store the command instead of executing it immediately. The purpose of temporarily storing the command is to wait for the arrival of commands related to the first command so that the merge processing can be performed. At the same time, the COS of the smart card will send a confirmation message to the sending end (such as a card reader, terminal, etc.) to notify the sending end that the first command has been successfully received and temporarily stored, waiting for further processing. This ensures that the sending end knows that the command has been received and can continue to send related commands. Then, after sending the confirmation message, the COS of the smart card determines that the second command has been received. The second command is the corresponding data of the first command. Then, the COS of the smart card merges the temporarily stored first command and the second command just received according to the provisions of the merging strategy. The merging operation can be to splice the data parts of the two commands together, or to combine them according to the protocol provisions to merge them to obtain a merged command. The merged command contains all the information and data required for execution. Finally, once the first command and the second command are merged into a merged command, the COS of the smart card will forward it to the corresponding unit for further processing.
[0101] The merge strategy indicates that the process of merging the sending of the response to the instruction is as follows: the COS of the smart card receives the third command, which is the response data and status word about the merge command. The response data is feedback on the execution result of the merge command, including but not limited to at least one of the result of the operation, the returned data or other related information. The status word is used to indicate the status of the response, such as success, failure or further operation required. The COS of the smart card temporarily stores the third command for processing in subsequent steps. Then, after receiving the third command and parsing the status word, the COS of the smart card immediately sends the status word to the sender. The purpose of sending the status word is to inform the sender of the execution status of the merge command so that the sender can understand the progress and results of the operation in a timely manner. By sending the status word, the sender can make corresponding processing according to the content of the status word, such as continuing to send subsequent commands or performing other operations. Finally, after sending the status word, the COS of the smart card will continue to listen for response instructions from the sender. The response instruction can be a further operation request made by the sender based on the status word sent previously. Once the response instruction is received, the COS of the smart card will send the previously temporarily stored third command to the sender.
[0102] As follows, the method for determining a target transmission strategy adapted for target attribute information according to an embodiment of the present disclosure also includes:
[0103] When the target attribute information indicates that the first command carries a large data block, determining the target transmission strategy to be a pre-buffer strategy;
[0104] The pre-buffering strategy indicates that a receiving buffer pool is allocated in advance for the data portion of the first command.
[0105] In the disclosed embodiment, first, COS can query the target attribute information of the first command from the registered command information. And check whether the parsed data size attribute indicates a large data block based on the target attribute information. This can be determined by comparing with a preset threshold, or by user customization. Then, if the data size attribute indicates a large data block (exceeding the preset threshold or user-defined setting), the target transmission strategy is determined to be a pre-buffer strategy. Finally, according to the requirements of the pre-buffer strategy, sufficient receiving buffer pools are allocated in advance for the data part of the first command. This can be achieved by setting memory management operations to ensure that there is enough continuous memory space to store the data to be received. Among them, the pre-buffer strategy is to allocate sufficient buffer space for the received data in advance before the actual data transmission. In this way, when the data arrives, it can be directly stored in the pre-allocated buffer pool, reducing the delay caused by real-time memory allocation and improving the efficiency and stability of data transmission.
[0106] Exemplarily, the command is an APDU instruction, and the preferred process for determining the pre-buffering strategy is:
[0107] After receiving the command header of the APDU, the COS bottom module 7816 driver or the Secure Write Protect (SWP) driver of the smart card checks whether the APDU carries large blocks of data. If it does, it selects or temporarily applies for a receiving buffer pool of appropriate size according to the situation to avoid overflow due to a small buffer or waste of precious storage space due to a large buffer. When the application downloads or calculates the representation (HASH) value of large blocks of data, the APDU generally carries large blocks of data.
[0108] As follows, according to an embodiment of the present disclosure, determining a target transmission strategy for target attribute information adaptation also includes:
[0109] When the target attribute information indicates that the first command has a high priority, determining the target transmission strategy as a priority processing strategy;
[0110] The priority processing policy indicates that the first command is processed preferentially.
[0111] In the disclosed embodiment, first, COS parses the target attribute information in the registered command information to identify the priority of the first command. This can be to read the command attribute field, or to read at least one of a flag or value indicating priority. COS checks the parsed priority information to determine whether the first command is a high priority. This can be determined by comparing with a preset priority threshold or level. Then, if the priority of the first command is confirmed to be a high priority (exceeding a preset threshold or level), the target transmission strategy is determined to be a priority processing strategy. Finally, the priority processing strategy is executed, which also means that when the first command arrives, COS should give priority to the command instead of following the normal or other scheduling strategies. Among them, the priority processing strategy is to sort the tasks according to their priorities and give priority to high-priority tasks. In this way, when faced with multiple concurrent tasks or commands, the priority processing strategy can ensure that critical or urgent tasks are processed in a timely and prioritized manner, thereby improving the response speed and overall performance of the system.
[0112] Exemplarily, the command is an APDU instruction, and the preferred process for determining the priority processing strategy is:
[0113] After receiving the APDU command header or the entire frame of the APDU message, the smart card's COS checks whether the APDU is a high-priority instruction. If so, it cooperates with thread scheduling or other related modules of COS to prioritize the APDU and ensure that the instruction is executed as quickly as possible. In scenarios such as encrypted voice calls and smart connected car message signing, the real-time execution of related instructions must be guaranteed.
[0114] As follows, according to an embodiment of the present disclosure, determining a target transmission strategy for target attribute information adaptation also includes:
[0115] When the target attribute information indicates that the first command is a time-consuming command, determining that the target transmission strategy is a multi-thread transmission strategy;
[0116] The multi-thread transmission strategy indicates that the first command is to be transmitted in multiple threads.
[0117] In the disclosed embodiment, first, COS parses the target attribute information in the registered command information to identify the time-consuming command of the first command. COS checks the parsed time consumption to determine whether the first command is a time-consuming command. This can be determined by comparing with a preset time consumption threshold or level. Then, if the time consumption of the first command is confirmed as a time-consuming command (exceeding the preset threshold or level), COS will choose to determine a multi-threaded transmission strategy as the target transmission strategy. Among them, the multi-threaded transmission strategy is to decompose the transmission task of the first command into multiple subtasks, and assign them to different threads or processes for parallel execution. In this way, tasks that were originally executed sequentially by a single thread can now be processed by multiple threads simultaneously, thereby significantly speeding up the transmission speed of commands.
[0118] Exemplarily, the command is an APDU instruction, and the preferred process for determining the multi-threaded transmission strategy is:
[0119] After receiving the APDU command header or the whole frame of the APDU message, the COS of the smart card queries whether the execution of the APDU is time-consuming (generally, instructions involving the erasing of FLASH animations, asymmetric cryptographic calculations, asymmetric key pair generation, etc. are time-consuming, such as key pair generation may take tens of seconds). If so, the buffering technology, asynchronous communication, multi-threading, dynamic adjustment of thread priority and other technologies can be comprehensively adopted to optimize the targeted situation. For example, in the application download or COS download scenario, the interface device will continuously send hundreds to thousands of large data packets to the smart card. The communication itself is time-consuming. In addition, these data need to be stored in FLASH, which involves FLASH erasing and writing, which is also time-consuming. Therefore, DMA reception and multiple buffers can be used to realize the parallel execution of communication and FLASH erasing to accelerate the download of applications or COS. Of course, if COS supports multi-threading, the time-consuming and low-real-time instructions can be dynamically adjusted to low priority and turned to "background execution", while high-priority instructions are allowed to "jump in line", which is suitable for scenarios such as defragmentation and data backup.
[0120] In summary, the present disclosure has described in detail the communication transmission method of the COS of the smart card. The present disclosure also provides a command registration method. The following is a specific description of the command registration method according to an embodiment of the present disclosure.
[0121] As follows, the method is applied to the smart card operating system COS. The command registration method according to the embodiment of the present disclosure includes:
[0122] Through the registration interface set in COS, a registration request from any application is received; the registration request carries the attribute information and command identifier of the command to be registered; the command to be registered is customized by the application developer of the application;
[0123] Based on the registration request, create or update the registered command information corresponding to the application.
[0124] In the disclosed embodiment, COS provides a registration interface for receiving registration requests from different applications. These requests contain attribute information and command identifiers of the commands to be registered. The commands to be registered are customized by the application developer of the application, which means that each application can define and register specific commands according to its own needs. Based on these registration requests, COS will create or update the registered command information corresponding to the application. This means that COS will maintain at least one of a table or a database of registered command information to store the command information that each application has registered.
[0125] Specifically, first, the registration interface in COS listens to and receives registration requests from applications. Once the request is received, COS will parse the request content and extract the attribute information and command identifier of the command to be registered. Then, before creating or updating the registered command information, COS will verify the legitimacy of the request. This may include but is not limited to at least one of the following: checking whether the request comes from a legitimate application developer, checking the uniqueness of the command identifier, and verifying the validity of the attribute information. Then, COS will search the registered information for a record corresponding to the application that sent the request. If the application already exists, its registered command information is directly updated; if the application does not exist, a new application record is created.
[0126] As follows, the method is applied to any application. The command registration method according to the embodiment of the present disclosure includes:
[0127] Receive the pending registration command customized by the application developer;
[0128] A registration request is sent to the smart card operating system COS, where the registration request carries the attribute information and command identifier of the command to be registered.
[0129] In the embodiment of the present disclosure, after the application developer has customized and determined the command to be registered, the application developer will send a registration request to the COS, and the registration request includes the attribute information and command identifier of the registration command.
[0130] Specifically, the application developer first defines and prepares the commands to be registered. Each command needs to have clear attribute information and a unique command identifier to distinguish different commands. Next, the developer uses appropriate programming languages and tools to build a registration request containing the attribute information and command identifier of the command to be registered. Then, the registration request can be sent to the smart card operating system (COS) through an appropriate communication interface (such as a serial port, network interface, etc.). Finally, after sending the registration request, you can wait for the response from COS. COS will process the received requests and verify and process the registration of these commands according to its internal logic and rules.
[0131] The present disclosure also provides a communication transmission device. Figure 5 is an overall device diagram of communication transmission according to an embodiment of the present disclosure, such as Figure 5 As shown, the communication transmission device 500 includes: a receiving unit 501, a determining unit 502 and a forwarding unit 503.
[0132] The receiving unit 501 is configured to receive a first command, where the first command carries at least command header information.
[0133] The determination unit 502 is configured to determine the target attribute information of the first command based on the registered command information and the command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; the command identifier is part of the information in the command header.
[0134] The forwarding unit 503 is configured to determine a target transmission strategy adapted to the target attribute information, and forward the first command according to the target transmission strategy.
[0135] In an exemplary embodiment, the attribute information includes at least one of the following: command type, large data volume information, time consumption, priority; the command identifier includes at least one of the following: instruction byte, class byte; registered command information is stored in a preset form; the preset form includes at least one of the following: table form, key-value pair form, data set form.
[0136] In an exemplary embodiment, the registered command information includes: registered command information of at least one application; the registered command information is maintained by the COS based on the registration request of each application.
[0137] In an exemplary embodiment, the method also includes: receiving a registration request from any application through a registration interface set in COS; the registration request carries attribute information and command identifier of the command to be registered; the command to be registered is customized by the application developer of the application; based on the registration request, creating or updating the registered command information corresponding to the application.
[0138] In an exemplary embodiment, the target attribute information of the first command is determined based on the registered command information and the command header information, including: calling the query interface set in the COS; using the query interface to query the command header information in the registered command information, and confirming the attribute information corresponding to the command header information as the target attribute information.
[0139] In an exemplary embodiment, target attribute information of the first command is determined based on a registered command table and command header information, including: determining the target application of the command header information based on the correspondence between the class byte and the application identifier and the class byte in the command header information; determining the target attribute information based on the registered command information and command header information corresponding to the target application.
[0140] In an exemplary embodiment, determining a target transmission strategy adapted to target attribute information includes: when the target attribute information indicates that the first command is a preset target type, determining that the target transmission strategy is a combined sending and receiving strategy; wherein the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined; or, the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined, and the response sending process of the instruction is combined.
[0141] In an exemplary embodiment, determining a target transmission strategy adapted to target attribute information includes: when the target attribute information indicates that the first command carries a large data block, determining the target transmission strategy to be a pre-buffering strategy; the pre-buffering strategy indicates allocating a receiving buffer pool in advance for the data portion of the first command.
[0142] In an exemplary embodiment, determining a target transmission strategy adapted to target attribute information includes: when the target attribute information indicates that the first command is of high priority, determining the target transmission strategy as a priority processing strategy; the priority processing strategy indicates that the first command is processed first.
[0143] In an exemplary embodiment, determining a target transmission strategy adapted to target attribute information includes: when the target attribute information indicates that the first command is a time-consuming command, determining the target transmission strategy to be a multi-threaded transmission strategy; the multi-threaded transmission strategy indicates multi-threaded transmission of the first command.
[0144] The present disclosure also provides a device for command registration. Figure 6 FIG. 1 is an overall device diagram for command registration according to an embodiment of the present disclosure, such as Figure 6 As shown, the command registration device 600 includes: a receiving unit 601 and a processing unit 602.
[0145] The receiving unit 601 is configured to receive a registration request from any application through a registration interface set in COS; the registration request carries the attribute information and command identifier of the command to be registered; the command to be registered is customized by the application developer of the application.
[0146] The processing unit 602 is configured to create or update the registered command information corresponding to the application based on the registration request.
[0147] The present disclosure also provides another device for command registration. Figure 7 FIG. 1 is another overall device diagram for command registration according to an embodiment of the present disclosure, such as Figure 7 As shown, the command registration device 700 includes: a receiving unit 701 and a sending unit 702.
[0148] The receiving unit 701 is configured to receive a to-be-registered command that is customized by an application developer.
[0149] The sending unit 702 is configured to send a registration request to the smart card operating system COS, where the registration request carries attribute information and a command identifier of the command to be registered.
[0150] Figure 8 1 is a hardware block diagram of an electronic device 800 according to an embodiment of the present disclosure. The electronic device according to an embodiment of the present disclosure includes at least a processor; and a memory for storing computer-readable instructions. When the computer-readable instructions are loaded and executed by the processor, the processor executes the network access method as described above.
[0151] Figure 8 The electronic device 800 shown specifically includes: a central processing unit (CPU) 801, a graphics processing unit (GPU) 802 and a memory 803. These units are interconnected via a bus 804. The central processing unit (CPU) 801 and / or the graphics processing unit (GPU) 802 can be used as the above-mentioned processor, and the memory 803 can be used as the above-mentioned memory for storing computer-readable instructions. In addition, the electronic device 800 may also include a communication unit 805, a storage unit 806, an output unit 807, an input unit 808 and an external device 809, which are also connected to the bus 804.
[0152] Fig. 9 is a schematic diagram illustrating a computer-readable storage medium according to an embodiment of the present disclosure. Fig. 9As shown, a computer-readable storage medium 900 according to an embodiment of the present disclosure has computer-readable instructions 901 stored thereon. When the computer-readable instructions 901 are executed by a processor, the network access method according to the embodiment of the present disclosure described with reference to the above figures is executed. The computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may, for example, include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, an optical disk, a magnetic disk, etc.
[0153] The present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the communication transmission method described in any of the foregoing embodiments of the present disclosure.
[0154] In the above, the communication transmission method, command registration method and device according to the embodiments of the present disclosure are described with reference to the accompanying drawings. The COS of the smart card can receive the first command, compare the command header information carried in the first command with the registered command header information to identify and determine the target attribute information of the first command, and forward the command according to the adapted target transmission strategy based on the target attribute information. Among them, the registered command header information stores the information corresponding to the command identifier and the attribute information. The command identifier is part of the information in the command header information. In this way, the attribute information of the received command can be directly identified and determined based on the registered command information, and forwarded according to the transmission strategy adapted to the attribute information. The problem of requiring the application to perform parsing for communication transmission after receiving the command is overcome. The COS of the smart card not only realizes the accurate identification and processing of the command, but also can meet the communication needs in different scenarios through flexible transmission strategies, improves the rate and performance of the communication transmission of the smart card, and has wide applicability.
[0155] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0156] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0157] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0158] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0159] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0160] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0161] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0162] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A communication transmission method, characterized in that: The method is applied to a smart card operating system COS, and the method comprises: receiving a first command, wherein the first command carries at least command header information; Determine the target attribute information of the first command based on the registered command information and the command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; the command identifier is part of the information in the command header; Determine a target transmission strategy to which the target attribute information is adapted, and forward the first command according to the target transmission strategy.
2. The method according to claim 1, characterized in that in, The attribute information includes at least one of the following: command type, large data volume information, time consumption, and priority; Wherein, the command identifier includes at least one of the following: an instruction byte, a class byte; The registered command information is stored in a preset format; the preset format includes at least one of the following: a table format, a key-value pair format, and a data set format.
3. The method according to claim 1 or 2, characterized in that: The registered command information includes: the registered command information of at least one application; The registered command information is maintained by the COS based on the registration request of each application.
4. The method according to claim 3, characterized in that The method further comprises: A registration request from any one of the applications is received through a registration interface provided in the COS; the registration request carries attribute information and a command identifier of a command to be registered for registration; the command to be registered is customized by an application developer of the application; Based on the registration request, the registered command information corresponding to the application is created or updated.
5. The method according to any one of claims 1 to 4, characterized in that: The determining the target attribute information of the first command based on the registered command information and the command header information includes: Calling the query interface set in the COS; The query interface is used to query the command header information in the registered command information, and the attribute information corresponding to the command header information is confirmed as the target attribute information.
6. The method according to any one of claims 1 to 5, characterized in that: The determining the target attribute information of the first command based on the registered command table and the command header information includes: Determine the target application of the command header information based on the correspondence between the class byte and the application identifier and the class byte in the command header information; The target attribute information is determined based on the registered command information corresponding to the target application and the command header information.
7. The method according to any one of claims 1 to 6, characterized in that: The determining of a target transmission strategy adapted to the target attribute information includes: When the target attribute information indicates that the first command is a preset target type, determining that the target transmission strategy is a combined sending and receiving strategy; The combined sending and receiving strategy indicates that the data receiving process of the instruction is combined; or the combined sending and receiving strategy indicates that the data receiving process of the instruction is combined, and the response sending process of the instruction is combined.
8. The method according to any one of claims 1 to 6, characterized in that: The determining of a target transmission strategy adapted to the target attribute information includes: When the target attribute information indicates that the first command carries a large data block, determining that the target transmission strategy is a pre-buffering strategy; The pre-buffering strategy indicates that a receiving buffer pool is allocated in advance for the data portion of the first command.
9. The method according to any one of claims 1 to 6, characterized in that: The determining of a target transmission strategy adapted to the target attribute information includes: When the target attribute information indicates that the first command has a high priority, determining the target transmission strategy as a priority processing strategy; The priority processing policy indicates that the first command is processed with priority.
10. The method according to any one of claims 1 to 6, characterized in that: The determining of a target transmission strategy adapted to the target attribute information includes: When the target attribute information indicates that the first command is a time-consuming command, determining that the target transmission strategy is a multi-thread transmission strategy; The multi-thread transmission strategy indicates to perform multi-thread transmission on the first command.
11. A command registration method, characterized in that: The method is applied to a smart card operating system COS, and the method comprises: A registration request from any one of the applications is received through a registration interface provided in the COS; the registration request carries attribute information and a command identifier of a command to be registered for registration; the command to be registered is customized by an application developer of the application; Based on the registration request, the registered command information corresponding to the application is created or updated.
12. A command registration method, characterized in that: The method is applicable to any application, and comprises: Receive the pending registration command customized by the application developer; A registration request is sent to the smart card operating system COS, wherein the registration request carries the attribute information and command identifier of the command to be registered.
13. A communication transmission device, characterized in that: The device comprises: A receiving unit, configured to receive a first command, wherein the first command carries at least command header information; a determination unit configured to determine target attribute information of the first command based on the registered command information and the command header information; wherein the registered command information is used to correspond to the stored command identifier and attribute information; and the command identifier is part of the information in the command header; The forwarding unit is configured to determine a target transmission strategy adapted to the target attribute information, and forward the first command according to the target transmission strategy.
14. A command registration device, characterized in that: The device is applied to a smart card operating system COS, and the device comprises: A receiving unit is configured to receive a registration request from any one of the applications through a registration interface set in the COS; the registration request carries attribute information and a command identifier of a command to be registered for registration; the command to be registered is customized by an application developer of the application; The processing unit is configured to create or update the registered command information corresponding to the application based on the registration request.
15. A command registration device, characterized in that: The device is applied to any application, and the device comprises: A receiving unit, configured to receive a to-be-registered command that is customized by an application developer; The sending unit is configured to send a registration request to the smart card operating system COS, wherein the registration request carries the attribute information and command identifier of the command to be registered.
16. An electronic device, characterized in that: include: a memory for storing computer readable instructions; as well as A processor, configured to execute the computer-readable instructions so that the electronic device executes the communication transmission method according to any one of claims 1 to 10.
17. A non-transitory computer-readable storage medium for storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the processor is caused to perform the communication transmission method according to any one of claims 1 to 10.
18. A computer program product, characterized in that The invention comprises a computer program, wherein the computer program is executed by a processor to implement the communication transmission method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for realizing multi-card slot access
CN101719054A
Application loading running method for intelligent card, and intelligent card
CN106933536A
Smart card operating system encryption and decryption method and device and storage medium
CN111191252A
Method and Device for Achieving Remote Payment
US20170161699A1
