WO2020156256A1 - 数据包转发方法、装置、移动终端及存储介质 - Google Patents

数据包转发方法、装置、移动终端及存储介质 Download PDF

Info

Publication number
WO2020156256A1
WO2020156256A1 PCT/CN2020/072846 CN2020072846W WO2020156256A1 WO 2020156256 A1 WO2020156256 A1 WO 2020156256A1 CN 2020072846 W CN2020072846 W CN 2020072846W WO 2020156256 A1 WO2020156256 A1 WO 2020156256A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
time
mobile terminal
data
received
Prior art date
Application number
PCT/CN2020/072846
Other languages
English (en)
French (fr)
Inventor
陈岩
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020156256A1 publication Critical patent/WO2020156256A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • H04W28/14Flow control between communication endpoints using intermediate storage
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application relates to the field of communication technology, and more specifically, to a data packet forwarding method, device, mobile terminal, and storage medium.
  • the mobile terminal will periodically send some broadcast data wirelessly.
  • the mobile terminal scans a data packet of broadcast data sent by other devices, it will send the scanned data packet to the corresponding application for processing.
  • the content of many broadcast data packets does not change in real time. Yes, if the data packets of the broadcast data received each time are forwarded, it will increase unnecessary overhead for the mobile terminal.
  • this application proposes a data packet forwarding method, device, mobile terminal and storage medium to improve the above problems.
  • this application provides a data packet forwarding method, which is applied to the system service of a mobile terminal, and the method includes: when it is detected that the mobile terminal receives a data packet of broadcast data sent by a payment device wirelessly Then, the system service takes the data packet of the broadcast data as the data packet received this time, and obtains the first time stamp corresponding to the data packet received this time; obtains the buffered last time the mobile terminal received The second time stamp corresponding to the data packet of the broadcast data sent by the payment machine; calculate the interval between the first time stamp and the second time stamp; if the interval is not less than a specified threshold, the current time The received data packets are buffered and forwarded to the target program.
  • this application provides a data packet forwarding device that runs on a system service of a mobile terminal.
  • the device includes: a time acquisition unit configured to send the payment device wirelessly when it is detected that the mobile terminal receives After the data packet of the broadcast data, the data packet of the broadcast data is taken as the data packet received this time, and the first time stamp corresponding to the data packet received this time is obtained; the time obtaining unit is also used for Acquire the cached second time stamp corresponding to the data packet of the broadcast data sent by the payment device the last time the mobile terminal receives; a forwarding condition calculation unit, configured to calculate the first time stamp and the second time stamp The interval between the data packet forwarding unit is configured to, if the interval is not less than a specified threshold, buffer the currently received data packet and forward it to the target program.
  • this application provides a mobile terminal, including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, The one or more programs are configured to perform the methods described above.
  • the present application provides a computer-readable storage medium having program code stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is running.
  • FIG. 1 shows a schematic diagram of a data packet forwarding process provided by an embodiment of the present application
  • FIG. 2 shows a schematic diagram of an application environment of a payment method provided by an embodiment of the present application
  • FIG. 3 shows a flowchart of a data packet forwarding method proposed in an embodiment of the present application
  • FIG. 4 shows a schematic diagram of the location of the wireless signal coverage area of the mobile terminal and multiple payment devices proposed in an embodiment of the present application
  • FIG. 5 shows a flowchart of a data packet forwarding method proposed by another embodiment of the present application.
  • FIG. 6 shows a flowchart of a data packet forwarding method proposed by still another embodiment of the present application.
  • FIG. 7 shows a structural block diagram of a data packet forwarding device proposed in an embodiment of the present application.
  • FIG. 8 shows a structural block diagram of a data packet forwarding apparatus proposed by another embodiment of the present application.
  • FIG. 9 shows a structural block diagram of a data packet forwarding device proposed by still another embodiment of the present application.
  • FIG. 10 shows a structural block diagram of a mobile terminal proposed in this application.
  • Fig. 11 is a storage unit for storing or carrying program code for implementing the data packet forwarding method according to the embodiment of the present application.
  • payment can be made through the user's biometric information, such as the user's face, fingerprint, palmprint, and iris, which can uniquely identify the user's identity.
  • biometric information such as the user's face, fingerprint, palmprint, and iris
  • the user can directly provide the corresponding biometric information in the biometric collection device provided by the merchant.
  • the user provides the face in front of the face collection device for the face collection device to collect, and the user does not need additional information Take out the mobile phone and other payment devices, the payment speed is faster and the operation is simpler.
  • biometric information can uniquely identify a user’s identity, there is also a very small chance of identification errors, such as identifying one user’s biometric information as another user’s biometric information; on the other hand, criminals may pass The simulation imitates the biometric information of other users and impersonates other users for payment.
  • the inventor found that if it is determined that the user enters the vicinity of the payment device, and the user receives the biometric information provided by the payment device for deduction, it can be further determined The identity feature information provided for the user himself, thereby further ensuring the security of payment. Therefore, the inventor carefully studied the payment process through the user's biometric information.
  • the biometric information usually corresponds to a payment account.
  • the payment account corresponding to the biometric information is matched, and the payment account is deducted from the matched payment account.
  • the payment account matched by the biometric information may be a payment account bound in the mobile terminal, such as an account of a certain payment application in the mobile terminal.
  • users When shopping offline, users usually carry a mobile terminal bound with a payment account. Therefore, in the case where it is determined that the mobile terminal bound with the payment account is located near the payment machine, the receiving user makes the payment through the payment machine, which can further ensure the security of the payment.
  • the mobile terminal needs to send the device identification obtained from the broadcast data sent by the payment device and the payment account number bound to itself to the payment server.
  • a mobile terminal performs data packet scanning of broadcast data through Bluetooth BLE mode as an example.
  • the first program responsible for data packet forwarding in the mobile terminal obtains the data packet of the broadcast data from the BLE protocol stack, it forwards the received data packet to the second program.
  • the second program may be a third-party payment program, and the second program as a third-party payment program needs to send the device identification of the payment device carried in the received data packet to the payment server.
  • the first program forwards the data packet to the second program
  • the first program first calls the second program, triggers the start of the second program, and then forwards it. Therefore, the inventor found that if the program responsible for forwarding data packets forwards each received data packet to the target program (for example, the aforementioned second program), the target program will be triggered frequently to increase the mobile terminal’s Power consumption.
  • the inventor proposes the data packet forwarding method, device, mobile terminal, and storage medium provided in the embodiments of the application, and the data packet forwarding method provided in the embodiments of the application, which can prevent the mobile terminal from receiving data packets every time. Broadcast data packets are forwarded to the target program, but based on the set time interval to determine whether to forward the received broadcast data packet to the target program, thereby reducing the number of invalid calls to the target program. The power consumption of the mobile terminal is reduced.
  • the system involved in FIG. 2 includes a mobile terminal 100, a payment device 200 and a payment server 300.
  • the mobile terminal 100 may be a mobile phone or a tablet computer, etc., and a payment account pre-bound by the user is stored in the mobile terminal.
  • the payment device 200 is used to collect the user's biometric information and transmit it to the payment server 300, and the payment server 300 is used to complete the payment operation according to the received biometric information.
  • the payment device 200 may send broadcast data in a set wireless communication mode, wherein the dotted circle around the payment device 200 in FIG. 2 represents the coverage of the broadcast data sent by the payment device.
  • the wireless communication mode includes a Bluetooth BLE mode or a Wi-Fi Aware mode.
  • the mobile terminal 100 can search for nearby wireless signals in a set wireless communication mode, so that when the mobile terminal 100 enters the range of the dashed circle shown in FIG. 2, it can receive the broadcast data sent by the payment device 200 .
  • the mobile terminal 100 can establish a wireless connection with the payment device 200 based on the currently adopted wireless communication mode, and then after the wireless connection is established, the mobile terminal 100 can obtain a device ID that uniquely identifies the payment device from the data stored in the payment device.
  • the payment device 200 can carry its own device identification in the broadcast data sent by itself, so that the mobile terminal 100 may receive the broadcast data sent by the payment device 200.
  • the device identification of the payment device 200 that sends the broadcast data can be obtained from the broadcast data 200.
  • the mobile terminal 100 may send the acquired device identification and the stored payment account number to the payment server 300 through the base station 310 and the gateway 311 of the mobile communication network. Furthermore, the mobile terminal 100 may also send the acquired device identification and the payment account stored by itself to the payment server 300 through the wireless hotspot 320.
  • the payment server 300 receives the device identification and payment account number sent by the mobile terminal 100, it binds the device identification and the payment account number to indicate that the user of the payment account is near the payment device to which the device identification belongs.
  • the payment server 300 can verify that the payment account corresponding to the biometric information is bound to the device identification of the payment device, Complete the payment operation of the payment account.
  • a data packet forwarding method provided by an embodiment of the present application is applied to a system service of a mobile terminal, and the method includes:
  • Step S110 After detecting that the mobile terminal receives the data packet of the broadcast data sent by the payment device wirelessly, the system service uses the data packet of the broadcast data as the currently received data packet, and obtains the Describe the first time stamp corresponding to the data packet received this time.
  • system service in this embodiment may be the first program shown in FIG. 1, and the subsequent target program may be the second program in FIG. 1.
  • the payment device can send broadcast data based on the Bluetooth BLE mode or the Wi-Fi Aware mode.
  • the payment device can carry its own device identification in a specific field in the sent data packet during the process of sending broadcast data in the Bluetooth BLE mode.
  • beacon packet based on Bluetooth BLE broadcast The format of a beacon packet based on Bluetooth BLE broadcast is shown in the following table.
  • the Length field is used to represent the length of the data packet
  • the field named Type represents the connection type of the current data packet
  • the field named MFG ID represents the Bluetooth module sending the data packet
  • the ID of the manufacturer indicates that the current data packet is generated based on the iBeacon mode
  • the field named MD5 indicates the device identification encrypted based on the MD5 method carried in the data packet.
  • the field names Major, Minor and Ref are all Used to carry characteristic values to distinguish different data packets sent by the same device. Then it can be seen that in the data packet shown in the above table, the device identification of the payment device can be added in the 16Byte length field.
  • the data packet format and the name of each field shown in the above table are only exemplary, and the data packet format and field names of the broadcast data sent by the payment device can also be changed according to the actual data carried.
  • the mobile terminal can also scan the broadcast data based on the Bluetooth BLE mode or Wi-Fi Aware mode, so that after scanning the broadcast data sent by the payment machine, the mobile terminal can obtain the broadcast data from the scanned payment machine.
  • the equipment identification of the payment machine For example, if the mobile terminal scans broadcast data in Bluetooth BLE mode, after scanning the broadcast data that the payment device also sends in Bluetooth BLE mode, it can be parsed from the 16Byte length field of the broadcast data packet shown in the table above The equipment identification of the payment machine.
  • the payment device can also broadcast its own device identification in a similar manner. Accordingly, the mobile terminal can also use a similar method to obtain the device identification of the payment device .
  • the system service can detect the data packets of the broadcast data sent by the payment device scanned by the mobile terminal in real time, and after detecting that the mobile terminal has received the data packet of the broadcast data sent by the payment device wirelessly , The system service regards the data packet of the broadcast data as the data packet currently received.
  • the mobile terminal may have multiple ways to obtain the first timestamp corresponding to the currently received data packet.
  • the payment device can write the current system time of the payment device into a specific field of the generated data packet during the process of generating the data packet of the broadcast data.
  • the mobile terminal can read the value of the specific field from the data packet as the first time stamp corresponding to the data packet received this time after acquiring the data packet received this time.
  • the first time stamp corresponding to the data packet received in the mobile terminal is uniformly generated by the payment device according to the system time of the payment device, and the system time of different payment devices is synchronized with the payment server.
  • the timestamps under the entire system can be unified without causing time confusion, so that the mobile terminal can obtain more accurate data when comparing different timestamps subsequently.
  • the system service when the system service detects that the mobile terminal scans the data packet of the broadcast data sent by the payment device, it can obtain the current mobile terminal system time as the first time stamp corresponding to the data packet received this time. In this way, it can be avoided that other illegal devices pretend to be a legal payment device to send broadcast data, and because the system time of the illegal device is not synchronized with the system time of the legal payment device, the mobile terminal cannot accurately time stamp Comparison. The reason why the mobile terminal cannot accurately compare the time stamps will be described in detail later.
  • Step S120 Obtain the cached second time stamp corresponding to the last time the mobile terminal received the broadcast data packet sent by the payment device.
  • Step S130 Calculate the interval between the first time stamp and the second time stamp, and determine whether the interval is less than a specified threshold.
  • Step S140 If the interval is not less than a specified threshold, buffer the data packet received this time and forward it to the target program.
  • the mobile terminal cannot accurately compare time stamps because the system time of the illegal device is not synchronized with the system time of the legal payment device. For example, if there is currently a legal payment device A and an illegal payment device B with the same device identification, and the system time of the payment device A is different from the system time of the payment device B by a second, then if the mobile terminal adopts to receive When the time stamp carried in the data packet itself is used as the time stamp corresponding to the data packet, if the mobile terminal first receives the data packet sent by payment device A, the data packet a of the broadcast data sent by payment device A is regarded as the current time The first time stamp corresponding to the received data packet and the acquired data packet a received this time is m.
  • the illegal payment device B when the payment device A generates the data packet a and generates the data packet b with broadcast data, after the mobile terminal has determined that the payment device A generated the data packet a as being cached and forwarded to the target program, After receiving the data packet b of the broadcast data sent by the payment device B, the last time the mobile terminal received the data packet of the broadcast data sent by the payment device in the buffer is already the aforementioned data packet a, and because The difference between the system time of payment machine A and the system time of payment machine B is a second, then there is a gap of at least a second between the first time stamp corresponding to data packet b and the second time stamp corresponding to data packet a.
  • the interval between the first time stamp and the second time stamp is more likely to be no less than the specified threshold, which in turn causes data packets that may not be cached and forwarded to the target program will be forwarded to The target program, which causes the target program to be called invalid, causing invalid overhead.
  • the mobile terminal can also perform the first time stamp of the current received data packet and the buffered last time the mobile terminal received all the data based on the time stamp carried by the data packet itself and the system time of the mobile terminal. The comparison of the second time stamp corresponding to the data packet of the broadcast data sent by the payment device.
  • the frequency at which the payment device sends broadcast data packets is usually fixed. For example, a packet of broadcast data will be sent every 2 seconds or once every 3 seconds. Then, if the mobile terminal is in the wireless signal coverage of the payment device and the wireless signal scanning is maintained, it will scan the data packet at the same or similar frequency. For example, the mobile terminal also scans data packets every 2 seconds or every 3 seconds.
  • the frequency of broadcast data packets sent by illegal payment devices and the frequency of broadcast data packets sent by legal payment devices may be different, which will cause the mobile terminal to scan the frequency of broadcast data packets to change. For example, if the frequency of the data packet that the mobile terminal starts to receive is once every 2 seconds, and when the broadcast data sent by an illegal payment device is also received at the same time, it may become once every 1 second.
  • the mobile terminal uses the timestamp carried in the data packet to perform the time stamp comparison from the moment it starts scanning the data packet. That is, the mobile terminal uses the time stamp carried by the data packet received this time as the first time stamp, and the buffered time carried by the data packet of the broadcast data sent by the payment device last time that the mobile terminal received as the first time stamp. Two timestamp.
  • the time stamp is compared with the mobile terminal's own system time.
  • the mobile terminal uses the system time of the current received data packet as the first time stamp, and the buffered system time of the last time the mobile terminal received the data packet of the broadcast data sent by the payment device as the first time stamp. Two timestamp.
  • the mobile terminal can determine the first time stamp and the second time stamp more flexibly, and improve the accuracy of the calculated interval between the first time stamp and the second time stamp.
  • Step S150 If the interval is less than the specified threshold, discard the data packet received this time.
  • the data packet received by the mobile terminal is a data packet of broadcast data carrying the device identification of the payment device, and one purpose of the mobile terminal acquiring the data packet is to obtain the device identification of the payment device, then the system service is in In the process of forwarding the data packet to the target program, only the device identification in the data packet can be sent to the target program, thereby reducing the amount of data transmission.
  • a plug-in corresponding to the target program is embedded in the system service, such as an SDK (Software Development Kit) plug-in. While the target program provides an interface for data interaction with the plug-in, the system service can forward the data packet to the interface provided by the target program through the plug-in, so as to realize the data packet forwarding to the target program.
  • SDK Software Development Kit
  • the mobile terminal may be simultaneously within the wireless signal coverage of multiple payment devices.
  • the mobile terminal 100 is simultaneously within the wireless signal coverage of the payment device 200a and the payment device 200b.
  • the mobile terminal 100 can scan the data packet of the broadcast data sent by the payment device 200a and the data packet of the broadcast data sent by the payment device 200b. Since the judgment of whether the data packet can be forwarded to the target application is based on the data packet of the same payment device, the data packets sent by the payment device 200a and the payment device 200b in FIG. 4 must be judged separately.
  • the system service can enable different threads for processing, so as to pass multiple The thread approach improves the comparison efficiency of data packets, thereby improving the efficiency of the mobile terminal uploading the device identification and payment account to the payment server.
  • the system service can determine the number of threads to start according to the number of broadcast data packets received in a period of time.
  • the number of data packets of broadcast data received within a period of time includes the number of received data packets sent by different payment devices.
  • the mobile terminal when the mobile terminal detects that the number of data packets received within a specified time period exceeds the target threshold, it starts different threads for the data packets sent by different payment devices to perform subsequent timestamp comparison processing, and When the mobile terminal detects that the number of data packets received in the specified time period does not exceed the target threshold, it can start only one thread to process the subsequent timestamp comparison processing of all the data packets.
  • the system service can flexibly determine the number of threads to be started according to the number of received data packets, thereby improving the efficiency of time comparison of data packets and the efficiency of data packet forwarding.
  • the data packet forwarding method after detecting that the mobile terminal receives the data packet of the broadcast data sent by the payment device wirelessly, will transfer the data packet of the broadcast data to the system service As the data packet received this time, the first time stamp corresponding to the data packet received this time is then obtained, and then the buffered data of the last time the mobile terminal received the broadcast data sent by the payment device The second time stamp corresponding to the packet is calculated, and the interval between the first time stamp and the second time stamp is calculated. When the interval is not less than a specified threshold, the data packet received this time Cache and forward to the target program.
  • the mobile terminal will not forward the received broadcast data packet to the target program, but based on the set time interval to determine whether to forward the currently received broadcast data packet For the target program, the number of invalid calls to the target program is reduced, and the power consumption of the mobile terminal is reduced.
  • a data packet forwarding method provided by another embodiment of the present application is applied to a system service of a mobile terminal, and the method includes:
  • Step S210 After detecting that the mobile terminal receives the data packet of the broadcast data sent by the payment device wirelessly, the system service uses the data packet of the broadcast data as the currently received data packet, and obtains the Describe the first time stamp corresponding to the data packet received this time.
  • Step S220 Determine whether the mobile terminal buffers the data packet of the broadcast data sent by the payment machine.
  • the mobile terminal can store the data packet in a key-value manner.
  • the key can be a designated parameter that is obtained from the data packet to uniquely identify the data packet.
  • the value is the data of the data packet, for example, it can be the corresponding timestamp.
  • the specified parameter includes a MAC address or a custom field.
  • a key-value method is shown in the following table.
  • the field “Data_id” stores the MAC address of the data packet
  • the field “Data_time” stores the time stamp of the data packet.
  • the mobile terminal can obtain the value of the specified parameter in the data packet received at the current time as a reference value, and the value of the specified parameter is used to uniquely identify the sender of the data packet of the broadcast data, and search for the buffered data packet. Whether there is a value matching the reference value among the specified parameter values of the data packet of the broadcast data, and if there is a matching value, it is determined that the data packet of the broadcast data sent by the payment machine is cached. For example, if the system service obtains that the MAC address of the data packet received this time is "aa-bb-cc-dd-00-00", it can be determined according to the above table that the mobile terminal has cached the payment device to send Packet of broadcast data.
  • the payment device no longer uses the globally unique MAC address when generating the broadcast data packet, but uses a private MAC address, which will change over time, and The global uniqueness cannot be guaranteed, so that the unique MAC of the payment device will not be exposed, which improves security. Then in this mode, the MAC address carried in the data packet received by the mobile terminal may change over time. In this way, if the mobile terminal still uses the MAC address carried in the data packet as the unique identifier of the data packet, it may cause identification errors.
  • the mobile terminal when the mobile terminal buffers the data packet, it can buffer more parameters of the data packet. As shown in the following table:
  • the mobile terminal when the mobile terminal buffers the data packet, in addition to the MAC address, it can also buffer the device identification of the payment machine that sent the data packet. That is, the content represented by the field "Device_id". Furthermore, the system service of the mobile terminal can flexibly determine which parameter to use as the designated parameter of the current judgment according to the encapsulation protocol of the received data packet at the time.
  • the system service obtains the protocol feature parameters in the currently received data packet, the protocol feature parameters characterizing the protocol used when encapsulating the data packet of the broadcast data, and the data packet of the broadcast data includes
  • the designated parameter is determined among the multiple parameters of the designated parameter, and the value of the designated parameter is used to uniquely identify the sender of the data packet of the broadcast data, obtain the value of the designated parameter in the data packet received this time, and look up Whether there is a value matching the reference value among the specified parameter values of the data packet of the cached broadcast data, and if there is a matching value, it is determined that the data packet of the broadcast data sent by the payment machine is cached.
  • the system service can select a parameter from the MAC address and the device identification as the determined designated parameter.
  • the system service of the mobile terminal can not only use the more general MAC address to determine the uniqueness of the data packet sender, but also can flexibly adopt other parameters to determine the data packet when the MAC address cannot actually represent the uniqueness.
  • the uniqueness of the sending end makes the whole judgment process more adaptable, and it also has good flexibility.
  • the parameters carried in the cached data packets can be changed according to actual conditions, and the content in the foregoing table is only exemplary.
  • the IP address of the payment device can also be added to the data packet as the aforementioned specified parameter.
  • the subsequent step S232 is directly executed.
  • Step S230 If it is determined that the data packet of the broadcast data sent by the payment device is buffered, obtain the second time stamp corresponding to the buffered data packet of the broadcast data sent by the payment device the last time the mobile terminal received.
  • Step S231 Calculate the interval between the first time stamp and the second time stamp.
  • Step S232 If the interval is not less than the specified threshold, buffer the data packet received this time and forward it to the target program.
  • Step S233 If the interval is less than the specified threshold, discard the data packet received this time.
  • the data packet forwarding method provided by this application can prevent the mobile terminal from forwarding the data packet of broadcast data received every time to the target program through the foregoing method, but determines that the mobile terminal is currently receiving the payment for the first time. After the data packet of the broadcast data sent by the machine, or it is determined that the first time stamp of the data packet of the broadcast data received this time and the second time corresponding to the last time the data packet of the broadcast data sent by the payment machine was received After the interval of the stamp is not less than the specified threshold, the data packet of the broadcast data received this time is forwarded to the target program, thereby reducing the number of invalid calls to the target program and reducing the power consumption of the mobile terminal.
  • a data packet forwarding method provided by still another embodiment of the present application is applied to a system service of a mobile terminal, and the method includes:
  • Step S310 After detecting that the mobile terminal receives the data packet of the broadcast data sent by the payment device wirelessly, the system service uses the data packet of the broadcast data as the data packet received at the current time, and obtains the information Describe the first time stamp corresponding to the data packet received this time.
  • Step S320 Obtain the cached second time stamp corresponding to the last time the mobile terminal received the broadcast data packet sent by the payment device.
  • Step S330 Calculate the interval between the first time stamp and the second time stamp.
  • Step S331 If the interval is less than the specified threshold, discard the data packet received this time.
  • Step S340 If the interval is not less than the specified threshold, it is detected whether a data reporting service corresponding to the target program is running.
  • the system service directly forwards the data packet to the target program, it needs to trigger the start of the target program in order to receive the data packet.
  • the mobile terminal needs to consume certain CPU resources and storage resources.
  • the application program can run corresponding to a lightweight program.
  • the lightweight program can be a service-based data reporting service.
  • the data reporting service can only be responsible for reporting the received data. To the payment server.
  • the service-based data reporting service runs independently of the target program, it will not increase the resource overhead corresponding to the target application during the operation.
  • the system service when the system service detects that the target program has a corresponding data reporting service running, it can directly forward the received data packet to the data reporting service, and then the data reporting service will receive the received data packet.
  • the data packet is sent to the payment server, thereby avoiding resource overhead in the process of starting the target program.
  • Step S350 If yes, buffer the data packet received this time and forward it to the data reporting service corresponding to the target program.
  • Step S360 If not, buffer the data packet received this time and forward it to the target program.
  • the data packet forwarding method provided by this application can prevent the mobile terminal from forwarding the received broadcast data packet to the target program through the foregoing method, but determines whether to transmit the data packet based on the set time interval.
  • the received broadcast data packets are forwarded to the target program, thereby reducing the number of invalid calls to the target program and reducing the power consumption of the mobile terminal.
  • the system service before the system service performs data packet forwarding, it will first detect whether the data reporting service corresponding to the target program is running, and then when the data reporting service is running, the data packet will be forwarded to the data reporting service. This avoids triggering the target application to start, causing unnecessary system overhead.
  • a data packet forwarding apparatus 400 provided by an embodiment of the present application is a system service running on a mobile terminal.
  • the apparatus 400 includes:
  • the time acquiring unit 410 is configured to, after detecting that the mobile terminal receives the data packet of the broadcast data sent by the payment device wirelessly, use the data packet of the broadcast data as the data packet received this time, and acquire the Describe the first time stamp corresponding to the data packet received this time.
  • the time obtaining unit 410 is further configured to obtain a second time stamp corresponding to the buffered data packet of the broadcast data sent by the payment machine the last time the mobile terminal received.
  • the forwarding condition calculation unit 420 is configured to calculate the interval between the first time stamp and the second time stamp.
  • the data packet forwarding unit 430 is configured to, if the interval is not less than a specified threshold, buffer the currently received data packet and forward it to the target program.
  • the device 400 further includes a buffered data judging unit 440 for judging whether the mobile terminal has buffered a data packet of broadcast data sent by the payment device.
  • a buffered data judging unit 440 judges that there is a data packet of the broadcast data sent by the payment machine in the buffer, the time acquiring unit 410 will only execute the acquisition of the buffered last time the mobile terminal received all the data packets.
  • the second time stamp corresponding to the data packet of the broadcast data sent by the payment machine.
  • the buffered data judging unit 440 is specifically configured to obtain the value of the specified parameter in the currently received data packet as a reference value, and the value of the specified parameter is used to uniquely identify the sender of the data packet of the broadcast data; Finding whether there is a value matching the reference value among the specified parameter values of the data packet of the buffered broadcast data; if there is a matching value, it is determined that the data packet of the broadcast data sent by the payment machine is cached.
  • the specified parameters include MAC addresses or custom fields.
  • the buffered data judging unit 440 is specifically configured to obtain a protocol feature parameter in the currently received data packet, where the protocol feature parameter characterizes the protocol used when encapsulating the data packet of the broadcast data; according to the protocol feature parameter Determine a designated parameter from a plurality of parameters included in the data packet of the broadcast data, and the value of the designated parameter is used to uniquely identify the sender of the data packet of the broadcast data; and obtain the designated parameter in the data packet received this time
  • the value of is a reference value; to find whether there is a value that matches the reference value among the specified parameter values of the data packet of the cached broadcast data; if there is a matching value, it is determined that the broadcast data sent by the payment machine is cached Packets.
  • the device 400 further includes an application service judgment unit 450 for detecting whether a data reporting service corresponding to the target program is running.
  • the data packet forwarding unit 430 is configured to buffer the data packet received this time and forward it to the target Data reporting service corresponding to the program. If the application service judgment unit 450 detects that no data reporting service corresponding to the target program is running, it is used to cache and forward the data packet received this time to the target program.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • an embodiment of the present application also provides another mobile terminal 100 that can execute the foregoing data packet forwarding method.
  • the mobile terminal 100 includes one or more (only one is shown in the figure) a processor 102, a memory 104, and a wireless module 106 coupled to each other.
  • the memory 104 stores a program that can execute the content in the foregoing embodiment, and the processor 102 can execute the program stored in the memory 104.
  • the processor 102 may include one or more processing cores.
  • the processor 102 uses various interfaces and lines to connect various parts of the entire mobile terminal 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104.
  • the processor 102 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), and a modem.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly processes the operating system, user interface, and application programs
  • the GPU is used for rendering and drawing of display content
  • the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
  • the memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 104 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 104 may include a storage program area and a storage data area.
  • the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions for implementing the following method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
  • a device that can execute the payment method provided in the foregoing embodiment may be stored in the memory, and the device may be the device 400.
  • the wireless module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as communication with audio playback devices.
  • the wireless module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a subscriber identity module (SIM) card, a memory, etc. .
  • the wireless module 106 may be a Bluetooth module. In this manner, the wireless module 106 may scan data packets broadcast by the payment device based on Bluetooth based on the Bluetooth BLE mode.
  • the wireless module 106 may be a WiFi Aware module. Correspondingly, in this way, the wireless module 106 may scan data packets broadcast by the payment device based on WiFi Aware based on the WiFi Aware mode.
  • FIG. 11 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in a suitable form, for example.
  • the data packet forwarding method, device, mobile terminal, and storage medium provided by this application, when it is detected that the mobile terminal receives a data packet of broadcast data sent by a payment device wirelessly, it will The system service regards the data packet of the broadcast data as the data packet received at the current time, and then obtains the first time stamp corresponding to the data packet received at the current time, and then obtains the cached last move The terminal receives the second time stamp corresponding to the data packet of the broadcast data sent by the payment device, and then calculates the interval between the first time stamp and the second time stamp, when the interval is not less than a specified threshold In the case of, the data packet received this time is buffered and forwarded to the target program.
  • the mobile terminal will not forward the received broadcast data packet to the target program, but based on the set time interval to determine whether to forward the currently received broadcast data packet For the target program, the number of invalid calls to the target program is reduced, and the resource overhead of the mobile terminal is reduced.

Abstract

本申请实施例公开了一种数据包转发方法、装置、移动终端及存储介质。该方法包括:当检测到移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,系统服务将广播数据的数据包作为当次接收的数据包,获取与当次接收的数据包对应的第一时间戳;获取缓存的上一次移动终端接收到支付机具发送的广播数据的数据包对应的第二时间戳;若第一时间戳和第二时间戳的间隔不小于指定阈值,将当次接收的数据包进行缓存并转发给目标程序。该方法使得移动终端是基于设定的时间间隔来确定是否将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的功耗。

Description

数据包转发方法、装置、移动终端及存储介质
相关申请的交叉引用
本申请要求于2019年2月1日提交的申请号为CN201910105815.9的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及通信技术领域,更具体地,涉及一种数据包转发方法、装置、移动终端及存储介质。
背景技术
随着支持无线通信的设备越来越多,更多的设备会定期通过无线发送一些广播数据。当移动终端扫描到有其他设备发送的广播数据的数据包后,就会将扫描到的数据包发送给对应的应用程序进行处理,但是,实际上很多广播数据的数据包的内容也不是实时变化的,如果将每次接收到的广播数据的数据包都进行转发会增加移动终端不必要的开销。
发明内容
鉴于上述问题,本申请提出了一种数据包转发方法、装置、移动终端及存储介质,以实现改善上述问题。
第一方面,本申请提供了一种数据包转发方法,应用于移动终端的系统服务,所述方法包括:当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳;获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳;计算所述第一时间戳和所述第二时间戳之间的间隔;若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
第二方面,本申请提供了一种数据包转发装置,运行于移动终端的系统服务,所述装置包括:时间获取单元,用于当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳;所述时间获取单元,还用于获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳;转发条件计算单元,用于计算所述第一时间戳和所述第二时间戳之间的间隔;数据包转发单元,用于若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
第三方面,本申请提供了一种移动终端,包括一个或多个处理器以及存 储器;一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述的方法。
第四方面,本申请提供的一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行上述的方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了一种本申请实施例提供的数据包转发流程示意图;
图2示出了本申请实施例提供的一种支付方法的应用环境示意图;
图3示出了本申请实施例提出的一种数据包转发方法的流程图;
图4示出了本申请实施例提出的移动终端与多个支付机具的无线信号覆盖范围的位置示意图;
图5示出了本申请另一实施例提出的一种数据包转发方法的流程图;
图6示出了本申请再一实施例提出的一种数据包转发方法的流程图;
图7示出了本申请实施例提出的一种数据包转发装置的结构框图;
图8示出了本申请另一实施例提出的一种数据包转发装置的结构框图;
图9示出了本申请再一实施例提出的一种数据包转发装置的结构框图;
图10示出了本申请提出的一种移动终端的结构框图;
图11是本申请实施例的用于保存或者携带实现根据本申请实施例的数据包转发方法的程序代码的存储单元。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
随着互联网技术的发展,不需要依赖于现金的电子支付越来越成为人们青睐的支付方式。通常,电子支付时,需要用户拿出用于支付的电子产品进行支付操作,如拿出手机并调出支付二维码进行扫描,拿出手机进入扫码界面扫描商店收款二维码,拿出银行卡给收银员通过刷卡机刷卡等。在这些电子支付过程中,用户需要拿出用于支付的电子产品并进行相应的操作,整个支付过程比较耗时。
为了提高支付速度,缩短支付时间,可以通过用户的生物特征信息进行支付,如通过用户的人脸、指纹、掌纹以及虹膜等可以对用户身份进行唯一标识的生物特征信息。用户在支付时,可以直接在商家提供的生物特征采集设备提供对应的生物特征信息,如通过人脸支付时,用户在人脸采集设备前提供脸部供人脸采集设备采集,不需要用户额外拿出手机等用于支付的设备, 支付速度更快,操作更简单。
但是,通过生物特征信息进行支付时具有一定的安全隐患。一方面,虽然生物特征信息可以对用户身份进行唯一标识,但是也有极小几率识别出错,如将一个用户的生物特征信息识别为另一个用户的生物特征信息;另一方面,可能有不法分子通过仿真模仿其他用户的生物特征信息,假冒其他用户进行支付。
根据用户对移动终端的使用特点以及线下购物特点,发明人发现,若在确定用户进入到支付机具附近的情况下,接收到该用户通过该支付机具提供生物特征信息进行扣款,可以进一步确定为用户本人提供的身份特征信息,从而进一步保证支付的安全性。因此,发明人对通过用户的生物特征信息进行支付的流程进行了仔细研究。
发明人发现,通过生物特征信息进行支付的情况下,通常是生物特征信息对应有支付帐号。当获取到用户的生物特征信息,匹配该生物特征信息对应的支付帐号,从匹配到的支付帐号进行扣款。生物特征信息匹配的支付帐号可以是移动终端中绑定的支付帐号,如移动终端中某支付应用程序的帐号等。而用户在线下购物时,通常会携带绑定有支付帐号的移动终端。因此,在确定绑定支付帐号的移动终端位于到支付机具的附近的情况下,接收用户通过支付机具进行付款,可以进一步保证该付款的安全性。
然而在完成前述的支付过程之前,移动终端需要将从支付机具发送的广播数据中获取的设备标识和自身绑定的支付帐号发送给支付服务器。具体的,如图1所示,以移动终端通过蓝牙BLE模式进行广播数据的数据包扫描为例。移动终端中的负责数据包转发的第一程序在从BLE协议栈获取到广播数据的数据包后,会将接收到的数据包转发给第二程序。当在支付场景下,第二程序可以为第三方支付程序,作为第三方支付程序的第二程序需要将接收到的数据包中携带的支付机具的设备标识发送给支付服务器。而在第一程序将数据包转发给第二程序的过程中,第一程序会先调用第二程序,触发第二程序启动后,再进行转发。因此,发明人发现,如果负责转发数据包的程序将每次接收到的数据包都转发到目标程序(例如,前述的第二程序),那么会造成频繁的触发目标程序启动,增加移动终端的功耗。
因此,发明人提出了本申请实施例提供的数据包转发方法、装置、移动终端及存储介质,本申请实施例提供的数据包转发方法,该方法可以使得移动终端不会将每次接收到的广播数据的数据包都转发给目标程序,而是基于设定的时间间隔来确定是否将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的功耗。
下面将对本申请实施例所涉及的应用环境进行介绍。
如图2所示,请参阅图2,在图2涉及的系统中包括移动终端100、支付机具200以及支付服务器300。其中,移动终端100可以为手机或者平板电脑等,在该移动终端中存储有用户预先绑定的支付帐号。该支付机具200用于采集用户的生物特征信息并传输给支付服务器300,而支付服务器300用于根据接收到的生物特征信息完成支付操作。
在系统运行过程中,支付机具200可以以设定的无线通信模式发送广播数据,其中,图2中支付机具200周围的虚线圈表征支付机具所发送的广播数据的覆盖范围。可选的,该无线通信模式包括蓝牙BLE模式或者Wi-Fi Aware模式。相应的,移动终端100可以以设定的无线通信模式搜索附近的无线信号,从而当移动终端100进入到图2中所示的虚线圈范围内时,就可以接受到支付机具200发送的广播数据。
作为一种方式,在移动终端100可以接收到支付机具200发送的广播数据后,移动终端100可以与支付机具200基于当前所采用的无线通信模式建立无线连接,进而在建立无线连接以后,移动终端100可以从支付机具存储的数据中获取到唯一性标识支付机具的设备标识。而作为另外一种方式,为了便于降低移动终端100的功耗,支付机具200可以在自己发送的广播数据中携带自己的设备标识,从而使得移动终端100在接收到支付机具200发送的广播数据后,可以从广播数据200中获取到发送该广播数据的支付机具200的设备标识。
可选的,移动终端100在获取到支付机具200的设备标识以后,可以通过移动通信网络的基站310以及网关311将所获取的设备标识以及自己存储的支付帐号发送到支付服务器300。再者,移动终端100也可以通过无线热点320将获取的设备标识以及自己存储的支付帐号发送到支付服务器300。而当支付服务器300接收到移动终端100发送的设备标识以及支付帐号后,就会将该设备标识以及支付帐号进行绑定,从而表征支付帐号的所属用户在该设备标识所属支付机具的附近。进而,当支付机具200在支付过程中,将采集的生物特征信息发送到支付服务器300后,支付服务器300可以在验证生物特征信息对应的支付帐号与该支付机具的设备标识绑定的情况下,完成该支付帐号的支付操作。
基于上面介绍的系统以及系统运行流程,下面将结合附图具体描述本申请的各实施例。
请参阅图3,本申请实施例提供的一种数据包转发方法,应用于移动终端的系统服务,所述方法包括:
步骤S110:当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳。
需要说明的是,在本实施例中的系统服务可以为图1所示的第一程序,而后续的目标程序可以为图1中的第二程序。
基于前述图2所示的系统可知,为了便于移动终端获取到支付机具的设备标识,支付机具可以基于蓝牙BLE模式或者Wi-Fi Aware模式发送广播数据。以蓝牙BLE模式为例,支付机具可以在以蓝牙BLE模式发送广播数据的过程中,在所发送的数据包中的特定字段中携带自己的设备标识。
如下表所示的一种基于蓝牙BLE广播的beacon数据包的格式。
Figure PCTCN2020072846-appb-000001
Figure PCTCN2020072846-appb-000002
在上表所示的数据包的格式中名称为Length字段用于表征数据包的长度,名称为Type的字段表征当前数据包的连接类型,名称为MFG ID的字段表征发送该数据包的蓝牙模块的生产商的ID,名称为iBeacon的字段表征当前的数据包为基于iBeacon模式生成,名称为MD5的字段表征数据包所携带的基于MD5方式加密后的设备标识,字段名称Major、Minor以及Ref均用于携带特征值,以区别同一设备发送的不同数据包。那么可以看出的是,在上表所示的数据包中可以在16Byte长度的字段处添加支付机具的设备标识。需要说明的是,上表所示的数据包格式以及每个字段的名称只是示例性的,支付机具所发送的广播数据的数据包格式以及字段名称还可以根据实际所携带的数据进行改变。
相应的,所述移动终端也可以基于蓝牙BLE模式或者Wi-Fi Aware模式进行广播数据扫描,从而在扫描到支付机具发送的广播数据后,从扫描到的支付机具发送的广播数据中获取所述支付机具的设备标识。例如,若移动终端以蓝牙BLE模式进行广播数据扫描,那么在扫描到支付机具同样以蓝牙BLE模式发送的广播数据后,可以从上表所示的广播数据的数据包的16Byte长度的字段中解析出支付机具的设备标识。
需要说明的是,若支付机具以Wi-Fi Aware模式发送广播数据,支付机具也可以以相似的方式广播自己的设备标识,相应的,移动终端也可以采用相似的方式获取到支付机具的设备标识。
那么基于上述方式,系统服务可以实时检测移动终端所扫描到的支付机具所发送的广播数据的数据包,在检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包。
当在获取到当次接收的数据包后,可以进一步的获取到当次接收的数据包对应的第一时间戳。其中,移动终端可以有多种方式来获取当次接收的数据包对应的第一时间戳。
作为一种方式,支付机具在生成广播数据的数据包的过程中,可以将支付机具的当前系统时间写入到所生成的数据包的特定字段中。在这种方式下,移动终端可以在获取到当次接收的数据包以后,从数据包中读取该特定字段的值作为当次接收的数据包对应的第一时间戳。在这种方式下,移动终端中接收到的数据包对应的第一时间戳都是统一由支付机具根据支付机具的系统时间生成的,而不同支付机具的系统时间都是与支付服务器同步的,进而可以使得整个系统下的时间戳都是统一的,不会造成时间错乱,进而使得移动终端在后续比较不同的时间戳时,能够得到较为准确的数据。
作为另外一种方式,系统服务在检测到移动终端扫描到支付机具发送的广播数据的数据包时,可以获取当前移动终端的系统时间作为当次接收的数据包对应的第一时间戳。在这种方式下,可以避免因为由其他非法设备冒充合法的支付机具发送广播数据,又因为非法设备的系统时间与合法的支付机具的系统 时间不同步,造成的移动终端无法准确的进行时间戳的比较。而对于此处为何会造成的移动终端无法准确的进行时间戳的比较,后续会再进行详细的叙述。
步骤S120:获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
步骤S130:计算所述第一时间戳和所述第二时间戳之间的间隔,判断所述间隔是否小于指定阈值。
步骤S140:若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
下面将继续对前述的因为非法设备的系统时间与合法的支付机具的系统时间不同步,造成的移动终端无法准确的进行时间戳的比较进行详细的描述。例如,当前有携带的设备标识相同的合法的支付机具A以及非法的支付机具B,且该支付机具A的系统时间与该支付机具B的系统时间差a秒钟,那么若移动终端采用以接收到的数据包本身携带的时间戳作为数据包对应的时间戳的情况下,若移动终端先接收到支付机具A发送的数据包后,将该支付机具A发送的广播数据的数据包a作为当次接收到的数据包,且获取到的当次接收到的数据包a对应的第一时间戳为m。
而对于非法的支付机具B在支付机具A生成数据包a的同时生成有广播数据的数据包b,那么在移动终端已经将支付机具A生成数据包a判定为进行缓存并转发给目标程序后,再接收到了支付机具B发送的广播数据的数据包b后,此时的缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包已经是前述的数据包a,而因为支付机具A的系统时间与该支付机具B的系统时间差a秒钟,那么数据包b对应的第一时间戳和数据包a对应的第二时间戳之间本身就有至少a秒钟的差距,进而造成此种情况下第一时间戳和所述第二时间戳之间的间隔更大概率的不小于指定阈值,进而造成可能不该被进行缓存并转发给目标程序的数据包会被转发给目标程序,从而造成目标程序被无效调起,造成无效的开销。
作为再一种方式,移动终端还可以同时基于数据包本身携带的时间戳以及移动终端的系统时间进行当次接收到的数据包的第一时间戳与缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳的比对。
可以理解的是,支付机具发送广播数据的数据包的频率通常是固定的。例如,会按照每2秒一次或者每3秒一次发送广播数据的数据包。那么若移动终端处于支付机具的无线信号覆盖内,且保持无线信号扫描的情况下,也是会以相同或者相似的频率扫描到数据包的。例如,移动终端也会每隔2秒或者每隔3秒就扫描到一次数据包。但是,非法的支付机具发送的广播数据的数据包的频率和合法的支付机具的发送广播数据的数据包的频率可能会不同,就会造成移动终端扫描到广播数据的数据包的频率发生改变。例如,若移动终端开始接收的数据包的频率为2秒一次,而当同时还会接收到非法的支付机具发送的广播数据后,可能就会变成1秒一次。
那么在这种情况下,移动终端从开始进行数据包的扫描的时刻起,以数据 包本身携带的时间戳进行时间戳比对。即移动终端将当次接收到的数据包自己携带的时间戳作为第一时间戳,而将缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包携带的时间作为第二时间戳。而当移动终端从开始进行数据包的扫描的时刻起检测到接收到数据包的频率发生改变后,以移动终端自己的系统时间进行时间戳比对。即移动终端将当次接收到的数据包时的系统时间作为第一时间戳,而将缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包时的系统时间作为第二时间戳。通过前述方式,使得移动终端可以更加灵活的确定第一时间戳以及第二时间戳,并提升所计算的所述第一时间戳和所述第二时间戳之间的间隔的准确性。
步骤S150:若所述间隔小于指定阈值,将所述当次接收的数据包丢弃。
需要说明的是,移动终端接收到的数据包为携带有支付机具的设备标识的广播数据的数据包,而移动终端获取该数据包的一个目的是为了得到支付机具的设备标识,那么系统服务在将数据包转发给目标程序的过程中,可以只将数据包中的设备标识发送给目标程序,进而降低数据传输量。
还有,在一种方式中,系统服务中嵌入有目标程序对应的插件,例如SDK(Software Development Kit)插件。而目标程序提供与该插件数据交互的接口,那么系统服务可以通过该插件将数据包转发给目标程序提供的该接口,从而实现将数据包转发给目标程序。
在一种方式中,移动终端可能会同时处于多个支付机具的无线信号覆盖范围内。例如,如图4所示,移动终端100同时处于支付机具200a和支付机具200b的无线信号覆盖范围内。那么在这种情况下,移动终端100可以扫描到支付机具200a发送的广播数据的数据包以及支付机具200b发送的广播数据的数据包。而因为对于数据包是否可以被转发到目标应用程序是基于同一个支付机具的数据包进行判断的,那么图4中的支付机具200a和支付机具200b所发送的数据包是要分别进行判断的。那么在这种方式下,为了便于提升移动终端的系统服务的数据包的时间戳的比对效率,对于不同的支付机具发送的数据包,系统服务可以启用不同的线程来进行处理,以便通过多线程的方式提升数据包的对比效率,进而提升移动终端将设备标识以及支付帐号上传给支付服务器的效率。
可以理解的是,系统服务所启动的同时运行的线程越多,所消耗的资源也就越多。再者,移动终端通常是跟随用户移动的,那么移动终端所接收到的某些支付机具发送的数据包的数量也会是变动的,作为进一步的一种方式,即使移动终端当前处于多个支付机具的无线信号覆盖范围内的情况下,系统服务可以根据一段时间内接收到的广播数据的数据包的数量来确定开启线程的数量。该一段时间内接收到的广播数据的数据包的数量包括接收到的不同的支付机具发送的数据包的数量。
可选的,当移动终端检测到指定时间段内接收到的数据包的数量超过目标阈值后,就针对不同的支付机具发送的数据包分别启动不同的线程进行后续的时间戳比对处理,而当移动终端检测到指定时间段内接收到的数据包的数量未超过目标阈值,就可以只启动一条线程来处理所有的数据包的后续的 时间戳比对处理。通过上述方式,可以使得系统服务灵活的根据所接收到的数据包的数量来确定启动的线程的数量,进而可以提升数据包的时间比对的效率以及数据包转发的效率。
本申请提供的一种数据包转发方法,在当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,会将所述系统服务将所述广播数据的数据包作为当次接收的数据包,进而再获取与所述当次接收的数据包对应的第一时间戳,然后再获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳,进而计算所述第一时间戳和所述第二时间戳之间的间隔,在当所述间隔不小于指定阈值的情况下,将所述当次接收的数据包进行缓存并转发给目标程序。从而通过前述方式可以使得移动终端不会将每次接收到的广播数据的数据包都转发给目标程序,而是基于设定的时间间隔来确定是否将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的功耗。
请参阅图5,本申请另一实施例提供的一种数据包转发方法,应用于移动终端的系统服务,所述方法包括:
步骤S210:当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳。
步骤S220:判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包。
作为一种方式,移动终端在接收到支付机具发送的广播数据的数据包,并判定该数据包可以被缓存后,可以通过key-value的方式进行数据包的存储。其中,该key可以为从数据包中获取的唯一标识数据包的指定参数。而该value为数据包的数据,例如,可以为对应的时间戳。可选的,所述指定参数包括MAC地址或者自定义字段。例如,如下表所示的一种key-value方式。
ID Data_id Data_time
1 aa-bb-cc-dd-00-00 time1
2 ab-bd-cc-dd-00-00 time2
在上表中,字段“Data_id”存储数据包的MAC地址,字段“Data_time”存储数据包的时间戳。
在这种方式下,移动终端可以获取所述当次接收的数据包中指定参数的值为参考值,所述指定参数的值用于唯一性标识广播数据的数据包的发送端,查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值,若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。例如,若系统服务获取到当次接收到的数据包的MAC地址为“aa-bb-cc-dd-00-00”,那么根据上表就可以判定,移动终端已经缓存有所述支付机具发送的广播数据的数据包。
需要说明的是,在一种方式下,支付机具在生成广播数据的数据包时不再使用全局唯一的MAC地址,而是使用私有的MAC地址,该私有的MAC 地址会随着时间变化,且不能保证全局唯一,进而使得支付机具自己的唯一性MAC不会暴露,提升安全性。那么在这种模式下,移动终端接收到的数据包的所携带的MAC地址是可能会随着时间变化的。那么在这种方式下,移动终端如果依然采用数据包中携带的MAC地址作为数据包的唯一性标识,那就就可能会造成识别错误。
那么在这种方式下,移动终端在缓存数据包时,可以缓存更多的数据包的参数。如下表所示:
ID Data_id Device_id Data_time
1 aa-bb-cc-dd-00-00 G001 time1
2 ab-bd-cc-dd-00-00 G002 time2
如上表所示,移动终端在缓存数据包时,除了缓存MAC地址外,还可以缓存发送数据包的支付机具的设备标识。也就是字段“Device_id”所表征的内容。进而移动终端的系统服务可以灵活的根据当次接收到的数据包的封装协议来确定采用那个参数来作为当次判定的指定参数。具体的,系统服务获取所述当次接收的数据包中协议特征参数,所述协议特征参数表征封装广播数据的数据包时所采用的协议,根据所述协议特征参数从广播数据的数据包包括的多个参数中确定指定参数,所述指定参数的值用于唯一性标识广播数据的数据包的发送端,获取所述当次接收的数据包中所述指定参数的值为参考值,查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值,若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。可以理解的是,若系统服务按照上表的方式进行数据包的缓存,那么系统服务就可以从MAC地址以及设备标识中选择一个参数作为确定的指定参数。通过上述方式,可以使得移动终端的系统服务不仅可以以比较通用的MAC地址来确定数据包发送端的唯一性,还可以在确定MAC地址无法实际表征唯一性时,灵活采用其他的参数来确定数据包发送端的唯一性,进而使得整个判断过程具有很多的适配性的情况下,也具有很好的灵活性。
需要说明的是,系统服务在缓存数据包时,所缓存的数据包所携带的参数可以根据实际情况进行改变,前述表中的内容只是示例性的。例如,还可以在数据包中添加支付机具的IP地址作为前述的指定参数。
若判定未缓存有所述支付机具发送的广播数据的数据包,直接执行后续的步骤S232。
步骤S230:若判定缓存有所述支付机具发送的广播数据的数据包,获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
步骤S231:计算所述第一时间戳和所述第二时间戳之间的间隔。
步骤S232:若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
步骤S233:若所述间隔小于指定阈值,将所述当次接收的数据包丢弃。
本申请提供的一种数据包转发方法,通过前述方式可以使得移动终端不会将每次接收到的广播数据的数据包都转发给目标程序,而是在判定移动终端当 前是首次接收到该支付机具发送的广播数据的数据包后,或者而是确定当次接收到的广播数据的数据包的第一时间戳与上一次接收到所述支付机具发送的广播数据的数据包对应的第二时间戳的间隔不小于指定阈值后,将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的功耗。
请参阅图6,本申请再一实施例提供的一种数据包转发方法,应用于移动终端的系统服务,所述方法包括:
步骤S310:当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳。
步骤S320:获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
步骤S330:计算所述第一时间戳和所述第二时间戳之间的间隔。
步骤S331:若所述间隔小于指定阈值,将所述当次接收的数据包丢弃。
步骤S340:若所述间隔不小于指定阈值,检测是否有目标程序对应的数据上报服务在运行。
可以理解的是,若系统服务直接将数据包转发给目标程序,那么需要先触发目标程序启动以便接收数据包。而移动终端在启动目标程序的过程中,需要消耗一定的CPU资源以及存储资源。在一种方式中,应用程序可以对应有轻量级的程序运行,可选的,该轻量级的程序可以为基于service的数据上报服务,该数据上报服务可以仅负责将接收到的数据上报给支付服务器。再者,因为基于service的数据上报服务是独立于目标程序以外运行的,所以在运行过程中不会额外增加目标应用程序对应的资源开销。在这种情况下,系统服务在检测到目标程序有对应的数据上报服务在运行的情况下,可以直接将当次接收到的数据包转发给数据上报服务,然后由数据上报服务将接收到的数据包发送给支付服务器,从而避免启动目标程序的过程中的资源开销。
步骤S350:若有,将所述当次接收的数据包进行缓存并转发给目标程序对应的数据上报服务。
步骤S360:若无,将所述当次接收的数据包进行缓存并转发给目标程序。
本申请提供的一种数据包转发方法,通过前述方式可以使得移动终端不会将每次接收到的广播数据的数据包都转发给目标程序,而是基于设定的时间间隔来确定是否将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的功耗。并且,在系统服务在执行数据包转发之前,会先检测是否有目标程序对应的数据上报服务在运行,进而当由数据上报服务在运行的情况下,就将数据包转发给数据上报服务,进一步的避免了触发目标应用程序启动,造成不必要的系统开销。
请参阅图7,本申请实施例提供的一种数据包转发装置400,运行于移动终端的系统服务,所述装置400包括:
时间获取单元410,用于当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,将所述广播数据的数据包作为当次接 收的数据包,获取与所述当次接收的数据包对应的第一时间戳。
所述时间获取单元410,还用于获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
转发条件计算单元420,用于计算所述第一时间戳和所述第二时间戳之间的间隔。
数据包转发单元430,用于若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
作为一种方式,如图8所示,所述装置400还包括缓存数据判断单元440,用于判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包。在这种方式下,若所述缓存数据判断单元440判定缓存有所述支付机具发送的广播数据的数据包,所述时间获取单元410才会执行获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
可选的,缓存数据判断单元440具体用于获取所述当次接收的数据包中指定参数的值为参考值,所述指定参数的值用于唯一性标识广播数据的数据包的发送端;查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值;若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。其中,指定参数包括MAC地址或者自定义字段。
可选的,缓存数据判断单元440具体用于获取所述当次接收的数据包中协议特征参数,所述协议特征参数表征封装广播数据的数据包时所采用的协议;根据所述协议特征参数从广播数据的数据包包括的多个参数中确定指定参数,所述指定参数的值用于唯一性标识广播数据的数据包的发送端;获取所述当次接收的数据包中所述指定参数的值为参考值;查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值;若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。
作为一种方式,如图9所示,所述装置400还包括应用服务判断单元450,用于检测是否有目标程序对应的数据上报服务在运行。在这种方式下,若应用服务判断单元450检测到有目标程序对应的数据上报服务在运行,所述数据包转发单元430,用于将所述当次接收的数据包进行缓存并转发给目标程序对应的数据上报服务。若应用服务判断单元450检测到没有目标程序对应的数据上报服务在运行,用于将所述当次接收的数据包进行缓存并转发给目标程序。
需要说明的是,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性。另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
下面将结合图10对本申请提供的一种移动终端进行说明。
请参阅图10,基于上述的数据包转发方法、装置,本申请实施例还提供的另一种可以执行前述数据包转发方法的移动终端100。移动终端100包括相互耦合的一个或多个(图中仅示出一个)处理器102、存储器104以及无线模块106。其中,该存储器104中存储有可以执行前述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。
其中,处理器102可以包括一个或者多个处理核。处理器102利用各种接口和线路连接整个移动终端100内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行移动终端100的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。其中,存储器中可以存储有可以执行前述实施例提供的支付方法的装置,该装置可以为装置400。
所述无线模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯,例如和音频播放设备进行通讯。所述无线模块106可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。作为一种方式,该无线模块106可以为蓝牙模块,在这种方式下,该无线模块106可以基于蓝牙BLE模式扫描支付机具基于蓝牙广播的数据包。作为另外一种方式,该无线模块106可以为WiFi Aware模块,相应的,在这种方式下,该无线模块106可以基于WiFi Aware模式扫描支付机具基于WiFi Aware广播的数据包。
请参考图11,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable  storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。
综上所述,本申请提供的一种数据包转发方法、装置、移动终端及存储介质,在当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,会将所述系统服务将所述广播数据的数据包作为当次接收的数据包,进而再获取与所述当次接收的数据包对应的第一时间戳,然后再获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳,进而计算所述第一时间戳和所述第二时间戳之间的间隔,在当所述间隔不小于指定阈值的情况下,将所述当次接收的数据包进行缓存并转发给目标程序。从而通过前述方式可以使得移动终端不会将每次接收到的广播数据的数据包都转发给目标程序,而是基于设定的时间间隔来确定是否将当次接收到的广播数据的数据包转发给目标程序,进而降低了无效的调起目标程序的次数,降低了移动终端的的资源的开销。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种数据包转发方法,其特征在于,应用于移动终端的系统服务,所述方法包括:
    当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,所述系统服务将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳;
    获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳;
    计算所述第一时间戳和所述第二时间戳之间的间隔;
    若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
  2. 根据权利要求1所述的方法,其特征在于,所述获取与所述当次接收的数据包对应的第一时间戳的步骤包括:
    从所述当次接收的数据包中读取特定字段的值作为对应的所述第一时间戳。
  3. 根据权利要求1所述的方法,其特征在于,所述获取与所述当次接收的数据包对应的第一时间戳的步骤包括:
    获取移动终端的系统时间作为所述当次接收的数据包对应的所述第一时间戳。
  4. 根据权利要求3所述的方法,其特征在于,所述获取移动终端的系统时间作为所述当次接收的数据包对应的所述第一时间戳的步骤包括:
    若检测到从数据包的扫描时刻起接收到数据包的频率发生改变,获取移动终端的系统时间作为所述当次接收的数据包对应的所述第一时间戳。
  5. 根据权利要求1-4任一所述的方法,其特征在于,获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳的步骤之前还包括:
    判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包;
    若判定缓存有所述支付机具发送的广播数据的数据包,执行所述获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    若判定未缓存有所述支付机具发送的广播数据的数据包,将所述当次接收的数据包进行缓存并转发给目标程序。
  7. 根据权利要求5所述的方法,其特征在于,所述判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包的步骤包括:
    获取所述当次接收的数据包中指定参数的值为参考值,所述指定参数的值用于唯一性标识广播数据的数据包的发送端;
    查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值;
    若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。
  8. 根据权利要求7所述的方法,其特征在于,所述指定参数包括MAC地址或者自定义字段。
  9. 根据权利要求7所述的方法,其特征在于,所述指定参数包括支付机具的IP地址。
  10. 根据权利要求7-9任一所述的方法,其特征在于,所述获取所述当次接收的数据包中指定参数的值为参考值的步骤包括:
    根据所述当次接收到的数据包的封装协议,从所述当次接收到的数据包包括的多个参数中确定指定参数;
    将所述指定参数的值作为参考值。
  11. 根据权利要求5所述的方法,其特征在于,所述判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包的步骤包括:
    获取所述当次接收的数据包中协议特征参数,所述协议特征参数表征封装广播数据的数据包时所采用的协议;
    根据所述协议特征参数从广播数据的数据包包括的多个参数中确定指定参数,所述指定参数的值用于唯一性标识广播数据的数据包的发送端;
    获取所述当次接收的数据包中所述指定参数的值为参考值;
    查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值;
    若有匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。
  12. 根据权利要求1所述的方法,其特征在于,所述将所述当次接收的数据包进行缓存并转发给目标程序的步骤之前包括:
    检测是否有目标程序对应的数据上报服务在运行;
    若有,将所述当次接收的数据包进行缓存并转发给目标程序对应的数据上报服务。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    若无,执行所述将所述当次接收的数据包进行缓存并转发给目标程序。
  14. 根据权利要求1-13任一所述的方法,其特征在于,所述方法还包括:
    若所述间隔小于指定阈值,将所述当次接收的数据包丢弃。
  15. 一种数据包转发装置,其特征在于,运行于移动终端的系统服务,所述装置包括:
    时间获取单元,用于当检测到所述移动终端接收到支付机具通过无线的方式发送的广播数据的数据包后,将所述广播数据的数据包作为当次接收的数据包,获取与所述当次接收的数据包对应的第一时间戳;
    所述时间获取单元,还用于获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳;
    转发条件计算单元,用于计算所述第一时间戳和所述第二时间戳之间的间隔;
    数据包转发单元,用于若所述间隔不小于指定阈值,将所述当次接收的数据包进行缓存并转发给目标程序。
  16. 根据权利要求15所述的装置,其特征在于,所述装置还包括:
    缓存数据判断单元,用于判断所述移动终端是否缓存有所述支付机具发送的广播数据的数据包;
    若判定缓存有所述支付机具发送的广播数据的数据包,所述时间获取单元,用于获取缓存的上一次所述移动终端接收到所述支付机具发送的广播数据的数据包对应的第二时间戳。
  17. 根据权利要求16所述的装置,其特征在于,若判定未缓存有所述支付机具发送的广播数据的数据包,所述数据包转发单元,还用于将所述当次接收的数据包进行缓存并转发给目标程序。
  18. 根据权利要求16或者17所述的装置,其特征在于,所述缓存数据判断单元具体用于获取所述当次接收的数据包中指定参数的值为参考值,所述指定参数的值用于唯一性标识广播数据的数据包的发送端;查找已缓存广播数据的数据包的所述指定参数的值中是否有与所述参考值匹配的值;若有 匹配的值,判定缓存有所述支付机具发送的广播数据的数据包。
  19. 一种移动终端,其特征在于,包括一个或多个处理器以及存储器;
    一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行权利要求1-14任一所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行权利要求1-14任一所述的方法。
PCT/CN2020/072846 2019-02-01 2020-01-17 数据包转发方法、装置、移动终端及存储介质 WO2020156256A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910105815.9 2019-02-01
CN201910105815.9A CN109714716B (zh) 2019-02-01 2019-02-01 数据包转发方法、装置及移动终端

Publications (1)

Publication Number Publication Date
WO2020156256A1 true WO2020156256A1 (zh) 2020-08-06

Family

ID=66264235

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/072846 WO2020156256A1 (zh) 2019-02-01 2020-01-17 数据包转发方法、装置、移动终端及存储介质

Country Status (2)

Country Link
CN (1) CN109714716B (zh)
WO (1) WO2020156256A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112888029A (zh) * 2021-02-03 2021-06-01 惠州Tcl移动通信有限公司 一种通信方法、计算机设备及计算机可读存储介质
CN115278551A (zh) * 2022-06-14 2022-11-01 广东逸动科技有限公司 控制方法、远控端、智能终端、通信系统及存储介质
CN117854698A (zh) * 2024-03-05 2024-04-09 四川大象医疗科技有限公司 核磁类设备的在线预警方法、装置、电子设备及存储介质
CN117854698B (zh) * 2024-03-05 2024-05-10 四川大象医疗科技有限公司 核磁类设备的在线预警方法、装置、电子设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714716B (zh) * 2019-02-01 2020-08-25 Oppo广东移动通信有限公司 数据包转发方法、装置及移动终端

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902772A (zh) * 2009-05-25 2010-12-01 北京时代凌宇科技有限公司 基于异构分簇无线传感网多源监测数据融合的方法及系统
CN105405170A (zh) * 2015-12-07 2016-03-16 广西米付网络技术有限公司 基于低功耗蓝牙和二维码扫描的地铁检票终端
CN108566641A (zh) * 2018-03-06 2018-09-21 阿里巴巴集团控股有限公司 支付辅助方法、装置以及设备
CN109714716A (zh) * 2019-02-01 2019-05-03 Oppo广东移动通信有限公司 数据包转发方法、装置及移动终端

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8849183B2 (en) * 2007-10-05 2014-09-30 Qualcomm Incorporated Location and time based filtering of broadcast information
CN102347975B (zh) * 2007-10-19 2015-12-16 神达电脑股份有限公司 提供终端使用者内容的导航系统及架构
CN106157013B (zh) * 2015-04-13 2019-08-30 中国电信股份有限公司 支付终端、机具、服务器、系统及支付处理方法
CN105243541A (zh) * 2015-11-13 2016-01-13 广西米付网络技术有限公司 一种ble蓝牙与声波结合的移动支付方法及系统
CN108476228B (zh) * 2016-03-01 2019-07-09 谷歌有限责任公司 基于与ip白名单接近度的网络安全
CN107545426A (zh) * 2016-06-27 2018-01-05 李明 确定支付装置的方法和系统以及交易方法和系统
CN107545421A (zh) * 2016-06-27 2018-01-05 李明 确定支付装置的方法和系统以及交易方法和系统
CN106658686B (zh) * 2016-12-30 2020-01-14 Oppo广东移动通信有限公司 一种数据转发方法,及接入设备
CN108805553A (zh) * 2017-04-27 2018-11-13 上海慧流云计算科技有限公司 一种支付信息处理方法及装置
CN107820307A (zh) * 2017-10-11 2018-03-20 捷开通讯(深圳)有限公司 移动设备进行无线通信时的省电方法、系统以及装置
CN107708194A (zh) * 2017-11-10 2018-02-16 珠海市魅族科技有限公司 一种报文过滤方法及装置、终端和可读存储介质
CN108985749A (zh) * 2018-06-07 2018-12-11 阿里巴巴集团控股有限公司 一种支付方法、测距方法、支付机具设备和测距设备
CN108985754A (zh) * 2018-07-20 2018-12-11 广州科韵智慧科技有限公司 基于蓝牙广播的支付装置、系统及方法
CN109284046B (zh) * 2018-09-18 2021-04-27 广州虎牙信息科技有限公司 一种控制控件的方法、装置、终端及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902772A (zh) * 2009-05-25 2010-12-01 北京时代凌宇科技有限公司 基于异构分簇无线传感网多源监测数据融合的方法及系统
CN105405170A (zh) * 2015-12-07 2016-03-16 广西米付网络技术有限公司 基于低功耗蓝牙和二维码扫描的地铁检票终端
CN108566641A (zh) * 2018-03-06 2018-09-21 阿里巴巴集团控股有限公司 支付辅助方法、装置以及设备
CN109714716A (zh) * 2019-02-01 2019-05-03 Oppo广东移动通信有限公司 数据包转发方法、装置及移动终端

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112888029A (zh) * 2021-02-03 2021-06-01 惠州Tcl移动通信有限公司 一种通信方法、计算机设备及计算机可读存储介质
CN112888029B (zh) * 2021-02-03 2022-08-09 惠州Tcl移动通信有限公司 一种通信方法、计算机设备及计算机可读存储介质
CN115278551A (zh) * 2022-06-14 2022-11-01 广东逸动科技有限公司 控制方法、远控端、智能终端、通信系统及存储介质
CN115278551B (zh) * 2022-06-14 2023-10-13 广东逸动科技有限公司 控制方法、远控端、智能终端、通信系统及存储介质
CN117854698A (zh) * 2024-03-05 2024-04-09 四川大象医疗科技有限公司 核磁类设备的在线预警方法、装置、电子设备及存储介质
CN117854698B (zh) * 2024-03-05 2024-05-10 四川大象医疗科技有限公司 核磁类设备的在线预警方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN109714716B (zh) 2020-08-25
CN109714716A (zh) 2019-05-03

Similar Documents

Publication Publication Date Title
WO2020156256A1 (zh) 数据包转发方法、装置、移动终端及存储介质
WO2020156255A1 (zh) 支付方法、装置、系统、移动终端、支付机具及服务器
WO2018184410A1 (zh) 一种连接无线接入点的方法与设备
WO2015090248A1 (zh) 服务器的过载保护方法及装置
WO2020228038A1 (zh) 域名处理方法、装置、电子设备以及存储介质
US9753562B2 (en) Dynamic threshold for local connectivity setup
CN103731810A (zh) 接入点共享方法及装置
WO2017071087A1 (zh) 信息的传输方法、装置和设备
JP2015512192A (ja) 複数のnfc−aデバイスの識別を改善するための方法および装置
WO2021207984A1 (zh) 流量检测方法、装置、服务器以及存储介质
US9301124B2 (en) Audio command-based triggering
WO2023020187A1 (zh) 数据获取方法、装置、电子设备及存储介质
WO2023020253A1 (zh) 数据获取方法、装置、电子设备及存储介质
WO2020156154A1 (zh) 支付信息处理方法、装置、移动终端及系统
CN107666662B (zh) 一种终端识别方法和接入点
WO2015103886A1 (en) Numerical value transferring method, terminal, server, and system
CN110009004B (zh) 图像数据处理方法、计算机设备和存储介质
WO2018166202A1 (zh) 网络定位方法、计算机设备及非易失性可读存储介质
WO2021159393A1 (zh) 信息推送方法、装置、服务器及存储介质
SE539872C2 (en) Providing a service by a service terminal to a user of a mobile device
US20190327246A1 (en) Information Security Verification Method and Terminal
WO2021072761A1 (zh) 设备接入方法、装置、系统控制方法、电子设备及存储介质
WO2018049970A1 (zh) 热点网络切换方法及终端
WO2020156152A1 (zh) 支付信息绑定方法、装置、移动终端及系统
US20230300107A1 (en) Electronic device for performing edge computing service and operation method of electronic device

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: 20747659

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: 20747659

Country of ref document: EP

Kind code of ref document: A1