CN106528053B - A kind of terminal device high efficiency data processing method and its terminal device - Google Patents

A kind of terminal device high efficiency data processing method and its terminal device Download PDF

Info

Publication number
CN106528053B
CN106528053B CN201710003731.5A CN201710003731A CN106528053B CN 106528053 B CN106528053 B CN 106528053B CN 201710003731 A CN201710003731 A CN 201710003731A CN 106528053 B CN106528053 B CN 106528053B
Authority
CN
China
Prior art keywords
instruction
module
read
terminal device
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710003731.5A
Other languages
Chinese (zh)
Other versions
CN106528053A (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201710003731.5A priority Critical patent/CN106528053B/en
Publication of CN106528053A publication Critical patent/CN106528053A/en
Application granted granted Critical
Publication of CN106528053B publication Critical patent/CN106528053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of terminal device high efficiency data processing method and its terminal devices, belong to the communications field.The described method includes: terminal device receives the command message that host computer is sent, the instruction sequence in reading order message successively executes corresponding operating according to instruction sequence and obtains sequence of operations result;Or the instruction sequence in terminal device reading order message, instruction sequence is successively sent to card, receives the sequence of operations result that card returns;When the instruction sequence in command message all complete by processing, the operating result is returned to host computer by terminal device.Technical solution in the present invention contains a plurality of instruction in one command message during terminal device and host computer carry out data interaction, realizes the processing that a plurality of instruction is completed in primary exchange, improves the data-handling efficiency of terminal device.

Description

A kind of terminal device high efficiency data processing method and its terminal device
Technical field
The present invention relates to the communications fields more particularly to a kind of terminal device high efficiency data processing method and its terminal to set It is standby.
Background technique
Data processing is acquisition, storage, retrieval, processing, transformation and the transmission to data, data be to true, concept or A kind of expression-form of instruction can be set by manual or automatic makeup and be handled;Data processing is host computer engineering and automatic control The basic link of system, data processing through social production and social life every field, the development of data processing technique and Its apply breadth and depth, strong influence the process of human social development.
In the prior art, terminal device and upper structure at data interaction system in, data handling procedure is usual It is that primary one processing instructed of interaction completion then needs repeatedly to be interacted for complicated data handling procedure, consumes With the more time, data-handling efficiency is relatively low.
Summary of the invention
The present invention in order to solve the deficiencies in the prior art, provide a kind of terminal device high efficiency data processing method and its Terminal device.
On the one hand, the present invention provides a kind of terminal device high efficiency data processing methods, comprising:
Step S1: terminal device receives the command message that host computer is sent;
Step S2: the terminal device reads the instruction sequence in the command message, successively according to described instruction sequence It executes corresponding operating and obtains sequence of operations result;Or the terminal device reads the instruction sequence in the command message, Described instruction sequence is successively sent to card, receives the sequence of operations result that the card returns;
Step S3: when the instruction sequence in the command message all complete by processing, the terminal device is by the behaviour The host computer is returned to as result.
Optionally, before the step S2, further includes: the terminal device judges whether the command message is correct, is Then follow the steps S2;Otherwise error code is returned to host computer, is terminated.
The terminal device judges whether the command message is correct, specifically:
The terminal device judges length shown in the data in the command message in the first preset byte and the life It enables the total length of the corresponding each data element of the instruction sequence in message whether equal, is to confirm that the command message is correct, it is no Then confirm that the command message is incorrect;
Alternatively,
The terminal device judges length shown in the data in the command message in the first preset byte and the life It enables the instruction sequence in message and each total length identified that separates whether equal, is to confirm that the command message is correct, otherwise Confirm that the command message is incorrect.
Optionally, in the step S2, the terminal device reads the instruction sequence in the command message, specifically:
The terminal device parses the command message and obtains each data element, and the instruction read in each data element obtains Instruction sequence;
Alternatively,
The terminal device parses the command message and obtains each separation mark, distinguishes fetching according to obtained each separation sign So that arriving instruction sequence.
Optionally, the step S2, specifically includes:
Step W1: the terminal device is using the instruction arrived unread in the instruction sequence in the command message as current Pending data reads first instruction in the current pending data, as present instruction;
Step W2: the terminal device executes corresponding operating according to the present instruction and obtains operating result;Or by institute It states present instruction and is sent to card, receive the operating result that the card returns;
The step S3, specifically: the terminal device judges whether the present instruction is the currently pending number The last item instruction in is the instruction sequence all processing completions confirmed in the command message, the operation is tied Fruit returns to the host computer;Otherwise, return step W1.
Optionally, the step S2, specifically includes:
Step Q1: the terminal device is using the instruction arrived unread in the instruction sequence in the command message as current Data to be resolved read first instruction in the current data to be resolved, and the instruction sequences read are saved in pre- If in memory block;
Step Q2: the instruction read described in terminal device judgement whether be in the current data to be resolved most Latter item instruction, is to then follow the steps Q3, otherwise return step Q1;
Step Q3: the terminal device reads institute using the instruction in the default memory block as current pending data First instruction in current pending data is stated as present instruction, corresponding operating is executed according to the present instruction and is grasped Make result;Or the present instruction is sent to card, receive the operating result that the card returns;
Step Q4: the terminal device removes the present instruction from the default memory block;
The step S3, specifically: whether the terminal device judges there are also instructing in the default memory block, is to return Return step Q3;Otherwise confirm that the instruction sequence in the command message all complete by processing, returns to institute for the operating result State host computer.
Optionally, first thread and the second thread are run simultaneously in the terminal device, the step S2 is specifically included:
The terminal device runs the first thread, executes following operation:
Step H1: the terminal device is using the instruction arrived unread in the instruction sequence in the command message as current Data to be resolved read first instruction in the current data to be resolved, and the instruction sequences read are saved in pre- If in memory block;
Step H2: the instruction read described in terminal device judgement whether be in the current data to be resolved most Latter item instruction, is to terminate, otherwise return step H1;
The terminal device runs second thread, executes following operation:
Step R1: the terminal device accesses the default memory block, when detecting in the default memory block there is instruction When, execute step R2;
Step R2: the terminal device reads institute using the instruction in the default memory block as current pending data First instruction in current pending data is stated as present instruction;Corresponding operating is executed according to the present instruction to be grasped Make result;Or the present instruction is sent to card, receive the operating result that the card returns;
Step R3: the terminal device removes the present instruction from the default memory block;
The step S3, specifically: whether the terminal device judges there are also instructing in the default memory block, is to return Return step R2;Otherwise confirm that the instruction sequence in the command message all complete by processing, returns to institute for the operating result State host computer.
It is optionally, described to be successively sent to described instruction sequence before card in the step S2, further includes:
Step D1: the current data to be sent instructed in corresponding data element on first character section of terminal device judgement Whether be the first preset value, be to execute card to reset operation, receive the operating result that the card returns, otherwise will currently to It sends instruction and is sent to card, receive the operating result that the card returns.
Optionally, in the step S2, when the operating result that the card returns is operation failure, further includes:
Step F1: whether instruct corresponding with the operation failure result of terminal device judgement is described instruction sequence In the last item instruction, be to confirm that all processing is completed for instruction sequence in the command message, executes step S3;Otherwise Execute step F2;
Step F2: the terminal device judges whether to continue to read the unread instruction arrived in described instruction sequence, is then Step S2 is continued to execute, the operating result having received otherwise is returned into the host computer, is terminated.
Optionally, the terminal device judges whether to continue to read the unread instruction arrived in described instruction sequence, specifically Are as follows:
The terminal device is by third predetermined word in data element corresponding to instruction corresponding with the operation failure result Data and the second preset value on section, which are done, obtains operation result with operation, and the operation result is converted to binary representation, is sentenced Whether the data in the operation result of disconnected binary representation in highest order are the first preset data, are, confirmation continues to read Otherwise the unread instruction arrived in described instruction sequence confirms and does not continue to read the unread instruction arrived in described instruction sequence;
Alternatively,
The terminal device judges in data element corresponding to instruction corresponding with the operation failure result that the 4th presets Whether the data in byte are third preset value, are, confirmation continues to read the unread instruction arrived in described instruction sequence, no Then confirm and does not continue to read the unread instruction arrived in described instruction sequence.
Optionally, the step S2, further includes: when a wherein instruction processing failure for described instruction sequence, execute Step M;
Step M: the terminal device is suitable by the operating result currently obtained or the operating result currently having received Sequence splicing, and it is corresponding with the number of untreated instruction in described instruction sequence, phase is filled after spliced operating result The second preset data with number gets response packet, and the response message is returned to the host computer.
Optionally, the step S2, further includes: when a wherein instruction processing failure for described instruction sequence, execute Step N;
Step N: the terminal device returns to error code to the host computer, terminates.
Optionally, it in the step S2, after the terminal device reads the instruction sequence in the command message, also wraps It includes:
The terminal device is identified according to predetermined manner more New count;
When a wherein instruction processing failure for described instruction sequence, step L is executed;
Step L: the terminal device returns to failure operation result with the current count value for counting mark together The host computer terminates.
Optionally, in the step S2, further includes: when the operating result that the terminal device receives is default less than the 4th When value, the operating result received is returned into the host computer, is terminated.
Optionally, it in the step S2, when the terminal device reads first instruction in described instruction sequence, will read The instruction got is sent to before card, further includes:
Step P: the terminal device judges card type, and executes card selecting operation according to the card type, if behaviour Succeed, then the instruction read is sent to card;If operation failure, error code is returned to the host computer, is terminated.
Optionally, in the step S3, the operating result is returned to the host computer by the terminal device, specifically Are as follows:
The terminal device gets response packet the operating result sequential concatenation of the volume of data meta structure, by institute It states response message and returns to the host computer;
Alternatively,
The terminal device is by the sequence of operations result sequential concatenation, and between every two adjacent operating results The default mark that separates of addition gets response packet, and the response message is returned to the host computer;
Alternatively,
The last one operating result returns to the host computer in sequence of operations result described in the terminal device.
On the other hand, the present invention provides a kind of high efficiency data processing terminal equipments, comprising:
First receiving module, the first read module, execution module and the first sending module;
Alternatively,
First receiving module, first read module, first sending module, the second sending module and second Receiving module;
First receiving module, the command message sent for receiving host computer;
First read module, for reading the sequence of instructions in the command message that first receiving module receives Column;
The execution module, the instruction sequence for being read according to first read module successively execute corresponding operating Obtain sequence of operations result;
Second sending module, the instruction sequence for reading first read module are successively sent to card Piece;
Second receiving module, the operating result returned for receiving the card;
First sending module, for will operate when the instruction sequence in the command message all complete by processing As a result the host computer is returned to.
Optionally, the terminal device, further includes: first judgment module;
The first judgment module reads the order that first receiving module receives for first read module Before instruction sequence in message, whether the command message for judging that first receiving module receives is correct;
First read module, is specifically used for: when the first judgment module judges that first receiving module connects When the command message received is correct, the instruction sequence in the command message that first receiving module receives is read;
First sending module is also used to judge that first receiving module receives when the first judgment module Command message it is incorrect when, return to error code to host computer, terminate.
Optionally, the first judgment module, is specifically used for:
Judge length shown in the data in the command message in the first preset byte and the finger in the command message It enables the total length of the corresponding each data element of sequence whether equal, is to confirm that the command message is correct, otherwise confirms the life Enable message incorrect;
Alternatively,
Judge length shown in the data in the command message in the first preset byte and the finger in the command message It enables sequence and each total length for separating mark whether equal, is to confirm that the command message is correct, otherwise confirms the order Message is incorrect.
Optionally, first read module, is specifically used for:
It parses the command message and obtains each data element, the instruction read in each data element obtains instruction sequence;
Alternatively,
It parses the command message and obtains each separation mark, sequence of instructions is obtained according to obtained each separation sign recognition instruction fetch Column.
Optionally, the terminal device, further includes: the second judgment module;
First read module, is specifically used for: by the instruction arrived unread in the instruction sequence in the command message As current pending data, first instruction in the current pending data is read, as present instruction;
The execution module, is specifically used for: executing corresponding operating according to the present instruction and obtains operating result;
Second sending module, is specifically used for: the present instruction is sent to card;
Second judgment module, is specifically used for: judging whether the present instruction is in the current pending data The last item instruction;
First sending module, is specifically used for: when second judgment module judges that the present instruction is described When the last item in current pending data instructs, confirm that the instruction sequence in the command message all complete by processing, it will Operating result returns to the host computer;
First read module is also used to judge the present instruction not when second judgment module to be described work as In preceding pending data the last item instruction when, using the instruction arrived unread in the instruction sequence in the command message as Current pending data, and first in current pending data instruction is read, as present instruction.
Optionally, the terminal device, further includes: the first preserving module, the second judgment module, the second read module, One remove module and third judgment module;
First read module, for using in the instruction sequence in the command message it is unread to instruction as working as Preceding data to be resolved read first instruction in the current data to be resolved;
First preserving module, the instruction sequences for reading first read module are saved in default storage Qu Zhong;
Second judgment module, for judge instruction that first read module is read whether be it is described currently to Parse the last item instruction in data;
First read module is also used to judge that first read module is read when second judgment module Instruction when not being the last item instruction in the current data to be resolved, by the instruction sequence in the command message not The instruction read reads first instruction in the current data to be resolved as current data to be resolved;
Second read module, for judging what first read module was read when second judgment module When instruction is the last item instruction in the current data to be resolved, using the instruction in the default memory block as currently to Data are handled, read first instruction in the current pending data as present instruction;
The execution module, the present instruction for being read according to second read module execute corresponding operating and obtain Operating result;
Second sending module, is specifically used for: the present instruction that second read module is read is sent to card Piece;
First remove module, for being grasped when the execution module executes corresponding operating according to the present instruction After making result, the present instruction is removed from the default memory block;It is also used to receive when second receiving module After the operating result returned to card, the present instruction is removed from the default memory block;
The third judgment module, for first remove module by the present instruction from the default memory block After removal, judge whether there are also instruct in the default memory block;
Second read module is also used to judge there is instruction in the default memory block when the third judgment module When, using the instruction in the default memory block as current pending data, read first in the current pending data Item instruction is used as present instruction;
First sending module, is specifically used for: when the third judgment module judges do not have in the default memory block When having instruction, confirm that the instruction sequence in the command message all complete by processing, returns to host computer for operating result.
Optionally, the terminal device, further includes: the second preserving module, the 4th judgment module, detection module, third are read Modulus block, the second remove module and the 5th judgment module;
First read module, for using in the instruction sequence in the command message it is unread to instruction as working as Preceding data to be resolved read first instruction in the current data to be resolved;
Second preserving module is also used to for the instruction sequences that first read module is read being saved in default deposit In storage area;
4th judgment module, for judge instruction that first read module is read whether be it is described currently to Parse the last item instruction in data;
First read module is also used to judge that first read module is read when the 4th judgment module Instruction when not being the last item instruction in the current data to be resolved, by the instruction arrived unread in described instruction sequence As current data to be resolved, first instruction in the current data to be resolved is read;
First read module, second preserving module and the 4th judgment module are run in the terminal device While, also run the detection module, the third read module, the execution module, second remove module and institute State the 5th judgment module;Alternatively, also running the detection module, the third read module, second sending module, described Second remove module and the 5th judgment module;
The detection module, whether for accessing the default memory block, detecting in the default memory block has instruction;
The third read module, for inciting somebody to action when the detection module, which detects, has instruction in the default memory block Instruction in the default memory block reads first instruction in the current pending data as current pending data As present instruction;
The execution module, is specifically used for: executing corresponding behaviour according to the present instruction that the third read module is read Obtain operating result;
Second sending module, is specifically used for: the present instruction that the third read module is read is sent to card Piece;
Second remove module, for being grasped when the execution module executes corresponding operating according to the present instruction After making result, the present instruction is removed from the default memory block;It is also used to receive when second receiving module After the operating result returned to card, the present instruction is removed from the default memory block;
5th judgment module, for second remove module by the present instruction from the default memory block After removal, judge whether there are also instruct in the default memory block;
The third read module is also used to judge also to refer in the default memory block when the 5th judgment module When enabling, using the instruction in the default memory block as current pending data, in the current pending data is read One instruction is used as present instruction;
First sending module, is specifically used for: when the 5th judgment module judges do not have in the default memory block When having instruction, confirm that the instruction sequence in the command message all complete by processing, returns to host computer for operating result.
Optionally, the terminal device, further includes: the 6th judgment module and the second execution module;
6th judgment module, for second sending module by described instruction sequence be successively sent to card it Before, judgement is currently to be sent to instruct whether the data in corresponding data element on first character section are the first preset value;
Second execution module, for judging the corresponding data of current instruction to be sent when the 6th judgment module When data in member on first character section are the first preset values, execute card and reset operation;
Second sending module, is specifically used for: when the 6th judgment module judges that current instruction to be sent corresponds to Data element in data on first character section when not being the first preset value, the current instruction to be sent is sent to card.
Optionally, the terminal device, further includes: the 7th judgment module and the 8th judgment module;
7th judgment module, when operating result for returning when the card is operation failure, judgement with it is described Operation failure result it is corresponding instruction whether be in described instruction sequence the last item instruction;
First sending module, is also used to: when the 7th judgment module is judged and the operation failure result pair When the instruction answered is the last item instruction in described instruction sequence, confirm that the instruction sequence in the command message is all handled It completes, operating result is returned into host computer;
8th judgment module, for when the 7th judgment module judge it is corresponding with the operation failure result When instruction is not the last item instruction in described instruction sequence, judge whether to continue to read unread in described instruction sequence arrive Instruction;
First read module is also used to judge to continue to read in described instruction sequence when the 8th judgment module When the unread instruction arrived, the instruction sequence in the command message is read;
First sending module is also used to judge not continue to read described instruction sequence when the 8th judgment module In the unread instruction arrived when, the operating result having received is returned into the host computer, terminate.
Optionally, the 8th judgment module, is specifically used for:
By in data element corresponding to instruction corresponding with the operation failure result in third preset byte data with Second preset value, which is done, obtains operation result with operation, and the operation result is converted to binary representation, judges binary representation The operation result in data in highest order whether be the first preset data, be that confirmation continues to read described instruction sequence In the unread instruction arrived, otherwise confirm do not continue read described instruction message in the unread instruction arrived;
Alternatively,
Judge the data in data element corresponding to instruction corresponding with the operation failure result in the 4th preset byte Whether it is third preset value, is, confirmation continues to read the unread instruction arrived in described instruction sequence, otherwise confirms and does not continue Read the unread instruction arrived in described instruction sequence.
Optionally, first sending module is also used to when a wherein instruction processing failure for described instruction sequence, By the operating result currently obtained or the operating result sequential concatenation currently having received, and in described instruction sequence not The number of the instruction of processing is corresponding, and the second preset data that same number is filled after spliced operating result is responded The response message is returned to the host computer by message.
First sending module is also used to when a wherein instruction processing failure for described instruction sequence, is returned wrong Error code gives the host computer.
Optionally, the terminal device, further includes: update module;
The update module, after reading the instruction sequence in the command message for first read module, root It is identified according to predetermined manner more New count;
Optionally, first sending module is also used to when a wherein instruction processing failure for described instruction sequence, The failure operation result is returned into the host computer with the current count value for counting mark together.
Optionally, first sending module, the operating result for being also used to receive when second receiving module are less than When four preset values, the operating result received is returned into the host computer.
Optionally, the terminal device, further includes: the 9th judgment module and card selection module;
9th judgment module, for reading first instruction in described instruction sequence when first read module When, before the instruction that first read module is read is sent to card by second sending module, judge card type;
The card selection module, the card type for being judged according to the 9th judgment module execute card selecting operation;
Second sending module, is specifically used for: when the card selection module operates successfully, by first read module The instruction read is sent to card;
First sending module is also used to when the card selection module operation failure, returns to error code to described upper Machine.
Optionally, first sending module, is specifically used for:
The operating result sequential concatenation of the volume of data meta structure is got response packet, the response message is returned Back to the host computer;
Alternatively,
By the sequence of operations result sequential concatenation, and between every two adjacent operating results, addition separates mark It gets response packet, the response message is returned into the host computer;
Alternatively,
The last one operating result in the sequence of operations result is returned into the host computer.
Compared with prior art, the present invention having the advantage that
During terminal device and host computer carry out data interaction, contain a plurality of instruction in a command message, it is real Show the processing that a plurality of instruction is completed in primary exchange, improves the data-handling efficiency of terminal device.
Detailed description of the invention
Fig. 1 is a kind of terminal device high efficiency data processing method flow chart that the embodiment of the present invention one provides;
Fig. 2 is a kind of terminal device high efficiency data processing method flow chart provided by Embodiment 2 of the present invention;
Fig. 3 and Fig. 4 is a kind of terminal device high efficiency data processing method flow chart that the embodiment of the present invention three provides;
Fig. 5 is a kind of terminal device high efficiency data processing method flow chart that the embodiment of the present invention four provides;
Fig. 6 is a kind of terminal device high efficiency data processing method flow chart that the embodiment of the present invention five provides;
Fig. 7 is a kind of module composition block diagram for high efficiency data processing terminal equipment that the embodiment of the present invention six provides;
Fig. 8 is a kind of module composition block diagram for high efficiency data processing terminal equipment that the embodiment of the present invention seven provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those skilled in the art's every other implementation obtained without making creative work Example, shall fall within the protection scope of the present invention.
Embodiment one
The embodiment of the present invention one provides a kind of terminal device high efficiency data processing method, as shown in Figure 1, comprising:
Step 101: terminal device receives the command message that host computer is sent;
Step 102: the instruction sequence in terminal device reading order message successively executes corresponding operating according to instruction sequence Obtain sequence of operations result;Or the instruction sequence in terminal device reading order message, instruction sequence is successively sent to Card receives the sequence of operations result that card returns;
Step 103: when the instruction sequence in command message all complete by processing, terminal device returns to operating result Host computer.
In the present embodiment, before step 102, further includes: whether the command message that terminal device judgement receives is correct, It is to then follow the steps 102, otherwise returns to error code to host computer, terminate.
Wherein, whether the command message that terminal device judgement receives is correct, specifically:
Length shown in data in the command message that terminal device judgement receives in the first preset byte and order are reported Whether the total length of the corresponding each data element of instruction sequence in text is equal, is to confirm that the command message received is correct, no Then confirm that the command message received is incorrect;
Alternatively,
Length shown in data in the command message that terminal device judgement receives in the first preset byte and order are reported Whether the instruction sequence and each total length for separating mark in text are equal, are to confirm that command message is correct, otherwise confirmation order Message is incorrect.
Optionally, in the present embodiment, the instruction sequence in terminal device reading order message, specifically:
Terminal device resolve command message obtains each data element, and the instruction read in each data element obtains instruction sequence;
Alternatively,
Terminal device resolve command message obtains each separation mark, is referred to according to obtained each separation sign recognition instruction fetch Enable sequence.
Further, in the present embodiment, step 102 specifically includes:
Step W1: terminal device is using the instruction arrived unread in the instruction sequence in command message as currently pending number According to first read in current pending data instructs, as present instruction;
Step W2: terminal device executes corresponding operating according to present instruction and obtains operating result;Or present instruction is sent out Card is given, the operating result that card returns is received;
Correspondingly, step 103, specifically: terminal device judge present instruction whether be in current pending data most Latter item instruction is the instruction sequence all processing completions confirmed in command message, operating result is returned to host computer;It is no Then, return step W1.
In the present embodiment, step 102 can also specifically include:
Step Q1: terminal device is using the instruction arrived unread in the instruction sequence in command message as current number to be resolved According to first read in current data to be resolved instructs, and the instruction sequences read are saved in default memory block;
Step Q2: whether the instruction that terminal device judgement is read is the last item instruction in current data to be resolved, It is to then follow the steps Q3, otherwise return step Q1;
Step Q3: terminal device is read currently pending using the instruction in default memory block as current pending data First instruction in data is used as present instruction, executes corresponding operating according to present instruction and obtains operating result;Or it will work as Preceding instruction is sent to card, receives the operating result that card returns;
Step Q4: terminal device removes present instruction from default memory block;
Correspondingly, step 103, specifically: whether terminal device judges there are also instructing in default memory block, is to return to step Rapid Q3;Otherwise confirm that the instruction sequence in command message all complete by processing, returns to host computer for operating result.
In the present embodiment, first thread and the second thread, correspondingly, step can also be run in terminal device simultaneously 102 specifically include:
Terminal device runs first thread, executes following operation:
Step H1: terminal device is using the instruction arrived unread in the instruction sequence in command message as current number to be resolved According to first read in current data to be resolved instructs, and the instruction sequences read are saved in default memory block;
Step H2: whether the instruction that terminal device judgement is read is the last item instruction in current data to be resolved, It is to terminate, otherwise return step H1;
Terminal device runs the second thread, executes following operation:
Step R1: terminal device access preset memory block executes step when detecting has instruction in default memory block R2;
Step R2: terminal device is read currently pending using the instruction in default memory block as current pending data First instruction in data is used as present instruction;Corresponding operating, which is executed, according to present instruction obtains operating result;Or it will work as Preceding instruction is sent to card, receives the operating result that card returns;
Step R3: terminal device removes present instruction from default memory block;
Correspondingly, step 103, specifically: whether terminal device judges there are also instructing in default memory block, is to return to step Rapid R2;Otherwise confirm that the instruction sequence in command message all complete by processing, returns to host computer for operating result.
Optionally, in the present embodiment step 102, instruction sequence is successively sent to before card, further includes:
Step D1: whether the current data to be sent instructed in corresponding data element on first character section of terminal device judgement For the first preset value, it is to execute card to reset operation, receives the operating result that card returns, it otherwise will current instruction to be sent It is sent to card, receives the operating result that card returns.
Preferably, in the present embodiment, the first preset value is CC.
Optionally, in the present embodiment step 102, when the operating result that card returns is operation failure, further includes:
Step F1: whether instruct corresponding with operation failure result of terminal device judgement is the last item in instruction sequence Instruction is the instruction sequence all processing completions confirmed in command message, executes step 103;It is no to then follow the steps F2;
Step F2: terminal device judges whether to continue to read the unread instruction arrived in instruction sequence, is to continue to execute Step 102, the operating result having received otherwise is returned into host computer, terminated.
Wherein, terminal device judges whether to continue to read the unread instruction arrived of instruction sequence, specifically:
Terminal device is by the number in data element corresponding to instruction corresponding with operation failure result in third preset byte Operation result is obtained with operation according to doing with the second preset value, operation result is converted into binary representation, judges binary representation Operation result in data in highest order whether be the first preset data, be that confirmation continues to read unread in instruction sequence Otherwise the instruction arrived confirms and does not continue to read the unread instruction arrived in instruction sequence;
Alternatively,
Whether the data in data element corresponding to judgement instruction corresponding with operation failure result in the 4th preset byte For third preset value, it is that confirmation continues to read the unread instruction arrived in described instruction sequence, otherwise confirms and do not continue to read The unread instruction arrived in described instruction sequence.
Preferably, in the present embodiment, third preset byte is data corresponding to the corresponding instruction of operation failure result 1st byte of member, the second preset value are 0x80, and the first preset data is 1;4th preset byte is corresponding for operation failure result Instruction corresponding to data element the 3rd byte, third preset value be 0x01.
Optionally, in the present embodiment, step 102 further include: when a wherein instruction processing failure for instruction sequence, Execute step M;
Step M: terminal device spells the operating result currently obtained or the operating result currently having received sequence It connects, and corresponding with the number of instruction untreated in instruction sequence, same number is filled after spliced operating result Second preset data gets response packet, and response message is returned to host computer.
Optionally, in the present embodiment, step 102 further include: when a wherein instruction processing failure for instruction sequence, Execute step N;
Step N: terminal device returns to error code to host computer, terminates.
Optionally, in the present embodiment step 102, after the instruction sequence in terminal device reading order message, further includes:
Terminal device is identified according to predetermined manner more New count;
When a wherein instruction processing failure for instruction sequence, step L is executed;
Step L: failure operation result is returned to host computer with the current count value for counting mark by terminal device together, is tied Beam.
Optionally, in the present embodiment step 102, further includes: when the operating result that terminal device receives is pre- less than the 4th If the operating result received is returned to host computer when value, terminate.
Preferably, in the present embodiment, the 4th preset value is 0x1000.
Optionally, it in the present embodiment step 102, when terminal device reads first instruction in instruction sequence, will read To instruction be sent to before card, further includes:
Step P: terminal device judges card type, and executes card selecting operation according to card type, if operated successfully, The instruction read is sent to card;If operation failure, error code is returned to host computer, is terminated.
Optionally, in step 103, operating result is returned to host computer by terminal device, specifically:
Terminal device gets response packet the operating result sequential concatenation of volume of data meta structure, and response message is returned Back to host computer;
Alternatively,
Sequence of operations result sequential concatenation is added between every two adjacent operating results and is preset by terminal device Separate mark to get response packet, response message is returned into host computer;
Alternatively,
The last one operating result returns to host computer in terminal device sequence of operations result.
Embodiment two
Second embodiment of the present invention provides a kind of terminal device high efficiency data processing methods, as shown in Figure 2, comprising:
Step 201: terminal device receives the command message that host computer is sent;
In the present embodiment, instruction sequence is contained in command message, and the corresponding TLV of every instruction in instruction sequence (Type-Length-Value) data element of structure, i.e., " label (1 byte)+data length (byte)+data are (several Byte) " structure;Wherein, all data on V structure are all data in instruction or V structure after second byte For instruction;Preferably, in the present embodiment, all data on V structure are instruction.
Particularly, when the data in T structure are the first preset value, L structure is 00 in corresponding data element, therefore corresponding Instruction be do-nothing instruction, terminal device according to the type of card execute card reset operation;Preferably, the first preset value is CC;
For example, the command message that terminal device receives is 7E50000017810C00A4040007A000000333010 1CC0002050084000008;
Wherein, the instruction sequence for including is instruction 00A4040007A0000003330101, do-nothing instruction and instruction 0084000008, and correspond respectively to TLV structure data element 810C00A4040007A0000003330101, CC00 and 02050084000008。
Step 202: whether the command message that terminal device judgement receives is correct, is to then follow the steps 203, otherwise returns Error code terminates to host computer;
Specifically, terminal device judges length shown in the data in command message in the first preset byte and command message In the corresponding each TLV structure of instruction sequence data element total length it is whether equal, be to confirm the command message received Correctly, otherwise confirm the command message mistake received;Preferably, the first preset byte is the 5th byte;
More specifically, the data in the 5th byte of terminal device reading order message obtain the overall length of each data element Degree, and from the 6th byte of command message, it is successively read the data in each data element in L structure and obtains the V of each data element The length of the V structure of each data element is added two bytes to obtain the length of each data element by the length of structure, by the length of each data element Degree is added summation, and whether the sum for judging that addition acquires is equal with the total length of obtained each data element, then confirmation receives Command message is correct, otherwise confirms the command message mistake received;
For example, reading the data in the 5th byte is 17 in mentioned order message, being converted into the decimal system is 23, i.e., Length shown in data in 5th byte is 23 bytes;From the 6th byte, it is successively read L structure in each data element On the length of the data V structure that obtains each data element be respectively 0C, 00,05, it is known that the length of each data element be respectively 0E, 02,07, it is respectively 14 bytes, 2 bytes, 7 bytes that the length of each data element can be obtained after the decimal system by, which being converted into, by each data The length of member is added acquiring and is 23 bytes, and confirmation command message is correct.
Step 203: terminal device is using the instruction arrived unread in the instruction sequence in command message as currently pending Data, and first in current pending data instruction is read, as present instruction;
Specifically, in the present embodiment, terminal device is corresponding by the instruction arrived unread in the instruction sequence of command message Data element as current pending data, and read first data element in current pending data as current data Member, using the instruction in current data member as present instruction;
More specifically, the data in terminal device reading order message in current pending data on first character section, That is T structure obtains the label of first data element in current pending data, reads in current data to be resolved in second byte Data, i.e. L structure obtains the length of the V structure of first data element in current pending data, according to the length read Continue read second byte after corresponding data obtain the V structure of first data element in current pending data, read To all data be first data element in current pending data, as current data member, and by current data Data on the V structure of member are as present instruction.
For example, the current data member read is 810C00A4040007A0000003330101 in above-metioned instruction, when Preceding instruction is 00A4040007A0000003330101.
Step 204: terminal device judges current mark using the label of the corresponding data element of present instruction as current label Whether label are the first preset value, are to then follow the steps 210, no to then follow the steps 205;
Preferably, in the present embodiment, the first preset value is CC.
Further, in the present embodiment, when present instruction is first instruction in instruction sequence, by step 204 Before execution step 205 and step 210, further includes:
Step P: terminal device judges the type of card, and executes card selecting operation according to the type of card, if operation at Function then continues;If operation failure, error code is returned to host computer, is terminated;
Specifically, terminal device judges that the card of current operation is contact card or non-contact card, comprising:
Step A1: terminal device blocks card as contact, and sends present instruction to card, judges whether to receive card The response that piece returns is to confirm that card is contact card, no to then follow the steps A2:
Specifically, terminal device assumes that card is contact card, and sends present instruction to card, particularly, when current mark When label are the first preset value, terminal device transmission powers on instruction and determines card when not receiving the response of card return to card Piece may be contact card but be in power-down state, and card is also possible to be non-contact card, it is also possible to without card, thus continue to execute Step A2.
Step A2: terminal device obtains its internal first state mark, whether judges card according to first state mark It is to confirm card selection success for contact card, it is no to then follow the steps A3;
In the present embodiment, first state mark is for identifying the state of contact card;
Specifically, when the value of first state mark is 0, indicating card not is contact card;When the value of first state mark When being 1, indicate that card is contact card, and card is in power-up state;When the value of first state mark is 2, indicate that card is Contact card, and card is in power-down state.
Step A3: terminal device obtains its second internal status indicator, whether judges card according to the second status indicator For non-contact card, it is to confirm card selection success, otherwise confirms no card, returns to corresponding state code to host computer.
In the present embodiment, the second status indicator is used to identify the state of non-contact card;
Specifically, when the value of the second status indicator is 1, indicate that card is non-contact card;When the value of the second status indicator When being 0, no card is indicated.
Step 205: terminal device sends present instruction to card;
For example, in the present embodiment, the above-mentioned present instruction 00A4040007A0000003330101 read is sent To card, card executes selection application operating.
Step 206: terminal device receives operating result, and judges whether card operates success, is the behaviour that will be received Make result correspondence to be saved in the first memory block, executes step 211;It is no to then follow the steps 207;
Specifically, terminal device receives operating result, and judges whether the operating result received is third preset value, is Then confirm that card operates successfully;Otherwise confirm card operation failure;
Preferably, in the present embodiment, third preset value is 0x9000;
Further, in the present embodiment, the operating result received correspondence is saved in the first memory block, preferably Are as follows: the data element that operating result is organized into the data element of corresponding TLV structure and is saved in the first memory block, and is organized The T structure of T structure current data member corresponding with present instruction is identical;
For example, in the present embodiment, card executes selection application operating success according to above-mentioned present instruction, operation knot is returned Fruit 0x9000, then be saved as 01029000, wherein T structure, i.e., the data 01 on first character section indicate the operating result For the operating result of first instruction in the instruction sequence of command message, L structure, i.e. data 02 in second byte indicate V The length of structure is 2 bytes, and V structure, i.e. data 9000 in third byte and the 4th byte are operating result.
Further, in the present embodiment, the operating result received correspondence is saved in the first memory block, may be used also With are as follows: the operating result received is saved directly in the first memory block;Alternatively, the operating result received is organized into LV The data element of structure is simultaneously saved in the first memory block.
For example, the operating result 0x9000 received is saved directly in the first memory block, alternatively, according to receiving Operating result 0x9000 is saved in 029000 in the first memory block.
Step 207: whether the operating result that terminal device judgement receives will then receive less than the 4th preset value Operating result returns to host computer, terminates, and otherwise the operating result received correspondence is saved in the first memory block, executes step Rapid 208;
Preferably, in the present embodiment, the 4th preset value is 0x1000;
Specifically, when the operating result that terminal device receives be less than 0x1000 when, the operating result be terminal device from The error code that body returns determines that mistake occurs in terminal device itself, then exits flow chart of data processing, and the mistake that itself is returned Code is sent to host computer, terminates;When the operating result that terminal device receives is not less than 0x1000, confirm that the operating result is The operation failure that card returns is as a result, execute step 208.
Step 208: terminal device judge present instruction whether be in current pending data the last item instruction, be then Execute step 212;Otherwise, step 209 is executed;
In the present embodiment, terminal device judges whether present instruction is that the last item in current pending data refers to It enables, specifically: terminal device judges that the corresponding current data member of present instruction is that then confirmation currently refers to later whether there are also data Order is not the last item instruction in current pending data, otherwise confirms that present instruction is last in current pending data One instruction.
Step 209: terminal device judges whether the unread instruction arrived in the instruction sequence in continuation reading order message, It is then return step 203, it is no to then follow the steps 212;
In the present embodiment, terminal device judges whether to continue unread in the instruction sequence in reading order message arrive Instruction, specifically: terminal device by the corresponding data element of present instruction in third preset byte data and the second preset value It does and obtains operation result with operation, operation result is converted into binary representation, judge in the operation result of binary representation most Whether the data in a high position are the second preset data, are to confirm unread in the instruction sequence for continuing reading order message arrive Instruction, otherwise confirms the unread instruction arrived in the instruction sequence for not continuing reading order message;
Preferably, third preset byte is the 1st byte of the corresponding data element of present instruction, i.e. T structure, and second is default Value is 0x80, and the second preset data is 1;
For example, in the present embodiment, by the data 0x81 and 0x80 in the 1st byte of the corresponding data element of present instruction It does and obtains operation result 0x80 with operation, be converted into and be represented in binary as 10000000, the data in highest order are 1, Confirmation continues the unread instruction arrived in the instruction sequence of reading order message.
In the present embodiment, when all data after second byte in the V structure of data element are instruction, accordingly Ground, terminal device judge whether the unread instruction arrived in the instruction sequence of continuation reading order message, specifically: terminal device Judge whether the data in the corresponding data element of present instruction in the 4th preset byte are third preset value, are, confirmation is after resuming studies The unread instruction arrived in the instruction sequence of command message is taken, is otherwise confirmed in the instruction sequence for not continuing reading order message not The instruction read;
Preferably, the 4th preset byte be the corresponding data element of present instruction the 3rd byte, i.e., the 1st in V structure Byte;Third preset value is 0x01.
For example, the command message that terminal device receives is 7E1601001C010D0100A4040007A0000003330 10102060100840000040306010084000008, present instruction 00A4040007A0000003330101, it is corresponding Data element is 010D0100A4040007A0000003330101, and the data in the 3rd byte are 01, and confirmation continues to read life Enable the unread instruction arrived in the instruction sequence of message.
Step 210: terminal device executes card and resets operation, receives the operating result that card returns and judges to reset operation Whether succeed, be, the operating result received correspondence is saved in the first memory block, step 211 is executed, otherwise returns wrong Accidentally reply data terminates to host computer;
Specifically, when card is non-contact card, terminal device executes the control of external field strength to card by hardware Lower electricity and power on operation, complete the reset of card;
When card is contact card, terminal device sends corresponding lower electricity instruction according to the chip type of card and powers on finger Enable the reset operation that card is completed to card;
For example, when the chip of card is 9541 chip, the lower electricity instruction that terminal device is sent to card is 63000000000000000000, powering on instruction is 62000000000000000000.
Step 211: terminal device judge present instruction whether be in current pending data the last item instruction, be then Execute step 212;Otherwise, return step 203;
In the present embodiment, terminal device judges whether present instruction is last in current pending data in this step The method of one instruction is identical with the method described in step 208, and details are not described herein.
Step 212: the operating result in the first memory block is returned to host computer by terminal device, is terminated.
Specifically, terminal device will obtain response report after the operating result sequential concatenation of data meta structure in the first memory block Response message is returned to host computer by text;
For example, the operating result of the TLV structure in the first memory block is 0103009000,02029000,03029000, spell Response message after connecing is 01030090000202900003029000;Or the operating result of the first LV structure in memory block It is 03009000,029000,029000, spliced response message is 03009000029000029000.
Further, when operating result is saved directly in the first memory block by terminal device, accordingly, by first Operating result in memory block returns to host computer, specifically: terminal device spells the operating result sequence in the first memory block It connects, and adds the default mark that separates between every two adjacent operating results and get response packet, response message is returned to Host computer;
Preferably, default separation is identified as 0x2C;
For example, the operating result in the first memory block is 009000,9000,9000, spliced response message are as follows: 0090002C90002C9000。
In the present embodiment, the operating result in the first memory block is returned into host computer, it can be with are as follows: terminal device will In operating result in first memory block, the last one operating result returns to host computer;
For example, the operating result in the first memory block is 0103009000,02029000,03029000, by 03029000 Return to host computer;
Alternatively,
Operating result in first memory block is 009000,9000,9000, returns to host computer for 9000.
Further, when executing step 212 by step 209, in the step 212 by the operation knot in the first memory block Fruit returns to host computer, can be with are as follows: by the operating result sequential concatenation in the first memory block, and with it is unread in instruction sequence The number for the instruction arrived is corresponding, and the second preset data that same number is filled after spliced operating result obtains response report Obtained response message is returned to host computer by text;Preferably, the second preset data is 6D00;
It needs explanatorily, the data element of the corresponding TLV structure of each second preset data, and the T of corresponding data element Structure is identical as the T structure of the corresponding data element of instruction arrived unread in instruction sequence;
For example, the instruction sequence in command message contains five instructions, card operation failure when Article 3 instructs, and no longer Continue the unread instruction arrived in the instruction sequence in reading order message, then it is corresponding with Article 4 instruction and Article 5 instruction, The corresponding data element of first the second preset data of filling is 04026D00, and second the second preset data of filling is corresponding Data element is 05026D00.
Optionally, in the present embodiment, when the wherein instruction operation failure in instruction sequence, terminal device may be used also Directly to return to error code to host computer, terminate;
Optionally, in step 202, when terminal device judges that the command message received is correct, can also include:
Step a1: terminal device is using the instruction arrived unread in the instruction sequence in command message as current number to be resolved According to first read in current data to be resolved instructs, and the instruction sequences read are saved in the second memory block;
Step a2: whether the instruction that terminal device judgement is read is the last item instruction in current data to be resolved, It is to then follow the steps 203, otherwise return step a1;
Correspondingly, step 203, specifically:
Step 203 ': terminal device is read using the instruction in the second memory block as current pending data currently wait locate First instruction managed in data is used as present instruction, reads the label of the corresponding data element of present instruction as current label;
Step 208, specifically:
Step 208 ': whether terminal device judges there are also instructing in the second memory block, is to then follow the steps 209;Otherwise, will Operating result in first memory block returns to host computer, terminates;
Step 209, specifically:
Step 209 ': terminal device judges whether to continue to read the instruction in the second memory block, is then return step 203; Otherwise, the operating result in the first memory block is returned into host computer, terminated;
Step 210, specifically:
Step 210 ': whether terminal device judge in the second memory block there are also instructing, and is then return step 203;Otherwise, will Operating result in first memory block returns to host computer, terminates;
Method in the present embodiment contains instruction sequence in the command message that terminal device receives, and in instruction sequence Every instructs the data element of a corresponding TLV structure, and terminal device can parse command message, often obtain a TLV structure Data element handles a corresponding instruction, also can parse command message and obtains the data element of each TLV structure, and successively processing is each The corresponding instruction of the data element of TLV structure realizes the processing that a plurality of instruction is completed in primary interaction, improves the processing effect of data Rate.
Embodiment three
The embodiment of the present invention three provides a kind of terminal device high efficiency data processing method, when terminal device receive it is upper When the command message that machine is sent, first thread and the second thread are opened and run simultaneously in terminal device;
As shown in figure 3, terminal device operation first thread executes following operation:
Step 301: whether the command message that terminal device judgement receives is correct, is to then follow the steps 302, otherwise returns Error code terminates to host computer;
In the present embodiment, instruction sequence is contained in command message, and the corresponding TLV of every instruction in instruction sequence (Type-Length-Value) data element of structure, i.e., " label (1 byte)+data length (byte)+data are (several Byte) " structure, wherein all data on V structure are all data in instruction or V structure after second byte For instruction;Preferably, in the present embodiment, all data on V structure are instruction;
Particularly, when the data in T structure are the first preset value, L structure is 00 in corresponding data element, therefore corresponding Instruction be do-nothing instruction, terminal device according to the type of card execute card reset operation;Preferably, the first preset value is CC;
In the present embodiment, the implementation method of step 301 is identical with method described in the step 202 of embodiment two, This is repeated no more.
Step 302: terminal device is using the instruction arrived unread in the instruction sequence in command message as current to be resolved Data read first instruction in current data to be resolved, and the instruction sequences read are saved in third memory block;
Specifically, terminal device using the corresponding data element of instruction arrived unread in the instruction sequence in command message as Current pending data reads first data element in current pending data, and the data element read sequence is saved in In third memory block;
More specifically, the data in terminal device reading order message in current data to be resolved on first character section, That is T structure obtains the label of first data element in current pending data, reads in current data to be resolved in second byte Data, i.e. L structure obtains the length of the V structure of first data element in current pending data, according to the length read Continue read second byte after corresponding data obtain the V structure of first data element in current pending data, read To all data be first data element in current pending data, the data element read sequence is saved in third and deposits In storage area;
For example, the command message received is 7E50000017810C00A4040007A0000003330101CC00020 50084000008, current pending data 810C00A4040007A0000003330101CC0002050084000008 are read First data element got is 810C00A4040007A0000003330101.
Step 303: whether the instruction that terminal device judgement is read is the last item instruction in current data to be resolved, It is to terminate;Otherwise, return step 302;
In the present embodiment, whether the instruction that terminal device judgement is read is the last item in current data to be resolved Instruction, specifically: whether there are also data after the corresponding data element of instruction that terminal device judgement is read, and are to confirm reading To instruction be not the last item instruction in current data to be resolved, otherwise confirm that the instruction read is current number to be resolved The last item instruction in.
In the present embodiment, as shown in figure 4, terminal device, which runs the second thread, executes following operation:
Step 401: terminal device accesses third memory block, when detecting has instruction in third memory block, executes step 402;
Specifically, when detecting has data element in third memory block, step 402 is executed.
Step 402: terminal device is read currently pending using the instruction in third memory block as current pending data First instruction in data, and as present instruction;
Specifically, terminal device is read using the data element in third memory block as current pending data currently wait locate First data element in data is managed as current data member, using the instruction in current data member as present instruction.
For example, the current data member read is 810C00A4040007A0000003330101, present instruction is 00A4040007A0000003330101。
Step 403: terminal device judges current mark using the label of the corresponding data element of present instruction as current label Whether label are the first preset value, are to then follow the steps 409, no to then follow the steps 404;
Preferably, in the present embodiment, the first preset value is CC.
Further, in the present embodiment, when present instruction is first instruction in three memory blocks, by step 403 Before execution step 404 and step 410, further includes:
Terminal device judges the type of card, and executes card selecting operation according to the type of card, if card selecting operation success, Then continue;If card selecting operation fails, wrong responses data are returned to host computer, are terminated;
In the present embodiment, terminal device judges described in step P of the implementation method of the type of card with embodiment two Terminal device judge that the method for the type of card is identical, details are not described herein.
Step 404: terminal device sends present instruction to card;
Step 405: terminal device receives operating result, and judges whether card operates success, is the behaviour that will be received It is saved in the 4th memory block as result, present instruction is removed from third memory block, execute step 410;Otherwise, step is executed Rapid 406;
Specifically, terminal device receives operating result, and judges that the operating result received is as third preset value, is then Confirmation card operates successfully, otherwise confirms card operation failure;
Preferably, in the present embodiment, third preset value is 0x9000.
Further, in the present embodiment, the operating result received is saved in the method in the 4th memory block, with real It is identical to apply the method that the operating result received is corresponded to described in two step 206 of example and is saved in the first memory block, herein It repeats no more.
Step 406: whether the operating result that terminal device judgement receives will then receive less than the 4th preset value Operating result returns to host computer, terminates, and otherwise the operating result received correspondence is saved in the 4th memory block, and will work as Preceding instruction is removed from third memory block, executes step 407;
Preferably, in the present embodiment, the 4th preset value is 0x1000;
Specifically, when the operating result that terminal device receives be less than 0x1000 when, the operating result be terminal device from The error code that body returns determines that mistake occurs in terminal device itself, then exits flow chart of data processing, and the mistake that itself is returned Code is sent to host computer, terminates;When the operating result that the second thread receives is not less than 0x1000, confirm that the operating result is The operation failure that card returns is as a result, execute step 407.
Step 407: whether terminal device judges to be to then follow the steps 408, otherwise execute there are also instructing in third memory block Step 411;
Step 408: terminal device judges whether to continue to read the instruction in third memory block, is then return step 402, no Then follow the steps 411;
In the present embodiment, terminal device described in step 209 of the implementation method of step 408 with embodiment two judges The method for whether continuing the unread instruction arrived in the instruction sequence in reading order message is identical, and details are not described herein.
Step 409: terminal device executes card and resets operation, receives the operating result that card returns and judges to reset operation Whether succeed, be, the operating result received correspondence is saved in the 4th memory block, by present instruction from third memory block Middle removing executes step 410, otherwise returns to error code to host computer, terminates;
Specifically, when card is non-contact card, the second thread passes through control pair of the terminal device hardware to external field strength Card executes lower electricity and power on operation, completes the reset of card;
When card is contact card, the second thread sends corresponding lower electricity instruction according to the chip type of card and powers on finger Enable the reset operation that card is completed to card;
For example, when the chip of card is 9541 chip, the lower electricity instruction that the second thread is sent to card is 63000000000000000000, powering on instruction is 62000000000000000000.
Step 410: whether terminal device judge in third memory block there are also instructing, and is then return step 402;Otherwise it executes Step 411:
Step 411: the operating result in the 4th memory block is returned to host computer by terminal device, is terminated.
In the present embodiment, terminal device described in step 212 of the concrete methods of realizing of step 411 with embodiment two The method that operating result in first memory block is returned to host computer is identical, and details are not described herein.
Optionally, in the present embodiment, when the wherein instruction operation failure in instruction sequence, terminal device may be used also Directly to return to error code to host computer, terminate;
Method in the present embodiment contains instruction sequence in the command message that terminal device receives, and in instruction sequence Every data element for instructing a corresponding TLV structure;First thread and the second thread are run in terminal device simultaneously;Wherein, Terminal device operation first thread carrys out resolve command message and obtains the data element of the corresponding each TLV structure of instruction sequence, and terminal is set The second thread of received shipment row runs each data element for the TLV structure that first thread obtains to handle;First thread and the second thread are same When work, further improve data-handling efficiency.
Example IV
The embodiment of the present invention four provides a kind of terminal device high efficiency data processing method, as shown in Figure 5, comprising:
Step 501: terminal device receives the command message that host computer is sent;
In the present embodiment, instruction sequence is contained in command message, and each instruction sequences splicing in instruction sequence, per adjacent Two instructions between separated with the default mark that separates;Preferably, default separation is identified as 0x2C.
For example, the command message that the host computer that terminal device receives is sent is 7E1600001800A4040007A00 000033301012C00840000042C0084000008;Instruction sequence wherein included is 00A4040007A0000003330101,0084000004 and 0084000008.
Step 502: whether the command message that terminal device judgement receives is correct, is to then follow the steps 503, otherwise returns Error code is to upper, end;
Specifically, terminal device judges length shown in the data in command message in the first preset byte and command message In instruction sequence and each total length for separating mark it is whether equal, be to confirm that command message is correct, otherwise confirmation order report Text is incorrect;Preferably, the first preset byte is the 5th byte;
For example, reading the data in the 5th byte is 18 in mentioned order message, being converted to the decimal system is 24, That is length shown in the data in the 5th byte is 24 bytes, from the 6th byte, reads in instruction sequence and respectively instructs Length be 12 bytes, 5 bytes and 5 bytes, each length for separating mark is 1 byte and 1 byte, by each instruction Length and it is each separate mark length add up to 24 bytes, confirm that the command message received is correct;
Step 503: terminal device is using the instruction arrived unread in the instruction sequence in command message as currently pending Data read first instruction in current pending data;
Specifically, in the present embodiment, terminal device by the instruction arrived unread in command message and separates mark conduct Current pending data finds first separation mark in current pending data, reads the in current pending data Data in one byte to the previous byte of the separation mark found, obtain first instruction;
For example, in the present embodiment, first instruction in terminal device reading order message, then extremely by the 6th byte Data 00A4040007A00000033301012C00840000042C0084000008 in the last byte is as current Pending data, first instruction read is 00A4040007A0000003330101.
Step 504: terminal device is according to the count value of predetermined manner refresh counter;
Preferably, in the present embodiment, the initial count value of counter is 00, when terminal device reads an instruction When, the count value of counter is increased preset step-length by terminal device, and preset step-length is 1.
For example, the count value of timer is updated when first instruction in the instruction sequence for reading command message It is 01.
Step 505: the instruction read is sent to card by terminal device, and receives the operating result of card return, such as Operating result is to operate successfully, then the operating result received is saved in the 5th memory block, executes step 506;Such as operation As a result it is operation failure, then the current count value of the operating result received and counter is returned into host computer together, terminates;
Preferably, in the present embodiment, when the operating result received be 9000 when, indicate operating result be operation at Otherwise function indicates that operating result is operation failure;
For example, in the present embodiment, when the instruction read is that Article 3 instructs, the present timing value of counter is 03, the operating result such as received is operation failure, then operating result and 03 is returned to host computer together, is terminated.
In the present embodiment, the operating result received is saved in the 5th memory block, preferably are as follows: the behaviour that will be received It is saved directly in the 5th memory block as result;
Further, in the present embodiment, the operating result received is saved in the 5th memory block, it can be with are as follows: The operating result received is organized into the data element of TLV structure or LV structure and is saved into the 5th memory block;Wherein, In the data element of TLV structure, the data in T structure are identical as the current count value of counter;
For example, the current count value of counter is 03, the operating result received is 9000, then the operation knot that will be received Fruit saves as 03029000.
Further, the current count value of the operating result received and counter is returned into host computer together, also It could alternatively be the data element that the operating result that will be received is organized into TLV structure, and return to host computer;Or replace with by The operating result received is organized into the data element of LV structure and returns to host computer together with the current count value of counter.
Step 506: terminal device judgement read instruction whether be in current pending data the last item instruction, It is that the last one operating result in the 5th memory block is returned into host computer, terminates, otherwise return step 504.
Wherein, terminal device judgement read instruction whether be in current pending data the last item instruction, tool Body are as follows: whether there are also data after the instruction that reads of terminal device judgement, be confirm the instruction read not and be currently to The last item instruction in data is handled, otherwise confirms that the instruction read is that the last item in current pending data refers to It enables.
In the present embodiment, the last one operating result in the 5th memory block is returned into host computer, i.e., by sequence of instructions The operating result that the last item instructs in column returns to host computer.
Further, in the present embodiment, the last one operating result in the 5th memory block is returned into host computer, also It could alternatively be: all operating results in the 5th memory block are returned into host computer;
Specifically, by all operating result sequential concatenations in the 5th memory block, and in every two adjacent operating results Between the default mark that separates of addition get response packet, response message is returned into host computer;Preferably, default separation is identified as 0x2C;
Alternatively, when the operating result received is saved in the 5th memory block specifically: the operating result that will be received When being organized into the data element of TLV structure or LV structure, and data element being saved into the 5th memory block, correspondingly, by the 5th All operating results in memory block return to host computer, specifically: by the operating result of data meta structure in the 5th memory block Sequential concatenation gets response packet, and response message is returned to host computer.
Embodiment five
The embodiment of the present invention five provides a kind of terminal device high efficiency data processing method, as shown in Figure 6, comprising:
Step 601: terminal device receives the command message that host computer is sent;
In the present embodiment, instruction sequence is contained in command message, and the corresponding LV of every instruction in instruction sequence (Length-Value) data element of structure, the i.e. structure of " data length (two bytes)+data (several bytes) ", wherein V Data in structure are instruction;
For example, in the present embodiment, the command message that terminal device receives is 0X0400002F000580EA000008 000680FC19000104000780FC1800020001000700A40000022001000580FC0411010005008400 0008;Wherein, instruction sequence be instruction 80EA000008,80FC19000104,80FC1800020001, The data element of 00A40000022001,580FC041101 and 0084000008, corresponding LV structure are respectively as follows: 000580EA000008、000680FC19000104、000780FC1800020001、000700A40000022001、 1000580FC041101、00050084000008。
Further, in the present embodiment, every instruction can also correspond to a TLV (Type- in instruction sequence Length-Value) the data element of structure.
Step 602: whether the command message that terminal device judgement receives is correct, is to then follow the steps 603, otherwise returns Error code terminates to host computer;
Specifically, terminal device judges length shown in the data in command message in the first preset byte and command message In the corresponding each LV structure of instruction sequence data element total length it is whether equal, be to confirm the command message received just Really, otherwise confirm that the command message received is incorrect;Preferably, the first preset byte is the 5th byte;
More specifically, the data in the 5th byte of terminal device reading order message obtain the overall length of each data element Degree, and from the 6th byte of command message, it is successively read the data in each data element in L structure and obtains the V of each data element The length of the V structure of each data element is added 2 bytes to obtain the length of each data element by the length of structure, by the length of each data element Degree is added summation, and whether the sum for judging that addition acquires is equal with the total length of obtained each data element, then confirmation receives Command message is correct, otherwise confirms that the command message received is incorrect;
For example, reading the data in the 5th byte is 2F in mentioned order message, being converted into the decimal system is 47, i.e., Length shown in data in 5th byte is 47 bytes;From the 6th byte, it is successively read L structure in each data element On the length of the data V structure that obtains each data element be respectively 0005,0006,0007,0007,0005,0005, each LV can be obtained The length of the data element of structure is respectively 7 bytes, 8 bytes, 9 bytes, 9 bytes, 7 bytes, 7 bytes, will be each The length of the data element of LV structure is added acquiring and is 47 bytes, confirms that the command message received is correct.
Step 603: terminal device is using the instruction arrived unread in the instruction sequence in command message as currently pending Data, and first in current pending data instruction is read, as present instruction;
Specifically, in the present embodiment, terminal device is by the instruction pair arrived unread in the instruction sequence in command message The data element answered reads first data element in current pending data as current data as current pending data Member, using the instruction in current data member as present instruction.
More specifically, terminal device is by the corresponding data element of instruction arrived unread in the instruction sequence in command message As current pending data, read the data in the first two byte of current pending data, i.e. L structure, obtain currently to The length for handling the V structure of first data element in data, according to corresponding after obtained length second byte of reading Data obtain the V structure of first data element in current pending data, and all data read are current pending data In first data element, and as current data member, and using the data on the V structure of current data member as currently finger It enables;
For example, reading first in current pending data data element is in mentioned order message 000580EA000008, and as current data member.
Step 604: terminal device executes corresponding operating according to present instruction, obtains operating result, and by operating result pair It should be saved in the 6th memory block;
Preferably, in the present embodiment, operating result correspondence is saved in the 6th memory block, specifically: operation is tied Fruit is organized into the data element of LV structure and is saved in the 6th memory block;
For example, terminal device is executed according to current data member 000580EA000008 obtains sequence number operation, it is preferable that obtain Success is taken, obtaining operating result is 000000570000025900009000, then saves as operating result 000C000000570000025900009000。
Further, in the present embodiment, operating result can also be saved directly in the 6th memory block by terminal device, Or operating result is organized into the data element of TLV structure, and be saved in the 6th memory block;
For example, aforesaid operations result 000000570000025900009000 is saved in the 6th memory block, or will 010C000000570000025900009000 is saved in the 6th memory block.
Step 605: terminal device judge present instruction whether be in current pending data the last item instruction, be then Operating result in 6th memory block is returned into host computer, is terminated;Otherwise, return step 603.
In the present embodiment, terminal device judges whether present instruction is that the last item in current pending data refers to It enables, specifically: whether also terminal device judge after present instruction data, is that confirm present instruction not be currently pending Otherwise the last item instruction in data confirms that present instruction is the last item instruction in current pending data;
In the present embodiment, the operating result in the 6th memory block is returned into host computer, specifically: terminal device is by It gets response packet after operating result sequential concatenation in six memory blocks, response message is returned into host computer.
Further, when operating result is saved directly in the 6th memory block by terminal device, accordingly, the 6th is deposited Operating result in storage area returns to host computer, specifically: terminal device by the operating result sequential concatenation in the 6th memory block, And add the default mark that separates between every two adjacent operating results and get response packet, response message is returned to upper Machine;
Preferably, default separation is identified as 0x2C;
In the present embodiment, the operating result in the 6th memory block is returned into host computer, it can be with are as follows: terminal device will In operating result in 6th memory block, the last one operating result returns to host computer.
Optionally, in the present embodiment, when the wherein instruction operation failure in instruction sequence, terminal device may be used also Directly to return to error code to host computer, terminate;
Further, in the present embodiment, instruction sequence is contained in the command message that terminal device receives, and is instructed Every instructs the data element of a corresponding LV structure in sequence, and terminal device resolve command message often obtains a LV structure Data element handles a corresponding instruction;Terminal device can obtain the data element of each LV structure with resolve command message, and according to The corresponding instruction of data element of secondary each LV structure of processing;Terminal device can also run first thread and the second thread simultaneously, In, terminal device operation first thread carrys out resolve command message and obtains the data element of the corresponding each LV structure of instruction sequence, terminal Equipment runs the second thread to handle the corresponding instruction of each data element that first thread obtains.
Embodiment six
The present invention provides a kind of high efficiency data processing terminal equipment, as shown in fig. 7, comprises:
First receiving module 701, the first read module 702, execution module 703 and the first sending module 704;
Wherein, the first receiving module 701, the command message sent for receiving host computer;
First read module 702, for reading the instruction sequence in the command message that the first receiving module 701 receives;
Execution module 703, the instruction sequence for being read according to the first read module 702 successively execute corresponding operating and obtain To sequence of operations result;
First sending module 704, for when the instruction sequence in command message all complete by processing, operating result to be returned Back to host computer.
Terminal device in the present embodiment, further includes: first judgment module;
First judgment module is read for the first read module 702 in the command message that first receiving module 701 receives Instruction sequence before, whether the command message for judging that the first receiving module 701 receives correct;
First read module 702, is specifically used for: when first judgment module judges what the first receiving module 701 received When command message is correct, the instruction sequence in the command message that the first receiving module 701 receives is read;
First sending module 704 is also used to judge the order that the first receiving module 701 receives when first judgment module When message is incorrect, error code is returned to host computer, is terminated.
In the present embodiment, first judgment module is specifically used for:
Judge that length shown in the data in command message in the first preset byte is corresponding with the instruction sequence of command message Each data element total length it is whether equal, be to confirm that command message is correct, otherwise confirm command message it is incorrect;
Alternatively,
Judge instruction sequence in length shown in the data in command message in the first preset byte and command message and Whether each total length for separating mark is equal, is to confirm that command message is correct, otherwise confirms that command message is incorrect.
In the present embodiment, the first read module 702, is specifically used for:
Resolve command message obtains each data element, and the instruction read in each data element obtains instruction sequence;
Alternatively,
Resolve command message obtains each separation mark, obtains instruction sequence according to obtained each separation sign recognition instruction fetch.
Terminal device in the present embodiment, further includes: the second judgment module;
First read module 702, is specifically used for: using in the instruction sequence in command message it is unread to instruction as working as Preceding pending data reads first instruction in current pending data, as present instruction;
Execution module 703, is specifically used for: executing corresponding operating according to present instruction and obtains operating result;
Second judgment module, is specifically used for: judging whether present instruction is that the last item in current pending data refers to It enables;
First sending module 704, is specifically used for: when the second judgment module judges that present instruction is current pending data In the last item instruction when, confirmation instruction sequence all processing complete, operating result is returned into host computer;
First read module 702 is also used to judge that present instruction is not current pending data when the second judgment module In the last item instruction when, using the instruction arrived unread in the instruction sequence in command message as current pending data, And first in current pending data instruction is read, as present instruction.
Optionally, the terminal device in the present embodiment, further includes: the first preserving module, the second judgment module, second are read Module, the first remove module and third judgment module;
Correspondingly, the first read module 702, for using the instruction arrived unread in the instruction sequence in command message as Current data to be resolved read first instruction in current data to be resolved;
First preserving module, the instruction sequences for reading the first read module are saved in default memory block;
Second judgment module, for judging whether the instruction that the first read module 702 is read is current data to be resolved In the last item instruction;
First read module 702 is also used to judge the instruction that the first read module 702 is read when the second judgment module When not being the last item instruction in current data to be resolved, the instruction arrived unread in the instruction sequence in command message is made For current data to be resolved, first instruction in current data to be resolved is read;
Second read module, the instruction for judging that the first read module 702 is read when the second judgment module is to work as When the last item in preceding data to be resolved instructs, using the instruction in default memory block as current pending data, reading is worked as First instruction in preceding pending data is used as present instruction;
Execution module 703, the present instruction for being read according to the second read module execute corresponding operating and are operated As a result;
First remove module, for when execution module 703 according to present instruction execute corresponding operating obtain operating result it Afterwards, present instruction is removed from default memory block;
Third judgment module is used for the first remove module by present instruction after removing in default memory block, and judgement is pre- If whether there are also instruct in memory block;
Second read module is also used to deposit when third judgment module, which is judged, has instruction in default memory block by default As current pending data, first instruction read in current pending data is used as present instruction for instruction in storage area;
First sending module 704, is specifically used for: when third judgment module is judged not instruct in default memory block, Confirm that the instruction sequence in command message all complete by processing, returns to host computer for operating result.
Optionally, the terminal device in the present embodiment, further includes: the second preserving module, the 4th judgment module, detection mould Block, third read module, the second remove module and the 5th judgment module;
Correspondingly, the first read module 702, for using the instruction arrived unread in instruction sequence as current number to be resolved According to first read in current data to be resolved instructs;
Second preserving module is also used to the instruction sequences that the first read module 702 is read being saved in default memory block In;
4th judgment module, for judging whether the instruction that the first read module 702 is read is current data to be resolved In the last item instruction;
First read module 702 is also used to judge the instruction that the first read module 702 is read when the 4th judgment module When not being the last item instruction in current data to be resolved, the instruction arrived unread in the instruction sequence in command message is made For current data to be resolved, first instruction in current data to be resolved is read;
In the present embodiment, above-mentioned first read module 702, the second preserving module and the 4th judgement are run in terminal device While module, above-mentioned detection module, third read module, execution module 703, the second remove module and the 5th judgement are also run Module;
Wherein, detection module is used for access preset memory block, and whether detect in default memory block has instruction;
Third read module will be in default memory block for when detection module, which detects, has instruction in default memory block Instruction as current pending data, first instruction read in current pending data is used as present instruction;
Execution module 703, is specifically used for: the present instruction read according to third read module executes corresponding operating and obtains Operating result;
Second remove module, for when execution module 703 according to present instruction execute corresponding operating obtain operating result it Afterwards, present instruction is removed from the default memory block;
5th judgment module is used for the second remove module by present instruction after removing in default memory block, and judgement is pre- If whether there are also instruct in memory block;
Third read module is also used to preset when the 5th judgment module is judged in default memory block there are also instructing Instruction in memory block reads first instruction in current pending data as currently finger as current pending data It enables;
First sending module 704, is specifically used for: when the 5th judgment module is judged not instruct in default memory block, Confirm that instruction sequence all complete by processing, returns to host computer for operating result.
Optionally, in the present embodiment, the first sending module 704 is also used at a wherein instruction for instruction sequence When reason failure, the operating result sequential concatenation that will have currently obtained, and it is corresponding with the number of instruction untreated in instruction sequence, The second preset data that same number is filled after spliced operating result gets response packet, and response message is returned to Host computer.
Optionally, the first sending module 704 is also used to when a wherein instruction processing failure for instruction sequence, is returned Error code is to host computer.
Terminal device in the present embodiment, further includes: update module;
Update module, after the instruction sequence in 702 reading order message of the first read module, according to predetermined manner More New count mark;
First sending module 704 is also used to when a wherein instruction processing failure for instruction sequence, by failure operation knot Fruit returns to host computer with the current count value for counting mark together.
Optionally, in the present embodiment, the first sending module 704, is specifically used for:
The operating result sequential concatenation of volume of data meta structure is got response packet, response message is returned to upper Machine;
Alternatively,
By sequence of operations result sequential concatenation, and between every two adjacent operating results, addition separation mark is obtained Response message is returned to host computer by response message;
Alternatively,
The last one operating result in sequence of operations result is returned into host computer.
Embodiment seven
The embodiment of the present invention seven provides a kind of high efficiency data processing terminal equipment, as shown in Figure 8, comprising:
First receiving module 801, the first read module 802, the second sending module 803, the second receiving module 804 and first Sending module 805;
Wherein, the first receiving module 801, the command message sent for receiving host computer;
First read module 802: for reading the instruction sequence in the command message that the first receiving module 801 receives;
Second sending module 803, the instruction sequence for reading the first read module 802 are successively sent to card;
Second receiving module 804, for receiving the operating result of card return;
First sending module 805, for when the instruction sequence in command message all complete by processing, operating result to be returned Back to host computer.
Terminal device in the present embodiment, further includes: first judgment module;
First judgment module is read for the first read module 802 in the command message that first receiving module 801 receives Instruction sequence before, whether the command message for judging that the first receiving module 801 receives correct;
First read module 802, is specifically used for: when first judgment module judges what the first receiving module 801 received When command message is correct, the instruction sequence in the command message that the first receiving module 801 receives is read;
First sending module 805 is also used to judge the order that the first receiving module 801 receives when first judgment module When message is incorrect, error code is returned to host computer, is terminated.
In the present embodiment, first judgment module is specifically used for:
Judge that length shown in the data in command message in the first preset byte is corresponding with the instruction sequence of command message Each data element total length it is whether equal, be to confirm that command message is correct, otherwise confirm command message it is incorrect;
Alternatively,
Judge instruction sequence in length shown in the data in command message in the first preset byte and command message and Whether each total length for separating mark is equal, is to confirm that command message is correct, otherwise confirms that command message is incorrect.
In the present embodiment, the first read module 802, is specifically used for:
Resolve command message obtains each data element, and the instruction read in each data element obtains instruction sequence;
Alternatively,
Resolve command message obtains each separation mark, obtains instruction sequence according to obtained each separation sign recognition instruction fetch.
Optionally, the terminal device in the present embodiment, further includes: the second judgment module;
First read module 802, is specifically used for: using the instruction arrived unread in instruction sequence as currently pending number According to first read in current pending data instructs, as present instruction;
Second sending module 803, is specifically used for: present instruction is sent to card;
Second judgment module, is specifically used for: judging whether present instruction is that the last item in current pending data refers to It enables;
First sending module 805, is specifically used for: when the second judgment module judges that present instruction is current pending data In the last item instruction when, confirm command message in instruction sequence all processing complete, operating result is returned to upper Machine;
First read module 802 is also used to judge that present instruction is not current pending data when the second judgment module In the last item instruction when, using the instruction arrived unread in the instruction sequence in command message as current pending data, And first in current pending data instruction is read, as present instruction.
Optionally, the terminal device in the present embodiment, further includes: the first preserving module, the second judgment module, second are read Module, the first remove module and third judgment module;
Correspondingly, the first read module 802, for using the instruction arrived unread in the instruction sequence in command message as Current data to be resolved read first instruction in current data to be resolved;
First preserving module, the instruction sequences for reading the first read module 802 are saved in default memory block;
Second judgment module, for judging whether the instruction that the first read module 802 is read is current data to be resolved In the last item instruction;
First read module 802 is also used to judge instruction that the first read module is read not when the second judgment module When being the last item instruction in current data to be resolved, using the instruction arrived unread in the instruction sequence in command message as Current data to be resolved read first instruction in current data to be resolved;
Second read module, the instruction for judging that the first read module 802 is read when the second judgment module is to work as When the last item in preceding data to be resolved instructs, using the instruction in default memory block as current pending data, reading is worked as First instruction in preceding pending data is used as present instruction;
Second sending module 803, is specifically used for: the present instruction that the second read module is read is sent to card;
First remove module will be current after for receiving the operating result of card return when the second receiving module 804 Instruction is removed from default memory block;
Third judgment module is used for the first remove module by present instruction after removing in default memory block, and judgement is pre- If whether there are also instruct in memory block;
Second read module is also used to deposit when third judgment module, which is judged, has instruction in default memory block by default As current pending data, first instruction read in current pending data is used as present instruction for instruction in storage area;
First sending module 805, is specifically used for: when third judgment module is judged not instruct in default memory block, Confirm that the instruction sequence in command message all complete by processing, returns to host computer for operating result.
Optionally, the terminal device in the present embodiment, further includes: the second preserving module, the 4th judgment module, detection mould Block, third read module, the second remove module and the 5th judgment module;
Correspondingly, the first read module 802, for using the instruction arrived unread in the instruction sequence in command message as Current data to be resolved read first instruction in current data to be resolved;
Second preserving module is also used to the instruction sequences that the first read module 802 is read being saved in default memory block In;
4th judgment module, for judging whether the instruction that the first read module 802 is read is current data to be resolved In the last item instruction;
First read module 802 is also used to judge the instruction that the first read module 802 is read when the 4th judgment module When not being the last item instruction in current data to be resolved, the instruction arrived unread in the instruction sequence in command message is made For current data to be resolved, first instruction in current data to be resolved is read;
In the present embodiment, above-mentioned first read module 802, the second preserving module and the 4th judgement are run in terminal device While module, also operation detection module, third read module, the second sending module 803, the second remove module and the 5th judgement Module;
Wherein, detection module is used for access preset memory block, and whether detect in default memory block has instruction;
Third read module will be in default memory block for when detection module, which detects, has instruction in default memory block Instruction as current pending data, first instruction read in current pending data is used as present instruction;
Second sending module 803, is specifically used for: the present instruction that third read module is read is sent to card;
Second remove module will be current after for receiving the operating result of card return when the second receiving module 804 Instruction is removed from default memory block;
5th judgment module is used for the second remove module by present instruction after removing in default memory block, and judgement is pre- If whether there are also instruct in memory block;
Third read module is also used to preset when the 5th judgment module is judged in default memory block there are also instructing Instruction in memory block reads first instruction in current pending data as currently finger as current pending data It enables;
First sending module 805, is specifically used for: when the 5th judgment module is judged not instruct in default memory block, Confirm that the instruction sequence in command message all complete by processing, returns to host computer for operating result.
Terminal device in the present embodiment, further includes: the 6th judgment module and the second execution module;
Wherein, the 6th judgment module is sentenced before instruction sequence is successively sent to card for the second sending module 803 Whether the data in the corresponding data element of disconnected current instruction to be sent on first character section are the first preset value;
Second execution module, for judging first in the corresponding data element of current instruction to be sent when the 6th judgment module When data in a byte are the first preset values, execute card and reset operation;
Second sending module 803, is specifically used for: when the 6th judgment module judges the corresponding data of current instruction to be sent When data in member on first character section are not the first preset values, current instruction to be sent is sent to card.
Terminal device in the present embodiment, further includes: the 7th judgment module and the 8th judgment module;
Wherein, the 7th judgment module, when the operating result for returning when card is operation failure, judgement and operating result It is corresponding instruction whether be in instruction sequence the last item instruction;
First sending module 805, is also used to: when the 7th judgment module judges that instruction corresponding with operating result is instruction When the last item in sequence instructs, confirm that the instruction sequence in command message all complete by processing, and operating result is returned to Host computer;
8th judgment module, for judging that instruction corresponding with operating result is not instruction sequence when the 7th judgment module In the last item instruction when, judge whether to continue to read the unread instruction arrived in instruction sequence;
First read module 802 is also used to judge to continue to read unread in instruction sequence arrive when the 8th judgment module Instruction when, the instruction sequence in reading order message;
First sending module 805, be also used to when the 8th judgment module judge not continue to read it is unread in instruction sequence When the instruction arrived, the operating result having received is returned into host computer, is terminated.
In the present embodiment, above-mentioned 8th judgment module, is specifically used for:
By the data and second in data element corresponding to instruction corresponding with operation failure result in third preset byte Preset value, which is done, obtains operation result with operation, and operation result is converted to binary representation, judges the operation knot of binary representation Whether the data in fruit in highest order are the first preset data, are, confirmation continues to read the unread finger arrived in instruction sequence It enables, otherwise confirms and do not continue to read the unread instruction arrived in instruction message;
Alternatively,
Whether the data in data element corresponding to judgement instruction corresponding with operation failure result in the 4th preset byte For third preset data, it is that confirmation continues to read the unread instruction arrived in instruction sequence, otherwise confirms that not continuing reading refers to Enable the unread instruction arrived in sequence.
Optionally, in the present embodiment, the first sending module 805 is also used at a wherein instruction for instruction sequence When reason failure, the operating result sequential concatenation that will currently have received, and the number pair with instruction untreated in instruction sequence It answers, the second preset data that same number is filled after spliced operating result gets response packet, and response message is returned Back to host computer.
Optionally, the first sending module 805 is also used to when a wherein instruction processing failure for instruction sequence, is returned Error code is to host computer.
Optionally, the terminal device in the present embodiment, further includes: update module;
Update module, after the instruction sequence in 802 reading order message of the first read module, according to predetermined manner More New count mark;
Correspondingly, the first sending module 805 is also used to lose when a wherein instruction processing failure for instruction sequence It loses operating result and returns to host computer together with the current count value for counting mark.
Optionally, the first sending module 805, the operating result for being also used to receive when the second receiving module 804 is less than the When four preset values, the operating result received is returned into host computer.
Terminal device in the present embodiment, further includes: the 9th judgment module and card selection module;
Wherein, the 9th judgment module, when for reading first instruction in instruction sequence when the first read module 802, Before the instruction that first read module 802 is read is sent to card by the second sending module 803, card type is judged;
Card selection module, the card type for being judged according to the 9th judgment module execute card selecting operation;
Second sending module 803, is specifically used for: when selecting card module to operate successfully, the first read module being read Instruction is sent to card;
First sending module 805 is also used to when selecting card module operation failure, returns to error code to host computer.
In the present embodiment, the first sending module 805, is specifically used for:
The operating result sequential concatenation of volume of data meta structure is got response packet, response message is returned to upper Machine;
Alternatively,
By sequence of operations result sequential concatenation, and between every two adjacent operating results, addition separation mark is obtained Response message is returned to host computer by response message;
Alternatively,
The last one operating result in sequence of operations result is returned into host computer.
In the present invention, during terminal device and host computer carry out data interaction, containing more in a command message Item instruction realizes the processing that a plurality of instruction is completed in primary interaction, improves the data processing rate of terminal device.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, Anyone skilled in the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, all It is covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (28)

1. a kind of terminal device high efficiency data processing method characterized by comprising
Step S1: terminal device receives the command message that host computer is sent;
Step S2: the terminal device reads the instruction sequence in the command message, is successively executed according to described instruction sequence Corresponding operating obtains sequence of operations result;Or the terminal device reads the instruction sequence in the command message, by institute It states instruction sequence and is successively sent to card, receive the sequence of operations result that the card returns;
Step S3: when the instruction sequence in the command message all complete by processing, the terminal device ties the operation Fruit returns to the host computer;
Further include: the terminal device judges whether the command message is correct, is to then follow the steps S2;Otherwise error code is returned To host computer, terminate;The terminal device judges whether the command message is correct, specifically:
The terminal device judges that length shown in the data in the command message in the first preset byte and the order are reported Whether the total length of the corresponding each data element of instruction sequence in text is equal, is to confirm that the command message is correct, otherwise really It is incorrect to recognize the command message;
Alternatively,
The terminal device judges that length shown in the data in the command message in the first preset byte and the order are reported Whether the instruction sequence and each total length for separating mark in text are equal, are to confirm that the command message is correct, otherwise confirm The command message is incorrect.
2. the method according to claim 1, wherein the terminal device reads the life in the step S2 The instruction sequence in message is enabled, specifically:
The terminal device parses the command message and obtains each data element, and the instruction read in each data element is instructed Sequence;
Alternatively,
The terminal device parses the command message and obtains each separation mark, is obtained according to obtained each separation sign recognition instruction fetch To instruction sequence.
3. the method according to claim 1, wherein the step S2, specifically includes:
Step W1: the terminal device using in the instruction sequence in the command message it is unread to instruction as currently wait locate Data are managed, first instruction in the current pending data are read, as present instruction;
Step W2: the terminal device executes corresponding operating according to the present instruction and obtains operating result;Or work as by described in Preceding instruction is sent to card, receives the operating result that the card returns;
The step S3, specifically: the terminal device judges whether the present instruction is in the current pending data The last item instruction, be to confirm that all processing is completed for instruction sequence in the command message, and the operating result is returned Back to the host computer;Otherwise, return step W1.
4. the method according to claim 1, wherein the step S2, specifically includes:
Step Q1: the terminal device using in the instruction sequence in the command message it is unread to instruction as currently wait solve Data are analysed, read first instruction in the current data to be resolved, and the instruction sequences read are saved in default deposit In storage area;
Step Q2: whether the instruction read described in terminal device judgement is last in the current data to be resolved Item instruction, is to then follow the steps Q3, otherwise return step Q1;
Step Q3: the terminal device is worked as described in reading using the instruction in the default memory block as current pending data First instruction in preceding pending data is used as present instruction, executes corresponding operating according to the present instruction and obtains operation knot Fruit;Or the present instruction is sent to card, receive the operating result that the card returns;
Step Q4: the terminal device removes the present instruction from the default memory block;
The step S3, specifically: whether the terminal device judges there are also instructing in the default memory block, is to return to step Rapid Q3;Otherwise confirm that the instruction sequence in the command message all complete by processing, and the operating result is returned on described Position machine.
5. the method according to claim 1, wherein first thread and second are run in the terminal device simultaneously Thread, the step S2, specifically includes:
The terminal device runs the first thread, executes following operation:
Step H1: the terminal device using in the instruction sequence in the command message it is unread to instruction as currently wait solve Data are analysed, read first instruction in the current data to be resolved, and the instruction sequences read are saved in default deposit In storage area;
Step H2: whether the instruction read described in terminal device judgement is last in the current data to be resolved Item instruction, is to terminate, otherwise return step H1;
The terminal device runs second thread, executes following operation:
Step R1: the terminal device accesses the default memory block and holds when detecting has instruction in the default memory block Row step R2;
Step R2: the terminal device is worked as described in reading using the instruction in the default memory block as current pending data First instruction in preceding pending data is used as present instruction;Corresponding operating, which is executed, according to the present instruction obtains operation knot Fruit;Or the present instruction is sent to card, receive the operating result that the card returns;
Step R3: the terminal device removes the present instruction from the default memory block;
The step S3, specifically: whether the terminal device judges there are also instructing in the default memory block, is to return to step Rapid R2;Otherwise confirm that the instruction sequence in the command message all complete by processing, and the operating result is returned on described Position machine.
6. the method according to claim 1, wherein in the step S2, it is described by described instruction sequence successively It is sent to before card, further includes:
Step D1: whether the current data to be sent instructed in corresponding data element on first character section of terminal device judgement For the first preset value, it is to execute card to reset operation, receives the operating result that the card returns, it otherwise will be current to be sent Instruction is sent to card, receives the operating result that the card returns.
7. the method according to claim 1, wherein in the step S2, when the operation knot that the card returns When fruit is operation failure, further includes:
Step F1: whether instruct corresponding with the operation failure result of terminal device judgement is in described instruction sequence The last item instruction is the instruction sequence all processing completions confirmed in the command message, executes step S3;Otherwise it executes Step F2;
Step F2: the terminal device judges whether to continue to read the unread instruction arrived in described instruction sequence, is to continue Step S2 is executed, the operating result having received otherwise is returned into the host computer, is terminated.
8. the method according to the description of claim 7 is characterized in that in the step F2, the terminal device judge whether after It resumes studies and takes the unread instruction arrived in described instruction sequence, specifically:
The terminal device will be in data element corresponding to instruction corresponding with the operation failure result in third preset byte Data and the second preset value do and obtain operation result with operation, the operation result is converted into binary representation, judges two Whether the data in the operation result that system indicates in highest order are the first preset data, are, confirmation continues described in reading Otherwise the unread instruction arrived in instruction sequence confirms and does not continue to read the unread instruction arrived in described instruction sequence;
Alternatively,
The terminal device judges the 4th preset byte in data element corresponding to instruction corresponding with the operation failure result On data whether be third preset value, be, confirmation continue read described instruction sequence in the unread instruction arrived, otherwise really Recognize and does not continue to read the unread instruction arrived in described instruction sequence.
9. the method according to claim 1, wherein the step S2, further includes: when its of described instruction sequence In an instruction processing failure when, execute step M;
Step M: the terminal device spells the operating result currently obtained or the operating result currently having received sequence It connects, and corresponding with the number of untreated instruction in described instruction sequence, identical is filled after spliced operating result The second several preset datas get response packet, and the response message is returned to the host computer.
10. the method according to claim 1, wherein the step S2, further includes: when described instruction sequence Wherein when an instruction processing failure, step N is executed;
Step N: the terminal device returns to error code to the host computer, terminates.
11. the method according to claim 1, wherein
In the step S2, the terminal device is read after the instruction sequence in the command message, further includes:
The terminal device is identified according to predetermined manner more New count;
When a wherein instruction processing failure for described instruction sequence, step L is executed;
Step L: the terminal device returns to failure operation result with the current count value for counting mark described together Host computer terminates.
12. the method according to claim 1, wherein in the step S2, further includes: when the terminal device When the operating result received is less than four preset values, the operating result received is returned into the host computer, is terminated.
13. the method according to claim 1, wherein in the step S2, read when the terminal device described in In instruction sequence when first instruction, the instruction read is sent to before card, further includes:
Step P: the terminal device judges card type, and executes card selecting operation according to the card type, if operation at The instruction read is then sent to card by function;If operation failure, error code is returned to the host computer, is terminated.
14. the method according to claim 1, wherein in the step S3, the terminal device is by the operation As a result the host computer is returned to, specifically:
The terminal device gets response packet the sequence of operations result sequential concatenation, and the response message is returned to The host computer;
Alternatively,
The terminal device is added by the sequence of operations result sequential concatenation, and between every two adjacent operating results The default mark that separates gets response packet, and the response message is returned to the host computer;
Alternatively,
The last one operating result returns to the host computer in sequence of operations result described in the terminal device.
15. a kind of high efficiency data processing terminal equipment characterized by comprising
First receiving module, the first read module, execution module and the first sending module;
Alternatively,
First receiving module, first read module, first sending module, the second sending module and second receive Module;
First receiving module, the command message sent for receiving host computer;
First read module: for reading the instruction sequence in the command message that first receiving module receives;
The execution module, the instruction sequence for being read according to first read module successively execute corresponding operating and obtain Sequence of operations result;
Second sending module, the instruction sequence for reading first read module are successively sent to card;
Second receiving module, the operating result returned for receiving the card;
First sending module, for when in the command message instruction sequence all processing complete when, by operating result Return to the host computer;
Further include: first judgment module;
The first judgment module reads the command message that first receiving module receives for first read module In instruction sequence before: judge length shown in the data in the command message in the first preset byte and the order report Whether the total length of the corresponding each data element of instruction sequence in text is equal, is to confirm that the command message is correct, otherwise really It is incorrect to recognize the command message;
Alternatively,
Judge length shown in the data in the command message in the first preset byte and the sequence of instructions in the command message Whether column and each total length for separating mark are equal, are to confirm that the command message is correct, otherwise confirm the command message It is incorrect;First read module, is specifically used for: when the first judgment module judges that first receiving module receives When the command message arrived is correct, the instruction sequence in the command message that first receiving module receives is read;
First sending module is also used to judge the life that first receiving module receives when the first judgment module When enabling message incorrect, error code is returned to host computer, is terminated.
16. terminal device according to claim 15, which is characterized in that first read module is specifically used for:
It parses the command message and obtains each data element, the instruction read in each data element obtains instruction sequence;
Alternatively,
It parses the command message and obtains each separation mark, instruction sequence is obtained according to obtained each separation sign recognition instruction fetch.
17. terminal device according to claim 15, which is characterized in that further include: the second judgment module;
First read module, is specifically used for: using the instruction arrived unread in the instruction sequence in the command message as Current pending data reads first instruction in the current pending data, as present instruction;
The execution module, is specifically used for: executing corresponding operating according to the present instruction and obtains operating result;
Second sending module, is specifically used for: the present instruction is sent to card;
Second judgment module, is specifically used for: judge the present instruction whether be in the current pending data most Latter item instruction;
First sending module, is specifically used for: when second judgment module judges that the present instruction is described current When the last item in pending data instructs, confirm that the instruction sequence in the command message all complete by processing, will operate As a result the host computer is returned to;
First read module, be also used to when second judgment module judge the present instruction not and be it is described currently to When handling the last item instruction in data, using the instruction arrived unread in the instruction sequence in the command message as current Pending data, and first in current pending data instruction is read, as present instruction.
18. terminal device according to claim 15, which is characterized in that further include: the first preserving module, second judge mould Block, the second read module, the first remove module and third judgment module;
First read module, for using the instruction arrived unread in the instruction sequence in the command message as currently to Data are parsed, first instruction in the current data to be resolved is read;
First preserving module, the instruction sequences for reading first read module are saved in default memory block In;
Second judgment module, for judging whether the instruction that first read module is read is described current to be resolved The last item instruction in data;
First read module is also used to judge the finger that first read module is read when second judgment module It, will be unread in the instruction sequence in the command message when order is not the last item instruction in the current data to be resolved The instruction arrived reads first instruction in the current data to be resolved as current data to be resolved;
Second read module, for judging the instruction that first read module is read when second judgment module When being the last item instruction in the current data to be resolved, using the instruction in the default memory block as currently pending Data read first instruction in the current pending data as present instruction;
The execution module, the present instruction for being read according to second read module execute corresponding operating and are operated As a result;
Second sending module, is specifically used for: the present instruction that second read module is read is sent to card;
First remove module, for obtaining operation knot when the execution module executes corresponding operating according to the present instruction After fruit, the present instruction is removed from the default memory block;It is also used to receive card when second receiving module After the operating result that piece returns, the present instruction is removed from the default memory block;
The third judgment module removes the present instruction for first remove module from the default memory block Later, judge whether there are also instruct in the default memory block;
Second read module is also used to when the third judgment module, which is judged, has instruction in the default memory block, Using the instruction in the default memory block as current pending data, first finger in the current pending data is read It enables and is used as present instruction;
First sending module, is specifically used for: when the third judgment module is judged not refer in the default memory block When enabling, confirm that the instruction sequence in the command message all complete by processing, returns to host computer for operating result.
19. terminal device according to claim 15, which is characterized in that further include: the second preserving module, the 4th judge mould Block, detection module, third read module, the second remove module and the 5th judgment module;
First read module, for using the instruction arrived unread in the instruction sequence in the command message as currently to Data are parsed, first instruction in the current data to be resolved is read;
Second preserving module is also used to the instruction sequences that first read module is read being saved in default memory block In;
4th judgment module, for judging whether the instruction that first read module is read is described current to be resolved The last item instruction in data;
First read module is also used to judge the finger that first read module is read when the 4th judgment module Enable when not being the last item instruction in the current data to be resolved, using the instruction arrived unread in described instruction sequence as Current data to be resolved read first instruction in the current data to be resolved;
The same of first read module, second preserving module and the 4th judgment module is run in the terminal device When, also run the detection module, the third read module, the execution module, second remove module and described Five judgment modules;Alternatively, also running the detection module, the third read module, second sending module, described second Remove module and the 5th judgment module;
The detection module, whether for accessing the default memory block, detecting in the default memory block has instruction;
The third read module will be described for when the detection module, which detects, has instruction in the default memory block Instruction in default memory block reads first instruction conduct in the current pending data as current pending data Present instruction;
The execution module, is specifically used for: the present instruction read according to the third read module executes corresponding operating and obtains To operating result;
Second sending module, is specifically used for: the present instruction that the third read module is read is sent to card;
Second remove module, for obtaining operation knot when the execution module executes corresponding operating according to the present instruction After fruit, the present instruction is removed from the default memory block;It is also used to receive card when second receiving module After the operating result that piece returns, the present instruction is removed from the default memory block;
5th judgment module removes the present instruction for second remove module from the default memory block Later, judge whether there are also instruct in the default memory block;
The third read module is also used to judge that there are also instruct in the default memory block when the 5th judgment module When, using the instruction in the default memory block as current pending data, read first in the current pending data Item instruction is used as present instruction;
First sending module, is specifically used for: when the 5th judgment module is judged not refer in the default memory block When enabling, confirm that the instruction sequence in the command message all complete by processing, returns to host computer for operating result.
20. terminal device according to claim 15, which is characterized in that further include: the 6th judgment module and second executes Module;
6th judgment module is sentenced before described instruction sequence is successively sent to card for second sending module Whether the data in the corresponding data element of disconnected current instruction to be sent on first character section are the first preset value;
Second execution module, for judging in the corresponding data element of current instruction to be sent when the 6th judgment module When data on first character section are the first preset values, execute card and reset operation;
Second sending module, is specifically used for: when the 6th judgment module judges the corresponding number of current instruction to be sent When according to the data in member on first character section not being the first preset value, the current instruction to be sent is sent to card.
21. terminal device according to claim 15, which is characterized in that further include: the 7th judgment module and the 8th judgement Module;
7th judgment module, when the operating result for returning when the card is operation failure, judgement and the operation Failure result it is corresponding instruction whether be in described instruction sequence the last item instruction;
First sending module, is also used to: when the 7th judgment module judge it is corresponding with the operation failure result When instruction is the last item instruction in described instruction sequence, confirm that the instruction sequence in the command message has all been handled At operating result is returned to host computer;
8th judgment module, for judging instruction corresponding with the operation failure result when the 7th judgment module When not being the last item instruction in described instruction sequence, judge whether to continue to read the unread finger arrived in described instruction sequence It enables;
First read module is also used to judge to continue to read in described instruction sequence not read when the 8th judgment module When the instruction got, the instruction sequence in the command message is read;
First sending module is also used to judge not continue to read in described instruction sequence not when the 8th judgment module When the instruction read, the operating result having received is returned into the host computer, is terminated.
22. terminal device according to claim 21, which is characterized in that the 8th judgment module is specifically used for:
By the data and second in data element corresponding to instruction corresponding with the operation failure result in third preset byte Preset value, which is done, obtains operation result with operation, and the operation result is converted to binary representation, judges the institute of binary representation State whether the data in operation result in highest order are the first preset data, be, confirmation continues to read in described instruction sequence not Otherwise the instruction read confirms and does not continue to read the unread instruction arrived in described instruction sequence;
Alternatively,
Whether the data in data element corresponding to judgement instruction corresponding with the operation failure result in the 4th preset byte For third preset value, it is that confirmation continues to read the unread instruction arrived in described instruction sequence, otherwise confirms and do not continue to read The unread instruction arrived in described instruction sequence.
23. terminal device according to claim 15, which is characterized in that first sending module is also used to when described When a wherein instruction processing failure for instruction sequence, by the operating result currently obtained or the operation currently having received As a result sequential concatenation, and it is corresponding with the number of untreated instruction in described instruction sequence, after spliced operating result Second preset data of filling same number gets response packet, and the response message is returned to the host computer.
24. terminal device according to claim 15, which is characterized in that first sending module is also used to when described When a wherein instruction processing failure for instruction sequence, error code is returned to the host computer.
25. terminal device according to claim 15, which is characterized in that further include: update module;
The update module, after reading the instruction sequence in the command message for first read module, according to pre- If mode more New count identifies;
First sending module is also used to when a wherein instruction processing failure for described instruction sequence, by the failure Operating result returns to the host computer with the current count value for counting mark together.
26. terminal device according to claim 15, which is characterized in that
First sending module, the operating result for being also used to receive when second receiving module is less than the 4th preset value When, the operating result received is returned into the host computer.
27. terminal device according to claim 15, which is characterized in that further include: the 9th judgment module and card selection module;
9th judgment module, when for reading first instruction in described instruction sequence when first read module, Before the instruction that first read module is read is sent to card by second sending module, card type is judged;
The card selection module, the card type for being judged according to the 9th judgment module execute card selecting operation;
Second sending module, is specifically used for: when the card selection module operates successfully, first read module being read To instruction be sent to card;
First sending module is also used to when the card selection module operation failure, returns to error code to the host computer.
28. terminal device according to claim 15, which is characterized in that first sending module is specifically used for:
The sequence of operations result sequential concatenation is got response packet, the response message is returned into the host computer;
Alternatively,
By the sequence of operations result sequential concatenation, and between every two adjacent operating results, addition separation mark is obtained The response message is returned to the host computer by response message;
Alternatively,
The last one operating result in the sequence of operations result is returned into the host computer.
CN201710003731.5A 2017-01-04 2017-01-04 A kind of terminal device high efficiency data processing method and its terminal device Active CN106528053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710003731.5A CN106528053B (en) 2017-01-04 2017-01-04 A kind of terminal device high efficiency data processing method and its terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710003731.5A CN106528053B (en) 2017-01-04 2017-01-04 A kind of terminal device high efficiency data processing method and its terminal device

Publications (2)

Publication Number Publication Date
CN106528053A CN106528053A (en) 2017-03-22
CN106528053B true CN106528053B (en) 2019-02-15

Family

ID=58336861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710003731.5A Active CN106528053B (en) 2017-01-04 2017-01-04 A kind of terminal device high efficiency data processing method and its terminal device

Country Status (1)

Country Link
CN (1) CN106528053B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577969B (en) * 2017-09-19 2018-10-12 恒宝股份有限公司 A kind of smart card and its personalization method
CN107727082B (en) * 2017-11-09 2023-08-04 自然资源部第二海洋研究所 Modularized system for monitoring buoy in real time
CN108202329A (en) * 2017-12-31 2018-06-26 芜湖哈特机器人产业技术研究院有限公司 A kind of method that robot demonstrator is communicated with controller data with parsing
CN111930425B (en) * 2020-06-23 2022-06-10 联宝(合肥)电子科技有限公司 Data control method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101383994A (en) * 2007-09-07 2009-03-11 凤凰微电子(中国)有限公司 Data processing method for APDU command
CN102541639A (en) * 2011-12-26 2012-07-04 北京握奇数据系统有限公司 CPU (Central Processing Unit) card data processing method, CPU card data processing system and CPU card
CN103345610A (en) * 2013-06-20 2013-10-09 武汉天喻信息产业股份有限公司 Device and method for quickly verifying data integrity of intelligent card
CN104092675A (en) * 2014-06-30 2014-10-08 飞天诚信科技股份有限公司 Reverse processing method and terminal based on main communication structure and auxiliary communication structure

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3883647B2 (en) * 1997-06-10 2007-02-21 インターナショナル・ビジネス・マシーンズ・コーポレーション Message processing method, message processing apparatus, and storage medium for storing program for controlling message processing
TWI363966B (en) * 2008-01-23 2012-05-11 Phison Electronics Corp Method, system and controller for transmitting and dispatching data stream
US9058420B2 (en) * 2008-06-20 2015-06-16 Vmware, Inc. Synchronous decoupled program analysis in virtual environments

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101383994A (en) * 2007-09-07 2009-03-11 凤凰微电子(中国)有限公司 Data processing method for APDU command
CN102541639A (en) * 2011-12-26 2012-07-04 北京握奇数据系统有限公司 CPU (Central Processing Unit) card data processing method, CPU card data processing system and CPU card
CN103345610A (en) * 2013-06-20 2013-10-09 武汉天喻信息产业股份有限公司 Device and method for quickly verifying data integrity of intelligent card
CN104092675A (en) * 2014-06-30 2014-10-08 飞天诚信科技股份有限公司 Reverse processing method and terminal based on main communication structure and auxiliary communication structure

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
智能卡COS的研究与设计;黄健;《中国优秀硕士学位论文全文数据库信息科技辑》;20080915;正文第66-75页

Also Published As

Publication number Publication date
CN106528053A (en) 2017-03-22

Similar Documents

Publication Publication Date Title
CN106528053B (en) A kind of terminal device high efficiency data processing method and its terminal device
CN101431809B (en) OBEX protocol bug excavation method and system
CN109144531A (en) The approaches to IM and device of programming system and its server
CA2179298A1 (en) Information display system for actively redundant computerized process control
CN105069617B (en) A kind of method and apparatus for restoring imperfect transaction
CN107220199B (en) The host computer of refrigerator, the slave computer of refrigerator, the communication means of refrigerator and system
CN105517110B (en) A kind of method and device connecting bluetooth equipment
CN108052094A (en) A kind of extension card identification method, device and frequency converter
CN109189421A (en) Burning management method, device and programming system based on programming system server
CN100487683C (en) System and method for initializing data card
CN108684057A (en) A kind of automatic test approach and system for test router and terminal transparency
CN105847031A (en) Network topology construction system and method for testing OpenFlow SDN (Software Defined Networking) controller
CN107548053A (en) Mobile terminal SIM card compatibility test method and system
CN109062586A (en) The burning management method and device of programming system and its client
CN105787408B (en) A kind of card reader and its method of work for supporting high-speed data communications
CN106445771A (en) Monitoring data processing method and device, and monitoring server
CN105407001B (en) A kind of method, system and device of quick identification communications parameter configuration
CN110032559A (en) A kind of data pick-up method and device
CN105959393B (en) A kind of card automatic production method and device
CN109032624A (en) A kind of test method and its device based on programming system
CN103914420B (en) SATA speed auto-negotiation method based on third party PHY and device
CN104881379B (en) A kind of serial port communication method
CN101399852B (en) Method for realizing wireless access kit upgrading through network interface
CN109542903B (en) Data processing method and device
CN117349201B (en) Multi-slave control method, system and storage medium based on serial port communication

Legal Events

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