WO2018033018A1 - 一种缩短Android智能POS交易时间的方法及系统 - Google Patents

一种缩短Android智能POS交易时间的方法及系统 Download PDF

Info

Publication number
WO2018033018A1
WO2018033018A1 PCT/CN2017/096836 CN2017096836W WO2018033018A1 WO 2018033018 A1 WO2018033018 A1 WO 2018033018A1 CN 2017096836 W CN2017096836 W CN 2017096836W WO 2018033018 A1 WO2018033018 A1 WO 2018033018A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain name
address
hosts file
android
pair
Prior art date
Application number
PCT/CN2017/096836
Other languages
English (en)
French (fr)
Inventor
张炽成
黄继翔
Original Assignee
福建联迪商用设备有限公司
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 福建联迪商用设备有限公司 filed Critical 福建联迪商用设备有限公司
Publication of WO2018033018A1 publication Critical patent/WO2018033018A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Definitions

  • the present invention relates to the field of POS transactions, and in particular, to a method and system for shortening Android smart POS transaction time.
  • the Android operating system has achieved great success. Due to the well-recognized user experience of the Android operating system, and its open source features facilitate secondary development and upgrade maintenance. Therefore, the customization of the POS device is completed on the Android system, and the user experience can be improved by using the good interface of the Android system for the POS machine.
  • the Android operating system is increasingly used by various financial equipment manufacturers as a software operating system for financial equipment (POS machines, smart terminals, self-service terminals).
  • the financial POS In the process of financial transactions, financial POS often needs to interact with the server background set up by financial service providers such as banks and third-party payment platforms through the SSL secure connection protocol.
  • the financial payment terminal equipped with the Android system needs to call the DNS domain name reverse resolution query interface provided by the Android system to obtain the domain name (host name) of the target IP address.
  • the DNS service system set up by the Internet operator often does not support the reverse resolution function of the DNS domain name, which causes the timeout of the DNS domain name reverse resolution query function of the Android system to expire, thereby prolonging the time required for the SSL connection process.
  • the premise of the invention is to know the domain name of the peer to be accessed, relying on the DNS server to resolve the IP address, and find the IP address corresponding to the domain name, thereby relying on the above domain name-IP address pair and updating the hosts file. .
  • the operator's DNS server cannot provide the IP address reverse resolution function, the client cannot obtain the domain name-IP address pair and cannot write the updated hosts. The file naturally cannot speed up the connection process.
  • the inventor provides a method for shortening the Android smart POS transaction time, including the steps:
  • the "sending the IP address-domain name update to the hosts file of the Android system” further includes the steps of: when the POS program is to connect the opposite end of the fixed IP and the domain name, the call is made to the getHostName through the SSL connection interface of the Android system.
  • the interface performs reverse domain name resolution, obtain the hosts file of the Android system, and find the fixed address according to the IP address-domain name in the hosts file. The domain name corresponding to the IP.
  • sending the IP address-domain name update to the hosts file of the Android system includes the following steps:
  • the IP address-domain name pair is an IP address-domain name pair of a server set up by the financial service provider.
  • the financial service provider includes banks and third party payment platforms that need to be connected in financial transactions.
  • the inventor also provides another technical solution, an Android smart POS system, which includes:
  • Interface display module used to display the user interface of the IP address-domain name import or input
  • the IP address-domain name pair obtaining module is configured to obtain an IP address-domain name pair imported or input in the user interaction interface
  • Hosts file update module used to save the IP address-domain name to the hosts file of the Android system.
  • IP parsing module used to connect the fixed IP and domain name to the peer end of the POS program.
  • SSL connection interface of the Android system is called to the getHostName interface for reverse domain name resolution
  • the host file of the Android system is obtained, according to the hosts file. IP address-domain name to find the domain name corresponding to the fixed IP.
  • the hosts file update module includes:
  • the IP address judging module is configured to determine whether the obtained IP address-domain name is the same as the IP address in the hosts file.
  • IP address replacement module If they are the same, replace the original IP address-domain name pair in the hosts file;
  • IP address adding module if not the same, it is added to the hosts file
  • Save update module Save the replaced or added hosts file.
  • the IP address-domain name pair is an IP address-domain name pair of a server set up by the financial service provider.
  • the financial service provider includes banks and third party payment platforms that need to be connected in financial transactions.
  • the above technical solution follows the original SSL connection mechanism of the Android system, and does not need to modify the Android system source code to ensure the stability of the system; whether the Internet operator that the terminal accesses provides the DNS reverse domain name query service, Presetting the known fixed IP address-domain name pair method can avoid the long-term reverse domain name query process, accelerate the SSL connection, and shorten the transaction time of the smart POS.
  • Figure 1 is a flow chart of a conventional traditional SSL connection
  • Figure 3 is a flowchart for analyzing the reverse domain name of the Android system
  • FIG. 4 is a flowchart of a method for shortening an Android smart POS transaction time according to the embodiment
  • FIG. 5 is a flowchart of specifically saving an IP address-domain name update to a hosts file of an Android system according to the embodiment
  • FIG. 6 is a structural diagram of an Android smart POS system according to a specific embodiment
  • FIG. 7 is a structural diagram of a host file update module of a specific embodiment.
  • IP address-domain name acquisition module 602.
  • IP address judgment module 6031, IP address judgment module,
  • IP address replacement module 6032, IP address replacement module
  • IP address adding module 6033, IP address adding module
  • TCP Transmission Control Protocol
  • TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol
  • TCP is a transport layer protocol in the Internet, which establishes a connection using a three-way handshake protocol.
  • the three-way handshake protocol refers to the three phases of interaction between the server and the client during the preparation phase of sending data: the first handshake: the client sends a TCP SYN (synchronize request synchronization) packet to the server, and enters SYN_SENT (requests the connection).
  • second handshake the server receives the TCP SYN packet, must confirm the customer's TCP SYN, and also sends a TCP SYN packet, that is, SYN+ACK (Acknowledgement command correctly responds) packet, at this time the server Enter the SYN_RECV state (the state when the server is passively opened, the SYN of the client is received and the ACK is sent); the third handshake: the client receives the SYN+ACK packet of the server, and sends an acknowledgement packet TCPACK to the server.
  • SYN_RECV the state when the server is passively opened, the SYN of the client is received and the ACK is sent
  • the third handshake the client receives the SYN+ACK packet of the server, and sends an acknowledgement packet TCPACK to the server.
  • the client and server enter the ESTABLISHED state the three-way handshake is completed.
  • the traditional SSL connection process is to establish an SSL handshake directly after the TCP three-way handshake.
  • Client Hello (client greeting): the client will have its SSL version number, encryption settings parameters, session-related data and other necessary information (such as encryption algorithms and keys that can be supported) Small) sent to the server.
  • Server Hello the server sends its SSL version number, encryption settings parameters, session-related data and other necessary information to the client
  • Certificate The server sends a certificate or a certificate chain to the client.
  • the certificate chain begins with the server public key and ends with the root certificate that proves authority. This certificate is used to confirm the identity of the server to the client. This message is optional. This message is sent if the server's SSL is configured to verify the identity of the server. Most e-commerce applications require server-side authentication.
  • Server Hello Done Notifies the client that the server has completed the initialization of the communication process.
  • Client Key Exchange The client generates a session key to share with the server. After the SSL handshake protocol is completed, the session key is used for the encryption of the communication between the client and the server. If the RSA encryption algorithm is used, the client will encrypt the session using the server's public key before sending it to the server. The server decrypts the received message using its own private key to obtain the shared session key.
  • the client tells the server that it is ready for secure communication.
  • the server tells the client that it is ready for secure communication. The flag for the completion of the SSL handshake.
  • each reverse domain name resolution will query whether the domain name corresponding to the target address exists in the local hosts file, and if not, it will operate on the currently registered network.
  • the DNS server provided by the provider initiates a domain name query of Get host name req.
  • the specific process of the reverse domain name resolution process of the Android system is as follows:
  • the invention designs a method for shortening the SSL connection time of the Android smart POS. Allow externally to add, modify, and import IP address-domain name pairs to the hosts file to ensure that when connecting to a peer with a known fixed IP address, avoid the SSL connection waiting timeout period because the carrier does not support DNS reverse domain name query. Thereby improving the efficiency of financial transactions.
  • a method for shortening an Android smart POS transaction time includes:
  • Step S401 Display the user interface of the IP address-domain name pair import or input; set the IP address-domain name pair import box, input box and confirmation button on the interface, import the import box and input box or input the IP address-domain name pair,
  • the confirmation button confirms the import or input, and the operation is simple, and no complicated operation is required. It is also possible to have a selection network button on the interface to import or input through the network transmission, and the operation is simple.
  • Step S402 Obtain an IP address-domain name pair imported or input in the user interaction interface; automatically obtain an IP address-domain name pair imported or input in the user interaction interface, and further process the obtained IP address-domain name pair, Other manual operations are required to facilitate data processing.
  • Step S403 Save the IP address-domain name update to the hosts file of the Android system; save the obtained IP address-domain name update to the hosts file of the Android system, and when viewing the hosts file of the Android system, according to The imported or imported IP address-domain name pair finds the domain name corresponding to the IP address corresponding to the target. It does not need to perform reverse domain name query to the DNS server to avoid the long-term reverse domain name query process.
  • the method further includes the step S404: when the POS program is to be connected to the opposite end of the fixed IP address and the domain name, and the host connection file is obtained by calling the getHostName interface to the reverse domain name resolution through the SSL connection interface of the Android system, the host file of the Android system is obtained. Find the domain name corresponding to the fixed IP address based on the IP address-domain name in the hosts file.
  • the POS program is to connect to the opposite end of the fixed IP and domain name, it is easier to use the existing getHostName interface for reverse domain name resolution programming, and further shorten the time for reverse domain name resolution.
  • Step S403 saving the IP address-domain name update to the hosts file of the Android system
  • Step S4031 Determine whether the obtained IP address-domain name pair is the same as the IP address in the hosts file.
  • Step S4032 If the same, replace the original IP address-domain name pair in the hosts file;
  • Step S4033 If not the same, the new IP address-domain name pair is added to the hosts file;
  • Step S4034 Save the replaced or added hosts file.
  • the obtained IP address-domain name pair is compared with the IP address in the hosts file of the Android system; when it is determined that the obtained IP address-domain name pair is the same as the IP address, the original IP address-domain name pair in the hosts file is replaced. Avoid duplicate IP addresses in the hosts file, which makes the search inconvenient and replaces the original IP address-domain name pair to make the search result more accurate. When it is judged that the obtained IP address-domain name pair is different from the IP address, Add the new IP address-domain name to the hosts file to avoid the possibility of not finding the required domain name and making the transaction time longer.
  • the Android 4.4 platform is programmed, and the compiled result is verified by the financial POS of the Android 4.4 platform.
  • the present invention can shorten the transaction time by 10 seconds.
  • the application software is installed on the intelligent POS machine based on the Android system, and the application software displays a user interaction interface for the user to import or input the IP address-domain name on the smart POS machine, so that the user can import or input the IP address of the server set up by the financial service provider.
  • - Domain name pairs Financial service providers include banks and third-party payment platforms that need to be connected in financial transactions. By importing or importing the IP address-domain name pair of the server set up by the financial service provider, avoid entering other IP addresses - domain names. The impact on the search process, resulting in increased search workload, and in today's society financial service providers are basically banks and third-party payment platforms, also reduce the IP address of the server set up by other financial service providers - domain name pairs And more work is generated.
  • the application software obtains the IP address-domain name imported or input by the user, and judges the obtained IP address-domain name, whether it is the same as the IP address in the hosts file. When the same, the software replaces the new IP address-domain name with the host file. Some IP addresses - domain name pairs, when different, the software adds the new IP address-domain name pair to the hosts file, and finally the application saves the replaced or added hosts file.
  • the POS program is to be connected to the opposite end of the fixed IP address and the domain name
  • the Android system's SSL connection interface is called to the getHostName interface for reverse domain name resolution, and the Android system's hosts file is obtained, according to the IP address-domain name pair in the hosts file. Find the domain name corresponding to the fixed IP.
  • a specific embodiment of an Android smart POS system includes:
  • the interface display module 601 is configured to display an IP address-domain name pair import or input user interaction interface
  • the IP address-domain name pair obtaining module 602 is configured to obtain an IP address-domain name pair imported or input in the user interaction interface
  • the hosts file update module 603 is configured to save the IP address-domain name pair to the hosts file of the Android system.
  • the IP parsing module 604 is further configured to: when the POS program is to be connected to the peer end of the fixed IP address and the domain name, and obtain the Android by using the SSL connection interface of the Android system to call the getHostName interface for reverse domain name resolution.
  • the hosts file of the system finds the domain name corresponding to the fixed IP address according to the IP address-domain name in the hosts file.
  • the hosts file update module 603 includes:
  • the IP address judging module 6031 is configured to determine whether the obtained IP address-domain name pair is the same as the IP address in the hosts file.
  • the IP address replacement module 6032 if the same, replace the original IP address-domain name pair in the hosts file;
  • IP address adding module 6033 if not the same, added to the hosts file;
  • Save update module 6034 Save the replaced or added hosts file.
  • the application software is installed on the intelligent POS machine based on the Android system, and the application software displays the user interaction interface for the user to import or input the IP address-domain name through the interface display module 601, so that the user can import or input the financial service provider.
  • Server IP address - Domain name pairs, financial service providers include banks and third-party payment platforms that need to be connected in financial transactions.
  • the application software obtains the IP address-domain name imported or input by the user through the IP address-domain name pair obtaining module 602, and determines whether the obtained IP address-domain name is obtained by the IP address determining module 6031, whether it is the same as the IP address in the hosts file. When the same, the software replaces the new IP address-domain name with the original IP address-domain name in the hosts file through the IP address replacement module 6032.
  • the software adds the new IP address-domain name pair through the IP address adding module 6033.
  • the last application saves the replaced or added hosts file by saving the update module 6034.
  • the Android system's SSL connection interface is called to the getHostName interface for reverse domain name resolution, and the Android system's hosts file is obtained, according to the IP address-domain name pair in the hosts file. Find the domain name corresponding to the fixed IP.
  • the financial easy program is connected to the peer end of the known fixed IP (such as the bank backend server), when the SSL connection interface of the Android system is called to the getHostName interface for reverse domain name resolution, it will be viewed.
  • the system's hosts file finds the pre-configured IP address-domain name pair, and does not need to perform reverse domain name query to the DNS server.
  • the original SSL connection mechanism of the Android system is used, and the Android system source code is not required to be modified, thereby ensuring the stability of the system; whether the Internet operator that the terminal accesses provides the DNS reverse domain name query service, by searching for the imported or input IP address-domain name In the right way, you can avoid the long-term reverse domain name query process and accelerate the SSL connection.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种缩短Android智能POS交易时间的方法,其特征在于,包括:显示IP地址-域名对导入或者输入的用户交互界面;获取所述用户交互界面中导入或者输入的IP地址-域名对;将IP地址-域名对更新保存至Android系统的hosts文件中。沿用Android系统原有的SSL连接机制,无需修改Android系统源码,保证了系统的稳定性;无论终端接入的互联网运营商是否提供DNS反向域名查询服务,通过预设已知固定IP地址-域名对的方式,均可避免耗时较长的反向域名查询流程,加速SSL连接,缩短了智能POS的交易时间。

Description

一种缩短Android智能POS交易时间的方法及系统 技术领域
本发明涉及POS交易领域,特别涉及一种缩短Android智能POS交易时间的方法及系统。
背景技术
随着智能手机的普及,Android操作系统取得巨大的成功。由于Android操作系统良好的用户体验得到广泛的认可,且其具有开源的特点便于二次开发和升级维护。因此,在Android系统上完成对POS设备的定制,可以为POS机借助Android系统的良好界面,提升用户体验效果。目前,Android操作系统越来越多地被各类金融设备厂商作为金融设备(POS机,智能终端,自助终端)所搭载的软件操作系统。
金融POS在金融交易过程中,往往需要通过SSL安全连接协议与银行、第三方支付平台等金融服务供应商所架设的服务器后台进行交互。搭载Android系统的金融支付终端在SSL连接流程中,需要调用Android系统自带的DNS域名反向解析查询接口,获取目标IP地址的域名(host name)。然而目前互联网运营商所架设的DNS服务系统中,往往不支持DNS域名的反向解析功能,导致Android系统的DNS域名反向解析查询功能超时结束,从而延长了SSL连接流程所需时间。
而如果要通过修改Android系统中DNS域名方向解析查询接口,以解决SSL连接流程耗时过长的问题,意味着要修改Android系统源码中涉及SSL连接和DNS域名反向解析查询的部分,并更新替换所有搭载Android系统的金融POS的操作系统,该方案耗费时间且开销过大。
申请号为201510875328.2的专利《一种特定接入网专用hosts文件的产生、更新系统及其方法》中,公开了一种特定接入网专用hosts文件产生、更新方 法及其实现过程。此方法可找出用户访问的优质热点资源,并通过域名解析出其IP地址,然后生成hosts文件,把域名和解析出的IP地址写入文件中。用户在访问时资源时,可直接通过hosts文件找到对应的IP地址,不用经过DNS服务器进行解析,大大提高了访问速度的同时,还引导用户从此接入网访问资源。可通过两种方法实现:一是在互联口采集DNS数据;二是在接入网部署客户端测量性能,把IP和域名的数据汇总。根据性能数据和互联口解析排名,获得hosts文件。主要有以下缺点:
1)依赖于DNS查询:该发明的前提是知道要访问的对端的域名,依赖DNS服务器正向解析,查找解析出域名对应的IP地址,从而依赖于以上的域名-IP地址对,更新hosts文件。但是我们目前要解决的从IP地址反向查询对端的域名问题,当运营商的DNS服务器不能提供IP地址反向解析功能时,客户端便无法获取域名-IP地址对,从而无法写入更新hosts文件,自然无法加速连接过程。
发明内容
为此,需要提供一种缩短Android智能POS交易时间的方法及系统,规避SSL连接流程中DNS域名反向解析查询功能超时,无需修改和升级Android操作系统。
为实现上述目的,发明人提供了一种缩短Android智能POS交易时间的方法,包括步骤:
显示IP地址-域名对导入或者输入的用户交互界面;
获取所述用户交互界面中导入或者输入的IP地址-域名对;
将IP地址-域名对更新保存至Android系统的hosts文件中。
进一步优化,所述“将IP地址-域名对更新保存至Android系统的hosts文件中”后还包括步骤:当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定 IP对应的域名。
进一步优化,所述“将IP地址-域名对更新保存至Android系统的hosts文件中”包括步骤:
判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
如果相同,则替换hosts文件中原有的IP地址-域名对;
如果不相同,则添加至hosts文件中;
保存替换或者添加完后的hosts文件。
进一步优化,所述IP地址-域名对为金融服务供应商所架设的服务器的IP地址-域名对。
进一步优化,所述金融服务供应商包括金融交易中需要连接的银行和第三方支付平台。
本发明人还提供了另一个技术方案一种Android智能POS系统,其特征在于,包括:
界面显示模块:用于显示IP地址-域名对导入或者输入的用户交互界面;
IP地址-域名对获取模块:用于获取所述用户交互界面中导入或者输入的IP地址-域名对;
hosts文件更新模块:用于将IP地址-域名对保存更新至Android系统的hosts文件中。
进一步优化,还包括:
IP解析模块:用于当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名。
进一步优化,所述hosts文件更新模块包括:
IP地址判断模块:用于判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
IP地址替换模块:如果相同,则替换hosts文件中原有的IP地址-域名对;
IP地址添加模块:如果不相同,则添加至hosts文件中;
保存更新模块:保存替换或者添加完后的hosts文件。
进一步优化,所述IP地址-域名对为金融服务供应商所架设的服务器的IP地址-域名对。
进一步优化,所述金融服务供应商包括金融交易中需要连接的银行和第三方支付平台。
区别于现有技术,上述技术方案沿用Android系统原有的SSL连接机制,无需修改Android系统源码,保证了系统的稳定性;无论终端接入的互联网运营商是否提供DNS反向域名查询服务,通过预设已知固定IP地址-域名对的方式,均可避免耗时较长的反向域名查询流程,加速SSL连接,缩短了智能POS的交易时间。
附图说明
图1为传统传统SSL连接的流程图;
图2为Android系统SSL连接的流程图;
图3为Android系统反向域名的解析流程;
图4为具体本实施例一种缩短Android智能POS交易时间的方法的流程图;
图5为具体本实施例“将IP地址-域名对更新保存至Android系统的hosts文件中”的一种流程图;
图6为具体实施例一种Android智能POS系统的结构图;
图7为具体实施例hosts文件更新模块的结构图。
附图标记说明:
601、界面显示模块,
602、IP地址-域名对获取模块,
603、hosts文件更新模块,
6031、IP地址判断模块,
6032、IP地址替换模块,
6033、IP地址添加模块,
6034、保存更新模块,
604、IP解析模块。
具体实施方式
为详细说明技术方案的技术内容、构造特征、所实现目的及效果,以下结合具体实施例并配合附图详予说明。
请参阅图1,TCP(Transmission Control Protocol传输控制协议)是一种面向连接的、可靠的、基于字节流的传输层通信协议;TCP是因特网中的传输层协议,使用三次握手协议建立连接。三次握手协议指的是在发送数据的准备阶段,服务器端和客户端之间需要进行三次交互:第一次握手:客户端发送TCP SYN(synchronize请求同步)包到服务器,并进入SYN_SENT(请求连接)状态,等待服务器确认;第二次握手:服务器收到TCP SYN包,必须确认客户的TCP SYN,同时自己也发送一个TCP SYN包,即SYN+ACK(Acknowledgement命令正确应答)包,此时服务器进入SYN_RECV状态(服务端被动打开后,接收到了客户端的SYN并且发送了ACK时的状态);第三次握手:客户端收到服务器的SYN+ACK包,向服务器发送确认包TCPACK,此包发送完毕,客户端和服务器进入ESTABLISHED(连接成功)状态,完成三次握手。传统SSL连接流程是在TCP三次握手后,直接建立SSL握手,具体过程如下:
1、Client Hello(客户端问候):客户端将其SSL版本号、加密设置参数、与session有关的数据以及其它一些必要信息(如加密算法和能支持的密钥大 小)发送到服务器。
2、Server Hello(服务器问候):服务器将其SSL版本号、加密设置参数、与session有关的数据以及其它一些必要信息发送给客户端
3、Certificate(证书):服务器发一个证书或一个证书链到客户端,证书链开始于服务器公共钥匙并结束于证明权威的根证书。该证书用于向客户端确认服务器的身份,该消息是可选的。如果配置服务器的SSL需要验证服务器的身份,会发送该消息。多数电子商务应用都需要服务器端身份验证。
4、Server Hello Done(服务器问候结束):通知客户端,服务器已经完成了交流过程的初始化。
5、Client Key Exchange(客户端密钥交换):客户端产生一个会话密钥与服务器共享。在SSL握手协议完成后,客户端与服务器端通信信息的加密就会使用该会话密钥。如果使用RSA加密算法,客户端将使用服务器的公钥将会话加密后再发送给服务器。服务器使用自己的私钥对接收的消息进行解密得到共享的会话密钥。
6、Change cipher spec(更改密码规格):客户端要求服务器在后续的通信中使用加密模式。
7、Finished(结束):客户端告诉服务器已经准备好安全通信了。
8、Change cipher spec(更改密码规格):服务器要求客户端在后续的通信中使用加密模式。
9、Finished(结束):服务器告诉客户端它已经准备好安全通信了。SSL握手完成的标志。
请参阅图2,在Android操作系统的金融设备上,各类金融交易程序均基于Android操作系统进行开发。其中涉及到SSL协议的网络连接传输开发,自然用到了Android自带的SSL协议接口。通过分析Android SSL协议的连接流程,发现其与传统的SSL协议的连接流程有着区别,Android系统的SSL协议连接流程中,在TCP三次握手后,建立SSL握手之前,系统会调用 getHostName接口进行IP地址的反向域名解析。
请参阅图3,对于Android系统反向域名解析流程而言,每次反向域名解析,均会查询本地hosts文件中是否存有目标地址对应的域名,如果没有,则会向当前注册的网络运营商提供的DNS服务器发起Get host name req的域名查询。Android系统反向域名解析流程的具体过程如下:
1、开始查看系统hosts文件。
2、判断是否有目标IP地址对应的域名记录;如果有则结束;如果没有则进行以下步骤。
3、向DNS服务器发起Get HostName Req(获取主机名的请求)的反向域名查询。
4、等待DNS服务器Get HostName Response(获取主机名称响应)回应。
5、回应是否成功;如果没有,则结束;如果有,则进行以下步骤。
6、记录IP地址与域名于hosts文件,结束。
目前,大部分网络运营商并未提供DNS反向域名解析功能,即其架设的DNS服务器并不会对客户端发起的反向域名查询请求进行回应。这就导致Android客户端等待不到Get host name response直至超时,然后才能进入下一步骤。而Android客户端在Get host name req设置的超时等待时间一般为10秒,这就意味着,如果当前接入的网络运营商未提供DNS服务,则Android金融POS所发起的每次SSL连接均会在原有用时基础上加上10秒。这对于金融交易业务而言,大大降低了效率。
本发明基于Android系统基础上,设计一种缩短Android智能POS的SSL连接时间的方法。允许外部新增、修改和导入IP地址-域名对到hosts文件,以确保连接某些已知固定IP的对端时,避免因为运营商不支持DNS反向域名查询,导致SSL连接等待超时时间,从而可以提高金融交易的效率。
请参阅图4,本实施例中,一种缩短Android智能POS交易时间的方法,包括:
步骤S401:显示IP地址-域名对导入或者输入的用户交互界面;在界面上设置IP地址-域名对导入框、输入框和确认按钮,导入框和输入框导入或者输入IP地址-域名对,通过确认按钮确认导入或者输入,操作简单,不需要复杂的操作。也可以在界面设有选择联网按钮,通过网络传输进行导入或者输入,操作简单。
步骤S402:获取所述用户交互界面中导入或者输入的IP地址-域名对;自动获取用户交互界面中导入或者输入的IP地址-域名对,可以进一步对获取的IP地址-域名对进行处理,不再需要其他人工进行操作,方便对数据进行处理。
步骤S403:将IP地址-域名对更新保存至Android系统的hosts文件中;通过将获取的IP地址-域名对更新保存至Android系统的hosts文件中,当对Android系统的hosts文件进行查看,可以根据导入或者输入的IP地址-域名对查找到与目标对应的IP地址对应的域名,无需向DNS服务器进行反向域名查询,避免耗时较长的反向域名查询流程。
本实施例中,还包括步骤S404:当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名。当POS程序要连接固定IP与域名的对端,运用现有的getHostName接口进行反向域名解析编程更简单,而且进一步缩短反向域名解析的时间。
参阅图5,本实施例中,“步骤S403:将IP地址-域名对更新保存至Android系统的hosts文件中”具体包括以下步骤:
步骤S4031:判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
步骤S4032:如果相同,则替换hosts文件中原有的IP地址-域名对;
步骤S4033:如果不相同,则将新的IP地址-域名对添加至hosts文件中;
步骤S4034:保存替换或者添加完后的hosts文件。
将获取的IP地址-域名对跟Android系统的hosts文件中的IP地址进行对比判断;当判断获取的IP地址-域名对与IP地址相同的时候,替换hosts文件中原有的IP地址-域名对,避免在hosts文件中存在重复的IP地址,使查找不方便,且替换原有的IP地址-域名对,使查找结果更精确;当判断获取的IP地址-域名对与IP地址不相同的时候,将新的IP地址-域名对添加至hosts文件中,避免出现查找不到需要的的域名而使得交易时间加长的情况出现。
本实施例中,是Android4.4平台进行编程设计,编译结果利用Android4.4平台的金融POS进行验证,实验证明,本发明可以缩短交易用时10秒。
在基于Android系统的智能POS机安装应用软件,应用软件在智能POS机上显示用于用户导入或者输入IP地址-域名的用户交互界面,方便用户导入或者输入金融服务供应商所架设的服务器的IP地址-域名对,金融服务供应商包括金融交易中需要连接的银行和第三方支付平台等,通过导入或者输入金融服务供应商所架设的服务器的IP地址-域名对,避免输入其他的IP地址-域名对对查找过程影响,而产生增加查找的工作量,而且现今社会中金融服务供应商基本为银行和第三方支付平台,同样减少输入其他的金融服务供应商所架设的服务器的IP地址-域名对而产生的更多工作量。应用软件获取用户导入或者输入的IP地址-域名,并对获取的IP地址-域名进行判断,是否与hosts文件中的IP地址相同,当相同时,软件将新的IP地址-域名替换hosts文件中原有的IP地址-域名对,当不相同时,软件将新的IP地址-域名对添加至hosts文件中,最后应用软件保存替换或者添加完后的hosts文件。当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名,在金融易程序要连接已知固定IP的对端(如银行后台服务器等)时,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,会查看系统的 hosts文件,从中查找到预先设置的IP地址-域名对,无需向DNS服务器进行反向域名查询。沿用Android系统原有的SSL连接机制,无需修改Android系统源码,保证了系统的稳定性;无论终端接入的互联网运营商是否提供DNS反向域名查询服务,通过查找导入或者输入的IP地址-域名对的方式,均可避免耗时较长的反向域名查询流程,加速SSL连接。
请参阅图6,具体实施例一种Android智能POS系统,包括:
界面显示模块601:用于显示IP地址-域名对导入或者输入的用户交互界面;
IP地址-域名对获取模块602:用于获取所述用户交互界面中导入或者输入的IP地址-域名对;
hosts文件更新模块603:用于将IP地址-域名对保存更新至Android系统的hosts文件中。
在本实施例中,还包括IP解析模块604:用于当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名。
请参阅图7,本实施例中,hosts文件更新模块603包括:
IP地址判断模块6031:用于判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
IP地址替换模块6032:如果相同,则替换hosts文件中原有的IP地址-域名对;
IP地址添加模块6033:如果不相同,则添加至hosts文件中;
保存更新模块6034:保存替换或者添加完后的hosts文件。
在基于Android系统的智能POS机安装应用软件,应用软件通过界面显示模块601在智能POS机上显示用于用户导入或者输入IP地址-域名的用户交互界面,方便用户导入或者输入金融服务供应商所架设的服务器的IP地址- 域名对,金融服务供应商包括金融交易中需要连接的银行和第三方支付平台等。应用软件通过IP地址-域名对获取模块602获取用户导入或者输入的IP地址-域名,并通过IP地址判断模块6031对获取的IP地址-域名进行判断,是否与hosts文件中的IP地址相同,当相同时,软件通过IP地址替换模块6032将新的IP地址-域名替换hosts文件中原有的IP地址-域名对,当不相同时,软件通过IP地址添加模块6033将新的IP地址-域名对添加至hosts文件中,最后应用软件通过保存更新模块6034保存替换或者添加完后的hosts文件。当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名,在金融易程序要连接已知固定IP的对端(如银行后台服务器等)时,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,会查看系统的hosts文件,从中查找到预先设置的IP地址-域名对,无需向DNS服务器进行反向域名查询。沿用Android系统原有的SSL连接机制,无需修改Android系统源码,保证了系统的稳定性;无论终端接入的互联网运营商是否提供DNS反向域名查询服务,通过查找导入或者输入的IP地址-域名对的方式,均可避免耗时较长的反向域名查询流程,加速SSL连接。
尽管已经对上述各实施例进行了描述,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改,所以以上所述仅为本发明的实施例,并非因此限制本发明的专利保护范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围之内。

Claims (10)

  1. 一种缩短Android智能POS交易时间的方法,其特征在于,包括:
    显示IP地址-域名对导入或者输入的用户交互界面;
    获取所述用户交互界面中导入或者输入的IP地址-域名对;
    将IP地址-域名对更新保存至Android系统的hosts文件中。
  2. 根据权利要求1所述缩短Android智能POS交易时间的方法,其特征在于,所述“将IP地址-域名对更新保存至Android系统的hosts文件中”后还包括步骤:当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名。
  3. 根据权利要求1所述缩短Android智能POS交易时间的方法,其特征在于,所述“将IP地址-域名对更新保存至Android系统的hosts文件中”包括步骤:
    判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
    如果相同,则替换hosts文件中原有的IP地址-域名对;
    如果不相同,则将新的IP地址-域名对添加至hosts文件中;
    保存替换或者添加完后的hosts文件。
  4. 根据权利要求1所述缩短Android智能POS交易时间的方法,其特征在于,所述IP地址-域名对为金融服务供应商所架设的服务器的IP地址-域名对。
  5. 根据权利要求4所述缩短Android智能POS交易时间的方法,其特征在于,所述金融服务供应商包括金融交易中需要连接的银行和第三方支付平台。
  6. 一种Android智能POS系统,其特征在于,包括:
    界面显示模块:用于显示IP地址-域名对导入或者输入的用户交互界面;
    IP地址-域名对获取模块:用于获取所述用户交互界面中导入或者输入的 IP地址-域名对;
    hosts文件更新模块:用于将IP地址-域名对保存更新至Android系统的hosts文件中。
  7. 根据权利要求6所述Android智能POS系统,其特征在于,还包括:
    IP解析模块:用于当POS程序要连接固定IP与域名的对端,通过Android系统的SSL连接接口调用到getHostName接口进行反向域名解析时,获取所述Android系统的hosts文件,根据hosts文件中的IP地址-域名对查找到固定IP对应的域名。
  8. 根据权利要求6所述Android智能POS系统,其特征在于,所述hosts文件更新模块包括:
    IP地址判断模块:用于判断获取的IP地址-域名对与hosts文件中的IP地址是否相同;
    IP地址替换模块:如果相同,则替换hosts文件中原有的IP地址-域名对;
    IP地址添加模块:如果不相同,则添加至hosts文件中;
    保存更新模块:保存替换或者添加完后的hosts文件。
  9. 根据权利要求6所述Android智能POS系统,其特征在于,所述IP地址-域名对为金融服务供应商所架设的服务器的IP地址-域名对。
  10. 根据权利要求9所述Android智能POS系统,其特征在于,所述金融服务供应商包括金融交易中需要连接的银行和第三方支付平台。
PCT/CN2017/096836 2016-08-18 2017-08-10 一种缩短Android智能POS交易时间的方法及系统 WO2018033018A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610682883.8A CN106302856B (zh) 2016-08-18 2016-08-18 一种缩短Android智能POS交易时间的方法及系统
CN201610682883.8 2016-08-18

Publications (1)

Publication Number Publication Date
WO2018033018A1 true WO2018033018A1 (zh) 2018-02-22

Family

ID=57679597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/096836 WO2018033018A1 (zh) 2016-08-18 2017-08-10 一种缩短Android智能POS交易时间的方法及系统

Country Status (2)

Country Link
CN (1) CN106302856B (zh)
WO (1) WO2018033018A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302856B (zh) * 2016-08-18 2018-11-20 福建联迪商用设备有限公司 一种缩短Android智能POS交易时间的方法及系统
CN109617881A (zh) * 2018-12-18 2019-04-12 福建联迪商用设备有限公司 一种pos终端报文的处理方法及终端
CN114389980B (zh) * 2021-12-15 2023-10-27 广州品唯软件有限公司 测试环境监测管理方法、装置和计算机设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040148398A1 (en) * 2003-01-15 2004-07-29 Samsung Electronics Co., Ltd. Method of automatically registering an IP address and domain name in IP protocol version 6
CN102263837A (zh) * 2011-08-10 2011-11-30 北京天融信科技有限公司 一种域名系统dns解析方法及装置
CN103957282A (zh) * 2013-09-12 2014-07-30 赛尔网络有限公司 一种域内终端用户域名解析加速系统及其方法
CN106302856A (zh) * 2016-08-18 2017-01-04 福建联迪商用设备有限公司 一种缩短Android智能POS交易时间的方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040148398A1 (en) * 2003-01-15 2004-07-29 Samsung Electronics Co., Ltd. Method of automatically registering an IP address and domain name in IP protocol version 6
CN102263837A (zh) * 2011-08-10 2011-11-30 北京天融信科技有限公司 一种域名系统dns解析方法及装置
CN103957282A (zh) * 2013-09-12 2014-07-30 赛尔网络有限公司 一种域内终端用户域名解析加速系统及其方法
CN106302856A (zh) * 2016-08-18 2017-01-04 福建联迪商用设备有限公司 一种缩短Android智能POS交易时间的方法及系统

Also Published As

Publication number Publication date
CN106302856A (zh) 2017-01-04
CN106302856B (zh) 2018-11-20

Similar Documents

Publication Publication Date Title
US11811722B2 (en) Method for processing cloud service in cloud system, apparatus, and device
US20210297410A1 (en) Mec platform deployment method and apparatus
US8073954B1 (en) Method and apparatus for a secure remote access system
US6934848B1 (en) Technique for handling subsequent user identification and password requests within a certificate-based host session
US8606885B2 (en) Method and system of providing access point data associated with a network access point
US8799639B2 (en) Method and apparatus for converting authentication-tokens to facilitate interactions between applications
WO2019200965A1 (zh) 用于连接无线接入点的方法和设备
US8412806B2 (en) Setting a preliminary time on a network appliance using a message received from a server
CN109936529B (zh) 一种安全通信的方法、装置和系统
WO2020233361A1 (zh) 基于网关的内部服务调用方法、装置及终端设备
US10841293B2 (en) Gateway device for authentication and authorization of applications and/or servers for data transfer between applications and/or servers
US10721311B1 (en) System and method for coupling two separate applications to an application session within a serverless infrastructure
WO2018033018A1 (zh) 一种缩短Android智能POS交易时间的方法及系统
TW202026980A (zh) 一種電子支付方法、裝置、系統和存儲介質
US11803398B2 (en) Computing device and associated methods providing browser launching of virtual sessions in an application
CN109510799B (zh) 页面展示方法、浏览器客户端、设备及存储介质
US20150006346A1 (en) Account engine with modular services and access channels
CN109246212B (zh) 一种基于长连接的多银行数据交互实现方法
US11968238B2 (en) Policy management system to provide authorization information via distributed data store
CN111698097A (zh) 一种证书认证方法及装置
CN114338078B (zh) 一种cs客户端登录方法及装置
US20230291726A1 (en) System and method for providing multi factor authorization to rdp services through a zero trust cloud environment
WO2017173967A1 (zh) 重定向方法、服务商、非结构化补充数据业务中心及系统
US20230164135A1 (en) Digital certificate obtaining method and apparatus
CN114244607B (zh) 单点登录方法、系统、设备、介质和程序

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17840992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17840992

Country of ref document: EP

Kind code of ref document: A1