WO2020014954A1 - 数据控制方法及终端设备 - Google Patents

数据控制方法及终端设备 Download PDF

Info

Publication number
WO2020014954A1
WO2020014954A1 PCT/CN2018/096419 CN2018096419W WO2020014954A1 WO 2020014954 A1 WO2020014954 A1 WO 2020014954A1 CN 2018096419 W CN2018096419 W CN 2018096419W WO 2020014954 A1 WO2020014954 A1 WO 2020014954A1
Authority
WO
WIPO (PCT)
Prior art keywords
data message
request frequency
data
token bucket
preset
Prior art date
Application number
PCT/CN2018/096419
Other languages
English (en)
French (fr)
Inventor
黄军
关永艺
Original Assignee
威富通科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 威富通科技有限公司 filed Critical 威富通科技有限公司
Priority to PCT/CN2018/096419 priority Critical patent/WO2020014954A1/zh
Priority to CN201880000850.8A priority patent/CN109076024A/zh
Publication of WO2020014954A1 publication Critical patent/WO2020014954A1/zh
Priority to PH12020550861A priority patent/PH12020550861A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/22Traffic shaping
    • H04L47/225Determination of shaping rate, e.g. using a moving window
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds

Definitions

  • the present application belongs to the technical field of data processing, and particularly relates to a data control method and a terminal device.
  • the payment gateway is the interface between the bank's financial network system and the Internet network. It converts the data transmitted on the Internet into internal data of financial institutions, or a designated third party processes merchant payment information and customer payment instructions.
  • the payment gateway provides various interfaces to provide services for multiple users. However, when a payment gateway provides services to users, network congestion often occurs, causing business anomalies and unable to provide users with high-quality services.
  • the embodiments of the present application provide a data control method and a terminal device to solve the problem that when existing payment gateways provide services to users, network congestion often occurs, causing business anomalies and inability to provide users with high-quality services. .
  • a first aspect of the embodiments of the present application provides a data control method, where the method is applied to a payment gateway, and the method includes:
  • IP Internet Protocol
  • the repeat request frequency of the order is lower than the preset order repeat request frequency threshold, and the IP address request frequency is lower than the preset IP address request frequency threshold.
  • the data packet is discharged into a buffer queue;
  • the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, read the data message from the cache queue and send it, and send the token in the token bucket The number reduces the value corresponding to the number of bytes of the data message.
  • a second aspect of the embodiments of the present application provides a data control device, including:
  • a data message receiving unit configured to receive a data message sent by a client, the data message carrying an IP address, a user identifier, and an order identifier;
  • a request frequency obtaining unit configured to obtain a request frequency of the user corresponding to the user ID, a repeated request frequency of the order corresponding to the order, and a request frequency of the IP address;
  • a data message buffer unit configured to: if the frequency of requests by the user is lower than a preset user request frequency threshold, the frequency of repeat requests for the order is lower than the preset request frequency threshold, and the request frequency of the IP address is low Discharging the data packet into a buffer queue at a preset IP address request frequency threshold;
  • a data message sending unit configured to read and send the data message from the buffer queue if the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, and send the The number of tokens in the token bucket decreases by a value corresponding to the number of bytes of the data message.
  • a third aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, where the processor executes the computer When the instructions are readable, the steps of the method described above are implemented.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the foregoing method are implemented.
  • a user's request frequency is lower than a preset user request frequency threshold
  • an order repeat request frequency is lower than a preset order repeat request frequency threshold
  • an IP address request frequency is lower than a preset IP address request frequency threshold
  • FIG. 1 is a schematic flowchart of a data control method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a data control device according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a data control apparatus according to another embodiment of the present application.
  • FIG. 8 is a schematic block diagram of a terminal device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a data control method according to an embodiment of the present application.
  • an example of triggering from a payment gateway is used as an example.
  • the payment gateway can ensure that transactions are performed by Internet users. Secure and seamless transfer with transaction processors.
  • the processing procedure of the payment gateway may include the following steps:
  • S101 Receive a data packet sent by a client, where the data packet carries an IP address, a user identifier, and an order identifier.
  • the user identification may be information such as a mobile phone number, an ID number, and a mailbox of the user that can be used to confirm the identity of the user
  • the order identification may be information such as an order name and an order number that are used to confirm the identity of the order.
  • IP address refers to the Internet protocol address. IP address is a unified address format provided by the IP protocol. It allocates a logical address to each network and each host on the Internet to shield the differences in physical addresses.
  • the IP address, user ID, and order ID carried in the data message can also be displayed, which is convenient for relevant personnel to review.
  • the received data message can be saved for subsequent data query.
  • S102 Acquire a request frequency of the user corresponding to the user ID, a repeated request frequency of the order corresponding to the order, and a request frequency of the IP address.
  • the corresponding user is determined according to the user ID, and the corresponding request frequency of the user is found from the pre-stored correspondence between the user and the request frequency.
  • the corresponding order is determined according to the order ID, and In the correspondence between the order and the requested frequency in a pre-stored period of time, the requested frequency corresponding to the above order is found. From the correspondence between the IP address and the requested frequency in a pre-stored period of time, find the requested frequency corresponding to the IP address.
  • the above Data messages are queued in the buffer queue.
  • the frequency of the user's request is lower than the preset user request frequency threshold. If it is lower, it is determined whether the repeat request frequency of the order is lower than the preset request repeat frequency threshold. Otherwise, the operation is stopped and the user is generated. Request for too frequent reminders. If the repeat request frequency of the above order is lower than the preset repeat request frequency threshold, determine whether the request frequency of the IP address is lower than the preset IP address request frequency threshold; otherwise, stop the operation and generate a prompt that the order repeat request frequency is too high. If the request frequency of the IP address is lower than a preset IP address request frequency threshold, the data packet is discharged into a cache queue; otherwise, the operation is stopped, and a prompt that the IP address request frequency is too high is generated.
  • the data packets in the buffer queue may also be sorted according to the scheduling priority of each data packet in the buffer queue, and the sorting results are sorted according to the sorting result. Determine the reading order of the data messages in the buffer queue.
  • S104 If the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, read the data message from the cache queue and send it, and send the The number of tokens is reduced by a value corresponding to the number of bytes of the data message.
  • the above data message is continuously discharged into the cache queue, waiting to generate a new token, and according to the above token
  • the number of tokens in the bucket and the number of bytes of the above data message generate a number of new tokens required.
  • the number of tokens in the token bucket is equal to or greater than the number of bytes of the above data message, it is read from the cache queue. Take the above data message and send it, and reduce the number of tokens in the token bucket by a value corresponding to the number of bytes of the data message.
  • the token bucket can be regarded as a container that stores a certain number of tokens.
  • the system places tokens in the bucket at a set rate. When the bucket is full, the extra tokens overflow and the bucket orders Cards no longer increase.
  • the token bucket is used to evaluate traffic specifications, it is based on whether the number of tokens in the token bucket is sufficient to forward packets. Every packet that needs to be forwarded must receive a certain number of tokens from the token bucket before it can be forwarded normally. If there are enough tokens in the bucket to forward packets, the traffic is said to comply or meet the agreed value, otherwise it is called non-conformance or exceeded.
  • a user's request frequency is lower than a preset user request frequency threshold
  • an order repeat request frequency is lower than a preset order repeat request frequency threshold
  • an IP address request frequency is lower than
  • the data packets sent by the client are discharged into the cache queue to avoid the client from being attacked or the malicious sending of data packets caused by temporary failures.
  • the number of tokens in the data packet is equal to or greater than the number of bytes of the data packet
  • the data packet is read from the buffer queue and sent, and the data stream is shaped and rate-limited to avoid network congestion and ensure normal business operations. To provide users with quality services.
  • FIG. 2 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • the difference between the above embodiments of this embodiment is S204, where S201 to S203 are the same as S101 to S103 in the previous embodiment, and S205 is the same as S104 in the previous embodiment.
  • S101 to S103 and S104 are the same as S104 in the previous embodiment.
  • the data control method in this embodiment may further include:
  • S204 Sort the data messages in the cache queue according to the scheduling priority of each data message in the cache queue, and determine the reading order of the data messages in the cache queue according to the sorting result.
  • the scheduling priority of each data message may be determined according to the sending time of each data message, or may be set according to the actual situation.
  • the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message
  • the data message is read from the cache queue and sent, and the number of tokens in the token bucket is reduced by the data The value corresponding to the number of bytes in the message.
  • sorting the data messages in the cache queue according to the scheduling priority of each data message can make the data messages with higher scheduling priority to be processed preferentially to meet application needs.
  • FIG. 3 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • the difference between the above embodiments of this embodiment is S305 to S306, where S301 to S304 are the same as S101 to S104 in the previous embodiment.
  • S301 to S304 are the same as S101 to S104 in the previous embodiment.
  • the data control method in this embodiment may further include:
  • the data message is continuously discharged into the cache queue, waiting to generate a new token, and according to The number of tokens in the token bucket and the number of bytes of the above data message generate a new token demand number prompt.
  • the number of new tokens generated is equal to the new token demand number in the above prompt, it is read from the cache queue.
  • the above data message is sent and the number of tokens in the token bucket is reduced by a value corresponding to the number of bytes of the data message, which is suitable for application.
  • FIG. 4 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • the difference between the above embodiments of this embodiment is S405, in which S401 to S404 are the same as S101 to S104 in the previous embodiment.
  • S401 to S404 are the same as S101 to S104 in the previous embodiment.
  • the data control method in this embodiment may further include:
  • the operation is stopped and an alarm is generated Promptly notify the corresponding technical and operation and maintenance personnel to deal with it in time to avoid the phenomenon of maliciously sending data packets caused by client attacks or temporary failures.
  • FIG. 5 is a schematic flowchart of a data control method according to another embodiment of the present application.
  • the difference from the embodiment corresponding to FIG. 1 is that: if the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, the data message is read from the buffer queue and A value corresponding to sending and reducing the number of tokens in the token bucket by the number of bytes of the data packet may include S504.
  • S501 ⁇ S503 and S101 ⁇ in the previous embodiment S103 is the same.
  • S504 may include S5041 ⁇ S5043:
  • S5041 Receive a token bucket startup instruction, and start the token bucket according to the token bucket startup instruction. If the number of tokens in the token bucket is equal to or greater than the number of bytes of the data packet, The data packet is read from the buffer queue and sent, and the number of tokens in the token bucket is reduced by a value corresponding to the number of bytes of the data packet.
  • S5042 if the time for the client to send the data message is within a preset time period, start the token bucket; if the number of tokens in the token bucket is equal to or greater than the bytes of the data message The data packet is read from the buffer queue and sent, and the number of tokens in the token bucket is reduced by a value corresponding to the number of bytes of the data packet.
  • S5043 if the size of the data message reaches a preset data message size threshold, start the token bucket; if the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, Read the data message from the buffer queue and send it, and reduce the number of tokens in the token bucket by a value corresponding to the number of bytes of the data message.
  • both the preset time period and the preset data message size threshold can be set according to actual conditions, and a token is started through a token bucket startup instruction, a time when the client sends the data message, or a size of the data message. Token buckets, or token buckets are not started in other cases, so that the token buckets can be started as needed to meet the application requirements of various scenarios.
  • FIG. 6 shows a schematic block diagram of a data control device provided by an embodiment of the present application.
  • Each unit included in the data control device 600 of this embodiment is configured to execute steps in the embodiment corresponding to FIG. 1.
  • the data control device 600 in this embodiment includes a data packet receiving unit 601, a request frequency acquiring unit 602, a data packet buffer unit 603, and a data packet sending unit 604.
  • the data packet receiving unit 601 is configured to receive a data packet sent by a client, where the data packet carries an IP address, a user identifier, and an order identifier.
  • the request frequency obtaining unit 602 is configured to obtain a request frequency of the user corresponding to the user ID, a repeat request frequency of the order corresponding to the order ID, and a request frequency of the IP address.
  • a data message buffer unit 603 is configured to: if the frequency of requests from the user is lower than a preset user request frequency threshold, the frequency of repeated requests for the order is lower than the preset frequency of repeated requests for the order, and the frequency of requests for the IP address If the frequency threshold is lower than the preset IP address request frequency, the data packet is discharged into a buffer queue.
  • a data message sending unit 604 is configured to: if the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, read the data message from the buffer queue and send it, and send The number of tokens in the token bucket is reduced by a value corresponding to the number of bytes of the data packet.
  • the data control device in the embodiment of the present application avoids the phenomenon of maliciously sending data packets due to client attacks, or temporary failures, while shaping and rate limiting data flows to avoid network congestion and guarantee The business is proceeding normally, providing high-quality services to users.
  • FIG. 7 is a schematic block diagram of another data control apparatus according to another embodiment of the present application.
  • the data control device 700 in this embodiment includes a data message receiving unit 701, a request frequency obtaining unit 702, a data message buffering unit 703, a data message sending unit 704, a data message sequencing unit 705, a cache queue judging unit 706, and a command The card number prompting unit 707 and the alarm prompting unit 708.
  • the data message receiving unit 601 and the request frequency please refer to the data message receiving unit 601 and the request frequency in the embodiments corresponding to FIG. 6 and FIG. Relevant descriptions of the obtaining unit 602, the data message buffer unit 603, and the data message sending unit 604 are not repeated here.
  • the data message sorting unit 705 is configured to sort the data messages in the cache queue according to the scheduling priority of each data message in the cache queue, and determine the cache queue according to the sorting result. The order in which data messages are read.
  • the cache queue judging unit 706 is configured to determine whether the cache queue is full if the number of tokens in the token bucket is less than the number of bytes of the data message.
  • the token number prompting unit 707 is configured to continue to discharge the data message in the cache queue if the cache queue is not full, wait for generating a new token, and according to the information in the token bucket, The number of tokens and the number of bytes of the data message generate a prompt for the number of new token requirements.
  • the alarm prompting unit 708 is configured to: if the frequency of the user's request reaches the preset user request frequency threshold, the repeat request frequency of the order reaches the preset repeat request frequency threshold, or the If the request frequency of the IP address reaches the preset IP address request frequency threshold, the operation is stopped and an alarm prompt is generated.
  • the data packet sending unit 704 may include a first sending unit 7041, a second sending unit 7042, and a third sending unit 7043.
  • the first sending unit 7041 is configured to receive a token bucket startup instruction and start the token bucket according to the token bucket startup instruction. If the number of tokens in the token bucket is equal to or greater than the datagram, The number of bytes of the message, read the data message from the buffer queue and send it, and reduce the number of tokens in the token bucket by a value corresponding to the number of bytes of the data message.
  • the second sending unit 7042 is configured to start the token bucket if the time for sending the data packet by the client is within a preset time period, and if the number of tokens in the token bucket is equal to or greater than The number of bytes of the data message, then read the data message from the buffer queue and send it, and reduce the number of tokens in the token bucket by the number of bytes of the data message. Value.
  • the third sending unit 7043 is configured to start the token bucket if the size of the data message reaches a preset data message size threshold, and if the number of tokens in the token bucket is equal to or greater than the data The number of bytes of the message, then read the data message from the buffer queue and send it, and reduce the number of tokens in the token bucket by a value corresponding to the number of bytes of the data message.
  • the frequency of user requests is lower than a preset user request frequency threshold
  • the frequency of repeated requests for orders is lower than the preset frequency of repeated requests for orders
  • the frequency of requests for IP addresses is lower than a preset IP address
  • the frequency threshold is requested
  • the data packets sent by the client are drained into the cache queue to prevent the client from being attacked or sending malicious data packets caused by temporary failures.
  • the tokens in the token bucket When the number is equal to or greater than the number of bytes of the data packet, the data packet is read from the buffer queue and sent, and the data stream is shaped and rate-limited to avoid network congestion and ensure normal business operations. Excellent service.
  • FIG. 8 is a schematic block diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 80 of this embodiment includes a processor 800, a memory 801, and computer-readable instructions 802 stored in the memory 801 and executable on the processor 800, such as a data control program. .
  • the processor 800 executes the computer-readable instructions 802
  • the steps in the foregoing data control method embodiments are implemented, for example, steps 101 to 104 shown in FIG. 1.
  • the processor 800 executes the computer-readable instructions 802
  • the functions of the units in the foregoing device embodiments are implemented, for example, the functions of the units 701 to 708 shown in FIG. 7.
  • the computer-readable instructions 802 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 801 and executed by the processor 800 to complete the application. .
  • the one or more modules / units may be a series of computer-readable instruction instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 802 in the terminal device 80.
  • the computer-readable instruction 802 may be divided into a data message receiving unit, a request frequency obtaining unit, a data message buffering unit, a data message sending unit, a data message sequencing unit, a cache queue judging unit, and a number of tokens Prompt unit and alarm prompt unit, the specific functions of each unit are as follows:
  • the repeat request frequency of the order is lower than the preset order repeat request frequency threshold, and the IP address request frequency is lower than the preset IP address request frequency threshold.
  • the data packet is discharged into a buffer queue;
  • the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, read the data message from the cache queue and send it, and send the token in the token bucket The number reduces the value corresponding to the number of bytes of the data message.
  • each unit includes:
  • each unit includes:
  • the cache queue If the cache queue is not full, continue to discharge the data message in the cache queue, wait to generate a new token, and according to the number of tokens in the token bucket and the word of the data message Number of Sections Generates a hint for the number of new token requirements.
  • each unit includes:
  • the frequency of user requests reaches the preset user request frequency threshold
  • the repeat request frequency of the order reaches the preset request repeat frequency threshold
  • the request frequency of the IP address reaches the preset IP address If the frequency threshold is requested, the operation is stopped and an alarm prompt is generated.
  • each unit includes:
  • the token bucket is started, and the word if the number of tokens in the token bucket is equal to or greater than the data message The number of sections, the step of reading the data packet from the buffer queue and sending it;
  • the size of the data message reaches a preset data message size threshold, starting the token bucket, and executing the if the number of tokens in the token bucket is equal to or greater than the number of bytes of the data message, The step of reading the data packet from the buffer queue and sending the data packet.
  • the above scheme will only be used when the frequency of user requests is lower than the preset user request frequency threshold, the frequency of repeated requests for orders is lower than the preset frequency of repeated requests for orders, and the frequency of requests for IP addresses is lower than the preset frequency of requests for IP addresses.
  • the data packets sent by the client are placed in the cache queue to avoid the phenomenon of maliciously sending data packets caused by the client being attacked or caused by a temporary failure.
  • the number of tokens in the token bucket is equal to or greater than the above datagrams.
  • the above data packets are read from the cache queue and sent, and the data flow is shaped and rate-limited to avoid network congestion, ensure normal business operations, and provide users with high-quality services.
  • the terminal device 80 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 800 and a memory 801.
  • FIG. 8 is only an example of the terminal device 80, and does not constitute a limitation on the terminal device 80.
  • the terminal device 80 may include more or fewer components than shown in the figure, or some components may be combined or different components
  • the terminal device may further include an input / output device, a network access device, a bus, and the like.
  • the processor 800 may be a central processing unit (Central Processing Unit). Unit (CPU), can also be other general-purpose processors, digital signal processors (Digital Signal Processor (DSP), 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.
  • the memory 801 may be an internal storage unit of the terminal device 80, such as a hard disk or a memory of the terminal device 80.
  • the memory 801 may also be an external storage device of the terminal device 80, for example, a plug-in hard disk, a smart media card (SMC), and a secure digital (SD) provided on the terminal device 80. Card, flash card, etc.
  • the memory 801 may include both an internal storage unit of the terminal device 80 and an external storage device.
  • the memory 801 is configured to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 801 may also be used to temporarily store data that has been output or is to be output.
  • the disclosed apparatus / terminal device and method may be implemented in other ways.
  • the device / terminal device embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division.
  • components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the integrated module / unit When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this application implements all or part of the processes in the methods of the above embodiments, and can also be completed by computer-readable instructions instructing related hardware.
  • the computer-readable instructions can be stored in a computer-readable storage medium In the computer-readable instructions, when executed by a processor, the steps of the foregoing method embodiments can be implemented.
  • the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes may be in a source code form, an object code form, an executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read-Only Memory, ROM), Random Access Memory Memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media.
  • a recording medium a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read-Only Memory, ROM), Random Access Memory Memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media.
  • ROM Read-Only Memory
  • RAM Random Access Memory Memory

Landscapes

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

Abstract

本申请适用于数据处理技术领域,提供了一种数据控制方法及终端设备,所述方法应用于支付网关,包括:接收客户端发送的数据报文,获取报文中的用户标识对应用户的请求频率,订单标识对应订单的重复请求频率,以及IP地址的请求频率;若用户的请求频率低于预设用户请求频率阈值,订单的重复请求频率低于预设订单重复请求频率阈值,且IP地址的请求频率低于预设IP地址请求频率阈值,则将数据报文排放在缓存队列中;若令牌桶中的令牌数等于或大于数据报文的字节数,则从缓存队列中读取数据报文并发送,并将令牌桶中的令牌数减少数据报文的字节数对应的数值,解决现有支付网关在为用户提供服务时,经常发生网络拥塞,造成业务出现异常的问题。

Description

数据控制方法及终端设备 技术领域
本申请属于数据处理技术领域,尤其涉及一种数据控制方法及终端设备。
背景技术
支付网关是银行金融网络系统和Internet网络之间的接口,将Internet上传输的数据转换为金融机构内部数据的一组服务器设备,或由指派的第三方处理商家支付信息和顾客的支付指令。支付网关对外提供各种接口,为多个用户提供服务。但是支付网关在为用户提供服务时,经常发生网络拥塞,造成业务出现异常,无法为用户提供优质服务。
技术问题
有鉴于此,本申请实施例提供了一种数据控制方法及终端设备,以解决现有支付网关在为用户提供服务时,经常发生网络拥塞,造成业务出现异常,无法为用户提供优质服务的问题。
技术解决方案
本申请实施例的第一方面提供了一种数据控制方法,所述方法应用于支付网关,所述方法包括:
接收客户端发送的数据报文,所述数据报文携带互联网协议(Internet Protocol,IP)地址、用户标识和订单标识;
获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率;
若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中;
若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
本申请实施例的第二方面提供了一种数据控制装置,包括:
数据报文接收单元,用于接收客户端发送的数据报文,所述数据报文携带IP地址、用户标识和订单标识;
请求频率获取单元,用于获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率;
数据报文缓存单元,用于若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中;
数据报文发送单元,用于若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
本申请实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如上述方法的步骤。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如上述方法的步骤。
有益效果
本申请实施例,在用户的请求频率低于预设用户请求频率阈值,订单的重复请求频率低于预设订单重复请求频率阈值,且IP地址的请求频率低于预设IP地址请求频率阈值时,才将客户端发送的数据报文排放在缓存队列中,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象,同时在令牌桶中的令牌数等于或大于上述数据报文的字节数时,才从缓存队列中读取上述数据报文并发送,对数据流进行整形和限速,避免发生网络拥塞,保证业务正常进行,为用户提供优质服务。
附图说明
图 1是本申请实施例提供的一种数据控制方法的示意流程图;
图 2是本申请另一实施例提供的一种数据控制方法的示意流程图;
图3是本申请再一实施例提供的一种数据控制方法的示意流程图;
图4是本申请又一实施例提供的一种数据控制方法的示意流程图;
图5是本申请又一实施例提供的一种数据控制方法的示意流程图;
图6是本申请实施例提供的一种数据控制装置的示意性框图;
图7是本申请另一实施例提供的一种数据控制装置示意性框图;
图8是本申请实施例提供的一种终端设备的示意性框图。
本发明的实施方式
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
参见图1,图1是本申请实施例提供的一种数据控制方法的示意流程图,在该实施例中,以支付网关的角度触发为例进行说明,这里,支付网关可以确保交易在Internet用户和交易处理商之间安全、无缝的传递。如图1所示,在该实施例中,支付网关的处理过程可以包括以下步骤:
S101:接收客户端发送的数据报文,所述数据报文携带IP地址、用户标识和订单标识。
这里,用户标识可以是用户的手机号、身份证号、邮箱等可以用于确认用户身份的信息,订单标识可以是订单名称、订单编号等用于确认订单身份的信息。IP地址是指互联网协议地址,IP地址是IP协议提供的一种统一的地址格式,它为互联网上的每一个网络和每一台主机分配一个逻辑地址,以此来屏蔽物理地址的差异。
在接收客户端发送的数据报文之后,还可以显示数据报文携带的IP地址、用户标识和订单标识,方便相关人员审核,同时还可以保存接收的数据报文,方便后续数据查询。
S102:获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率。
具体地,根据上述用户标识确定相应的用户,并从预存的一段时间内用户与请求频率的对应关系中,找到上述用户对应的请求频率,同理,根据上述订单标识确定相应的订单,并从预存的一段时间内订单与请求频率的对应关系中,找到上述订单对应的请求频率。从预存的一段时间内IP地址与请求频率的对应关系中,找到上述IP地址对应的请求频率。
将找到的上述用户对应的请求频率与预设用户请求频率阈值进行比较,将找到的上述订单对应的请求频率与预设订单重复请求频率阈值进行比较,且将找到的上述IP地址对应的请求频率与预设IP地址请求频率阈值进行比较,其中,预设用户请求频率阈值、预设订单重复请求频率阈值和预设IP地址请求频率阈值可以根据实际情况设置。
S103:若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中。
如果上述用户的请求频率低于预设用户请求频率阈值,上述订单的重复请求频率低于预设订单重复请求频率阈值,且上述IP地址的请求频率低于预设IP地址请求频率阈值,将上述数据报文排放在缓存队列中。
这里,还可以先判断上述用户的请求频率是否低于预设用户请求频率阈值,如果低于,判断上述订单的重复请求频率是否低于预设订单重复请求频率阈值,否则,停止操作,生成用户请求频率过高的提示。如果上述订单的重复请求频率低于预设订单重复请求频率阈值,判断上述IP地址的请求频率是否低于预设IP地址请求频率阈值,否则,停止操作,生成订单重复请求频率过高的提示。如果上述IP地址的请求频率低于预设IP地址请求频率阈值,将上述数据报文排放在缓存队列中,否则,停止操作,生成IP地址请求频率过高的提示。
具体地,在将所述数据报文排放在缓存队列中之后,还可以根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
S104:若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
这里,如果令牌桶中的令牌数小于上述数据报文的字节数,缓存队列未满时,继续将上述数据报文排放在缓存队列中,等待生成新令牌,并根据上述令牌桶中的令牌数和上述数据报文的字节数生成新令牌需求数目提示,一旦令牌桶中的令牌数等于或大于上述数据报文的字节数,则从缓存队列中读取上述数据报文并发送,并将令牌桶中的令牌数减少上述数据报文的字节数对应的数值。
具体地,令牌桶可以看作是一个存放一定数量令牌的容器,系统按设定的速度向桶中放置令牌,当桶中令牌满时,多出的令牌溢出,桶中令牌不再增加。在使用令牌桶对流量规格进行评估时,是以令牌桶中的令牌数量是否足够满足报文的转发为依据的。每个需要被转发的报文,都要从令牌桶中领取一定数量的令牌,才可以被正常转发。如果桶中存在足够的令牌可以用来转发报文,称流量遵守或符合约定值,否则称为不符合或超标。
从以上描述可知,本申请实施例数据控制方法,在用户的请求频率低于预设用户请求频率阈值,订单的重复请求频率低于预设订单重复请求频率阈值,且IP地址的请求频率低于预设IP地址请求频率阈值时,才将客户端发送的数据报文排放在缓存队列中,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象,同时在令牌桶中的令牌数等于或大于上述数据报文的字节数时,才从缓存队列中读取上述数据报文并发送,对数据流进行整形和限速,避免发生网络拥塞,保证业务正常进行,为用户提供优质服务。
请参阅图2,图2为本申请另一实施例提供的一种数据控制方法的示意流程图。本实施例上述实施例的区别在于S204,其中S201~S203与上一实施例中的S101~S103相同,S205与上一实施例中的S104相同,具体请参阅上述实施例中S101~S103和S104的相关描述,此处不赘述。本实施例中的数据控制方法还可以包括:
S204:根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
具体地,每个数据报文的调度优先级可以根据每个数据报文的发送时间确定,也可以根据实际情况设置。
根据上述缓存队列中每个数据报文的调度优先级对缓存队列中的数据报文进行排序,按照排序结果依次读取缓存队列中的数据报文,在读取上述客户端发送的数据报文时,如果令牌桶中的令牌数等于或大于该数据报文的字节数,则从缓存队列中读取该数据报文并发送,并将令牌桶中的令牌数减少该数据报文的字节数对应的数值。
这里,根据每个数据报文的调度优先级对缓存队列中的数据报文进行排序,可以使调度优先级高的数据报文优先处理,满足应用需要。
请参阅图3,图3为本申请再一实施例提供的一种数据控制方法的示意流程图。本实施例上述实施例的区别在于S305~S306,其中S301~S304与上一实施例中的S101~S104相同,具体请参阅上述实施例中S101~S104的相关描述,此处不赘述。本实施例中的数据控制方法还可以包括:
S305:若令牌桶中的令牌数小于所述数据报文的字节数,则判断所述缓存队列是否已满。
S306:若所述缓存队列未满,则继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据所述令牌桶中的令牌数和所述数据报文的字节数生成新令牌需求数目提示。
这里,如果令牌桶中的令牌数小于上述数据报文的字节数,且缓存队列未满,继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据令牌桶中的令牌数和上述数据报文的字节数生成新令牌需求数目提示,当生成的新令牌的数目等于上述提示中新令牌需求数目时,从缓存队列中读取上述数据报文并发送,并将令牌桶中的令牌数减少上述数据报文的字节数对应的数值,适合应用。
请参阅图4,图4为本申请又一实施例提供的一种数据控制方法的示意流程图。本实施例上述实施例的区别在于S405,其中S401~S404与上一实施例中的S101~S104相同,具体请参阅上述实施例中S101~S104的相关描述,此处不赘述。本实施例中的数据控制方法还可以包括:
S405:若所述用户的请求频率达到所述预设用户请求频率阈值,所述订单的重复请求频率达到所述预设订单重复请求频率阈值,或所述IP地址的请求频率达到预设IP地址请求频率阈值,则停止操作,生成告警提示。
这里,如果用户的请求频率达到预设用户请求频率阈值,订单的重复请求频率达到预设订单重复请求频率阈值,或者IP地址的请求频率达到预设IP地址请求频率阈值,则停止操作,生成告警提示,及时通知相应的技术和运维人员进行处理,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象。
请参阅图5,图5是本申请又一实施例提供的一种数据控制方法的示意流程图。与图1对应的实施例的区别在于:所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值可以包括S504。其中S501~ S503与上一实施例中的S101~ S103相同,具体请参阅上述实施例中S101~ S103的相关描述,此处不赘述。具体地,S504可以包括S5041~ S5043:
S5041:接收令牌桶启动指令,根据所述令牌桶启动指令启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
或者
S5042:若所述客户端发送所述数据报文的时间在预设时间段内,则启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
或者
S5043:若所述数据报文的大小达到预设数据报文大小阈值,则启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
具体地,上述预设时间段和预设数据报文大小阈值均可以根据实际情况设置,通过令牌桶启动指令、客户端发送所述数据报文的时间或数据报文的大小,启动令牌桶,其它情况不启动令牌桶,这样可以使令牌桶根据需要启动,满足多种场景的应用要求。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的数据控制方法,图6示出了本申请实施例提供的一种数据控制装置的示意性框图。本实施例的数据控制装置600包括的各单元用于执行图1对应的实施例中的各步骤,具体请参阅图1及图1对应的实施例中的相关描述,此处不赘述。本实施例的数据控制装置600包括数据报文接收单元601、请求频率获取单元602、数据报文缓存单元603和数据报文发送单元604。
其中,数据报文接收单元601,用于接收客户端发送的数据报文,所述数据报文携带IP地址、用户标识和订单标识。请求频率获取单元602,用于获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率。数据报文缓存单元603,用于若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中。数据报文发送单元604,用于若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
从以上描述可知,本申请实施例数据控制装置,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象,同时对数据流进行整形和限速,避免发生网络拥塞,保证业务正常进行,为用户提供优质服务。
参见图7,图7是本申请另一实施例提供的另一种数据控制装置的示意性框图。本实施例的数据控制装置700包括数据报文接收单元701、请求频率获取单元702、数据报文缓存单元703、数据报文发送单元704、数据报文排序单元705、缓存队列判断单元706、令牌数目提示单元707和告警提示单元708。
其中,数据报文接收单元701、请求频率获取单元702、数据报文缓存单元703和数据报文发送单元704具体请参阅图6及图6对应的实施例中数据报文接收单元601、请求频率获取单元602、数据报文缓存单元603和数据报文发送单元604的相关描述,此处不赘述。
进一步的,所述数据报文排序单元705,用于根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
进一步的,所述缓存队列判断单元706,用于若令牌桶中的令牌数小于所述数据报文的字节数,则判断所述缓存队列是否已满。
所述令牌数目提示单元707,用于若所述缓存队列未满,则继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据所述令牌桶中的令牌数和所述数据报文的字节数生成新令牌需求数目提示。
进一步的,所述告警提示单元708,用于若所述用户的请求频率达到所述预设用户请求频率阈值,所述订单的重复请求频率达到所述预设订单重复请求频率阈值,或者所述IP地址的请求频率达到所述预设IP地址请求频率阈值,则停止操作,生成告警提示。
进一步的,所述数据报文发送单元704可以包括第一发送单元7041、第二发送单元7042和第三发送单元7043。
其中,所述第一发送单元7041,用于接收令牌桶启动指令,根据所述令牌桶启动指令启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
所述第二发送单元7042,用于若所述客户端发送所述数据报文的时间在预设时间段内,则启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
所述第三发送单元7043,用于若所述数据报文的大小达到预设数据报文大小阈值,则启动所述令牌桶,若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
从以上描述可知,本申请实施例在用户的请求频率低于预设用户请求频率阈值,订单的重复请求频率低于预设订单重复请求频率阈值,且IP地址的请求频率低于预设IP地址请求频率阈值时,才将客户端发送的数据报文排放在缓存队列中,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象,同时在令牌桶中的令牌数等于或大于上述数据报文的字节数时,才从缓存队列中读取上述数据报文并发送,对数据流进行整形和限速,避免发生网络拥塞,保证业务正常进行,为用户提供优质服务。
参见图8,图8是本申请一个实施例提供的一种终端设备的示意框图。如图8所示,该实施例的终端设备80包括:处理器800、存储器801以及存储在所述存储器801中并可在所述处理器800上运行的计算机可读指令802,例如数据控制程序。所述处理器800执行所述计算机可读指令802时实现上述各个数据控制方法实施例中的步骤,例如图1所示的步骤101至104。或者,所述处理器800执行所述计算机可读指令802时实现上述各装置实施例中各单元的功能,例如图7所示单元701至708的功能。
所述计算机可读指令802可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器801中,并由所述处理器800执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令指令段,该指令段用于描述所述计算机可读指令802在所述终端设备80中的执行过程。例如,所述计算机可读指令802可以被分割成数据报文接收单元、请求频率获取单元、数据报文缓存单元、数据报文发送单元、数据报文排序单元、缓存队列判断单元、令牌数目提示单元和告警提示单元,各单元具体功能如下:
接收客户端发送的数据报文,所述数据报文携带IP地址、用户标识和订单标识;
获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率;
若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中;
若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
进一步的,各单元具体功能还包括:
根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
进一步的,各单元具体功能还包括:
若令牌桶中的令牌数小于所述数据报文的字节数,则判断所述缓存队列是否已满;
若所述缓存队列未满,则继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据所述令牌桶中的令牌数和所述数据报文的字节数生成新令牌需求数目提示。
进一步的,各单元具体功能还包括:
若所述用户的请求频率达到所述预设用户请求频率阈值,所述订单的重复请求频率达到所述预设订单重复请求频率阈值,或者所述IP地址的请求频率达到所述预设IP地址请求频率阈值,则停止操作,生成告警提示。
进一步的,各单元具体功能还包括:
接收令牌桶启动指令,根据所述令牌桶启动指令启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤;
或者
若所述客户端发送所述数据报文的时间在预设时间段内,则启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤;
或者
若所述数据报文的大小达到预设数据报文大小阈值,则启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤。
上述方案在用户的请求频率低于预设用户请求频率阈值,订单的重复请求频率低于预设订单重复请求频率阈值,且IP地址的请求频率低于预设IP地址请求频率阈值时,才将客户端发送的数据报文排放在缓存队列中,避免出现客户端被攻击,或者是暂时性故障导致的恶意发送数据报文现象,同时在令牌桶中的令牌数等于或大于上述数据报文的字节数时,才从缓存队列中读取上述数据报文并发送,对数据流进行整形和限速,避免发生网络拥塞,保证业务正常进行,为用户提供优质服务。
所述终端设备80可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器800、存储器801。本领域技术人员可以理解,图8仅仅是终端设备80的示例,并不构成对终端设备80的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器800可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器801可以是所述终端设备80的内部存储单元,例如终端设备80的硬盘或内存。所述存储器801也可以是所述终端设备80的外部存储设备,例如所述终端设备80上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器801还可以既包括所述终端设备80的内部存储单元也包括外部存储设备。所述存储器801用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器801还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种数据控制方法,其特征在于,所述方法应用于支付网关,所述方法包括:
    接收客户端发送的数据报文,所述数据报文携带互联网协议IP地址、用户标识和订单标识;
    获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率;
    若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中;
    若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
  2. 如权利要求1所述的数据控制方法,其特征在于,还包括:
    根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
  3. 如权利要求1所述的数据控制方法,其特征在于,还包括:
    若令牌桶中的令牌数小于所述数据报文的字节数,则判断所述缓存队列是否已满;
    若所述缓存队列未满,则继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据所述令牌桶中的令牌数和所述数据报文的字节数生成新令牌需求数目提示。
  4. 如权利要求1所述的数据控制方法,其特征在于,还包括:
    若所述用户的请求频率达到所述预设用户请求频率阈值,所述订单的重复请求频率达到所述预设订单重复请求频率阈值,或者所述IP地址的请求频率达到所述预设IP地址请求频率阈值,则停止操作,生成告警提示。
  5. 如权利要求1所述的数据控制方法,其特征在于,还包括:
    接收令牌桶启动指令,根据所述令牌桶启动指令启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤;
    或者
    若所述客户端发送所述数据报文的时间在预设时间段内,则启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤;
    或者
    若所述数据报文的大小达到预设数据报文大小阈值,则启动所述令牌桶,执行所述若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送的步骤。
  6. 一种数据控制装置,其特征在于,包括:
    数据报文接收单元,用于接收客户端发送的数据报文,所述数据报文携带IP地址、用户标识和订单标识;
    请求频率获取单元,用于获取所述用户标识对应用户的请求频率,所述订单标识对应订单的重复请求频率,以及所述IP地址的请求频率;
    数据报文缓存单元,用于若所述用户的请求频率低于预设用户请求频率阈值,所述订单的重复请求频率低于预设订单重复请求频率阈值,且所述IP地址的请求频率低于预设IP地址请求频率阈值,则将所述数据报文排放在缓存队列中;
    数据报文发送单元,用于若令牌桶中的令牌数等于或大于所述数据报文的字节数,则从所述缓存队列中读取所述数据报文并发送,并将所述令牌桶中的令牌数减少所述数据报文的字节数对应的数值。
  7. 如权利要求6所述的数据控制装置,其特征在于,还包括:
    数据报文排序单元,用于根据所述缓存队列中每个数据报文的调度优先级对所述缓存队列中的数据报文进行排序,按照排序结果确定所述缓存队列中数据报文的读取顺序。
  8. 如权利要求6所述的数据控制装置,其特征在于,还包括:
    缓存队列判断单元,用于若令牌桶中的令牌数小于所述数据报文的字节数,则判断所述缓存队列是否已满;
    令牌数目提示单元,用于若所述缓存队列未满,则继续将所述数据报文排放在所述缓存队列中,等待生成新令牌,并根据所述令牌桶中的令牌数和所述数据报文的字节数生成新令牌需求数目提示。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如权利要求1至5任一项所述方法的步骤。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要求1至5任一项所述方法的步骤。
PCT/CN2018/096419 2018-07-20 2018-07-20 数据控制方法及终端设备 WO2020014954A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2018/096419 WO2020014954A1 (zh) 2018-07-20 2018-07-20 数据控制方法及终端设备
CN201880000850.8A CN109076024A (zh) 2018-07-20 2018-07-20 数据控制方法及终端设备
PH12020550861A PH12020550861A1 (en) 2018-07-20 2020-06-11 Data control method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/096419 WO2020014954A1 (zh) 2018-07-20 2018-07-20 数据控制方法及终端设备

Publications (1)

Publication Number Publication Date
WO2020014954A1 true WO2020014954A1 (zh) 2020-01-23

Family

ID=64789378

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/096419 WO2020014954A1 (zh) 2018-07-20 2018-07-20 数据控制方法及终端设备

Country Status (3)

Country Link
CN (1) CN109076024A (zh)
PH (1) PH12020550861A1 (zh)
WO (1) WO2020014954A1 (zh)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382321A (zh) * 2020-03-19 2020-07-07 上海连尚网络科技有限公司 一种请求缓存素材的方法与设备
CN112436943A (zh) * 2020-10-29 2021-03-02 南阳理工学院 基于大数据的请求去重方法、装置、设备及存储介质
CN113225263A (zh) * 2021-04-20 2021-08-06 新华三半导体技术有限公司 一种流量请求处理方法、装置及网络芯片
CN113691627A (zh) * 2021-08-25 2021-11-23 杭州安恒信息技术股份有限公司 一种soar联动设备的控制方法、装置、设备及介质
CN113722097A (zh) * 2021-08-27 2021-11-30 北京天融信网络安全技术有限公司 一种浪涌保护方法、装置、电子设备及存储介质
CN114615203A (zh) * 2022-01-30 2022-06-10 阿里云计算有限公司 访问控制方法、装置、存储介质及处理器
CN115174485A (zh) * 2022-05-27 2022-10-11 中国经济信息社有限公司 播放控制管理方法和系统、设备及存储介质
CN116233010A (zh) * 2023-03-09 2023-06-06 北京百度网讯科技有限公司 流量控制方法、装置、设备及存储介质
CN112134808B (zh) * 2020-07-21 2024-02-02 上海寻梦信息技术有限公司 仓配服务控速下发方法、装置、电子设备及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417888A (zh) * 2019-07-30 2019-11-05 中国工商银行股份有限公司 流量控制方法、流量控制装置和电子设备
CN113794672B (zh) * 2020-06-12 2024-02-06 北京沃东天骏信息技术有限公司 数据处理方法及装置、电子设备和计算机可读存储介质
CN111897838A (zh) * 2020-06-28 2020-11-06 中国建设银行股份有限公司 一种交易查询方法、装置、电子设备及其可读存储介质
CN112396420A (zh) * 2020-12-11 2021-02-23 四川长虹电器股份有限公司 自动处理重复支付的系统及方法
CN112752307A (zh) * 2021-01-04 2021-05-04 欧普照明股份有限公司 控制方法、数据处理设备、控制系统及存储介质
CN114567674B (zh) * 2022-02-25 2024-03-15 腾讯科技(深圳)有限公司 一种数据处理方法、装置、计算机设备以及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420773A (zh) * 2012-01-05 2012-04-18 北京网御星云信息技术有限公司 一种基于令牌桶算法的数据传输方法及流量控制装置
CN104331296A (zh) * 2014-11-25 2015-02-04 北京奇虎科技有限公司 交易信息处理方法、装置和系统
CN105162793A (zh) * 2015-09-23 2015-12-16 上海云盾信息技术有限公司 一种防御网络攻击的方法与设备
CN106411773A (zh) * 2016-08-29 2017-02-15 武汉微创光电股份有限公司 基于令牌桶的视频传输中的流量整形方法及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968147B (zh) * 2006-11-27 2010-04-14 华为技术有限公司 业务处理方法、网络设备及业务处理系统
US20130246336A1 (en) * 2011-12-27 2013-09-19 Mcafee, Inc. System and method for providing data protection workflows in a network environment
CN106470204A (zh) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 基于请求行为特征的用户识别方法、装置、设备及系统
CN107342947B (zh) * 2016-04-28 2020-06-26 华为技术有限公司 流量整形方法、控制器、网络设备和流量整形系统
CN107391268A (zh) * 2016-05-17 2017-11-24 阿里巴巴集团控股有限公司 服务请求处理方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420773A (zh) * 2012-01-05 2012-04-18 北京网御星云信息技术有限公司 一种基于令牌桶算法的数据传输方法及流量控制装置
CN104331296A (zh) * 2014-11-25 2015-02-04 北京奇虎科技有限公司 交易信息处理方法、装置和系统
CN105162793A (zh) * 2015-09-23 2015-12-16 上海云盾信息技术有限公司 一种防御网络攻击的方法与设备
CN106411773A (zh) * 2016-08-29 2017-02-15 武汉微创光电股份有限公司 基于令牌桶的视频传输中的流量整形方法及系统

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382321A (zh) * 2020-03-19 2020-07-07 上海连尚网络科技有限公司 一种请求缓存素材的方法与设备
CN111382321B (zh) * 2020-03-19 2023-10-27 上海连尚网络科技有限公司 一种请求缓存素材的方法与设备
CN112134808B (zh) * 2020-07-21 2024-02-02 上海寻梦信息技术有限公司 仓配服务控速下发方法、装置、电子设备及存储介质
CN112436943A (zh) * 2020-10-29 2021-03-02 南阳理工学院 基于大数据的请求去重方法、装置、设备及存储介质
CN112436943B (zh) * 2020-10-29 2022-11-08 南阳理工学院 基于大数据的请求去重方法、装置、设备及存储介质
CN113225263A (zh) * 2021-04-20 2021-08-06 新华三半导体技术有限公司 一种流量请求处理方法、装置及网络芯片
CN113691627B (zh) * 2021-08-25 2022-09-27 杭州安恒信息技术股份有限公司 一种soar联动设备的控制方法、装置、设备及介质
CN113691627A (zh) * 2021-08-25 2021-11-23 杭州安恒信息技术股份有限公司 一种soar联动设备的控制方法、装置、设备及介质
CN113722097A (zh) * 2021-08-27 2021-11-30 北京天融信网络安全技术有限公司 一种浪涌保护方法、装置、电子设备及存储介质
CN113722097B (zh) * 2021-08-27 2024-04-19 北京天融信网络安全技术有限公司 一种浪涌保护方法、装置、电子设备及存储介质
CN114615203A (zh) * 2022-01-30 2022-06-10 阿里云计算有限公司 访问控制方法、装置、存储介质及处理器
CN115174485A (zh) * 2022-05-27 2022-10-11 中国经济信息社有限公司 播放控制管理方法和系统、设备及存储介质
CN116233010A (zh) * 2023-03-09 2023-06-06 北京百度网讯科技有限公司 流量控制方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN109076024A (zh) 2018-12-21
PH12020550861A1 (en) 2021-05-17

Similar Documents

Publication Publication Date Title
WO2020014954A1 (zh) 数据控制方法及终端设备
CN111344706B (zh) 管理区块链上的交易的方法和系统
US10592464B2 (en) Methods for enabling direct memory access (DMA) capable devices for remote DMA (RDMA) usage and devices thereof
US20120209921A1 (en) Instant Message Management Method and Apparatus
WO2019179026A1 (zh) 电子装置、集群访问域名自动生成方法及存储介质
CN112152940B (zh) 报文处理方法、装置以及系统
TWI771616B (zh) 支付防抖方法及裝置
WO2020164211A1 (zh) 一种数据传输方法、装置、终端设备及介质
CN110719215A (zh) 虚拟网络的流信息采集方法及装置
WO2019019676A1 (zh) 业务编号分配方法、装置、计算机设备和存储介质
WO2014004192A1 (en) Performing emulated message signaled interrupt handling
JP7164719B2 (ja) 顔サンプルライブラリのデプロイ方法、顔認識による業務処理方法及び装置
CN114020529A (zh) 一种流表数据的备份方法、装置、网络设备和存储介质
CN112910987A (zh) 消息推送方法、系统、装置、设备及存储介质
CN111105238A (zh) 一种交易风险控制方法和装置
CN107463829B (zh) 一种密码卡中dma请求的处理方法、系统及相关装置
CN111432357B (zh) 信息处理方法、系统及计算设备
US11869072B2 (en) System for facilitating mobile home purchase transactions
CN113919310A (zh) 短信内容确定方法、装置、电子设备及存储介质
CN114374686A (zh) 基于浏览器的文件处理方法、装置和设备
CN113779021A (zh) 数据处理方法、装置、计算机系统及可读存储介质
CN111953794A (zh) 一种团伙骗贷预警方法及装置
CN111753162A (zh) 数据爬取方法、装置、服务器及存储介质
CN113079110B (zh) 消息处理方法、装置、设备及存储介质
CN113766437B (zh) 一种短信发送方法和装置

Legal Events

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

Ref document number: 18926424

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

Country of ref document: EP

Kind code of ref document: A1