The content of the invention
Technical problems to be solved in this application are to provide a kind of data processing method and system, and solution is counted in the prior art
According to process steps frequently, redundancy, the problem of data-handling efficiency is low.
In order to solve the above problems, this application discloses a kind of data processing method, including:
After the first user is paid using the first valuable data as the second valuable data, order is generated based on payout status
Good authentication code;Second valuable data is safeguarded by second user;
When the corresponding article of second valuable data is sent to the first user, pass through second user corresponding second
Terminal obtains the order good authentication code entrained by the corresponding first terminal of the first user;
Second terminal parses the order good authentication code, order good authentication code is confirmed, and will confirm that message
It is sent to server;
First valuable data is transferred to second user by server according to the confirmation message.
It is preferred that, the order good authentication code is two-dimension code pattern data;The two-dimension code pattern data are whole by first
End generation.
It is preferred that, ordering entrained by the corresponding first terminal of the first user is obtained by the corresponding second terminal of second user
Include during single good authentication code:
Second terminal obtains the order good authentication code by bluetooth, and/or close range wireless communication;The order into
Work(identifying code is the coding information of encryption.
It is preferred that, the acquisition step that the first terminal carries order good authentication code includes:
Server is generated based on the situation that the first user is paid using the first valuable data as the second valuable data and paid
Sequence information, and the pay invoice information is sent to the first terminal;
First terminal is based on the pay invoice information, generates the two-dimension code pattern data.
It is preferred that, and include when the pay invoice information is sent to the first terminal:
A pair of the public and private keys generated based on server and second user, private key is to the pay invoice described in server by utilizing
Information is signed;
Pay invoice information after signature is sent to the first terminal.
It is preferred that, generating the two-dimension code pattern data includes:
First terminal includes the pay invoice information and the private based on the pay invoice information after the signature, generation
The two-dimension code pattern data of key signed data.
It is preferred that, the pay invoice information includes:The order number of 8 bytes, the time of 14 bytes, 8 bytes
Merchant ID, the amount of money of 8 bytes, the state of 1 byte, the quantity of 3 bytes.
It is preferred that, the generation step of the two-dimension code pattern data includes:
Set M*M picture element matrix, using described one layer of pixel of picture element matrix outermost as Quick Response Code view finding figure;
It regard one layer of pixel of the picture element matrix close to view finding figure as break graphic;
Remaining region in the picture element matrix is divided into N block sub-pixel matrix, and in every piece of sub-pixel matrix specific bit
Install positioning figure;
Pay invoice information is encoded to binary coding, the first coded sequence is constituted with reference to binary signed data;
According to the respective scale of N blocks sub-pixel matrix, first coded sequence is divided into corresponding N blocks first and encoded
Subsequence;
According to default error-correction level, corresponding Error Correction of Coding is generated for every piece of encoded subsequence, corresponding N blocks error correction is obtained
Encoding block;
The encoding block of N blocks first and corresponding N blocks error correction coding block are inserted into corresponding N blocks sub-pixel matrix, M*M bis- is generated
Tie up code graph data.
It is preferred that, the encoding block of N blocks first and corresponding N blocks error correction coding block are inserted into corresponding N blocks sub-pixel matrix, it is raw
Also include after into M*M two-dimension code pattern data:
It is covered in using at least two mask pattern datas on the two-dimension code pattern data, obtains the first Quick Response Code figure
Graphic data;
It is in place with N blocks sub-pixel matrix institute in the two-dimension code pattern data for the first two-dimension code pattern data
It is set to the characteristic value N1 of the color same case of adjacent cells block in units chunk, analysis ranks, by color identical units chunk group
There is the characteristic value N3 of 1011101 type figures, whole Quick Response Code in the characteristic value N2 of blocking situation, the ranks of each units chunk
The accounting N4 of dark units chunk in graph data;
Calculate described N1, N2, N3, N4 weighted average;
The version information of the corresponding mask pattern data of minimum in each weighted average is added the described 1st
The noncoding region of code graph data is tieed up, final two-dimension code pattern data are generated.
It is preferred that, the two-dimension code pattern data are parsed in second terminal, include during pay invoice validation of information:
The two-dimentional icon data is parsed, the signed data of pay invoice information and server is obtained;
Sent according to server to the public key corresponding to second terminal of second terminal, the pay invoice information to parsing is entered
Row signature, obtains the signed data of second terminal;
The signed data of second terminal is matched with the signed data of the server, if it does, then confirming branch
Pay sequence information.
It is preferred that, the two-dimentional icon data is parsed, is also wrapped during the signed data for obtaining pay invoice information and server
Include:
Parse the mask pattern data version information in the final two-dimension code pattern data;
The mask pattern data of the final two-dimension code pattern data is removed according to the version information, original two dimensional is obtained
Code graph data.
It is preferred that, the two-dimentional icon data is parsed, bag after the signed data of pay invoice information and server is obtained
Include:
Based on second terminal current time and effective period of time, judge whether the temporal information in pay invoice information is having
Imitate in the period;
If sent according to server to the public key corresponding to second terminal of second terminal, the payment to parsing
Sequence information is signed, and obtains the signed data of second terminal;
If it was not then not handling the data that parsing is obtained.
Accordingly, disclosed herein as well is a kind of data handling system, including:
Order good authentication code generation module, for being carried out as the first user by the second valuable data of the first valuable data
After payment, based on payout status generation order good authentication code;Second valuable data is safeguarded by second user;
Order good authentication code acquisition module, for being sent when by the corresponding article of second valuable data to the first use
During family, the order good authentication that the corresponding first terminal of the first user is carried is obtained by the corresponding second terminal of second user
Code;
Parsing confirms module, for parsing the order good authentication code by second terminal, to order good authentication code
Counterpart expenditure sequence information is confirmed, and will confirm that messaging to server;
First valuable data processing module, for by server according to the confirmation message by first valuable data
It is transferred to second user.
It is preferred that, in order good authentication code acquisition module, obtained by the corresponding second terminal of second user
Include during the order good authentication code that the corresponding first terminal of the first user is carried:
Second terminal obtains the order good authentication code by bluetooth, and/or near radio transmission;The order into
Work(identifying code is the coding information of encryption.
It is preferred that, the server includes pay invoice information and generates sending module, valuable with first based on the first user
Data are the situation generation pay invoice information that the second valuable data is paid, and the pay invoice information is sent to institute
State first terminal;
The order good authentication code generation module is in first terminal, for being believed in first terminal based on the pay invoice
Breath, generates the order good authentication code of two-dimension code pattern data format.
Compared with prior art, the application includes advantages below:
First, pass through interacting for first terminal and second terminal, it is not necessary to which account logs in, checks pay invoice information again
And final confirmation is operated, whole data handling procedure step is simple, improves the treatment effeciency of data;
Second, when first terminal is interacted with second terminal, second terminal can will confirm that information is sent to server, clothes
Being engaged in device then can be according to confirmation to the first valuable data progress transfer processing, and its time point handled delay is low, so as to improve
The efficiency of whole data handling procedure.
Embodiment
It is below in conjunction with the accompanying drawings and specific real to enable above-mentioned purpose, the feature and advantage of the application more obvious understandable
Mode is applied to be described in further detail the application.
One of core concept of the application is, the second valuable data of the network platform is uploaded to for second user, the
One user is paid in the network platform with the first valuable data to second valuable data, and the first of the first user payment
Valuable data is managed on behalf of another by the network platform or third-party platform, and the server for the side of managing on behalf of another believes the pay invoice generated after payment
Breath, the packet including the pay invoice information is sent to the corresponding first terminal of the first user (such as mobile phone etc.), the
One terminal includes the packet of the pay invoice information by described;When the corresponding article of valuable data is sent out under second user line
When giving the first user, Quick Response Code, bluetooth or NFC are crossed all, and (Near Field Communication, near radio leads to
News technology) the corresponding second terminal progress acknowledgement of orders of second user is transferred to, it then will confirm that message uploads onto the server, take
Business device receives the first valuable data for paying the first user after the confirmation message and goes to second user.So substantially may be used
Substantial amounts of data handling procedure is saved in deduction and exemption, and server can in time to the first valuable data of the first user payment at
Reason, improves whole data-handling efficiency.
Reference picture 1, it illustrates a kind of schematic flow sheet of data processing method of the application, including:
Step 110, after the first user is paid using the first valuable data as the second valuable data, based on payout status
Generate order good authentication code;Second valuable data is safeguarded by second user;
In this application, after the first user is paid using the first valuable data as the second valuable data, based on payment
Situation generation order good authentication code generally comprises two kinds of situations:
The first situation is that the first user login services device is paid by the second valuable data of the first valuable data
Afterwards, the pay invoice information generation order good authentication code that server is paid based on the first user;Then by the order
Good authentication code is sent to the corresponding first terminal of the first user;
Wherein, the order good authentication code is the coding information of encryption.Second terminal is by bluetooth, and/or closely
Wireless telecommunications obtain the order good authentication code.The coding information of the encryption includes the pay invoice information of signature, and/or
The sequence information of person's encryption.
Second of situation is that the first user login services device is paid by the second valuable data of the first valuable data
Afterwards, server sends the pay invoice information that the first user paid to the first terminal of the first user, by first terminal base
Order successful data is generated in receiving the pay invoice information paid.
Wherein, the order good authentication code is two-dimension code pattern data;The two-dimension code pattern data are by first terminal
Generation;Second terminal obtains first terminal two-dimension code pattern data by way of scanning.
Described order good authentication code can also be other types graphic code data, such as one-dimension code graph data in addition
Deng these graph datas can also be generated by first terminal.
Step 120, when the corresponding article of second valuable data is sent to the first user, second user pair is passed through
The second terminal answered obtains the order good authentication code entrained by the corresponding first terminal of the first user;
When the first user receives second user and sends the corresponding article of the second valuable data under line, second user uses the
Two terminals obtain the order good authentication code carried in the first terminal of the first user.
Wherein first terminal and second terminal can including mobile phone etc. mobile terminal.
Step 130, second terminal parses the order good authentication code, and order good authentication code is confirmed, and will
Confirmation message is sent to server;
The second terminal of second user parses the order good authentication code of its acquisition, carries out order good authentication code and confirms,
Confirm an order the corresponding pay invoice information of good authentication code, and will confirm that messaging to server;Ordered described in judging
Whether single good authentication code is authentic and valid, if it is valid, will confirm that message is sent to server.
Step 140, first valuable data is transferred to second user by server according to the confirmation message.
Server is received after the confirmation message, that is, shows that goods is handed under the corresponding pay invoice information wire of confirmation message
Connect and finish, the second valuable data can be handled, i.e., first valuable data is transferred to according to the confirmation message
Two users.
Reference picture 2, it illustrates a kind of schematic flow sheet of data processing method of the embodiment of the present application one.
For the data handling procedure of the application, one embodiment application environment is illustrated:Network buyer A is handed in network
Easy platform have purchased network seller B commodity, and then the commodity are paid by network, wherein the price paid is first
First deposit in server;Server is based on above-mentioned transaction and generates a pay invoice information, then sends out pay invoice information
Deliver to the corresponding first terminal of the first user, such as the terminal such as mobile phone, first terminal is based on pay invoice information generation and ordered
Single good authentication code, such as two-dimensional code graphical information.When seller sends physical commodity to buyer by modes such as mailing, sell
X-Y scheme information in the first terminal of the second terminal scanning buyer of family carries out acknowledgement of orders, and the Confirmation of Orders is disappeared
Breath uploads onto the server;Price is forwarded to seller by the Confirmation of Orders message that server is uploaded according to second terminal.
During this, buyer is after goods is received, and without logging on network trading platform, step-by-step operation carries out arrival confirmation;Clothes
The payment for goods value kept in server also can be given to seller by business device in time, without being waited for a long time.
A kind of application scenarios also may be present in addition:Buyer initiates to hand at seller scene, such as supermarket's hair by first terminal
Easily, after being paid by network trading (payment) platform to transaction, network trading (payment) platform sends pay invoice information
To first terminal, first terminal is based on pay invoice information generation order good authentication code, such as two-dimensional code graphical information.
For two-dimensional code graphical information, seller then scans two-dimensional code graphical information in first terminal by its second terminal, then carries out
Parsing and confirmation, confirm an order success, then buyer is let pass;And the second terminal of seller can will confirm that successful information send to
The price that buyer pays then is gone to seller's account by network trading (payment) platform, network trading (payment) platform according to confirmation message
Family.
Accordingly, the step of the present embodiment includes:
Step 210, the situation that server is paid based on the first user using the first valuable data as the second valuable data
Pay invoice information is generated, and the pay invoice information is sent to the first terminal;Second valuable data is by
Two users safeguard;
Such as, when buyer A have purchased the commodity b1 that seller B is issued in the network platform in the network platform, and to it
Enter to be about to its price to pay after server, server is based on payout status and generates pay invoice information, and the payment is ordered
Single information is sent to the first terminal.Again such as, buyer A is corresponding with the commodity b1 that seller B is issued in first terminal editor
Sequence information, then sends the sequence information to server, server generates pay invoice information again according to the sequence information
Send to buyer A first terminal.
In this application, corresponding sequence information receiving module and two dimension can be installed in the first terminal of the first user in advance
Code generation module, installs corresponding two-dimension code pattern data parsing in the second terminal of second user and confirms module and sequence information
Delivery and reception module etc..
It is preferred that, pay invoice information described herein includes:The order number of 8 bytes, the time of 14 bytes, 8
The Merchant ID of individual byte, the amount of money of 8 bytes, the state of 1 byte, the quantity of 3 bytes.
Such as, pay invoice packet contains:
Order number:8 bytes, pure digi-tal, such as 00000123
Time:14 bytes, pure digi-tal, such as 20120205164000 (represent on 2 5th, 2012 afternoon 4: 40
Minute)
Merchant ID:8 bytes, pure digi-tal, such as 00001888
The amount of money:8 bytes, pure digi-tal, such as 0000066600 (representing 666 yuan)
State:1 byte, pure digi-tal, 0:1 is not purchased:Purchase 2:Check and write off
Quantity:3 bytes, pure digi-tal, 010 (expression has bought 10)
Pay invoice information 42 bytes altogether.
Wherein, sequence information can be configured with other forms.The content of such as sequence information can be according to actual need
Ask and be added or delete.Form the application of specific job information is not any limitation as to it.
It is preferred that, and include when the pay invoice information is sent to the first terminal:
Step A1, a pair of the public and private keys generated based on server and second user, private key is to described described in server by utilizing
Pay invoice information is signed;
The pay invoice information generated for server, such as the pay invoice information of foregoing 42 byte, server then base
A pair of the public and private keys generated in server and second user, are signed using private key therein to the pay invoice information.
RSA (public-key encryptosystem) method signature such as is carried out using private key, signed data length can be 128 bytes.
Step A2, the pay invoice information after signature is sent to the first terminal.
Such as the signed data of the pay invoice information of foregoing 42 byte and 128 bytes is sent to first terminal.
Step 220, first terminal is based on the pay invoice information, generates two-dimension code pattern data.
It is preferred that, include after pay invoice information after first terminal receives the signature:
Step A3, first terminal includes the pay invoice information based on the pay invoice information after the signature, generation
With the two-dimension code pattern data of the private key signature data.
It is preferred that, the generation step of the two-dimension code pattern data includes:
Step B1, set M*M picture element matrix, using described one layer of pixel of picture element matrix outermost as Quick Response Code view finding
Figure;
In practice, two-dimension code pattern is typically represented colourless (generally white) by 0, and 1 represents coloured (generally black).By
Rule progress two-dimensional arrangements can form two-dimension code pattern data to the binary coding of 0 and 1 composition in certain sequence.The application is excellent
Choosing uses M*M pixel matrix configuration two-dimension code pattern data.Certainly, the M*M pixel matrix configuration two-dimension code patterns of the application
Data, its concrete form can be selected according to pay invoice information and/or signed data length, such as 49*49,52*52 etc..
Pay invoice information and 128 octet signature data such as foregoing 42 byte, be using 49*49 picture element matrixs
It may include the pay invoice information of 42 bytes and all the elements of 128 octet signature data, the digit of the 49*49 picture element matrixs
For 2041bits.Code efficiency preferably, most saves the memory space of first terminal.
, typically can be by one layer of pixel of picture element matrix outermost when using M*M pixel matrix configuration two-dimension code pattern data
As the view finding figure of Quick Response Code, that is, color is made it have, such as be black, be i.e. one layer of each pixel of pixel of outermost is set to
1。
Step B2, regard one layer of pixel of the picture element matrix close to view finding figure as break graphic;
, typically can be by the picture element matrix close to view finding figure when using M*M pixel matrix configuration two-dimension code pattern data
One layer of pixel of shape is as break graphic, even if its is colourless, such as is white, will the picture element matrix close to view finding figure
One layer of pixel as each pixel of break graphic be set to 0.
Step B3, is divided into N block sub-pixel matrix by remaining region in the picture element matrix, and in every piece of sub-pixel matrix
Specified location sets positioning figure;
Selection according to the M of M*M picture element matrixs is different, and the demand constructed based on two-dimension code pattern is, it is necessary to by M*M pixel squares
Battle array is divided into error correction coding block, coded strings piecemeal is put into the error correction coding block, to recognize.Wherein, in order to parsing when sentence
The position of disconnected every piece of sub-pixel matrix, can set positioning figure in every piece of sub-pixel matrix specified location.Position the specific of figure
Position can be determined according to the shape of corresponding sub-pixel matrix, can be each if such as error correction coding block is size same matrix
The upper left corner of sub-pixel matrix sets positioning figure.
Step B4, binary coding is encoded to by pay invoice information, is compiled with reference to binary signed data composition first
Code sequence;
In practice, data can be encoded according to a kind of pattern, to carry out more efficient decoding.Such as preceding
State the pay invoice information of 42 bytes and the signed data of 128 bytes.Due to pay invoice information regular length and for cardinar number
Word, so dividing one group, one group of 10bits, so being 144bits (140bits+4bits after sequence information coding using every 3 words
(mending 4 0);Signed data is binary message, can keep original form, and digit is 128x8=1024bits.So will branch
Pay sequence information and be encoded to binary coding, constitute the first coded sequence with reference to binary signed data is total up in encoded
1168bits。
Step B5, according to the respective scale of N blocks sub-pixel matrix, is divided into corresponding N blocks by first coded sequence
First encoded subsequence;
In order that coded sequence efficiently generates two-dimension code pattern data, it is typically respective according to the N blocks sub-pixel matrix
Scale, is divided into the corresponding encoded subsequence of N blocks first by first coded sequence.
Step B6, according to default error-correction level, corresponding error correction coding block is generated for every piece of encoded subsequence;
In order to ensure that decoding can be parsed with former first coded sequence identical coded sequence, it is necessary to carry out error correction volume
Code.Corresponding Error Correction of Coding is generated to foregoing each piece of the first encoded subsequence, corresponding N blocks error correction coding block is obtained.In reality
In, the grade of Error Correction of Coding is selected according to the actual requirements, can be using RS (Reed-solomon codes, inner institute's code) codings, production
Raw error correction coding block word.Certainly, other Error Correction of Coding block coding methods can also be used.
Finally, sequence generating mode can be:The code word 1 of first encoded subsequence 1, the code word of the first encoded subsequence 2
1 ... the code word 1 of the first encoded subsequence 1;The code word 2 of first encoded subsequence 1, the code word of the first encoded subsequence 2
2 ... the first encoded subsequences of code word 2...... n of the first encoded subsequence 1 code word 2 ... the first sub- sequence of coding
Last first encoded subsequence of code word ... n of row 1 last code word;Then, the code word 1 of error correction coding block 1,
The code word 1 of error correction coding block 2 ... error correction coding block n code word 1;The code word 2 of error correction coding block 1, error correction coding block 2
Code word 2 ... the code word 2...... error correction coding blocks n of error correction coding block 1 code word 2 ... error correction coding block 1 is most
Latter code word ... error correction coding block n last two code words.If necessary plus corresponding number individual remaining bit.Wherein first
Encoded subsequence is the N block encoded subsequences that foregoing pay invoice information and signed data are obtained.
In addition, in sequence generating mode, the code word of N number of error correction coding block can be m, n >=m >=1.Such as work as m=1
When, after the first encoded subsequence is drained by aforementioned sequence, follow the code word 1 of error correction coding block 1, the code word of error correction coding block 2
1 ... error correction coding block n code word 1.
Such as foregoing use 49*49 picture element matrixs, the label of pay invoice information and 128 bytes to foregoing 42 byte
The coding and corresponding Error Correction of Coding of name data generation, can be that the code word that can fill up symbol substantially is held by above-mentioned sequence generating mode
Amount, can add 3,4 or 7 remaining bits are supplemented if necessary.
Step B7, corresponding N blocks sub-pixel matrix is inserted by the encoding block of N blocks first and corresponding N blocks error correction coding block, raw
Into M*M two-dimension code pattern data.
Not as foregoing sequences generating mode, the N blocks that can be inserted according to its sequence generating mode in 49*49 picture element matrixs
Sub-pixel matrix, you can form the two-dimension code pattern data of 49*49 pixels.
It is preferred that, the encoding block of N blocks first and corresponding N blocks error correction coding block are inserted into corresponding N blocks sub-pixel matrix, it is raw
Also include after into M*M two-dimension code pattern data:
Step B8, is covered on the two-dimension code pattern data using at least two mask pattern datas, obtains first
Two-dimension code pattern data;
Step B9, for the first two-dimension code pattern data, with N block sub-pixel matrix in the two-dimension code pattern data
Position is the characteristic value N1 of the color same case of adjacent cells block in unit block, analysis ranks, by color identical list
Occurs the characteristic value N3, whole of 1011101 type figures in the characteristic value N2 of situation of position block blocking, the ranks of each units chunk
The accounting N4 of dark units chunk in two-dimension code pattern data;
It is (different that N block graphicses such as with N number of Matrix Pattern (i.e. mask graph reference) to known coding region carry out XOR
Or) operation.Analyze the characteristic value N1 of the color same case of adjacent cells block in ranks, by color identical units chunk blocking
The characteristic value N2 of situation, there is the characteristic value N3 of 1011101 type figures, whole two-dimension code pattern in the ranks of each units chunk
The accounting N4 of dark units chunk in data.
Step B10, calculates described N1, N2, N3, N4 weighted average;
Step B11, institute is added by the version information of the corresponding mask pattern data of minimum in each weighted average
The noncoding region of second graph data is stated, final two-dimension code pattern data are generated.
Such as the bitmap of the coding region in foregoing N blocks region is covered successively with 4 kinds of mask graphs in the application
Mould processing, 4 kinds of results obtained by evaluating select optimal one kind.It is preferred that balancedly arranging dark and light module, mask is not
Undesirable set of part of each result figure is scored (including color same case for functional graphics such as graph position detections
Characteristic value N1, the characteristic value N2 of situation by color identical units chunk blocking, occur in the ranks of each units chunk
The parts of accounting N4 tetra- of dark units chunk in the characteristic value N3 of 1011101 type figures, whole two-dimension code pattern data), select whole
The minimum figure of body score is used as the final two-dimension code pattern after mask process.Wherein selected mask version information is added into
The noncoding region of the first two-dimension code pattern data, i.e., be not used in picture element matrix and insert pay invoice information and signing messages
Coding, the coding region of error correcting code.
In addition, being based on the pay invoice information in first terminal, during generation two-dimension code pattern data, payment can be only utilized
The static informations such as order number and businessman inside sequence information generate two-dimension code pattern data.It is wherein specific to utilize pay invoice letter
Which information generation two-dimension code pattern data inside breath can be configured according to the actual requirements, and the application is not limited it
System.
Wherein, step 210 and the preferred embodiment that step 220 is abovementioned steps 110.
Step 230, when the corresponding article of second valuable data is sent to the first user, second user pair is passed through
The second terminal scanning answered obtains the two-dimension code pattern data that the corresponding first terminal of the first user is carried;
I.e. when the first user receives commodity, the first user correspondence is obtained by the corresponding second terminal scanning of second user
First terminal carry two-dimension code pattern data.
Step 240, second terminal parses the two-dimension code pattern data, and two-dimension code pattern data counterpart expenditure order is believed
Breath is confirmed, and will confirm that messaging to server;
It is preferred that, the two-dimension code pattern data are parsed in second terminal, include during pay invoice validation of information:
Step C1, parses the two-dimentional icon data, obtains the signed data of pay invoice information and server;
It is the inverse process of coded program from one two-dimension code pattern data of recognition to the decoding step of output data character.
Actually realizing, first:Positioned by the second squadron and obtain two-dimension code pattern data, such as monochrome BMP figures
Picture.Wherein, dark and light module is identified as the array being made up of " 0 " and " 1 ".
It is preferred that, when the two-dimension code pattern data are after mask process, the two-dimentional icon data is parsed, is propped up
Also include during the signed data for paying sequence information and server:
Step D1, parses the mask pattern data version information in the final two-dimension code pattern data;
Step D2, the mask pattern data of the final two-dimension code pattern data is removed according to the version information, is obtained
Original two dimensional code graph data.
Confirm that the two-dimension code pattern employs any mask artwork figurate number according to the mask pattern data version information
According to.Then carry out XOR processing of the mask pattern data to N block coding regions is used, mask is eliminated.
Then, according to module array rule, sign character is distinguished, recovers the data and error correction code word of information.
Again, with the error correction codeword detection mistake corresponding with error-correction level information, if an error is found, then being entangled
It is wrong.
Finally, enter row decoding, draw data character and output result.
Such as the sequence information of foregoing 42 byte, the signing messages of 128 bytes.Former sequence information is obtained after decoding
Data message and former server use the signing messages of public key.
It is preferred that, the two-dimentional icon data is parsed, bag after the signed data of pay invoice information and server is obtained
Include:
Step P1, based on second terminal current time and effective period of time, judges the temporal information in pay invoice information
Whether in effective period of time;
Such as, second terminal current time is 2012-04-12:00, effective period of time is 30 days;Obtained for parsing
Temporal information 2012-04-01-9 in pay invoice information:00, then temporal information 2012-04-01-9:00 distance second
Terminal current time 2012-04-12:00 less than 30 days, before the deadline.
Step P2, if sent according to server to the public key corresponding to second terminal of second terminal, to parsing
Pay invoice information signed, obtain second terminal signed data;
If the temporal information in pay invoice information is in effective period of time, then can determine whether the pay invoice
Effectively, you can carry out follow-up verification step.
Step P3, if it was not then not handling the data that parsing is obtained.
If the temporal information in pay invoice information is not in effective period of time, it is believed that order failure, can not
Continuation is handled order.
The processing time of second terminal can be so saved, treatment effeciency is improved.
Such as in another application scenarios:Such as seller has issued reward voucher or delivery of cargo certificate in the network platform, buys
The reward voucher or delivery of cargo certificate have been bought by family, and pay invoice information is sent to the first terminal of buyer, first terminal by server
Generate two-dimension code pattern data.Then in use, the two-dimension code pattern data of the second terminal scanning first terminal of seller are carried out
Parsing and confirmation.Average preference certificate or delivery of cargo certificate have effective period of time.Second terminal can be improved using above-mentioned steps
Treatment effeciency, and then improve the efficiency of whole data handling procedure.
Step C2, sends to the public key corresponding to second terminal of second terminal, the payment to parsing is ordered according to server
Single information is signed, and obtains the signed data of second terminal;
Such as aforementioned data, if payment information data are in preceding 42 byte, using number of the public key to preceding 42 byte
According to being signed, the signed data of second terminal is obtained.
Step C3, the signed data of second terminal is matched with the signed data of the server, if it does, then
Confirm pay invoice information.
After pay invoice information is confirmed, second terminal can then will confirm that message is sent to server.It will can wherein prop up
Pay sequence information and be sent completely to server, also can only send order number, concrete form can be set according to the actual requirements.
In addition, the opportunity that second terminal sends confirmation message can confirm to finish to be sent to server end immediately, also may be used
Delay is sent.I.e. such as when transmit signal it is bad when, can will confirm that message is temporarily stored into second terminal, may wait for signal it is good when again
It is transmitted.
Step 250, first valuable data is transferred to second user by server according to the confirmation message.
After server receives the confirmation message, respective pay sequence information corresponding the is searched according to confirmation message
One valuable data, is then transferred to second user by the first valuable data.Such as it is transferred to bank account of seller etc..
Reference picture 3, shows a kind of schematic flow sheet of data processing method of the embodiment of the present application two.For the application
Data handling procedure, illustrate one embodiment application environment:Network buyer A have purchased network in network trading platform and sell
Then the commodity are paid, wherein the price paid is deposited in server first by family B commodity by network;
Server is based on above-mentioned transaction and generates a pay invoice information, and pay invoice information then is sent into corresponding to the first user
The terminals such as first terminal, such as mobile phone, first terminal is kept in described into pay invoice information.When seller by physical commodity send to
During buyer, offline send to second terminal of order success is carried out acknowledgement of orders by buyer by bluetooth or NFC, and should
Confirmation of Orders message uploads onto the server;The Confirmation of Orders message that server is uploaded according to second terminal turns price
It is sent to seller.In this process, buyer is after goods is received, and without logging on network trading platform, step-by-step operation is carried out
Arrival confirms;The payment for goods value kept in server also can be given to seller by server in time, without being waited for a long time.
A kind of application scenarios also may be present in addition:Buyer initiates to hand at seller scene, such as supermarket's hair by first terminal
Easily, after being paid by network trading (payment) platform to transaction, network trading (payment) platform sends pay invoice information
To first terminal, first terminal keeps in pay invoice information.The second terminal of seller then obtains first eventually by bluetooth or NFC
Pay invoice information in end, is then parsed and is confirmed, confirm an order success, then buyer is let pass;And the second of seller
Terminal can will confirm that successful information is sent to network trading (payment) platform, and network trading (payment) platform is then according to confirmation message
The price that buyer is paid goes to seller's account.
The step of the present embodiment, includes:
Step 310, the situation that server is paid based on the first user using the first valuable data as the second valuable data
Pay invoice information is generated, and pay invoice Information Signature encryption is sent to the first terminal;Described second is valuable
Data are safeguarded by second user;
Such as, when buyer A have purchased the commodity b1 that seller B is issued in the network platform in the network platform, and to it
Enter to be about to its price to pay after server, server is based on payout status and generates pay invoice information, and the payment is ordered
Single Information Signature encryption is sent to the first terminal.
Again such as, then buyer A should in first terminal editor sequence information corresponding with the commodity b1 that seller B is issued
Sequence information is sent to server, and server generates pay invoice information according to the sequence information, and encrypted signature is sent to buyer again
A first terminal.
First terminal then keeps in the pay invoice information of the encrypted signature.Wherein pay invoice information with it is foregoing similar.
Wherein step 310 corresponds to the preferred embodiment of step 110.
Step 320, when the corresponding article of second valuable data is sent to the first user, second user pair is passed through
The second terminal answered obtains the encrypted signature pay invoice information that the corresponding first terminal of the first user is carried;
It is preferred that, in the present embodiment, first terminal can pre-set Bluetooth function or NFC function, corresponding second
Terminal can also set Bluetooth function or NFC function.
Such as NFC function.Such as mobile phone, the mobile phone of buyer can be using a radio frequency leaflet device insertion sound
Frequency interface, such as insert 3.5mm or 2.5mm standard audio interfaces.Seller can use a kind of card-reading terminal (RFID card reader.Branch
Hold reading, send and storage RFID information, support dynamic password, support the display of Transaction Information).
Step 330, second terminal parses the pay invoice information of the encrypted signature, and the pay invoice information is carried out
Confirm, and will confirm that messaging to server;
When second terminal is interacted by bluetooth or NFC with first terminal, the payment of the encrypted signature is got
Sequence information, then confirm, and will confirm that messaging to server to the pay invoice information.
Such as foregoing NFC mode, when buyer's mobile phone has been shaken hands by the card-reading terminal of radio frequency leaflet device and seller
Finish, transmitted after Transaction Information, you can carry out the parsing of order data.
Such as in foregoing NFC forms, COBBAIF can be inserted using a radio frequency leaflet device using the mobile phone of buyer,
When seller uses card-reading terminal.
When cellphone subscriber does shopping in businessman, enter after being paid on line, radio frequency leaflet device is inserted 3.5mm or 2.5mm and marked
On quasi- COBBAIF, contacted with card-reading terminal, using 13.56MHZ or 2.4G frequency ranges, data are transmitted using RDID technologies, are started
Certification link.Radio frequency leaflet device and card-reading terminal are mutually authenticated using four steps.Wherein, RFID is Radio
Frequency Identification abbreviation, i.e. radio frequency identification, are commonly called as electronic tag.RFID radio frequency identifications, which are that one kind is non-, to be connect
The automatic identification technology of touch, it is by radiofrequency signal automatic identification destination object and obtains related data, and identification work need not
Manual intervention.System is made up of a challenger (or reader) and many transponders (or label).
It is preferred that, second terminal includes after parsing the pay invoice information of the encrypted signature:
Step O1, based on second terminal current time and effective period of time, judges the temporal information in pay invoice information
Whether in effective period of time;
Step O2, if sent according to server to the public key corresponding to second terminal of second terminal, to parsing
Pay invoice information signed, obtain second terminal signed data;
If the temporal information in pay invoice information is in effective period of time, then can determine whether the pay invoice
Effectively, you can carry out follow-up verification step.
Step O3, if it was not then not handling the data that parsing is obtained.
The processing time of second terminal can be so saved, treatment effeciency is improved.
Such as in another application scenarios:Such as seller has issued reward voucher or delivery of cargo certificate in the network platform, buys
The reward voucher or delivery of cargo certificate have been bought by family, and pay invoice information is sent to the first terminal of buyer by server.Then use
When, the pay invoice information data of the second terminal acquisition first terminal of seller is parsed and confirmed.Average preference certificate or
Delivery of cargo certificate has effective period of time.The treatment effeciency of second terminal can be improved using above-mentioned steps, and then improves whole data
The efficiency of processing procedure.
Step 340, first valuable data is transferred to second user by server according to the confirmation message.
After server receives the confirmation message, respective pay sequence information corresponding the is searched according to confirmation message
One valuable data, is then transferred to second user by the first valuable data.Such as it is transferred to bank account of seller etc..
Reference picture 4, it illustrates a kind of structural representation of data handling system of the application, including:
Order good authentication code generation module 410, for when the first user is using the first valuable data as the second valuable data
After being paid, based on payout status generation order good authentication code;Second valuable data is safeguarded by second user;
Order good authentication code acquisition module 420, for be sent when by the corresponding article of second valuable data to the
During one user, the order success entrained by the corresponding first terminal of the first user is obtained by the corresponding second terminal of second user
Identifying code;
Parsing confirms module 430, parses the order good authentication code for second terminal, order good authentication code is entered
Row confirms, and will confirm that messaging to server;
First valuable data processing module 440, for valuable by described first according to the confirmation message by server
Data are transferred to second user.
Reference picture 5, it illustrates a kind of structural representation of data handling system of the embodiment of the present application one, including:
Server 510, first terminal 520, and second terminal 530.
The server 510 includes the valuable data processing module 512 of pay invoice information generating module 511 and first;
The pay invoice information generating module 511 is used for server and is based on the first user using the first valuable data as second
The situation generation pay invoice information that valuable data is paid, and the pay invoice information is sent to described first eventually
End;Second valuable data is safeguarded by second user;
The first valuable data processing module 512, for by server according to the confirmation message by described first
Valuable data is transferred to second user.
Wherein described sequence information generation module also includes encryption sending module, for based on server and second user life
Into a pair of public and private keys, private key described in server by utilizing signs to the pay invoice information, and by the payment after signature
Sequence information is sent to the first terminal.
The first terminal 520 includes two-dimension code pattern data generation module 521;
The two-dimension code pattern data generation module 521 is used to be based on the pay invoice information, generates two-dimension code pattern
Data.
Wherein described two-dimension code pattern data generation module includes:
View finding figure sets submodule, the picture element matrix for setting M*M, by described one layer of pixel of picture element matrix outermost
It is used as the view finding figure of Quick Response Code;
Break graphic sets submodule, for regarding one layer of pixel of the picture element matrix close to view finding figure as separation
Accord with figure;
Picture element matrix piecemeal submodule, for remaining region in the picture element matrix to be divided into N block sub-pixel matrix, and
In every piece of sub-pixel matrix specified location, positioning figure is set;
First encoding submodule, for pay invoice information to be encoded into binary coding, with reference to binary number of signature
According to constituting the first coded sequence;
Piecemeal submodule is encoded, for according to the respective scale of N blocks sub-pixel matrix, by first coded sequence
It is divided into the corresponding encoded subsequence of N blocks first;
Error Correction of Coding submodule, for according to default error-correction level, corresponding error correction to be generated for every piece of encoded subsequence
Coding, obtains corresponding N blocks error correction coding block;
Coding inserts submodule, for the encoding block of N blocks first and corresponding N blocks error correction coding block to be inserted into corresponding N blocks
Sub-pixel matrix, generates M*M two-dimension code pattern data.
It is preferred that, coding also includes after inserting submodule:
Mask cover submodule, for using at least two mask pattern datas be covered in the two-dimension code pattern data it
On, obtain the first two-dimension code pattern data;
Mask process submodule, for for the first two-dimension code pattern data, with N in the two-dimension code pattern data
Block sub-pixel matrix position be unit block, analysis ranks in adjacent cells block color same case characteristic value N1, by
There are 1011101 type figures in the characteristic value N2 of the situation of color identical units chunk blocking, the ranks of each units chunk
The accounting N4 of dark units chunk in characteristic value N3, whole two-dimension code pattern data;
Calculating sub module, the weighted average for calculating described N1, N2, N3, N4;
Submodule is generated, for by the version information of the corresponding mask pattern data of minimum in each weighted average
The noncoding region of the first two-dimension code pattern data is added, final two-dimension code pattern data are generated.
The second terminal 530 includes scan module 531 and parsing confirms module 532;
The scan module 531 is used for when the corresponding article of second valuable data is sent to the first user, leads to
Cross the corresponding second terminal scanning of second user and obtain the two-dimension code pattern data that the corresponding first terminal of the first user is carried;
The parsing confirms that module 532 is used for second terminal and parses the two-dimension code pattern data, to two-dimension code pattern number
Confirmed according to counterpart expenditure sequence information, and will confirm that messaging to server.
Wherein described parsing confirms that module includes:
First analyzing sub-module, for parsing the two-dimentional icon data, obtains the label of pay invoice information and server
Name data;
Second signature submodule, it is right for being sent according to server to the public key corresponding to second terminal of second terminal
The pay invoice information of parsing is signed, and obtains the signed data of second terminal;
Matching confirms submodule, for the signed data of the signed data of second terminal and the server to be carried out
Match somebody with somebody, if it does, then confirming pay invoice information.
First analyzing sub-module also includes:
Mask information acquisition submodule, for parsing the mask pattern data version in the final two-dimension code pattern data
Information;
Mask removes submodule, the mask artwork for removing the final two-dimension code pattern data according to the version information
Graphic data, obtains original two dimensional code graph data.
Reference picture 6, a kind of structural representation of data handling system of its embodiment of the present application two, including:
Server 610, first terminal 620, second terminal 630;
The server 610 includes pay invoice information and generates encrypting module 611, and the first valuable data processing module
612;
Pay invoice information generation encrypting module 611 be used for server be based on the first user using the first valuable data as
Situation that second valuable data is paid generation pay invoice information, and by the pay invoice information ciphering signature send to
The first terminal;Second valuable data is safeguarded by second user;
The first valuable data processing module 612 is used for server has valence mumber according to the confirmation message by described first
According to being transferred to second user.
The second terminal 620 includes data obtaining module 621 and parsing confirms module 622;
Described information acquisition module 621, which is used to work as, sends the corresponding article of second valuable data to the first user
When, the ciphering signature pay invoice that the corresponding first terminal of the first user is carried is obtained by the corresponding second terminal of second user
Information;
The parsing confirms that the second terminal of module 622 parses the pay invoice information of the ciphering signature, is paid to described
Sequence information is confirmed, and will confirm that messaging to server.
For system embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, it is related
Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is described by the way of progressive, what each embodiment was stressed be with
Between the difference of other embodiment, each embodiment identical similar part mutually referring to.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the application can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the application can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is the flow with reference to method, equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Above to a kind of data processing method provided herein and system, it is described in detail, it is used herein
Specific case is set forth to the principle and embodiment of the application, and the explanation of above example is only intended to help and understands
The present processes and its core concept;Simultaneously for those of ordinary skill in the art, according to the thought of the application, in tool
It will change in body embodiment and application, in summary, this specification content should not be construed as to the application
Limitation.