CN107995675A - Communication means, device, terminal and the storage medium of mobile POS machine - Google Patents
Communication means, device, terminal and the storage medium of mobile POS machine Download PDFInfo
- Publication number
- CN107995675A CN107995675A CN201711128395.3A CN201711128395A CN107995675A CN 107995675 A CN107995675 A CN 107995675A CN 201711128395 A CN201711128395 A CN 201711128395A CN 107995675 A CN107995675 A CN 107995675A
- Authority
- CN
- China
- Prior art keywords
- base station
- time interval
- dormancy
- identity code
- dormancy awakening
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. Transmission Power Control [TPC] or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0212—Power saving arrangements in terminal devices managed by the network, e.g. network or access point is leader and terminal is follower
- H04W52/0216—Power saving arrangements in terminal devices managed by the network, e.g. network or access point is leader and terminal is follower using a pre-established activity schedule, e.g. traffic indication frame
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. Transmission Power Control [TPC] or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0225—Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
- H04W52/0248—Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域technical field
本发明属于通信技术领域,尤其涉及一种移动POS机的通信方法、装置、终端及存储介质。The invention belongs to the technical field of communication, and in particular relates to a communication method, device, terminal and storage medium of a mobile POS machine.
背景技术Background technique
移动POS机是一种RF-SIM卡终端阅读器,又叫移动的销售点,应用于各个行业的移动销售。具有收款速度快,结账精确,无需找零的优点,并且使得人们无需携带现金就可以购物消费,给人们的生活带来了极大的便利。Mobile POS machine is a kind of RF-SIM card terminal reader, also known as mobile point of sale, which is used in mobile sales in various industries. It has the advantages of fast collection speed, accurate checkout, and no need for change, and enables people to shop and consume without carrying cash, which brings great convenience to people's lives.
但是,目前的移动POS机处于工作状态时,具有功耗大的缺点。为了降低移动POS机的功耗,现有技术中通常在移动POS机空闲时,让移动POS机进入休眠状态。然而,移动POS机在休眠状态下被唤醒后,需要与基站重新建立连接,耗费较长时间,导致交易时间延长,降低了交易效率。However, when the current mobile POS machine is in a working state, it has the disadvantage of high power consumption. In order to reduce the power consumption of the mobile POS machine, in the prior art, the mobile POS machine is usually put into a dormant state when the mobile POS machine is idle. However, after the mobile POS machine wakes up from the dormant state, it needs to re-establish a connection with the base station, which takes a long time, resulting in prolonged transaction time and reduced transaction efficiency.
发明内容Contents of the invention
有鉴于此,本发明实施例提供了一种移动POS机的通信方法、装置、终端及存储介质,能够解决现有技术中为了降低功耗导致的交易效率低的问题。In view of this, the embodiments of the present invention provide a communication method, device, terminal and storage medium of a mobile POS machine, which can solve the problem of low transaction efficiency caused by reducing power consumption in the prior art.
本发明实施例的第一方面提供了一种移动POS机的通信方法,包括:The first aspect of the embodiments of the present invention provides a communication method for a mobile POS machine, including:
获取基站的基站识别码,查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;Obtain the base station identification code of the base station, and check whether the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are stored in the base station identification code list;
若未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接;If the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are not stored; then the sleep wake-up time interval corresponding to the base station identification code is preset as the first sleep wake-up time interval, and established with the base station communication connection;
若休眠时长达到所述第一休眠唤醒时间间隔,则检测与所述基站的通信连接是否断开;If the sleep duration reaches the first sleep wake-up time interval, then detecting whether the communication connection with the base station is disconnected;
若所述通信连接断开,则缩短所述第一休眠唤醒时间间隔,与所述基站重新建立通信连接,进入下一次休眠;若所述通信连接未断开,则发送保活报文给网络服务器,以使得所述基站不释放所述移动POS机的网络资源,进入下一次休眠。If the communication connection is disconnected, then shorten the first dormancy wake-up time interval, re-establish a communication connection with the base station, and enter the next dormancy; if the communication connection is not disconnected, then send a keep-alive message to the network The server, so that the base station does not release the network resources of the mobile POS machine, enters the next dormancy.
本发明实施例的第二方面提供了一种移动POS机的通信装置,包括:The second aspect of the embodiments of the present invention provides a communication device for a mobile POS machine, including:
查找单元,用于获取基站的基站识别码,查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;A search unit, configured to obtain the base station identification code of the base station, and search whether the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are stored in the base station identification code list;
第一连接单元,用于若未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接;The first connection unit is used to preset the sleep wake-up time interval corresponding to the base station identification code as the first sleep wake-up time interval if the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are not stored. , and establishing a communication connection with the base station;
检测单元,用于若休眠时长达到所述第一休眠唤醒时间间隔,则检测与所述基站的通信连接是否断开;A detection unit, configured to detect whether the communication connection with the base station is disconnected if the sleep duration reaches the first sleep wake-up time interval;
第二连接单元,用于若所述通信连接断开,则缩短所述第一休眠唤醒时间间隔,与所述基站重新建立通信连接,进入下一次休眠;若所述通信连接未断开,则发送保活报文给网络服务器,以使得所述基站不释放分配的网络资源,进入下一次休眠。The second connection unit is configured to, if the communication connection is disconnected, shorten the first dormancy wake-up time interval, re-establish a communication connection with the base station, and enter the next dormancy; if the communication connection is not disconnected, then Sending a keep-alive message to the network server, so that the base station does not release the allocated network resources, and enters the next dormancy.
本发明实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述所述方法的步骤。A third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, when the processor executes the computer program Implement the steps of the method described above.
本发明实施例的第四方面提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述所述方法的步骤。A fourth aspect of the embodiments of the present invention provides a computer storage medium, the computer storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, the steps of the above method are implemented.
本发明实施例通过在所述基站识别码列表中未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔时,动态获取所述移动POS机与所述基站的通信连接不断开时的第一休眠唤醒时间间隔,并在休眠时长达到该第一休眠唤醒时间间隔时,发送保活报文给网络服务器,以使得所述基站不释放所述移动POS机的网络资源,进入下一次休眠。实现了所述移动POS机既能通过进入休眠来降低功耗,又能在休眠过程中仍使得所述基站不释放所述移动POS机的网络资源,解决了现有技术中移动POS机在休眠状态下被唤醒后,需要与基站重新建立连接,交易效率低的技术问题,提高了所述移动POS机的交易效率。In the embodiment of the present invention, when the base station identification code and the dormancy wake-up time interval corresponding to the base station identification code are not stored in the base station identification code list, dynamically obtain the communication connection between the mobile POS machine and the base station. The first dormancy wake-up time interval when it is turned on, and when the dormancy duration reaches the first dormancy wake-up time interval, send a keep-alive message to the network server, so that the base station does not release the network resources of the mobile POS machine, and enters the Hibernate next time. Realized that the mobile POS machine can not only reduce power consumption by entering dormancy, but also make the base station not release the network resources of the mobile POS machine during the dormancy process, and solve the problem of mobile POS machines in the dormant state in the prior art. After being awakened, the connection with the base station needs to be re-established, and the technical problem of low transaction efficiency improves the transaction efficiency of the mobile POS machine.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only of the present invention. For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.
图1是本发明实施例提供的一种移动POS机的通信方法的第一示意流程图;FIG. 1 is a first schematic flowchart of a communication method for a mobile POS machine provided by an embodiment of the present invention;
图2是本发明实施例提供的一种移动POS机的通信方法的第二示意流程图;FIG. 2 is a second schematic flowchart of a communication method for a mobile POS machine provided by an embodiment of the present invention;
图3是本发明实施例提供的一种移动POS机的通信方法的第三示意流程图;3 is a third schematic flowchart of a communication method for a mobile POS machine provided by an embodiment of the present invention;
图4是本发明实施例提供的一种移动POS机的通信方法的第四示意流程图;FIG. 4 is a fourth schematic flowchart of a communication method for a mobile POS machine provided by an embodiment of the present invention;
图5是本发明实施例提供的一种移动POS机的通信装置的结构示意框图;FIG. 5 is a schematic structural block diagram of a communication device of a mobile POS machine provided by an embodiment of the present invention;
图6是本发明实施例提供的一种终端设备的示意图。Fig. 6 is a schematic diagram of a terminal device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本发明实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本发明的实施例的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施例。基于本发明的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. The described embodiments are only some, not all, embodiments of the present invention. The components of the embodiments of the invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the protection scope of the present invention.
目前,移动POS机通常配备电池容量较小,然而,在实际使用中又要求所述POS机的待机时间较长。为了降低移动POS机的功耗,现有技术中通常在移动POS机空闲时,让移动POS机进入休眠状态。然而,移动POS机在休眠状态时,由于长时间不进行数据通信,将导致基站释放所述移动POS机的网络资源,导致所述移动POS机在休眠状态下被唤醒后,需要与基站重新建立连接,耗费较长时间,导致交易时间延长,降低了交易效率。At present, mobile POS machines are usually equipped with a battery with a small capacity, however, in actual use, the standby time of the POS machine is required to be longer. In order to reduce the power consumption of the mobile POS machine, in the prior art, the mobile POS machine is usually put into a dormant state when the mobile POS machine is idle. However, when the mobile POS machine is in the dormant state, since the base station does not perform data communication for a long time, the network resources of the mobile POS machine will be released by the base station, and after the mobile POS machine is awakened in the dormant state, it needs to re-establish The connection takes a long time, resulting in prolonged transaction time and reduced transaction efficiency.
例如,在餐厅等移动范围较小,且交易较为频繁的应用场景而言,用户通常希望每次交易时间尽量短。因此为了达到既能降低所述移动POS机的功耗,又能使得所述移动POS机与所述基站处于长连接状态,提高所述移动POS机的交易效率,本发明实施例提供一种移动POS机的通信方法。For example, in restaurants and other application scenarios where the range of movement is small and transactions are relatively frequent, users usually hope that the time for each transaction should be as short as possible. Therefore, in order to reduce the power consumption of the mobile POS machine, keep the mobile POS machine in a long-term connection state with the base station, and improve the transaction efficiency of the mobile POS machine, an embodiment of the present invention provides a mobile The communication method of the POS machine.
请参见图1,图1是本发明实施例提供的一种移动POS机的通信方法的第一示意流程图。本实施例中的方法的执行主体为一种移动POS机的通信装置,该装置可以由软件和/或硬件实现,集成于移动POS机中,适用于需要与基站进行通信的情况。如图1所示的移动POS机的通信方法,可包括步骤S101至步骤S105。Please refer to FIG. 1 . FIG. 1 is a first schematic flowchart of a communication method for a mobile POS machine provided by an embodiment of the present invention. The execution subject of the method in this embodiment is a communication device of a mobile POS machine, which can be implemented by software and/or hardware, integrated in the mobile POS machine, and is suitable for situations where communication with a base station is required. The communication method of the mobile POS machine as shown in FIG. 1 may include steps S101 to S105.
在S101中,获取基站的基站识别码,查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔。In S101, the base station identification code of the base station is acquired, and it is checked whether the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are stored in the base station identification code list.
所述移动POS机开机后,需要先进行网络注册。在基站判定所述移动POS机具有网络访问权限时,所述移动POS机获取所述基站的基站识别码。例如,所述基站在所述移动POS机开机时,获取所述移动POS机的用户名和密码信息,根据所述用户名和密码信息判定所述移动POS机是否具有网络访问权限。所述基站识别码用于唯一标识所述基站。After the mobile POS machine is powered on, it needs to perform network registration first. When the base station determines that the mobile POS machine has network access authority, the mobile POS machine acquires the base station identification code of the base station. For example, the base station obtains the user name and password information of the mobile POS machine when the mobile POS machine is turned on, and determines whether the mobile POS machine has network access authority according to the user name and password information. The base station identification code is used to uniquely identify the base station.
当所述移动POS机获取了所述基站的基站识别码后,需要查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔,以便在所述移动POS机进入休眠时,能够在休眠时长达到所述基站识别码对应的休眠唤醒时间间隔时,进行移动POS机的唤醒。After the mobile POS machine obtains the base station identification code of the base station, it needs to check whether the base station identification code and the corresponding dormancy wake-up time interval of the base station identification code are stored in the list of base station identification codes, so as to When the POS machine enters sleep, the mobile POS machine can be woken up when the sleep time reaches the sleep wake-up time interval corresponding to the base station identification code.
例如,当所述移动POS机第一次注册上所述基站时,所述移动POS机的基站识别码列表中将没有存储有所述基站的基站识别码及所述基站识别码对应的休眠唤醒时间间隔。当所述移动POS机曾经注册上所述基站时,所述移动POS机的基站识别码列表中将有可能存储有所述基站的基站识别码及所述基站识别码对应的休眠唤醒时间间隔。其中,所述基站识别码对应的休眠唤醒时间间隔可以是用户预设的休眠唤醒时间间隔,也可以是利用动态评估方法获取的休眠唤醒时间间隔。For example, when the mobile POS machine registers with the base station for the first time, the base station identification code of the base station and the corresponding dormancy wake-up function of the base station identification code will not be stored in the base station identification code list of the mobile POS machine. time interval. When the mobile POS machine has been registered with the base station, the base station identification code list of the mobile POS machine may store the base station identification code of the base station and the sleep wake-up time interval corresponding to the base station identification code. Wherein, the sleep wake-up time interval corresponding to the base station identification code may be a sleep wake-up time interval preset by a user, or may be a sleep wake-up time interval obtained by using a dynamic evaluation method.
其中,所述基站识别码对应的休眠唤醒时间间隔是指所述移动POS机未进行数据通信时,所述基站为所述移动POS机保留网络资源的时间间隔;即,在所述休眠唤醒时间间隔内,所述移动POS机不进行数据通信,所述基站也不会释放分配给所述移动POS机的网络资源。Wherein, the dormancy wake-up time interval corresponding to the base station identification code refers to the time interval during which the base station reserves network resources for the mobile POS machine when the mobile POS machine is not performing data communication; that is, during the dormancy wake-up time During the interval, the mobile POS machine does not perform data communication, and the base station will not release the network resources allocated to the mobile POS machine.
在S102中,若未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接;In S102, if the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are not stored; then preset the sleep wake-up time interval corresponding to the base station identification code as the first sleep wake-up time interval, and The base station establishes a communication connection;
通常为了提高网络资源的利用率,基站在移动POS机等通信设备长时间未进行数据通信时,将释放分配给所述移动POS机等通信设备的网络资源。例如,在所述移动POS机进入休眠状态,未进行数据通信时,所述基站将有可能释放分配给所述移动POS机等通信设备的网络资源,导致所述移动POS机休眠唤醒时,需要重新与所述基站建立通信连接,延长了所述移动POS机的交易时间,降低了所述移动POS机的交易效率。因此,本发明在所述移动POS机开机后,先获取所述移动POS机的休眠唤醒时间间隔,再进入休眠,以便在所述移动POS机的休眠时长达到所述移动POS机的休眠唤醒时间间隔时,唤醒所述移动POS机,并使得所述移动POS机与所述基站保持通信连接。Usually, in order to improve the utilization rate of network resources, the base station will release the network resources allocated to the mobile POS machine and other communication equipment when the communication equipment such as the mobile POS machine does not perform data communication for a long time. For example, when the mobile POS machine enters the dormant state and does not perform data communication, the base station may release the network resources allocated to communication devices such as the mobile POS machine, causing the mobile POS machine to wake up from sleep. Re-establishing a communication connection with the base station prolongs the transaction time of the mobile POS machine and reduces the transaction efficiency of the mobile POS machine. Therefore, after the mobile POS machine is turned on, the present invention first obtains the dormancy wake-up time interval of the mobile POS machine, and then enters dormancy, so that the dormancy time of the mobile POS machine reaches the dormancy wake-up time of the mobile POS machine At intervals, wake up the mobile POS machine and keep the mobile POS machine in communication with the base station.
在本发明的一些实施方式中,当所述基站识别码列表中未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔时,则需要通过动态评估的方法获取所述基站对应的休眠唤醒时间间隔。In some embodiments of the present invention, when the base station identification code and the sleep-wake-up time interval corresponding to the base station identification code are not stored in the base station identification code list, it is necessary to obtain the base station identification code through a dynamic evaluation method. Corresponding hibernation wakeup time interval.
具体地,先预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接。Specifically, first preset the dormancy wake-up time interval corresponding to the base station identification code as the first dormancy wake-up time interval, and establish a communication connection with the base station.
例如,先预设所述第一休眠唤醒时间间隔为最大休眠唤醒时间间隔T,又例如,预设所述最大休眠唤醒时间间隔T=60min,再与所述基站建立通信连接。需要说明的是,所述最大休眠唤醒时间间隔T的值根据实际经验获得或者根据实际应用进行设定,在此只是举例说明,不表示为对本发明保护范围的限制。For example, first preset the first sleep wake-up time interval as the maximum sleep wake-up time interval T, and for another example, preset the maximum sleep wake-up time interval T=60min, and then establish a communication connection with the base station. It should be noted that, the value of the maximum sleep-wake-up time interval T is obtained according to actual experience or set according to actual application, which is just an example here, and is not meant to limit the protection scope of the present invention.
其中,所述与所述基站建立通信连接包括与所述基站建立PDP连接或者与所述基站建立PPP连接。Wherein, the establishing a communication connection with the base station includes establishing a PDP connection with the base station or establishing a PPP connection with the base station.
在S103中,若休眠时长达到所述第一休眠唤醒时间间隔,则检测与所述基站的通信连接是否断开。In S103, if the sleep duration reaches the first sleep wake-up time interval, it is detected whether the communication connection with the base station is disconnected.
由于所述第一休眠唤醒时间间隔最开始为预设的最大休眠唤醒时间间隔T,当所述休眠时长达到所述预设的最大休眠唤醒时间间隔T时,所述移动POS机有可能已经与所述基站断开通信连接,也有可能与所述基站仍保持通信连接,因此,当所述休眠时长达到所述第一休眠唤醒时间间隔,需要检测与所述基站的通信连接是否断开。Since the first dormancy-wake-up time interval is initially the preset maximum dormancy-wake-up time interval T, when the dormancy duration reaches the preset maximum dormancy-wake-up time interval T, the mobile POS machine may have already communicated with The base station disconnects the communication connection, and may still maintain the communication connection with the base station. Therefore, when the sleep duration reaches the first sleep wake-up time interval, it is necessary to detect whether the communication connection with the base station is disconnected.
在S104中,若所述通信连接断开,则缩短所述第一休眠唤醒时间间隔,与所述基站重新建立通信连接,进入下一次休眠。In S104, if the communication connection is disconnected, shorten the first dormancy wake-up time interval, re-establish a communication connection with the base station, and enter the next dormancy.
由于所述移动POS机与所述基站断开通信连接时,则表示所述移动POS机的休眠时长过长,导致所述基站已经释放了分配给所述移动POS机的网络资源。因此,在所述移动POS机与所述基站断开通信连接时,需要缩短所述第一休眠唤醒时间间隔,并与所述基站重新建立通信连接,再进入下一次休眠。使得所述移动POS机的休眠时长再次达到所述第一休眠唤醒时间间隔时,有可能与所述基站保持通信连接。When the mobile POS machine is disconnected from the base station, it means that the sleep time of the mobile POS machine is too long, and the base station has released the network resources allocated to the mobile POS machine. Therefore, when the mobile POS machine disconnects the communication connection with the base station, it is necessary to shorten the first dormancy wake-up time interval, re-establish the communication connection with the base station, and then enter the next dormancy. When the dormancy duration of the mobile POS machine reaches the first dormancy wake-up time interval again, it is possible to maintain a communication connection with the base station.
其中,所述缩短所述第一休眠唤醒时间间隔包括按固定时间间隔缩短所述第一休眠唤醒时间间隔,例如,所述固定时间间隔为10min,则表示所述移动POS机休眠时长达到所述第一休眠唤醒时间间隔时,若所述移动POS机与所述基站的通信连接被断开,则缩短所述第一休眠唤醒时间间隔T=T-10min,并与所述基站重新建立通信连接,再进入下一次休眠。Wherein, the shortening of the first sleep wake-up time interval includes shortening the first sleep wake-up time interval by a fixed time interval, for example, if the fixed time interval is 10 minutes, it means that the sleep time of the mobile POS machine reaches the During the first dormancy wake-up time interval, if the communication connection between the mobile POS machine and the base station is disconnected, shorten the first dormancy wake-up time interval T=T-10min, and re-establish a communication connection with the base station , and then enter the next sleep mode.
在本发明的一些实施方式中,所述缩短所述第一休眠唤醒时间间隔还可以包括按梯度时间间隔缩短所述第一休眠唤醒时间间隔,例如,所述梯度时间间隔为10min、10min、10min、5min、5min、5min、5min、5min、5min,则表示所述移动POS机休眠时长达到所述第一休眠唤醒时间间隔T=60min时,若所述移动POS机与所述基站的通信连接被断开,则缩短所述第一休眠唤醒时间间隔T=T-10min=50min,并与所述基站重新建立通信连接,再进入下一次休眠。当所述移动POS机休眠时长达到所述第一休眠唤醒时间间隔T=30min时,若所述移动POS机与所述基站的通信连接被断开,则缩短所述第一休眠唤醒时间间隔T=T-5min=25min,并与所述基站重新建立通信连接,再进入下一次休眠,依此类推。需要说明的是,所述梯度时间间隔还可以为其他任意梯度时间间隔,例如15min、10min、10min、10min、5min、5min、5min等等,在此只是举例说明,并不表示为对本发明保护范围的限制。In some embodiments of the present invention, the shortening of the first dormancy wake-up time interval may also include shortening the first dormancy wake-up time interval according to a gradient time interval, for example, the gradient time interval is 10min, 10min, 10min . If it is disconnected, shorten the first dormancy wake-up time interval T=T-10min=50min, re-establish a communication connection with the base station, and then enter the next dormancy. When the dormancy time of the mobile POS machine reaches the first dormancy wake-up time interval T=30min, if the communication connection between the mobile POS machine and the base station is disconnected, the first dormancy wake-up time interval T is shortened =T-5min=25min, and re-establish a communication connection with the base station, and then enter the next dormancy, and so on. It should be noted that the gradient time interval can also be other arbitrary gradient time intervals, such as 15min, 10min, 10min, 10min, 5min, 5min, 5min, etc., which are just examples here and are not meant to limit the protection scope of the present invention. limits.
需要说明的是,在执行完S104时,需重新执行S103,直至若休眠时长达到所述第一休眠唤醒时间间隔,所述移动POS机与所述基站的通信连接未断开时,执行步骤S105。It should be noted that, when S104 is executed, S103 needs to be executed again until if the sleep duration reaches the first sleep wake-up time interval and the communication connection between the mobile POS machine and the base station is not disconnected, step S105 is executed .
在S105中,若所述通信连接未断开,则发送保活报文给网络服务器,以使得所述基站不释放所述移动POS机的网络资源,进入下一次休眠。In S105, if the communication connection is not disconnected, send a keep-alive message to the network server, so that the base station does not release the network resources of the mobile POS machine, and enters the next dormancy.
当所述移动POS机的休眠时长达到所述第一休眠唤醒时间间隔,所述移动POS机与所述基站的通信连接未断开时;表示所述移动POS机在所述第一休眠唤醒时间间隔内,未进行数据通信时,所述基站仍为所述移动POS机保留网络资源,此时,需要向所述基站发送保活报文给网络服务器,使得所述基站认为所述移动POS机仍然在进行数据通信,而为所述移动POS机保留网络资源,再进入下一次休眠。When the dormancy duration of the mobile POS machine reaches the first dormancy wake-up time interval, and the communication connection between the mobile POS machine and the base station is not disconnected; it means that the mobile POS machine is at the first dormancy wake-up time In the interval, when data communication is not performed, the base station still reserves network resources for the mobile POS machine. Still carrying out data communication, and reserve network resource for described mobile POS machine, enter next dormancy again.
其中,所述保活报文可以为ICMP报文或者其他协议的报文,如UDP协议族的报文等等。所述ICMP报文是TCP/IP协议族的一个子协议,用于在IP主机、路由器之间传递控制消息。所述网络服务器可以为公众所知的知名服务器,例如,谷歌服务器、百度服务器等等外网服务器。Wherein, the keep-alive message may be an ICMP message or a message of other protocols, such as a message of the UDP protocol family and the like. The ICMP message is a sub-protocol of the TCP/IP protocol family, and is used to transfer control messages between the IP host and the router. The network server can be a well-known server known to the public, for example, an external network server such as a Google server, a Baidu server, or the like.
需要说明的是,为了保证通信连接的可靠性,执行完步骤S105后,可以重新执行S103,并在休眠时长达到所述第一休眠唤醒时间间隔,且所述移动POS机与所述基站的通信连接未断开时,再执行步骤S105,否则执行步骤S104。在本发明的一些实施方式中,当基站分配网络资源较稳定时,还可以在执行完步骤S105后,直接重复执行步骤S105,不在检测所述移动POS机与所述基站的通信连接是否断开。It should be noted that, in order to ensure the reliability of the communication connection, after step S105 is executed, S103 can be re-executed, and the sleep duration reaches the first sleep wake-up time interval, and the communication between the mobile POS machine and the base station If the connection is not disconnected, then execute step S105, otherwise execute step S104. In some embodiments of the present invention, when the network resources assigned by the base station are relatively stable, step S105 can also be executed repeatedly after step S105 is executed, without detecting whether the communication connection between the mobile POS machine and the base station is disconnected .
可选地,如图2所示,在步骤S103之后,还包括步骤S201至步骤S20Optionally, as shown in FIG. 2, after step S103, step S201 to step S20 are also included
在S201中,若与所述基站的通信连接断开,则判断所述第一休眠唤醒时间间隔是否小于预设阈值。In S201, if the communication connection with the base station is disconnected, it is judged whether the first sleep wake-up time interval is less than a preset threshold.
例如,所述预设阈值为上述缩短所述第一休眠唤醒时间间隔时的固定时间间隔,也可以为梯度时间间隔中的最小梯度值,或者为其他用户设定的预设阈值。For example, the preset threshold is the fixed time interval when the first sleep-wake-up time interval is shortened, or the minimum gradient value in the gradient time interval, or a preset threshold set by other users.
当所述第一休眠唤醒时间间隔经过缩短之后,可以通过判断所述第一休眠唤醒时间间隔是否小于预设阈值,来结束所述第一休眠唤醒时间间隔的动态评估过程。After the first sleep-wake-up time interval is shortened, the dynamic evaluation process of the first sleep-wake-up time interval may be ended by judging whether the first sleep-wake-up time interval is smaller than a preset threshold.
在S202中,若所述第一休眠唤醒时间间隔小于预设阈值,则设置所述第一休眠唤醒时间间隔为零,并将所述基站的基站识别码及所述第一休眠唤醒时间间隔存储在基站识别码列表,进入休眠。In S202, if the first sleep wake-up time interval is less than a preset threshold, set the first sleep wake-up time interval to zero, and store the base station identification code of the base station and the first sleep wake-up time interval In the list of base station identification codes, go to sleep.
也就是说,当所述第一休眠唤醒时间间隔被缩短至小于预设阈值时,则直接将所述第一休眠唤醒时间间隔设置为零,并将所述基站的基站识别码及所述基站识别码对应的休眠唤醒时间间隔T=0存储在基站识别码列表,再进入休眠,而不与所述基站预先建立通信连接。That is to say, when the first dormancy wake-up time interval is shortened to less than a preset threshold, the first dormancy wake-up time interval is directly set to zero, and the base station identification code of the base station and the base station The sleep wake-up time interval T=0 corresponding to the identification code is stored in the base station identification code list, and then enters sleep without pre-establishing a communication connection with the base station.
需要说明的是,由于基站识别码对应的休眠唤醒时间间隔T=0时,表示所述移动POS机与所述基站完成数据通信后,在较短的时间内就被所述基站释放分配的网络资源,因此,当所述基站识别码对应的休眠唤醒时间间隔T=0时,可以不用预先与所述基站建立通信连接,而是在进行数据通信时,再与所述基站建立通信连接。例如,当所述移动POS机关机后,再开机时,根据获取的基站识别码从所述基站识别码列表中获取所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔T=0时,则直接进入休眠,而不预先与所述基站建立通信连接。只有当所述移动POS机被唤醒,进行数据通信时,才与所述基站建立通信连接,并在数据通信完成后,与所述基站断开通信连接。It should be noted that when the dormancy wake-up time interval T=0 corresponding to the base station identification code, it means that after the mobile POS machine completes data communication with the base station, it will be released by the base station within a relatively short period of time. Therefore, when the sleep-wake-up time interval corresponding to the base station identification code is T=0, it is not necessary to establish a communication connection with the base station in advance, but to establish a communication connection with the base station during data communication. For example, when the mobile POS is turned off and turned on again, the base station identification code and the sleep wake-up time interval T=0 corresponding to the base station identification code are obtained from the list of base station identification codes according to the obtained base station identification code. , it directly enters dormancy without establishing a communication connection with the base station in advance. Only when the mobile POS machine is woken up to perform data communication, it establishes a communication connection with the base station, and disconnects the communication connection with the base station after the data communication is completed.
可选地,在所述若所述通信连接未断开,则发送保活报文给网络服务器之后还包括:将所述基站的基站识别码及所述第一休眠唤醒时间间隔存储在基站识别码列表中。Optionally, after sending the keep-alive message to the network server if the communication connection is not disconnected, it further includes: storing the base station identification code of the base station and the first dormancy wake-up time interval in the base station identification code. code list.
所述将所述基站的基站识别码及所述第一休眠唤醒时间间隔存储在基站识别码列表中,使得所述移动POS机关机后,再开机时,可以根据获取的基站识别码从所述基站识别码列表中获取所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔,以便进行休眠过程中的唤醒,并使所述基站为所述移动POS机保留网络资源。The base station identification code of the base station and the first dormancy wake-up time interval are stored in the base station identification code list, so that after the mobile POS is turned off, when it is turned on again, it can be obtained from the base station identification code according to the acquired base station identification code. Obtain the base station identification code and the dormancy wake-up time interval corresponding to the base station identification code from the base station identification code list, so as to wake up during the dormancy process and make the base station reserve network resources for the mobile POS machine.
在本发明的一些实施方式中,如图3所示,在所述步骤S101之后还包括步骤S106。In some embodiments of the present invention, as shown in FIG. 3 , step S106 is further included after the step S101.
在S106中,若所述基站识别码列表中存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则与所述基站建立通信连接;在休眠时长达到所述休眠唤醒时间间隔时,发送保活报文给网络服务器,以使得所述基站不释放分配的网络资源,并进入下一次休眠。In S106, if the base station identification code list stores the base station identification code and the sleep wake-up time interval corresponding to the base station identification code; then establish a communication connection with the base station; the sleep duration reaches the sleep wake-up time At intervals, send a keep-alive message to the network server, so that the base station does not release the allocated network resources, and enters the next dormancy.
在本发明的一些实施方式中,如图4所示,若所述基站识别码列表中存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔之后还包括步骤S107至步骤S109。In some embodiments of the present invention, as shown in FIG. 4 , if the base station identification code list stores the base station identification code and the sleep wake-up time interval corresponding to the base station identification code, it further includes steps S107 to S109 .
在S107中,判断所述基站识别码对应的休眠唤醒时间间隔是否为零。In S107, it is judged whether the sleep-wake-up time interval corresponding to the base station identification code is zero.
也就是说,判断所述基站识别码列表中存储的所述基站识别码对应的休眠唤醒时间间隔是否为零,若为零,则表示所述移动POS机与所述基站完成数据通信后,在较短的时间内就被所述基站释放分配的网络资源,因此,执行步骤S108,若所述基站识别码对应的休眠唤醒时间间隔为零,则进入休眠;即表示可以不用预先与所述基站建立通信连接,而是在进行数据通信时,再与所述基站建立通信连接。That is to say, it is judged whether the dormancy and wake-up time interval corresponding to the base station identification code stored in the base station identification code list is zero, and if it is zero, it means that after the mobile POS machine completes the data communication with the base station, The allocated network resources are released by the base station within a relatively short period of time. Therefore, step S108 is executed, and if the dormancy wake-up time interval corresponding to the base station identification code is zero, it enters dormancy; A communication connection is established, but a communication connection is established with the base station when performing data communication.
若所述基站识别码对应的休眠唤醒时间间隔不为零,则表示所述移动POS机与所述基站完成数据通信后,在较短的时间内不会被所述基站释放分配的网络资源,因此,可以执行步骤S109,若所述基站识别码对应的休眠唤醒时间间隔不为零,则在休眠时长达到所述休眠唤醒时间间隔时,发送保活报文给网络服务器,以使得所述基站不释放分配的网络资源,并进入下一次休眠。If the dormancy wake-up time interval corresponding to the base station identification code is not zero, it means that after the mobile POS machine completes data communication with the base station, the allocated network resources will not be released by the base station within a relatively short period of time, Therefore, step S109 can be executed, if the sleep wake-up time interval corresponding to the base station identification code is not zero, when the sleep duration reaches the sleep wake-up time interval, send a keep-alive message to the network server, so that the base station The allocated network resources are not released, and the next sleep is entered.
本发明实施例通过在所述基站识别码列表中未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔时,动态获取所述移动POS机与所述基站的通信连接不断开时的第一休眠唤醒时间间隔,并在休眠时长达到该第一休眠唤醒时间间隔时,发送保活报文给网络服务器,以使得所述基站不释放所述移动POS机的网络资源,进入下一次休眠。使得所述移动POS机既能通过进入休眠来降低功耗,又能在休眠过程中仍使得所述基站不释放所述移动POS机的网络资源,解决了现有技术中移动POS机在休眠状态下被唤醒后,需要与基站重新建立连接,交易效率低的问题,提高了所述移动POS机的交易效率。In the embodiment of the present invention, when the base station identification code and the dormancy wake-up time interval corresponding to the base station identification code are not stored in the base station identification code list, dynamically obtain the communication connection between the mobile POS machine and the base station. The first dormancy wake-up time interval when it is turned on, and when the dormancy duration reaches the first dormancy wake-up time interval, send a keep-alive message to the network server, so that the base station does not release the network resources of the mobile POS machine, and enters the Hibernate next time. The mobile POS machine can not only reduce power consumption by entering dormancy, but also make the base station not release the network resources of the mobile POS machine during the dormancy process, which solves the problem that the mobile POS machine in the prior art is in a dormant state. After being awakened, the connection with the base station needs to be re-established, and the problem of low transaction efficiency improves the transaction efficiency of the mobile POS machine.
本发明实施例还提供一种移动POS机的通信装置,该装置包括用于执行前述所述的移动POS机的通信方法中的各步骤的模块,该装置可集成于所述移动POS机。该装置中未详细描述之处请详见前述方法的描述。An embodiment of the present invention also provides a communication device for a mobile POS machine. The device includes a module for performing each step in the above-mentioned communication method for a mobile POS machine. The device can be integrated into the mobile POS machine. For details not described in the device, please refer to the description of the aforementioned method.
参见图5,图5是本发明实施例提供的一种移动POS机的通信装置的示意框图。本实施例的移动POS机的通信装置500包括:查找单元501、第一连接单元502、检测单元503以及第二连接单元504。Referring to FIG. 5 , FIG. 5 is a schematic block diagram of a communication device for a mobile POS machine according to an embodiment of the present invention. The communication device 500 of the mobile POS machine in this embodiment includes: a search unit 501 , a first connection unit 502 , a detection unit 503 and a second connection unit 504 .
其中,查找单元501,用于获取基站的基站识别码,查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;Wherein, the search unit 501 is configured to obtain the base station identification code of the base station, and search whether the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are stored in the list of base station identification codes;
第一连接单元502,用于若未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接;The first connection unit 502 is configured to, if the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are not stored; then preset the sleep wake-up time interval corresponding to the base station identification code as the first sleep wake-up time interval, and establish a communication connection with the base station;
检测单元503,用于若休眠时长达到所述第一休眠唤醒时间间隔,则检测与所述基站的通信连接是否断开;A detection unit 503, configured to detect whether the communication connection with the base station is disconnected if the sleep duration reaches the first sleep wake-up time interval;
第二连接单元504,用于若所述通信连接断开,则缩短所述第一休眠唤醒时间间隔,与所述基站重新建立通信连接,进入下一次休眠;若所述通信连接未断开,则发送保活报文给网络服务器,以使得所述基站不释放分配的网络资源,进入下一次休眠。The second connection unit 504 is configured to, if the communication connection is disconnected, shorten the first dormancy wake-up time interval, re-establish a communication connection with the base station, and enter the next dormancy; if the communication connection is not disconnected, Then send a keep-alive message to the network server, so that the base station does not release the allocated network resources, and enters the next dormancy.
图6是本发明实施例提供的终端设备的示意图,所述终端设备可以为移动POS机。如图6所示,该实施例的终端设备6包括:处理器60、存储器61以及存储在所述存储器61中并可在所述处理器60上运行的计算机程序62,例如移动POS机的通信的程序。所述处理器60执行所述计算机程序62时实现上述各个移动POS机的通信方法实施例中的步骤,例如图1所示的S101至S105。或者,所述处理器60执行所述计算机程序62时实现上述各装置实施例中各模块/单元的功能,例如图5所示单元501至504的功能。Fig. 6 is a schematic diagram of a terminal device provided by an embodiment of the present invention, and the terminal device may be a mobile POS machine. As shown in Figure 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and operable on the processor 60, such as a communication system for a mobile POS machine. program of. When the processor 60 executes the computer program 62, it realizes the steps in the above embodiments of the communication method of each mobile POS machine, such as S101 to S105 shown in FIG. 1 . Alternatively, when the processor 60 executes the computer program 62, functions of the modules/units in the above-mentioned device embodiments, for example, the functions of the units 501 to 504 shown in FIG. 5 , are realized.
示例性的,所述计算机程序62可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器61中,并由所述处理器60执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序62在所述终端设备6中的执行过程。例如,所述计算机程序62可以被分割成查找单元、第一连接单元、检测单元以及第二连接单元(虚拟装置中的单元),各单元具体功能如下:Exemplarily, the computer program 62 can be divided into one or more modules/units, and the one or more modules/units are stored in the memory 61 and executed by the processor 60 to complete this invention. The one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the terminal device 6 . For example, the computer program 62 can be divided into a search unit, a first connection unit, a detection unit and a second connection unit (units in the virtual device), and the specific functions of each unit are as follows:
查找单元,用于获取基站的基站识别码,查找基站识别码列表中是否存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;A search unit, configured to obtain the base station identification code of the base station, and search whether the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are stored in the base station identification code list;
第一连接单元,用于若未存储有所述基站识别码及所述基站识别码对应的休眠唤醒时间间隔;则预设所述基站识别码对应的休眠唤醒时间间隔为第一休眠唤醒时间间隔,并与所述基站建立通信连接;The first connection unit is used to preset the sleep wake-up time interval corresponding to the base station identification code as the first sleep wake-up time interval if the base station identification code and the sleep wake-up time interval corresponding to the base station identification code are not stored. , and establishing a communication connection with the base station;
检测单元,用于若休眠时长达到所述第一休眠唤醒时间间隔,则检测与所述基站的通信连接是否断开;A detection unit, configured to detect whether the communication connection with the base station is disconnected if the sleep duration reaches the first sleep wake-up time interval;
第二连接单元,用于若所述通信连接断开,则缩短所述第一休眠唤醒时间间隔,与所述基站重新建立通信连接,进入下一次休眠;若所述通信连接未断开,则发送保活报文给网络服务器,以使得所述基站不释放分配的网络资源,进入下一次休眠。The second connection unit is configured to, if the communication connection is disconnected, shorten the first dormancy wake-up time interval, re-establish a communication connection with the base station, and enter the next dormancy; if the communication connection is not disconnected, then Sending a keep-alive message to the network server, so that the base station does not release the allocated network resources, and enters the next dormancy.
所述终端设备6可以为移动POS机。所述终端设备可包括,但不仅限于,处理器60、存储器61。本领域技术人员可以理解,图6仅仅是终端设备6的示例,并不构成对终端设备6的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device 6 may be a mobile POS machine. The terminal device may include, but not limited to, a processor 60 and a memory 61 . Those skilled in the art can understand that FIG. 6 is only an example of the terminal device 6, and does not constitute a limitation on the terminal device 6. It may include more or less components than those shown in the figure, or combine certain components, or different components. , for example, the terminal device may also include an input and output device, a network access device, a bus, and the like.
所称处理器60可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 60 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
所述存储器61可以是所述终端设备6的内部存储单元,例如终端设备6的硬盘或内存。所述存储器61也可以是所述终端设备6的外部存储设备,例如所述终端设备6上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器61还可以既包括所述终端设备6的内部存储单元也包括外部存储设备。所述存储器61用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器61还可以用于暂时地存储已经输出或者将要输出的数据。The storage 61 may be an internal storage unit of the terminal device 6 , such as a hard disk or memory of the terminal device 6 . The memory 61 can also be an external storage device of the terminal device 6, such as a plug-in hard disk equipped on the terminal device 6, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Further, the memory 61 may also include both an internal storage unit of the terminal device 6 and an external storage device. The memory 61 is used to store the computer program and other programs and data required by the terminal device. The memory 61 can also be used to temporarily store data that has been output or will be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the above system, reference may be made to the corresponding process in the foregoing method embodiments, and details will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal equipment and method may be implemented in other ways. For example, the device/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the integrated module/unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excludes electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still carry out the foregoing embodiments Modifications to the technical solutions recorded in the examples, or equivalent replacement of some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should be included in within the protection scope of the present invention.
Claims (10)
- A kind of 1. communication means of mobile POS machine, it is characterised in that including:The base station identity code of base station is obtained, searches in base station identity code list whether be stored with the base station identity code and the base The corresponding dormancy awakening time interval of station identification code;If the base station identity code and the corresponding dormancy awakening time interval of the base station identity code are not stored with;Then preset described The corresponding dormancy awakening time interval of base station identity code is the first dormancy awakening time interval, and establishes communication link with the base station Connect;If sleep time reaches the first dormancy awakening time interval, detect whether the communication connection with the base station breaks Open;If the communication connection disconnects, shorten the first dormancy awakening time interval, re-establish and communicate with the base station Connection, into dormancy next time;If the communication connection does not disconnect, keep Alive Packet is sent to the webserver, so that institute The Internet resources that base station does not discharge the mobile POS machine are stated, into dormancy next time.
- 2. the method as described in claim 1, it is characterised in that if the sleep time reaches the first dormancy awakening time Interval, then after whether detection and the communication connection of the base station disconnect, including:If the communication connection with the base station disconnects, judge whether the first dormancy awakening time interval is less than default threshold Value;If the first dormancy awakening time interval is less than predetermined threshold value, the first dormancy awakening time interval is set to be Zero, and the base station identity code of the base station and the first dormancy awakening time interval are stored in base station identity code list, into Enter dormancy.
- 3. method as claimed in claim 1 or 2, it is characterised in that if the communication connection does not disconnect, send keep-alive After message is to the webserver, including:The base station identity code of the base station and the first dormancy awakening time interval are stored in base station identity code list.
- 4. the method as described in claim 1-3 any one, it is characterised in that it is described lookup base station identity code list in whether It is stored with after the base station identity code and the corresponding dormancy awakening time interval of the base station identity code, including:If the base station identity code and the corresponding dormancy awakening of the base station identity code are stored with the base station identity code list Time interval;Then establish and communicate to connect with the base station;When sleep time reaches the dormancy awakening time interval, keep Alive Packet is sent to the webserver, so that described Base station does not discharge the Internet resources of distribution, and enters dormancy next time.
- 5. method as claimed in claim 4, it is characterised in that if being stored with the base in the base station identity code list After station identification code and the corresponding dormancy awakening time interval of the base station identity code, further include:Judge whether the corresponding dormancy awakening time interval of the base station identity code is zero;If the corresponding dormancy awakening time interval of the base station identity code is zero, into dormancy;If the corresponding dormancy awakening time interval of the base station identity code is not zero, reach the dormancy awakening in sleep time During time interval, keep Alive Packet is sent to the webserver, so that the base station does not discharge the Internet resources of distribution, and is entered Dormancy next time.
- A kind of 6. communicator of mobile POS machine, it is characterised in that including:Searching unit, for obtaining the base station identity code of base station, searches in base station identity code list whether be stored with the base station Identification code and the corresponding dormancy awakening time interval of the base station identity code;First connection unit, if during for not being stored with the base station identity code and the corresponding dormancy awakening of the base station identity code Between be spaced;It is the first dormancy awakening time interval then to preset the corresponding dormancy awakening time interval of the base station identity code, and with Communication connection is established in the base station;Detection unit, if reaching the first dormancy awakening time interval for sleep time, detection is logical with the base station Whether letter connection disconnects;Second connection unit, if being disconnected for the communication connection, shortens the first dormancy awakening time interval, and described Base station re-establishes communication connection, into dormancy next time;If the communication connection does not disconnect, keep Alive Packet is sent to network Server, so that the base station does not discharge the Internet resources of distribution, into dormancy next time.
- 7. device as claimed in claim 6, it is characterised in that including:Judgement and setting unit, for judging whether the first dormancy awakening time interval is less than predetermined threshold value;If the first dormancy awakening time interval is less than predetermined threshold value, the first dormancy awakening time interval is set to be Zero, and the base station identity code of the base station and the first dormancy awakening time interval are stored in base station identity code list, into Enter dormancy.
- 8. device as claimed in claim 7, it is characterised in that including:Storage unit, knows for the base station identity code of the base station and the first dormancy awakening time interval to be stored in base station In other code list.
- 9. a kind of terminal device, including memory, processor and it is stored in the memory and can be on the processor The computer program of operation, it is characterised in that the processor realizes such as claim 1 to 5 when performing the computer program The step of any one the method.
- 10. a kind of computer-readable storage medium, the computer-readable storage medium is stored with computer program, it is characterised in that described Realized when computer program is executed by processor such as the step of any one of claim 1 to 5 the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711128395.3A CN107995675B (en) | 2017-11-15 | 2017-11-15 | Communication method, device, terminal and storage medium of mobile POS machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711128395.3A CN107995675B (en) | 2017-11-15 | 2017-11-15 | Communication method, device, terminal and storage medium of mobile POS machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107995675A true CN107995675A (en) | 2018-05-04 |
CN107995675B CN107995675B (en) | 2020-12-22 |
Family
ID=62030995
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711128395.3A Active CN107995675B (en) | 2017-11-15 | 2017-11-15 | Communication method, device, terminal and storage medium of mobile POS machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107995675B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110996249A (en) * | 2019-11-12 | 2020-04-10 | 嘉联支付有限公司 | Terminal transaction area range control method and device |
CN112333766A (en) * | 2020-11-13 | 2021-02-05 | 北京美斯顿科技开发有限公司 | Wireless communication method, system, terminal communication equipment and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102217407A (en) * | 2008-11-17 | 2011-10-12 | 高通股份有限公司 | Reducing an occurrence of a voip call on hold from being dropped in ev-do systems |
CN102711254A (en) * | 2012-04-16 | 2012-10-03 | 中国联合网络通信集团有限公司 | Resource release control method of network side and radio network controller (RNC) |
CN102724716A (en) * | 2012-05-29 | 2012-10-10 | 清华大学 | Long connection method based on Proxy server |
US20140206333A1 (en) * | 2011-02-21 | 2014-07-24 | Telefonaktiebolaget L M Ericsson (Publ) | Offline device paging |
US9521625B2 (en) * | 2008-09-15 | 2016-12-13 | Apple Inc. | Electronic devices for receiving pushed data |
-
2017
- 2017-11-15 CN CN201711128395.3A patent/CN107995675B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9521625B2 (en) * | 2008-09-15 | 2016-12-13 | Apple Inc. | Electronic devices for receiving pushed data |
CN102217407A (en) * | 2008-11-17 | 2011-10-12 | 高通股份有限公司 | Reducing an occurrence of a voip call on hold from being dropped in ev-do systems |
US20140206333A1 (en) * | 2011-02-21 | 2014-07-24 | Telefonaktiebolaget L M Ericsson (Publ) | Offline device paging |
CN102711254A (en) * | 2012-04-16 | 2012-10-03 | 中国联合网络通信集团有限公司 | Resource release control method of network side and radio network controller (RNC) |
CN102724716A (en) * | 2012-05-29 | 2012-10-10 | 清华大学 | Long connection method based on Proxy server |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110996249A (en) * | 2019-11-12 | 2020-04-10 | 嘉联支付有限公司 | Terminal transaction area range control method and device |
CN112333766A (en) * | 2020-11-13 | 2021-02-05 | 北京美斯顿科技开发有限公司 | Wireless communication method, system, terminal communication equipment and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107995675B (en) | 2020-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10645559B2 (en) | Bluetooth connection method and terminal | |
CN111416867B (en) | Message processing method, server and computer storage medium between different devices | |
CN106102141B (en) | A kind of processing method and processing device based on packet | |
US9668294B2 (en) | Method and apparatus for bluetooth low energy suspend and resume | |
CN107407956B (en) | Method and system for coordinating operating states among multiple SOCs within a computing device | |
JP6226348B2 (en) | Method for transmitting heartbeat message and portable terminal | |
US9900919B1 (en) | Adaptive beacon rate system | |
CN105916100B (en) | Method, device and communication system for proxy heartbeat packet | |
CN109040210B (en) | A communication method, terminal device and storage medium between applications | |
CN106022061B (en) | A kind of solution lock control method and mobile terminal | |
US11074084B2 (en) | Technologies for optimizing resume time for media agnostic USB | |
CN110169143B (en) | Parameter configuration method, equipment and computer readable medium | |
CN113163345A (en) | Broadcast communication method, system, gateway equipment and electronic price tag | |
CN108541013A (en) | Information processing method, device, mobile terminal and computer readable storage medium | |
CN106664652A (en) | Method for awakening wireless-fidelity network and terminal | |
CN109816830B (en) | Unlocking method and device | |
CN107995675B (en) | Communication method, device, terminal and storage medium of mobile POS machine | |
CN103986588A (en) | Remote control method for computer system and computer device | |
CN107155164B (en) | NFC power management device and method | |
CN115412872A (en) | Electronic price tag communication method and device and electronic equipment | |
CN111930218B (en) | Bluetooth fingerprint power consumption control method, Bluetooth fingerprint device and storage medium | |
CN109379449B (en) | Data connection method, device, terminal and storage medium | |
CN114786246B (en) | Communication control method, communication system, electronic device, and readable storage medium | |
CN115915350A (en) | A monitoring method, communication device, chip and module equipment thereof | |
CN113075992A (en) | Memory power-on method, device, equipment and computer readable storage medium |
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 |