CN110766114B - Terminal and method for online generation of two-dimension code - Google Patents

Terminal and method for online generation of two-dimension code Download PDF

Info

Publication number
CN110766114B
CN110766114B CN201911017258.1A CN201911017258A CN110766114B CN 110766114 B CN110766114 B CN 110766114B CN 201911017258 A CN201911017258 A CN 201911017258A CN 110766114 B CN110766114 B CN 110766114B
Authority
CN
China
Prior art keywords
data
module
control
terminal
server
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
CN201911017258.1A
Other languages
Chinese (zh)
Other versions
CN110766114A (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 CN201911017258.1A priority Critical patent/CN110766114B/en
Publication of CN110766114A publication Critical patent/CN110766114A/en
Application granted granted Critical
Publication of CN110766114B publication Critical patent/CN110766114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a terminal and a method for online generation of two-dimension codes, and belongs to the field of information security. The terminal receives information input by a user through the input module, controls the MCU module to organize and generate first request message data, sends the first request message data to the server, receives request response data returned by the server through the communication module, controls the MCU module to analyze the request response data to acquire two-dimension code generation data, and codes and displays the two-dimension code through the display module. The method provided by the invention can display the online generated two-dimensional code on the terminal, avoid the behavior of deception users when other people input information, and ensure the safety of the operation process.

Description

Terminal and method for online generation of two-dimension code
Technical Field
The invention relates to the field of information security, in particular to a terminal and a method for online generation of two-dimensional codes.
Background
The two-dimensional code payment is a new generation wireless payment scheme based on an account system, becomes a master force army of mobile payment, and is widely popularized in the payment field by virtue of fashionable and convenient customer experience. In general, a merchant compiles account numbers, commodity information and the like into a two-dimensional code, and a user can realize payment settlement with the merchant account by scanning the two-dimensional code through a mobile phone client. However, because many two-dimensional codes are static, illegal personnel use people to rely on intelligent consumption habits to make illegal crimes. Recently, a plurality of news reports show that a person changes the two-dimension code on the sharing bicycle and reminds deposit to a private account; trojan horse is implanted in the static two-dimensional code, monitoring and theft and the like are carried out after the user scans, meanwhile, the central office starts to control the payment limit of the static bar code, all static scanning code payment single-day limits are set to be 500 yuan, the problems are caused to loss of benefits to merchants and users, at present, some schemes for generating dynamic two-dimensional codes offline are adopted aiming at the problems of the static two-dimensional code, however, the offline dynamic two-dimensional code requires the user to scan the code and input the amount of money on electronic equipment such as a mobile phone and the like, and the situation can lead to the behavior of the user cheating the merchant.
Disclosure of Invention
In order to solve the problems in the prior art, the embodiment of the invention provides a terminal and a method for online generation of two-dimensional codes.
The method for online generation of the two-dimensional code provided by the embodiment of the invention comprises the following steps:
the terminal is connected with a network through a communication module;
the terminal receives information input by a user through an input module;
the terminal control MCU module acquires information input by a user and received by the input module, acquires data elements in the MCU module, organizes and generates first combined data according to the acquired information input by the user and the acquired data elements, generates first request message data according to the first combined data, and sends the first request message data to the server through the communication module;
the terminal receives first response message data returned by the server through the communication module, controls the MCU module to verify the first response message data, and acquires second combination data in the first response message data if the verification is passed;
the terminal control MCU module judges the verification result of the server in the second combined data on the first request message, and if the verification result is successful, the two-dimensional code display data in the second combined data is obtained;
and the terminal control MCU module encodes the two-dimensional code display data to obtain encoded data, and the two-dimensional code is displayed through the display module according to the encoded data.
The method comprises the steps of generating first request message data according to first combined data, wherein the first request message data is specifically: the terminal control MCU module calculates the first combined data to obtain a first abstract value, signs the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data, and combines the first combined data with the first signature data to obtain first request message data.
The method for acquiring the data elements in the MCU module specifically comprises the following steps: acquiring a data element and the current time which are prestored in an MCU module;
specifically, the first combination data is generated according to the acquired information input by the user and the acquired data element organization, specifically: according to a preset data element combination form, first combination data are generated according to the acquired information input by a user, the current time and the pre-stored data element organization.
The terminal control MCU module acquires the information input by the user and received by the input module, and then comprises the following steps: the terminal control MCU module judges whether the information input by the current user is input for the first time on the same day, if so, generates update public key certificate request data, and organizes the update public key certificate request data, the information input by the user, the current time and the pre-stored data elements into first combined data according to a preset data element combination form.
Wherein, after the two-dimensional code is displayed to the encoded data through the display module, still include: the terminal control MCU module generates request query data and sends the request query data to the server through the communication module.
Wherein after the request query data is sent to the server through the communication module, the method further comprises: the terminal receives query response data returned by the server through the communication module, the terminal controls the MCU module to analyze the query response data, an operation result code is obtained, whether user operation is completed or not is judged through the operation result code, the operation is prompted to be completed through the display module, whether the preset query interval time meets the condition is judged if the operation is completed, whether the preset query interval time meets the condition is judged repeatedly if the operation is not completed, and if the operation is not completed, the request query data is sent to the server through the communication module.
Optionally, after the preset query interval time meets the condition, the method further includes: judging whether the accumulated inquiry times exceeds the preset inquiry termination times, if yes, prompting operation failure through a display module, and if not, sending the request inquiry data to a server through a communication module.
Optionally, when the terminal control MCU module verifies that the first response message data does not pass, the terminal control MCU module prompts the operation failure through the display module.
Optionally, when the terminal control MCU module determines that the verification result of the server on the first request packet in the second combined data is failure, the terminal control MCU module prompts the operation failure through the display module.
The terminal for online generation of the two-dimensional code provided by the embodiment of the invention comprises the following steps:
the communication module is used for connecting a network;
the input module is used for receiving information input by a user;
the control module is used for controlling the MCU module;
the MCU module is used for acquiring information input by a user and received by the input module under the control of the control module, acquiring data elements, organizing and generating first combined data according to the acquired information input by the user and the acquired data elements, and generating first request message data according to the first combined data;
the communication module is also used for sending the first request message data generated by the MCU module to the server;
the communication module is also used for receiving first response message data returned by the server;
the MCU module is also used for verifying the first response message data under the control of the control module, and obtaining second combined data in the first response message data if the verification is passed;
the MCU module is also used for judging the verification result of the server to the first request message in the second combined data under the control of the control module, and acquiring the two-dimensional code display data in the second combined data if the verification result is successful;
The MCU module is also used for encoding the two-dimensional code display data under the control of the control module to obtain encoded data, and displaying the two-dimensional code through the display module according to the encoded data;
and the display module is used for displaying the two-dimensional code according to the coded data obtained by the MCU module.
The MCU module comprises a first generation unit;
the first generation unit is used for calculating the first combined data to obtain a first abstract value under the control of the control module, signing the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data, and combining the first combined data with the first signature data to obtain first request message data.
The MCU module comprises a first acquisition unit, a second acquisition unit and a second generation unit;
the first acquisition unit is used for acquiring information input by a user and received by the input module under the control of the control module;
the second acquisition unit is used for acquiring pre-stored data elements and current time under the control of the control module;
the second generation unit is used for generating first combined data according to the information input by the user and acquired by the first acquisition unit, the pre-stored data elements and the current time organization under the control of the control module and in a preset data element combination form.
The MCU module further comprises a first judging unit and a third generating unit;
the first judging unit is used for judging whether the information input by the current user is input for the first time on the same day under the control of the control module after the first acquiring unit acquires the information input by the user;
and the third generation unit is used for generating updated public key certificate request data under the control of the control module when the first judgment unit judges that the information input by the current user is input for the first time on the day, and organizing the updated public key certificate request data, the information input by the user, the current time acquired from the timer and the acquired prestored data elements according to a preset data element combination form to generate first combination data.
The MCU module comprises a fourth generation unit;
the fourth generation unit is used for generating request query data under the control of the control module after the display module displays the two-dimensional code;
and the communication module is also used for sending the request query data generated by the fourth generation unit to the server.
The MCU module further comprises an analysis unit, a third acquisition unit, a second judgment unit and a third judgment unit;
the communication module is also used for receiving query response data returned by the server;
The analysis unit is used for analyzing the query response data received by the communication module under the control of the control module;
the third acquisition unit is used for acquiring an operation result code from the query response data analyzed by the analysis unit under the control of the control module;
the second judging unit is used for judging whether the user operation is finished or not according to the operation result code acquired by the third acquiring unit under the control of the control module;
the display module is also used for displaying a prompt of the completion of the operation when the second judging unit judges that the operation of the user is completed;
the third judging unit is used for judging whether the preset inquiry interval time accords with the condition or not under the control of the control module when the second judging unit judges that the user operation is not finished; when the preset inquiry interval time is judged to be not in accordance with the condition, repeatedly judging whether the preset inquiry interval time is in accordance with the condition;
and the communication module is also used for sending the request query data generated by the fourth generation unit to the server when the third judgment unit judges that the preset query interval time meets the condition.
The MCU module further comprises a fourth judging unit;
a fourth judging unit, configured to judge, under control of the control module, whether the accumulated query number exceeds the preset query termination number when the third judging unit judges that the preset query interval time meets a condition;
The display module is further used for displaying a prompt of operation failure when the fourth judging unit judges that the accumulated query times exceeds the preset query termination times;
and the communication module is also used for sending the request query data generated by the fourth generation unit to the server when the fourth judgment unit judges that the accumulated query times do not exceed the preset query termination times.
The display module is further used for displaying a prompt of operation failure when the MCU module verifies that the first response message data does not pass.
The display module is further configured to display a prompt for failure of operation when the MCU module determines that the verification result of the server on the first request packet in the second combined data is failure.
The technical scheme provided by the embodiment of the invention has the beneficial effects that: according to the invention, the input module of the terminal receives information input by a user, the MCU module is controlled to organize and generate first request message data, the first request message data is sent to the server, the communication module receives request response data returned by the server, the terminal controls the MCU module to analyze the request response data to acquire two-dimension code generation data, and the two-dimension code is displayed through the display module in a coding mode. The method provided by the invention can display the online generated two-dimensional code on the terminal, avoid the behavior of deception users when other people input information, and ensure the safety of the operation process.
Drawings
Fig. 1 is a terminal structure diagram for online generation of two-dimensional codes according to embodiment 1 of the present invention;
fig. 2 is a flowchart of a method for online generating a two-dimensional code according to embodiment 2 of the present invention;
FIG. 3 is a flowchart of a method for online generation of two-dimension codes according to embodiment 3 of the present invention;
fig. 4 is a block diagram of a terminal for online generation of two-dimensional codes according to embodiment 4 of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
An embodiment of the present invention provides a terminal for online generating two-dimensional codes, as shown in fig. 1, the terminal 100 includes: an input module 101, an MCU module 102, a communication module 103, a power management module 104, a display module 105;
The input module 101 is connected with the MCU module 102 and is used for receiving information input by a user;
the MCU module 102 is connected with the input module 101, the communication module 103, the power management module 104 and the display module 105, and is used for detecting information input by the input module, receiving the connection state of the communication module 103 and outputting information to be displayed to the display module;
the communication module 103 is connected with the MCU module 102 and the power management module 104, and is used for receiving power supply of the power management module 104 and connecting a network;
the power management module 104 is connected with the MCU module 102, the communication module 103 and the display module 105 and is used for supplying power;
the display module 105 is connected to the MCU module 102 and the power management module 104, and is used for displaying information to be displayed output by the MCU module 102.
The input module 101 includes: a keyboard;
MCU module 102 includes: the control chip, the buzzer, the indicator lamp, the crystal oscillator and surrounding circuits thereof;
the communication module 103 includes: a mobile communication module and a wireless communication module;
the display module 105 includes: a display screen;
the power management module 104 includes: the USB interface, the power interface, the first power chip, the second power chip, the third power chip and the fourth power chip;
Specifically, the first power chip is connected to the communication module 103, and specifically is used for supplying power to the mobile communication modules in the communication module 103; the second power chip is connected with the communication module 103, and is specifically configured to supply power to the wireless communication module in the communication module 103; the third power chip is connected with the MCU module 102 and is specifically used for supplying power to the MCU module 102; the fourth power chip is connected to the display module 105, and is specifically configured to supply power to the display module 105.
Example two
The second embodiment of the present invention provides a method for online generating a two-dimensional code, as shown in fig. 2, the method includes:
the terminal is connected with a network through a communication module;
the terminal receives information input by a user through an input module;
the terminal control MCU module acquires information input by a user and received by the input module, acquires data elements in the MCU module, organizes and generates first combined data according to the acquired information input by the user and the acquired data elements, generates first request message data according to the first combined data, and sends the first request message data to the server through the communication module;
the terminal receives first response message data returned by the server through the communication module, controls the MCU module to verify the first response message data, and acquires second combination data in the first response message data if the verification is passed;
The terminal control MCU module judges the verification result of the server in the second combined data on the first request message, and if the verification result is successful, the two-dimensional code display data in the second combined data is obtained;
and the terminal control MCU module encodes the two-dimensional code display data to obtain encoded data, and the two-dimensional code is displayed through the display module according to the encoded data.
In this embodiment, first request message data is generated according to first combined data, specifically: the terminal control MCU module calculates first combination data to obtain a first abstract value, signs the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data, and combines the first combination data and the first signature data to obtain first request message data.
In this embodiment, optionally, the obtaining the data element in the MCU module specifically includes: acquiring a data element and the current time which are prestored in an MCU module;
optionally, the first combined data is generated according to the acquired information input by the user and the acquired data element organization, specifically: according to a preset data element combination form, first combination data are generated according to the acquired information input by a user, the current time and the pre-stored data element organization.
In this embodiment, after the terminal control MCU module obtains the information input by the user and received by the input module, the method further includes: the terminal control MCU module judges whether the information input by the current user is input for the first time on the same day, if so, generates update public key certificate request data, and organizes the update public key certificate request data, the information input by the user, the current time and the pre-stored data elements into first combined data according to a preset data element combination form.
In this embodiment, after displaying the two-dimensional code with the encoded data through the display module, the method further includes: the terminal control MCU module generates request query data and sends the request query data to the server through the communication module.
In this embodiment, after the request query data is sent to the server through the communication module, the method further includes: the terminal receives query response data returned by the server through the communication module, the terminal controls the MCU module to analyze the query response data, an operation result code is obtained, whether user operation is completed or not is judged through the operation result code, the operation is prompted to be completed through the display module, whether the preset query interval time meets the condition is judged if the operation is completed, whether the preset query interval time meets the condition is judged repeatedly if the operation is not completed, and if the operation is not completed, the request query data is sent to the server through the communication module.
Optionally, after the judging that the preset query interval time meets the condition, the method further includes: judging whether the accumulated inquiry times exceeds the preset inquiry termination times, if yes, prompting operation failure through a display module, and if not, sending the request inquiry data to a server through a communication module.
In this embodiment, when the terminal control MCU module verifies that the first response message data does not pass, the terminal control MCU module prompts the operation failure through the display module.
In this embodiment, when the terminal control MCU module determines that the verification result of the server on the first request packet in the second combined data is failure, the terminal control MCU module prompts that the operation fails through the display module.
Example III
The third embodiment of the invention provides another method for online generation of two-dimensional codes; the method is suitable for a system comprising a terminal and a server, wherein the terminal comprises an input module, an MCU module, a communication module, a power management module and a display module;
as shown in fig. 3, the method includes:
step 101, a terminal is powered on and started through a power management module;
102, connecting a terminal with a network through a communication module;
in this embodiment, the manner in which the terminal connects to the network through the communication module includes: the terminal is connected through a mobile communication module in the communication module, and can also be connected through a wireless communication module in the communication module;
Specifically, the terminal performs network connection according to a connection mode set in a default setting;
optionally, when the connection mode in the default setting cannot connect to the network, the terminal prompts the user that the network cannot connect through the display module, and the user can set and select other network connection modes through the input module;
for example, the connection mode set in the default setting of the terminal is wireless communication connection, when wireless communication cannot be connected, the terminal display module displays that the network cannot be connected, and the user resets the network connection mode to be mobile communication connection through the key module in the input module.
Step 103, the terminal receives information input by a user through an input module;
104, the terminal controls the MCU module to acquire information input by a user and received by the input module, acquires data elements in the MCU module, and organizes and generates first combined data according to the acquired information input by the user and the acquired data elements;
in this embodiment, the obtaining the data element in the MCU module specifically includes: acquiring a data element and the current time which are prestored in an MCU module;
optionally, the current time may be obtained by obtaining a timer in the MCU module;
specifically, the first combination data is generated according to the acquired information input by the user and the acquired data element organization, specifically: according to a preset data element combination form, organizing the acquired information input by a user, the current time and the pre-stored data elements to generate first combination data;
Optionally, after the terminal control MCU module obtains the information input by the user and received by the input module, the method further includes: the terminal control MCU module judges whether the information input by the current user is the information input for the first time on the same day, if so, generates updated public key certificate request data, and organizes the updated public key certificate request data, the acquired information input by the user, the current time and the prestored data elements into first combined data according to a preset data element combination form;
specifically, the information input by the user and acquired by the MCU module comprises amount information;
the MCU module obtaining the pre-stored data elements in the memory comprises the following steps: version number, access type, coding mode, certificate ID, transaction type, transaction subclass, product type, channel type, access institution code, merchant order number, payment timeout time, transaction currency, device serial number, transaction notification address, signature method;
optionally, the data elements pre-stored in the memory of the MCU module are written by a production tool before the terminal leaves the factory;
optionally, in the preset data element combination form, the marks corresponding to the amounts and the data elements are expressed by key1, key2 and key3 … …, the corresponding values are expressed by value1, value2 and value3 … …, and the data element equation is expressed by key1=value1, key2=value2 and key3=value3 … …;
Preferably, the preset data element combination form specifically includes: arranging the data element equations according to the initial sequence of the data element identification key, and splicing and combining by using the symbols as connectors to obtain first combined data;
for example, the data element is an access type, its corresponding identifier key1 is an accessType, and its corresponding value1 is: 0, the data element equation is: accesstype=0;
the data element is a product type, the corresponding identifier key2 is bizType, and the corresponding value2 is: 000000, the data element equation is: biztype=000000;
the data element is a certificate ID, its corresponding identifier key3 is certId, and its corresponding value3 is: 68759663125, the data element equation is: certid= 68759663125;
the data element is a channel type, the corresponding identifier key4 is a channel type, and the corresponding value4 is: 08, the data element equation is: channel type = 08;
the data element is transaction currency, the corresponding identifier key5 is currencyCode, and the corresponding value5 is: 156, the data element equation is: currencycode=156;
the data element is a coding mode, the corresponding identifier key6 is encoding, and the corresponding value6 is: UTF-8, the data element equation is: encoding = UTF-8;
The data element is a merchant code, the corresponding identifier key7 is merId, and the corresponding value7 is: 777290058110048, the data element equation is: merid= 777290058110048;
the data element is a merchant order number, the corresponding identification key8 is an orderld representation, and the corresponding value8 is: FT20190718134500, the data element equation is: orderId = FT20190718134500;
the data element is a version number, the corresponding identifier key9 is version, and the corresponding value9 is: 5.1.0, the data element equation is: version=5.1.0;
the data element is a transaction type, the corresponding identifier key10 is txnType, and the corresponding value10 is: 01, the data element equation is: txntype=01;
the data element is transaction subclass, its corresponding label key 11 is txnSubType, its corresponding value11 is: 07, the data element equation is: txnsubtype=07;
the data element is the order sending time, the corresponding identification key12 is txnTime, and the corresponding value12 is: 20181130173803, the data element equation is: txntime= 20181130173803;
the data element is a transaction notification address, the corresponding identifier key13 is a backhaul, and the corresponding value13 is: the data element equation is: backUrl=http:// 222.222.222.222:8080/ACPSsample_QRC/backRcvResponse;
The data element is a signature method, the corresponding identifier key14 is a sign method, and the corresponding value14 is: 01, the data element equation is: sign method=01;
the data element is transaction amount, the corresponding identification key15 is txnAmt, and the corresponding value15 is: 1200, data element equation: txnamt=1200;
for example, according to a preset data element combination form, the data element is organized to generate first combination data as follows: accesstype=0 & backUrl=http:// 222.222.222:8080/acp sample_qrc/backrcv response & biztype=000000 & certid=68759663125 & channel type=08 & currencycode=156 & encoding=utf-8 & merid=777290058148 & orderid=ft 20190718134500& sign method=01 & txnamt=1200 & txnnsubbtype=07 & txnttime=201907160050 & txnttype=01 & version=5.1.0.
Preferably, the preset data element combination form may be: the json format, the marks corresponding to the amounts and the data elements are expressed by key1, key2 and key3 … …, the corresponding values are expressed by value1, value2 and value3 … …, and the data element equation is expressed by { "key1": "value1", "key2": "value2", … … };
for example, according to a preset data element combination form, the data element is organized to generate first combination data as follows: { "Message": { "Version": "V3.0.0", "Format": "JSON", "Merchant": { "ECMerchantType": "EBUS", "MerchantID": "103885024990759" } "TrxRequest" { "TrxType": "alicayordererreq", "Paymenttype": "9", "PaymentLinktype": "1", "receiveAccount": "1", "NotifyType": "0", "ResultNotifyURL": "http:// 127.0.1/merchantjmerchant/merchantResult. Aspx", "merchantRemarks" } "merchantRemarks", "IsBreakAccount": "0", "Order", "PayTypeID", "ALI_ PRECREATE", "OrderAcc 20190724153911", "ExyDadDadDadName", "30", "PayAccount", "rIcInd", "rIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIcIrIcIcIcIcIcIcIrIrIcIrIrIrIrIrIrIrIrIrSedecyMEmercrSemercrMEmercin" mercbilchmercin merc "mercin" merc "mercmercmerc" merc "mercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercmercby mercby method by mercby by method by mercby by with by with by method by with" method by with method by with syringe with method by with syringe with method by with method with method with.
Step 105, the terminal control MCU module calculates first combination data generated by organization to obtain a first abstract value;
in this embodiment, the algorithm used by the MCU module to calculate the first combined data generated by the organization to obtain the first digest value is a hash algorithm, for example, SHA-256;
for example, the first combined data generated by the organization is: accesstype=0 & backUrl=http:// 222.222.222:8080/acp sample_qrc/backrcv response & biztype=000000 & certid=68759663125 & channel type=08 & currencycode=156 & encoding=utf-8 & merid=777290058148 & orderid=ft 20190718134500& sign method=01 & txnamt=1200 & txnnsubbtype=07 & txnttime=201907160050 & txnttype=01 & version=5.1.0.
Step 106, the terminal control MCU module signs the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data;
in this embodiment, the preset algorithm specifically includes: RSA algorithm;
optionally, the terminal private key may be imported by a production tool before leaving the factory, or may be generated by the terminal itself, where the public key corresponding to the terminal private key is delivered to the payment mechanism and stored at the corresponding server side after leaving the factory;
For example, the first signature data obtained by signing is: signature=hxaTNkpJQEfOZF 1jjc1O/fjy// x1NHFjz0biys42adxrAVLwmhxAXCTdBWPY0/3 AFWWWWX2XUE04nugwx7xi5 lYat91XYzj+01 iOKnT1yN49WHP+6DugkCa5/QjjFhIDIwbXjJdt7HMpBH3L0 KBFLUTcL 0vX12xRSI3 WWJNwR 5e/8chv K7IvDFGL1e8pQBODozSg9LRtle0hsIYSOkHav/75jcM0mu6t/iDukQtHQ7ZeAcYe0zkdhRx0vwSaU6Mh8drdsDnju45d4oK9tWSJvgvDJYMtpjOiOyI66 OVP/ddsJFIjZGqSVsoqCAb 89SJhpgD65 XasAljjdMIQV 2 Pfw=.
Step 107, the terminal control MCU module combines the first combination data and the first signature data to obtain first request message data;
in this embodiment, the combination of the first combination data and the first signature data is specifically: sequentially splicing the first combined data and the first signature data to obtain first request message data;
for example, the obtained first request message data is: accesstype=0 & backurel=http% 3a%2f%2f222.222.222.222%3a8080%2facp sample_qrc% 2fcvrsponsive & biztype=000000 & certid=68759663125 & channeltype=08 & currencycode=156 & encoding=utf-8 & merid=777290058110048 & orderid=ft 20190718134500& sign method=01 & signal pattern=hxatnkpjqeifozf 1jjc O%2Ffjy%2F%2Fx1 Fjz0 biys42adrAlmmhHxAXCTBWBWPY0% 2F3AFWX2XUE04nugwx7xi5lYatE91XYzj%2B01 iKnT 1yN49 DugkCa5%2 FjFjFjIwBXjd 7HMpBH3L0 KBFLUTcL0 vX12xRSI3 WTjNwR5% 2F8chv7 KvDFGL1E 8 pF75jPKOHdFvOHg2F75jcAbysvOHv2F75jcMvz6 t%2 DukQtQQ7 AcyikKkkKkHkHvSavSau8 MvSau6 MvH6 HvU4 oKKDVTKJPYdTKDVTJPYPYPYPYdTJPYPYPYDYPYDVTJdTb 2 KvVdTvQdTvVvVvVvVd2 KvVvVvVvVvVvVvVvSkQd2 KvVvVvVvVvSvSvSv2Xd2 FvVvVvVvVvVv3 d2 HvVvVvVvVvSv3 HvXFvXFv3 HvXFv3 HvJHvJHv3 XFvJHv3 XFvJHvJHvXFvXFvJHbXFv3 XFJHhXFJHhXF3 XF3 HhHhHhHhHhHHHHHHH3 HHHHH3 H3 HBLFBLFBLFBLFBLFLFLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF =1200 & txnnsubtype=07 & txntime=20190718160050 & txntype=01 & version=5.1.0. =1200 & txnnsubtype=07 & txntime=20190718160050 & txntype=01 & version=5.1.0.
Step 108, the terminal control MCU module transmits the first request message to the communication module, and the communication module transmits the first request message data to the server according to the connected network protocol;
in this embodiment, after the terminal sends the first request packet data to the server, the method further includes: the server verifies the received first request message data, generates first response message data after verification, and sends the first response message data to the terminal control MCU module through the communication module;
specifically, the server verifies the received first request message data, and if the server is successful in verification, first response message data are generated;
the server generates the first response message data specifically as follows: the server generates second combined data containing a verification result and two-dimensional code display data according to the first request message data, signs the second combined data by using a server private key through a preset algorithm to obtain second signature data, and combines the second combined data and the second signature data to obtain first response message data.
The preset algorithm specifically comprises the following steps: RSA algorithm;
for example, the second combined data generated by the server is: biztype=000000 & txnsubtype=07 & orderid=ft 20190718134500& txntype=01 & encoding=utf-8 & version=5.1.0 & accesstype=0 & qrcode=https:// qr.9556. Com/00010001/011542232234081586836632229319 & txntime=20190718144626 & respmsg=success [0000000] & merid=777258148 & signmmethod=01 & respcode=00;
The second signature data is: signature=MtKdAXw 8Z7GMvCxaXeYeseJP5y+EhJzLOmSc// JOPedoQVPSWnwK1yjKT0pTmwXML7 cjEKbabaad/tXc pOyUB1 qeqOQ 52TfN8nIKEssa9M5S3JYRsmXnFTJz2UA6gKd WJ2 VkkHdFgeXK 1jHxz081EYq rTzLCLAgtHqnbucurClCUO 8+ oqWoBIcN5/GoJARsmyA6w8cwYDM20ugIsQC3jx4nnJp3zoHu/fE6 nvtpkptpop 6MMv3 qijaoxexqkef 0JLo68jZ6VCMYhAXmS7o1kVJ37CHRdR7Hq4 ccogqn 3cuNaJ0iC3KFaWAjWWS6qn3t8vajedynes zhgka=;
the first response message data is: biztype=000000 & txnSubtype=07 & orderId=FT 20190718134500& txnType=01 & encodings=UTF-8 & version=5.1.0 & accessType=0 & qrcode=https:// qr.9556. Com/00010001/011542232234081586836482229319 & txnTime=20190718144626 & respmsg=success [0000000] & merId=777290058148 & signmmethod=01 & respcode=00 & signPubKeycert= - - - - - - - - - - -, BEGINCERTIFACTE- - - - - -, and respmsg =success =0000000 ] & merId=777290058148 & signmmethod =01 & respcode =00 & singPubKeyCert- - - - - - - - - - - -
MIIEQzCCAyugAwIBAgIFEBJJZVgwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMC
Q04xMDAuBgNVBAoTJ0NoaW5hIEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhv
cml0eTEXMBUGA1UEAxMOQ0ZDQSBURVNUIE9DQTEwHhcNMTcxMTAxMDcyNDA4WhcN
MjAxMTAxMDcyNDA4WjB3MQswCQYDVQQGEwJjbjESMBAGA1UEChMJQ0ZDQSBPQ0Ex
MQ4wDAYDVQQLEwVDVVBSQTEUMBIGA1UECxMLRW50ZXJwcmlzZXMxLjAsBgNVBAMU
JTA0MUBaMjAxNy0xMS0xQDAwMDQwMDAwOlNJR05AMDAwMDAwMDEwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDIWO6AESrg+34HgbU9mSpgef0sl6avr1d
bD/IjjZYM63SoQi3CZHZUyoyzBKodRzowJrwXmd+hCmdcIfavdvfwi6x+ptJNp9d
EtpfEAnJk+4quriQFj1dNiv6uP8ARgn07UMhgdYB7D8aA1j77Yk1ROx7+LFeo7rZ
Ddde2U1opPxjIqOPqiPno78JMXpFn7LiGPXu75bwY2rYIGEEImnypgiYuW1vo9UO
G47NMWTnsIdy68FquPSw5FKp5foL825GNX3oJSZui8d2UDkMLBasf06Jz0JKz5AV
blaI+s24/iCfo8r+6WaCs8e6BDkaijJkR/bvRCQeQpbX3V8WoTLVAgMBAAGjgfQw
gfEwHwYDVR0jBBgwFoAUz3CdYeudfC6498sCQPcJnf4zdIAwSAYDVR0gBEEwPzA9
BghggRyG7yoBATAxMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmNmY2EuY29tLmNu
L3VzL3VzLTE0Lmh0bTA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8vdWNybC5jZmNh
LmNvbS5jbi9SU0EvY3JsMjQ4NzIuY3JsMAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQU
mQQLyuqYjES7qKO+zOkzEbvdFwgwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF
BwMEMA0GCSqGSIb3DQEBBQUAA4IBAQAujhBuOcuxA+VzoUH84uoFt5aaBM3vGlpW
KVMz6BUsLbIpp1ho5h+LaMnxMs6jdXXDh/du8X5SKMaIddiLw7ujZy1LibKy2jYi
YYfs3tbZ0ffCKQtv78vCgC+IxUUurALY4w58fRLLdu8u8p9jyRFHsQEwSq+W5+bP
MTh2w7cDd9h+6KoCN6AMI1Ly7MxRIhCbNBL9bzaxF9B5GK86ARY7ixkuDCEl4XCF
JGxeoye9R46NqZ6AA/k97mJun//gmUjStmb9PUXA59fR5suAB5o/5lBySZ8UXkrI
pp/iLT8vIl1hNgLh0Ghs7DBSx99I+S3VuUzjHNxL6fGRhlix7Rb8
-----ENDCERTIFICATE-----&signature=MtKdAXw8Z7GMvCxaXeYeseJP5y+EhJzLOmSc//JOPedoQVPSWnwK1yjKT0pTmwXML7cjEKbaTAaD/tXc9pOyUB1qeqYOQ52TfN8nIKEssa9M5S3JYRsmXnFTJz2UA6gKd90WJ2VpkHdFgeXK1jHxz081EYq0rTzLCLAgtHqnbuhrClCUO8+oqWoBIcN5/GoJARsmyA6w8cwYDM20ugIsQC3jx4nnJp3zoHu/fE6NVtPKndptpOP6MMv3QiJaOhexemqKEF0JLo68jZ6VCMYhAXmS7o1kVJ37CHRdR7Hq4cOCGQn3cuNaJ0iC3KFaWAjWWS6qn3t8VAjeDYNEsZHGkA==。
Optionally, when the first request message data received by the server includes the update public key certificate request data, the second combined data generated by the server according to the first request message data further includes the server public key certificate.
Step 109, the terminal receives the first response message data returned by the server through the communication module, controls the MCU module to verify the first response message data, acquires the second combined data in the first response message data if the verification is successful, and prompts the operation failure through the display module if the verification is unsuccessful;
In this embodiment, the first response packet data includes second combination data and second signature data, where the second combination data includes: the server verifies the verification result of the first request data message sent by the terminal and the two-dimensional code display data generated by the server;
the terminal control MCU module verifies the first response message data specifically as follows: the terminal control MCU module uses a public key stored by the terminal to check the first response message data through a preset algorithm;
optionally, the terminal control MCU module verifies the first response message data specifically further: the terminal control MCU module acquires second combination data in the first response message data, acquires a server public key certificate in the second combination data, and uses the server public key certificate to check and sign the first response message data through a preset algorithm;
optionally, if the current operation is not the first operation, the public key used by the terminal for signature verification is the public key issued by the server in the message response data in the first operation on the same day;
if the current operation is the first operation, the public key used by the terminal verification sign is the public key issued by the server in the message response data stored by the terminal before the first operation on the same day, or the public key contained in the message response data issued by the server and received in the first operation on the same day;
For example, the first response message data specifically includes: biztype=000000 & txnSubtype=07 & orderId=FT 20190718134500& txnType=01 & encodings=UTF-8 & version=5.1.0 & accessType=0 & qrcode=https:// qr.9556. Com/00010001/011542232234081586836482229319 & txnTime=20190718144626 & respmsg=success [0000000] & merId=777290058148 & signmmethod=01 & respcode=00 & signPubKeycert= - - - - - - - - - - -, BEGINCERTIFACTE- - - - - -, and respmsg =success =0000000 ] & merId=777290058148 & signmmethod =01 & respcode =00 & singPubKeyCert- - - - - - - - - - - -
MIIEQzCCAyugAwIBAgIFEBJJZVgwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMC
Q04xMDAuBgNVBAoTJ0NoaW5hIEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhv
cml0eTEXMBUGA1UEAxMOQ0ZDQSBURVNUIE9DQTEwHhcNMTcxMTAxMDcyNDA4WhcN
MjAxMTAxMDcyNDA4WjB3MQswCQYDVQQGEwJjbjESMBAGA1UEChMJQ0ZDQSBPQ0Ex
MQ4wDAYDVQQLEwVDVVBSQTEUMBIGA1UECxMLRW50ZXJwcmlzZXMxLjAsBgNVBAMU
JTA0MUBaMjAxNy0xMS0xQDAwMDQwMDAwOlNJR05AMDAwMDAwMDEwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDIWO6AESrg+34HgbU9mSpgef0sl6avr1d
bD/IjjZYM63SoQi3CZHZUyoyzBKodRzowJrwXmd+hCmdcIfavdvfwi6x+ptJNp9d
EtpfEAnJk+4quriQFj1dNiv6uP8ARgn07UMhgdYB7D8aA1j77Yk1ROx7+LFeo7rZ
Ddde2U1opPxjIqOPqiPno78JMXpFn7LiGPXu75bwY2rYIGEEImnypgiYuW1vo9UO
G47NMWTnsIdy68FquPSw5FKp5foL825GNX3oJSZui8d2UDkMLBasf06Jz0JKz5AV
blaI+s24/iCfo8r+6WaCs8e6BDkaijJkR/bvRCQeQpbX3V8WoTLVAgMBAAGjgfQw
gfEwHwYDVR0jBBgwFoAUz3CdYeudfC6498sCQPcJnf4zdIAwSAYDVR0gBEEwPzA9
BghggRyG7yoBATAxMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmNmY2EuY29tLmNu
L3VzL3VzLTE0Lmh0bTA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8vdWNybC5jZmNh
LmNvbS5jbi9SU0EvY3JsMjQ4NzIuY3JsMAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQU
mQQLyuqYjES7qKO+zOkzEbvdFwgwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF
BwMEMA0GCSqGSIb3DQEBBQUAA4IBAQAujhBuOcuxA+VzoUH84uoFt5aaBM3vGlpW
KVMz6BUsLbIpp1ho5h+LaMnxMs6jdXXDh/du8X5SKMaIddiLw7ujZy1LibKy2jYi
YYfs3tbZ0ffCKQtv78vCgC+IxUUurALY4w58fRLLdu8u8p9jyRFHsQEwSq+W5+bP
MTh2w7cDd9h+6KoCN6AMI1Ly7MxRIhCbNBL9bzaxF9B5GK86ARY7ixkuDCEl4XCF
JGxeoye9R46NqZ6AA/k97mJun//gmUjStmb9PUXA59fR5suAB5o/5lBySZ8UXkrI
pp/iLT8vIl1hNgLh0Ghs7DBSx99I+S3VuUzjHNxL6fGRhlix7Rb8
-----ENDCERTIFICATE-----&signature=MtKdAXw8Z7GMvCxaXeYeseJP5y+EhJzLOmSc//JOPedoQVPSWnwK1yjKT0pTmwXML7cjEKbaTAaD/tXc9pOyUB1qeqYOQ52TfN8nIKEssa9M5S3JYRsmXnFTJz2UA6gKd90WJ2VpkHdFgeXK1jHxz081EYq0rTzLCLAgtHqnbuhrClCUO8+oqWoBIcN5/GoJARsmyA6w8cwYDM20ugIsQC3jx4nnJp3zoHu/fE6NVtPKndptpOP6MMv3QiJaOhexemqKEF0JLo68jZ6VCMYhAXmS7o1kVJ37CHRdR7Hq4cOCGQn3cuNaJ0iC3KFaWAjWWS6qn3t8VAjeDYNEsZHGkA==。
Step 110, the terminal control MCU module judges the verification result of the server to the first request message in the second combined data, if the verification result is successful, the two-dimensional code display data in the second combined data are obtained, step 111 is executed, and if the verification result is failed, the operation failure is prompted through the display module;
in this embodiment, the verification result data is represented by respcode, and represents that verification is successful if its corresponding value is 00, and represents that verification is failed if its corresponding value is 11.
And 111, the terminal control MCU module encodes the two-dimensional code display data to obtain encoded data, and the two-dimensional code is displayed through the display module according to the encoded data.
In this embodiment, after the terminal displays the two-dimensional code through the display module, the method further includes: the terminal control MCU module generates request query data and sends the request query data to the server through the communication module;
The terminal further comprises the following steps after sending the request query data to the server: the terminal receives query response data returned by the server through the communication module, the terminal controls the MCU module to analyze the query response data to obtain an operation result code, judges whether user operation is finished through the operation result code, prompts the operation to be finished through the display module, judges whether preset query interval time accords with the condition if the operation is finished, repeatedly judges whether the preset query interval time accords with the condition if the operation is not finished, and sends the request query data to the server through the communication module if the operation is finished;
optionally, after the judging that the preset query interval time meets the condition, the method further includes: judging whether the accumulated inquiry times exceeds the preset inquiry termination times, if yes, prompting operation failure through a display module, and if not, sending the request inquiry data to a server through a communication module.
For example, the number of times of preset query termination is 3, and the preset query interval time is 60 seconds.
Optionally, after the terminal displays the two-dimensional code through the display module, the method further includes: the terminal receives operation response data sent by the server through the communication module, judges whether the operation is completed according to the operation response data, prompts the completion of the operation through the display module if the operation is completed, and prompts the failure of the operation through the display module if the operation is not completed.
According to the invention, the input module of the terminal receives information input by a user, controls the MCU to organize and generate first request message data, sends the first request message data to the server, receives request response data returned by the server through the communication module, and the terminal controls the MCU module to analyze the request response data to acquire two-dimension code generation data and display the two-dimension code through the display module in a coding mode. The method provided by the invention can display the online generated two-dimensional code on the terminal, avoid the behavior of deception users when other people input information, ensure the safety of the operation process, and can search the operation result online without displaying an operation result interface by the user.
Example IV
A fourth embodiment of the present invention provides a terminal for online generating a two-dimensional code, as shown in FIG. 4, the terminal includes:
a communication module 11 for connecting to a network;
an input module 12 for receiving information input by a user;
a control module 13 for controlling the MCU module;
the MCU module 14 is configured to obtain information input by a user and received by the input module 12, obtain data elements, organize and generate first combined data according to the obtained information input by the user and the obtained data elements, and generate first request message data according to the first combined data under control of the control module 13;
The communication module 11 is further configured to send the first request message data generated by the MCU module 14 to a server;
the communication module 11 is further configured to receive first response message data returned by the server;
the MCU module 14 is further used for verifying the first response message data under the control of the control module 13, and obtaining second combined data in the first response message data if the first response message data passes the verification;
the MCU module 14 is further configured to determine a verification result of the first request message by the server in the second combined data under the control of the control module 13, and if the verification result is successful, acquire two-dimensional code display data in the second combined data;
the MCU module 14 is further used for encoding the two-dimensional code display data under the control of the control module 13 to obtain encoded data, and displaying the two-dimensional code through the display module 15 according to the encoded data;
and the display module 15 is used for displaying the two-dimensional code according to the coded data obtained by the coding of the MCU module 14.
In the present embodiment, the MCU module 14 includes a first generation unit;
specifically, the first generating unit is configured to calculate, under control of the control module 13, the first combined data to obtain a first digest value, sign the first digest value by using a terminal private key through a preset algorithm to obtain first signature data, and combine the first combined data and the first signature data to obtain first request message data.
In the present embodiment, the MCU module 14 includes a first acquisition unit, a second acquisition unit, and a second generation unit;
specifically, the first obtaining unit is configured to obtain, under control of the control module 13, information input by a user and received by the input module 12;
specifically, the second obtaining unit is configured to obtain, under the control of the control module 13, a pre-stored data element and a current time;
specifically, the second generating unit is configured to generate, under the control of the control module 13, first combined data according to the preset data element combination format, the information input by the user and acquired by the first acquiring unit, the pre-stored data element acquired by the second acquiring unit, and the current time organization.
In this embodiment, the MCU module 14 further includes a first judging unit and a third generating unit;
specifically, the first judging unit is configured to judge, under the control of the control module 13, whether the information input by the current user is first input on the same day after the first acquiring unit acquires the information input by the user;
specifically, the third generating unit is configured to generate, under control of the control module 13, update public key certificate request data when the first judging unit judges that the information input by the current user is first input on the same day, and organize the update public key certificate request data, the information input by the user, the current time acquired from the timer, and the acquired pre-stored data elements according to a preset data element combination form to generate first combination data.
In the present embodiment, the MCU module 14 includes a fourth generation unit;
specifically, the fourth generating unit is configured to generate, under the control of the control module 13, request query data after the display module 15 displays the two-dimensional code;
specifically, the communication module 11 is further configured to send the request query data generated by the fourth generating unit to the server.
In this embodiment, the MCU module 14 further includes an analyzing unit, a third acquiring unit, a second judging unit, and a third judging unit;
specifically, the communication module 11 is further configured to receive query response data returned by the server;
specifically, the parsing unit is configured to parse the query response data received by the communication module 11 under the control of the control module 13;
specifically, the third obtaining unit is configured to obtain, under control of the control module 13, an operation result code from the query response data parsed by the parsing unit;
specifically, the second judging unit is configured to judge whether the user operation is completed according to the operation result code acquired by the third acquiring unit under the control of the control module 13;
specifically, the display module 15 is further configured to display a prompt for completing the operation when the second judging unit judges that the user operation is completed;
Specifically, the third judging unit is used for judging whether the preset inquiry interval time meets the condition or not under the control of the control module when the second judging unit judges that the user operation is not finished; when the preset inquiry interval time is judged to be not in accordance with the condition, repeatedly judging whether the preset inquiry interval time is in accordance with the condition;
specifically, the communication module 11 is further configured to send the request query data generated by the fourth generating unit to the server when the third determining unit determines that the preset query interval time meets the condition.
In this embodiment, the MCU module 14 further includes a fourth judging unit;
specifically, the fourth judging unit is configured to judge, under the control of the control module 13, whether the accumulated number of times of inquiry exceeds the preset number of times of inquiry termination when the third judging unit judges that the preset inquiry interval time meets the condition;
specifically, the display module 15 is further configured to display a prompt for failure of operation when the fourth determination unit determines that the accumulated number of queries exceeds the preset number of query termination times;
specifically, the communication module 11 is further configured to send the query request data generated by the fourth generating unit to the server when the fourth judging unit judges that the accumulated query number does not exceed the preset query termination number.
In this embodiment, the display module 15 is further configured to display a prompt for failure of operation when the MCU module 14 verifies that the first response message data fails.
In this embodiment, the display module 15 is further configured to display a prompt for failure of operation when the MCU module 14 determines that the verification result of the server on the first request packet in the second combined data is failure.
The terminal and the method for online generating the two-dimensional code provided by the invention are described in detail, and specific examples are applied to the explanation of the principle and the implementation mode of the invention, and the explanation of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the idea of the present invention, the present disclosure should not be construed as limiting the present invention in summary.

Claims (12)

1. A method for online generation of two-dimensional codes, the method comprising:
the terminal is connected with a network through a communication module;
the terminal receives information input by a user through an input module;
the terminal control MCU module acquires information input by a user and received by the input module, acquires data elements in the MCU module, organizes and generates first combined data according to the acquired information input by the user and the acquired data elements, generates first request message data according to the first combined data, and sends the first request message data to a server through the communication module; the data element in the MCU module is specifically obtained as follows: acquiring a data element and the current time which are prestored in an MCU module; the first combination data is generated according to the acquired information input by the user and the acquired data element organization, specifically: according to a preset data element combination form, first combination data are generated according to the acquired information input by a user, the current time and the pre-stored data element organization; the generating first request message data according to the first combined data specifically includes: the terminal control MCU module calculates first combination data to obtain a first abstract value, signs the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data, and combines the first combination data with the first signature data to obtain first request message data;
The terminal receives first response message data returned by the server through the communication module, controls the MCU module to verify the first response message data, and acquires second combined data in the first response message data if the verification is passed; the first response message data comprises second combined data which is generated by the server according to the first request message data and comprises a verification result of the first request message data and two-dimensional code display data, and second signature data obtained by signing the second combined data through a preset algorithm by using a server private key;
the terminal control MCU module judges the verification result of the server on the first request message in the second combined data, and if the verification result is successful, the two-dimensional code display data in the second combined data is obtained;
the terminal control MCU module encodes the two-dimensional code display data to obtain encoded data, and displays the two-dimensional code through the display module according to the encoded data;
the terminal control MCU module further comprises the following steps after acquiring the information input by the user and received by the input module: and the terminal control MCU module judges whether the information input by the current user is input for the first time on the same day, if so, generates updated public key certificate request data, and organizes the updated public key certificate request data, the information input by the user, the current time and the pre-stored data elements into first combined data according to a preset data element combination form.
2. The method for operating a terminal according to claim 1, wherein after the coded data is displayed on the display module, the method further comprises: the terminal control MCU module generates request query data and sends the request query data to the server through the communication module.
3. The method for operating a terminal according to claim 2, wherein after the request query data is transmitted to the server through the communication module, further comprising: the terminal receives query response data returned by the server through the communication module, the terminal controls the MCU module to analyze the query response data, an operation result code is obtained, whether user operation is completed or not is judged through the operation result code, if the user operation is completed, the operation is prompted through the display module, whether the preset query interval time meets the condition is judged if the user operation is completed, if the user operation is not completed, whether the preset query interval time meets the condition is judged repeatedly, and if the preset query interval time meets the condition, the request query data is sent to the server through the communication module.
4. The method for operating a terminal according to claim 3, further comprising, after determining that the preset query interval time meets the condition: judging whether the accumulated inquiry times exceeds the preset inquiry termination times, if yes, prompting operation failure through a display module, and if not, sending the request inquiry data to a server through a communication module.
5. The method according to claim 1, wherein when the terminal control MCU module verifies that the first response message data is not passed, the terminal control MCU module prompts an operation failure through the display module.
6. The method according to claim 1, wherein when the terminal control MCU module determines that the verification result of the server on the first request packet in the second combined data is a failure, the terminal control MCU module prompts the operation failure through the display module.
7. A terminal for online generation of two-dimensional codes, the terminal comprising:
the communication module is used for connecting a network;
the input module is used for receiving information input by a user;
the control module is used for controlling the MCU module;
the MCU module is used for acquiring information input by a user and received by the input module under the control of the control module, acquiring data elements, organizing and generating first combined data according to the acquired information input by the user and the acquired data elements, and generating first request message data according to the first combined data;
the communication module is further used for sending the first request message data generated by the MCU module to a server;
The communication module is also used for receiving first response message data returned by the server; the first response message data comprises second combined data which is generated by the server according to the first request message data and comprises a verification result of the first request message data and two-dimension code display data, and second signature data obtained by signing the second combined data by using a server private key through a preset algorithm;
the MCU module is further used for verifying the first response message data under the control of the control module, and obtaining second combined data in the first response message data if the verification is passed;
the MCU module is further used for judging a verification result of the server on the first request message in the second combined data under the control of the control module, and acquiring two-dimensional code display data in the second combined data if the verification result is successful;
the MCU module is further used for encoding the two-dimensional code display data under the control of the control module to obtain encoded data, and displaying the two-dimensional code through the display module according to the encoded data;
the display module is used for displaying the two-dimensional code according to the coded data obtained by the MCU module;
The MCU module specifically comprises:
the first generation unit is used for calculating the first combined data to obtain a first abstract value under the control of the control module, signing the first abstract value by using a terminal private key through a preset algorithm to obtain first signature data, and combining the first combined data with the first signature data to obtain first request message data;
the first acquisition unit is used for acquiring information input by a user and received by the input module under the control of the control module;
the second acquisition unit is used for acquiring pre-stored data elements and current time under the control of the control module;
the second generation unit is used for generating first combined data according to the information input by the user and acquired by the first acquisition unit, the pre-stored data elements acquired by the second acquisition unit and the current time organization under the control of the control module and in a preset data element combination form;
the MCU module further comprises:
the first judging unit is used for judging whether the information input by the current user is input for the first time on the same day under the control of the control module after the first acquiring unit acquires the information input by the user;
And the third generation unit is used for generating updated public key certificate request data under the control of the control module when the first judgment unit judges that the information input by the current user is input for the first time on the same day, and organizing the updated public key certificate request data, the information input by the user, the current time acquired from the timer and the acquired prestored data elements into first combined data according to a preset data element combination form.
8. The terminal according to claim 7, wherein the MCU module includes a fourth generation unit;
the fourth generating unit is used for generating request query data under the control of the control module after the display module displays the two-dimensional code;
the communication module is further configured to send the request query data generated by the fourth generating unit to a server.
9. The terminal of claim 8, wherein the MCU module further comprises an parsing unit, a third obtaining unit, a second judging unit, and a third judging unit;
the communication module is also used for receiving query response data returned by the server;
the analysis unit is used for analyzing the query response data received by the communication module under the control of the control module;
The third obtaining unit is used for obtaining an operation result code from the query response data analyzed by the analyzing unit under the control of the control module;
the second judging unit is used for judging whether the user operation is finished or not according to the operation result code acquired by the third acquiring unit under the control of the control module;
the display module is further used for displaying a prompt of operation completion when the second judging unit judges that the user operation is completed;
the third judging unit is used for judging whether the preset inquiry interval time meets the condition under the control of the control module when the second judging unit judges that the user operation is not finished; when the preset inquiry interval time is judged to be not in accordance with the condition, repeatedly judging whether the preset inquiry interval time is in accordance with the condition;
the communication module is further configured to send the query request data generated by the fourth generating unit to a server when the third judging unit judges that the preset query interval time meets a condition.
10. The terminal according to claim 9, wherein the MCU module further comprises a fourth judgment unit;
the fourth judging unit is configured to judge, under control of the control module, whether the accumulated query number exceeds the preset query termination number when the third judging unit judges that the preset query interval time meets a condition;
The display module is further used for displaying a prompt of operation failure when the fourth judging unit judges that the accumulated query times exceeds the preset query termination times;
the communication module is further configured to send the query request data generated by the fourth generating unit to a server when the fourth judging unit judges that the accumulated query times do not exceed the preset query termination times.
11. The terminal of claim 7, wherein the display module is further configured to display a prompt for an operation failure when the MCU module verifies that the first response message data fails.
12. The terminal of claim 7, wherein the display module is further configured to display a prompt for operation failure when the MCU module determines that the verification result of the server on the first request packet in the second combined data is failure.
CN201911017258.1A 2019-10-24 2019-10-24 Terminal and method for online generation of two-dimension code Active CN110766114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911017258.1A CN110766114B (en) 2019-10-24 2019-10-24 Terminal and method for online generation of two-dimension code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911017258.1A CN110766114B (en) 2019-10-24 2019-10-24 Terminal and method for online generation of two-dimension code

Publications (2)

Publication Number Publication Date
CN110766114A CN110766114A (en) 2020-02-07
CN110766114B true CN110766114B (en) 2023-09-22

Family

ID=69333435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911017258.1A Active CN110766114B (en) 2019-10-24 2019-10-24 Terminal and method for online generation of two-dimension code

Country Status (1)

Country Link
CN (1) CN110766114B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522516B (en) * 2020-07-06 2020-10-27 飞天诚信科技股份有限公司 Processing method and system for cloud broadcast print data

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103501228A (en) * 2013-08-01 2014-01-08 沈阳华矿新能源装备科技有限公司 Dynamic two-dimension code token and authentication method of dynamic two-dimension code instruction
CN204066149U (en) * 2014-02-21 2014-12-31 黄昱钊 The system of Dynamic Announce Quick Response Code
WO2016004241A1 (en) * 2014-07-03 2016-01-07 Alibaba Group Holding Limited Login using two-dimensional code
CN106656908A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 Two-dimensional code processing method and two-dimensional code processing device
JP2017119260A (en) * 2015-12-30 2017-07-06 日立工機株式会社 Centrifuge
CN106981012A (en) * 2017-03-21 2017-07-25 上海动联信息技术股份有限公司 A kind of dynamic two-dimension code order generation method and equipment
CN107181771A (en) * 2016-03-09 2017-09-19 北京优朋普乐科技有限公司 The generation method of Quick Response Code and the response method of two-dimensional code scanning event
CN107392612A (en) * 2017-06-05 2017-11-24 广东工业大学 A kind of method based on traffic Quick Response Code transaction verification
CN206711110U (en) * 2017-04-12 2017-12-05 武汉理工大学 Train checks handheld terminal
CN108596624A (en) * 2018-03-14 2018-09-28 阿里巴巴集团控股有限公司 Handling result, payment result acquisition methods and the device of service request
CN109005028A (en) * 2018-11-02 2018-12-14 美的集团股份有限公司 Cryptographic key negotiation method, Cloud Server, equipment, storage medium and system
CN109102270A (en) * 2018-07-24 2018-12-28 深圳前海益链网络科技有限公司 Transaction verification method, computer equipment and the storage medium of block chain number Token
CN109711921A (en) * 2018-11-08 2019-05-03 深圳市顺丰物业管理有限公司 Customization of two-dimension code management method, device, system and storage medium
CN109726578A (en) * 2019-01-22 2019-05-07 江苏哩咕信息科技有限公司 A kind of anti-fake solution of novel dynamic two-dimension code
CN109756447A (en) * 2017-11-01 2019-05-14 华为技术有限公司 A kind of safety certifying method and relevant device
CN110189126A (en) * 2019-06-03 2019-08-30 飞天诚信科技股份有限公司 A kind of generation method and device of dynamic two-dimension code

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10691788B2 (en) * 2017-02-03 2020-06-23 Ademco Inc. Systems and methods for provisioning a camera with a dynamic QR code and a BLE connection

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103501228A (en) * 2013-08-01 2014-01-08 沈阳华矿新能源装备科技有限公司 Dynamic two-dimension code token and authentication method of dynamic two-dimension code instruction
CN204066149U (en) * 2014-02-21 2014-12-31 黄昱钊 The system of Dynamic Announce Quick Response Code
WO2016004241A1 (en) * 2014-07-03 2016-01-07 Alibaba Group Holding Limited Login using two-dimensional code
CN106656908A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 Two-dimensional code processing method and two-dimensional code processing device
JP2017119260A (en) * 2015-12-30 2017-07-06 日立工機株式会社 Centrifuge
CN107181771A (en) * 2016-03-09 2017-09-19 北京优朋普乐科技有限公司 The generation method of Quick Response Code and the response method of two-dimensional code scanning event
CN106981012A (en) * 2017-03-21 2017-07-25 上海动联信息技术股份有限公司 A kind of dynamic two-dimension code order generation method and equipment
CN206711110U (en) * 2017-04-12 2017-12-05 武汉理工大学 Train checks handheld terminal
CN107392612A (en) * 2017-06-05 2017-11-24 广东工业大学 A kind of method based on traffic Quick Response Code transaction verification
CN109756447A (en) * 2017-11-01 2019-05-14 华为技术有限公司 A kind of safety certifying method and relevant device
CN108596624A (en) * 2018-03-14 2018-09-28 阿里巴巴集团控股有限公司 Handling result, payment result acquisition methods and the device of service request
CN109102270A (en) * 2018-07-24 2018-12-28 深圳前海益链网络科技有限公司 Transaction verification method, computer equipment and the storage medium of block chain number Token
CN109005028A (en) * 2018-11-02 2018-12-14 美的集团股份有限公司 Cryptographic key negotiation method, Cloud Server, equipment, storage medium and system
CN109711921A (en) * 2018-11-08 2019-05-03 深圳市顺丰物业管理有限公司 Customization of two-dimension code management method, device, system and storage medium
CN109726578A (en) * 2019-01-22 2019-05-07 江苏哩咕信息科技有限公司 A kind of anti-fake solution of novel dynamic two-dimension code
CN110189126A (en) * 2019-06-03 2019-08-30 飞天诚信科技股份有限公司 A kind of generation method and device of dynamic two-dimension code

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
.结合"互联网+"的电动汽车运营服务信息化系统研究及示范应用.中国电力企业管理.2016,(第04期),第34-37页. *
国网北京市电力公司电力科学研究院课题组 *
地铁公司二维码乘车安全解决方案;梅中雷;;网络空间安全(第01期);第65-71页 *
巩微等编著.传媒信息安全.中国传媒大学出版社,2015,(第1版),第110-119页. *
庞勇编著.《手机无线上网技术及应用》.国防工业出版社,2001,(第1版),第187-190页. *
数字签名技术在网络安全中的应用研究;张瑞娟;;科技广场(第06期);第40-42页 *
朱士明主编.计算机网络及应用.北京理工大学出版社,2012,(第1版),第181-184页. *
杨义先等主编.2005通信理论与技术新进展:第十届全国青年通信学术会议论文集.北京邮电大学出版社,2005,(第1版),第564-567页. *

Also Published As

Publication number Publication date
CN110766114A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
CN101038653B (en) Verification system
CN110098932B (en) Electronic document signing method based on safe electronic notarization technology
CN110930147B (en) Offline payment method and device, electronic equipment and computer-readable storage medium
KR101512001B1 (en) System and method for user authentication by using a physical financial card and mobile communication terminal
CN107798531B (en) Electronic payment method and system
CN103218740A (en) Trading system, method and device using two-dimension codes
CN105830390A (en) System and method for authentication using quick response code
CN103039098A (en) Authentication method and system using portable terminal
CN111064743B (en) Method and system for safely inputting password
WO2013166442A1 (en) System and method for wireless transaction authentication
CN110601815B (en) Block chain data processing method and equipment
CN106779705B (en) Dynamic payment method and system
CN111126533B (en) Identity authentication method and device based on dynamic password and dynamic token
CN101216915A (en) A secured mobile payment method
CN101765113A (en) Anti-theft system and method for data card
CN110766114B (en) Terminal and method for online generation of two-dimension code
CN104754568A (en) Identity recognition method and device based on NFC (Near Field Communication)
CN110691265B (en) Television payment method and system based on voiceprint recognition
CN107451806A (en) NFC payment and device
CN114244505B (en) Safety communication method based on safety chip
CN112039677B (en) Method and system for code scanning operation processing based on server
CN112039928B (en) Method and system for processing certificate
CN104424453A (en) System and method for verifying non-contact inductive label
WO2014154058A1 (en) System and method for mobile identity authentication and payment
CN110768925B (en) Verification method and device for verification code short message

Legal Events

Date Code Title Description
PB01 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