Remote debugging system and method for chip operating system
Technical Field
The invention relates to the field of remote debugging of smart cards, in particular to a remote debugging system and method of a chip operating system.
Background
Generally, in the initial implementation stage of each smart card project, a small number of test cards need to be manufactured to cooperate with clients to debug the server and perform online test on the cards. The current practice is to complete card making in a development office or production shop before the card is taken to the customer site or mailed to the customer by technical support personnel. The debugging period of some complex items is very long, and the customer does not require technical support personnel of the card to participate in the debugging in the whole process, but only needs to give the card to the customer, and the customer carries out the debugging and feeds back the problem. In the debugging process, if the chip operating system COS (chip operation system) needs to be modified, another batch of cards are manufactured and delivered to a client. Obviously, the process of making and handing cards for multiple times can prolong the debugging period.
In addition, the remote desktop technology is also a scheme which can complete remote operation at present. Because the remote desktop technology manages the entire computer operation right of the client at the control end, there are limitations such as security of the client computer, requirements for internet bandwidth, and the like. This solution is therefore rarely adopted by customers.
In the existing scheme, each modification of the card COS causes the interruption of the debugging and testing process for 1 to 3 days. The technical unfamiliarity of the customer with the card COS modification and update results in the inability to directly submit this work to the customer.
Therefore, a solution for remotely modifying the card COS is urgently needed, and in the solution, only the client needs to cooperate to establish remote connection, the operation authority of the whole computer of the client is not needed to be controlled by the control terminal, and all other technical details of the operation process should be transparent to the client.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a client, a control end, a server end and a corresponding remote debugging system and method for a chip operating system.
The invention provides a remote debugging system of a chip operating system, which comprises a control end, a server end, a client end and an intelligent card reader,
the control terminal is used for generating an application protocol data unit instruction, sending the application protocol data unit instruction to the client through the server, and receiving an execution result sent by the client through the server;
the server is used for establishing connection between the control terminal and the client and storing the connection IDs of all the clients;
the client is used for receiving an application protocol data unit instruction sent by the server and sending the instruction to the smart card reader; receiving an execution result from the smart card reader, and sending the execution result and the connection ID to the server;
and the smart card reader is used for sending the application protocol data unit instruction received from the client to the inserted chip and then sending an execution result generated by the chip to the client.
As an improvement of the above system, the connection ID is a unique identifier of the client; the client sends a connection request to the server, and the server generates a connection ID after connection is established and sends the connection ID to the client; and the client sends the connection ID to the control end.
As an improvement of the above system, the manner in which the client sends the connection ID to the control end is QQ, wechat, voice, or short message.
As an improvement of the above system, the server includes a data receiving unit, a data sending unit and a storage unit;
the data receiving unit is used for receiving data with connection IDs sent by the control end and the client, matching the connection IDs in the storage unit and acquiring a target terminal;
the data sending unit is used for removing the connection ID in the data with the connection ID; then sending the data to a target terminal;
the storage unit is used for storing the connection ID of the client.
As an improvement of the above system, the control end comprises an application protocol data unit instruction generating unit, a virtual smart card reader and a control end connecting unit;
the application protocol data unit instruction generating unit is used for generating an application protocol data unit instruction for debugging the chip operating system and sending the application protocol data unit instruction to the control end connecting unit through the virtual smart card reader;
the control end connecting unit is used for sending the connection ID and the application protocol data unit instruction to the server end together; sending an execution result sent by the server to the virtual smart card reader;
and the virtual smart card reader is used for verifying the debugging result according to the execution result, sending the execution result to the application protocol data unit instruction generating unit and displaying the execution result.
The invention also provides a remote debugging method for the chip operating system, which comprises the following steps:
the control terminal generates an application protocol data unit instruction and sends the instruction and the connection ID together to the server terminal;
the server acquires a client based on the connection ID and sends an application protocol data unit instruction to the client;
the client receives an application protocol data unit instruction and sends the instruction to the smart card reader;
the smart card reader sends an instruction to an inserted chip and then sends an execution result generated by the chip to a client;
the client sends the execution result and the connection ID to the server together;
the server acquires the control end on the basis of the connection ID and sends an execution result to the control end;
and the control end receives the execution result sent by the server end.
As an improvement of the above method, the method further comprises the following steps before:
the client sends a connection request to the server, and the server generates a connection ID after connection is established and sends the connection ID to the client;
and the client sends the connection ID to the control end.
As an improvement of the above method, the manner in which the client sends the connection ID to the control end is as follows: QQ, WeChat, Voice, or SMS.
As an improvement of the above method, the server obtains the client based on the connection ID, and sends the application protocol data unit instruction to the client, specifically: after receiving the data sent by the control end, the data receiving unit of the server end matches the connection ID in the storage unit to obtain a client end, and then sends an application protocol data unit instruction to the client end through the data sending unit;
the server acquires the control end based on the connection ID, and sends an execution result to the control end, specifically: after receiving the instruction, the data receiving unit of the server side firstly matches the connection ID in the storage unit to obtain the control side, and then sends the execution result to the control side through the data sending unit;
as an improvement of the above method, the control end generates an application protocol data unit instruction and sends the instruction and the connection ID together to the service end, specifically: the application protocol data unit instruction generating unit generates an application protocol data unit instruction and sends the instruction to the virtual smart card reader; the virtual smart card reader sends an application protocol data unit instruction to the control end connection unit; the control end connection unit sends the connection ID and the application protocol data unit instruction to the server end together;
the control end receives the execution result sent by the server end, and specifically includes: the control end connecting unit sends the received execution result to the virtual smart card reader; compared with the local card making and card handing, the client, the control end, the server end and the corresponding remote debugging system and method for the chip operating system provided by the embodiment of the invention have the advantages of being convenient and efficient, and being capable of effectively shortening the card modification delivery cycle.
Compared with the remote desktop technology, the client, the control end, the server end and the corresponding remote debugging system and method for the chip operating system can effectively improve the safety of a client computer. Since each instruction transmission is within 300 bytes, the method can be implemented even in the environment with low internet bandwidth.
Drawings
Fig. 1 is a block diagram illustrating a remote debugging system of a chip os according to an embodiment of the present invention;
fig. 2 is a flowchart of a remote debugging method of a chip operating system according to another embodiment of the present invention.
The attached drawings are as follows:
1. control end 2, server end 3 and client
4. Smart card reader 11, control terminal connection unit 12, virtual smart card reader
13. APDU instruction generation unit
Detailed Description
In order to make the technical solution and advantages of the present invention more clear, the present invention will be further described in detail by the following specific embodiments with reference to fig. 1 and 2. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, a remote debugging system of a chip operating system according to an embodiment of the present invention includes a control end 1, a service end 2, a client 3, and a smart card reader 4. In specific implementation, the server 2 may be installed on one server to provide real-time services to the outside. The client 3 may be installed on the computer of an external client.
Specifically, the client 3 sends a connection request to the server 2, and after the connection is established, the server 2 generates a connection ID and sends the connection ID to the client 3; the connection ID is a unique identifier assigned by the server 2 to the client 3. The client 3 transmits the connection ID to the control terminal 1. According to an embodiment of the present invention, the client 3 may send the connection ID to the control end 1 in a QQ, wechat, voice, or short message manner.
The control end 1 generates an Application Protocol Data Unit (APDU) instruction, and sends the APDU instruction to the client end 3 through the server end 2; the control end 1 receives the execution result sent by the client end 3 through the server end 2.
As shown in fig. 1, the control terminal 1 may include an application protocol data unit instruction generating unit (i.e., "APDU instruction generating unit") 13, a virtual smart card reader 12, and a control terminal connection unit 11. The application protocol data unit instruction generating unit 13 is configured to generate an application protocol data unit instruction for debugging a chip operating system, and send the application protocol data unit instruction to the control end connection unit 11 through the virtual smart card reader 12; the control end connecting unit 11 is used for sending the connection ID and the application protocol data unit instruction to the service end 2; and sending the execution result sent by the server 2 to the virtual smart card reader 12; the virtual smart card reader 12 is configured to verify a debugging result according to an execution result, send the execution result to the application protocol data unit instruction generating unit 13, and display the execution result.
The server 2 comprises a data receiving unit, a data sending unit and a storage unit;
the data receiving unit is used for receiving the data with the connection ID sent by the control terminal 1 and the client terminal 3 by the user, matching the connection ID in the storage unit and acquiring a target terminal; the target terminal is a control terminal 1 or a client terminal 3; then sending the data with the connection ID to a data sending unit;
a data sending unit, configured to remove the connection ID from the data with the connection ID; then sending the data to a target terminal;
a storage unit for storing the connection ID of the client 3.
The client 3 receives the application protocol data unit instruction from the server 2, sends the application protocol data unit instruction to the smart card reader 4, receives the execution result from the smart card reader 4, and sends the execution result and the connection ID to the server 2.
The smart card reader 4 is used for sending the application protocol data unit instruction received from the client 3 to the inserted chip, and then sending the execution result generated by the chip to the client 3;
it is noted that the remote debugging system of a chip operating system shown in fig. 1 is merely exemplary. According to other embodiments of the present invention, a remote debugging system for a chip operating system may simultaneously include a plurality of control terminals 1, one or more service terminals 2, and a plurality of client terminals 3, without departing from the spirit of the present invention.
As shown in fig. 2, a remote debugging method for a chip operating system according to an embodiment of the present invention includes the following steps:
1. the application protocol data unit command generating unit 13 generates an APDU command and sends the APDU command to the virtual smart card reader 12;
2. the virtual smart card reader 12 sends the APDU command to the control end connection unit 11;
3. the control end connection unit 11 sends the connection ID and the APDU command to the service end 2 together;
4. after receiving the instruction, the data receiving unit of the server 2 matches the connection ID in the storage unit to obtain the client 3, and then sends the original APDU instruction to the client 3 through the data sending unit;
5. after receiving the APDU command, the client 3 sends the APDU command to a chip inserted into the APDU command through the smart card reader 4;
6. the chip returns the execution result to the smart card reader 4;
7. the smart card reader 4 returns the execution result to the client 3;
8. the client 3 sends the connection ID and the execution result to the server 2;
9. after receiving the instruction, the data receiving unit of the server 2 matches the connection ID in the storage unit to obtain the control end 1, and then sends the original execution result to the control end 1 through the data sending unit;
10. the control end connection unit 11 sends the received execution result to the virtual smart card reader 12;
11. the virtual smart card reader 12 sends the execution result to the application protocol data unit instruction generating unit 13, and displays the execution result.
According to the embodiment of the invention, the remote debugging method further comprises the following steps between step 1:
the client 3 sends a connection request to the server 2, and the server generates a connection ID after connection is established and sends the connection ID to the client 3;
the client 3 sends the connection ID to the control terminal 1 in a QQ, wechat, voice or short message manner.
According to the embodiment of the invention, the modification and the update of the card COS are essentially that one APDU instruction is sent to the card through the control terminal 1 through the service terminal 2, the client terminal 3 and the smart card reader 4; meanwhile, the intelligent card reader 4 connected with the client 3 is mapped to the control end 1 by utilizing a virtual intelligent card reader technology.
Compared with local card making and card handing, the client, the control end, the server end and the corresponding remote debugging system and method for the chip operating system provided by the embodiment of the invention have the advantages of convenience, high timeliness and capability of effectively shortening the card modification delivery cycle.
Compared with the remote desktop technology, the client, the control end, the server end and the corresponding remote debugging system and method for the chip operating system can effectively improve the safety of a client computer; and the bandwidth requirement on the internet is low, because each instruction transmission is within 300 bytes, the method can be implemented even in an environment with low internet bandwidth.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention and are not limited. Although the present invention has been described in detail with reference to the embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the spirit and scope of the invention as defined in the appended claims.