CN109076024A - data control method and terminal device - Google Patents

data control method and terminal device Download PDF

Info

Publication number
CN109076024A
CN109076024A CN201880000850.8A CN201880000850A CN109076024A CN 109076024 A CN109076024 A CN 109076024A CN 201880000850 A CN201880000850 A CN 201880000850A CN 109076024 A CN109076024 A CN 109076024A
Authority
CN
China
Prior art keywords
data message
token
buffer queue
request frequency
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201880000850.8A
Other languages
Chinese (zh)
Inventor
黄军
关永艺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weifutong Technology Co Ltd
Original Assignee
Weifutong Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weifutong Technology Co Ltd filed Critical Weifutong Technology Co Ltd
Publication of CN109076024A publication Critical patent/CN109076024A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The present invention is suitable for technical field of data processing, provide a kind of data control method and terminal device, the method is applied to payment gateway, it include: the data message for receiving client and sending, obtain the request frequency that the user identifier in message corresponds to user, order note identification corresponds to the repetitive requests frequency of order and the request frequency of IP address;If the request frequency of user is lower than pre-set user request frequency threshold value, the repetitive requests frequency of order is lower than default order repetitive requests frequency threshold, and the request frequency of IP address is lower than preset IP address request frequency threshold value, then data message is emitted in buffer queue;If the token number in token bucket is equal to or more than the byte number of data message, data message is then read from buffer queue and is sent, and the token number in token bucket is reduced to the corresponding numerical value of byte number of data message, existing payment gateway is solved when providing service for user, network congestion frequent occurrence causes business abnormal problem occur.

Description

Data control method and terminal device
Technical field
The invention belongs to technical field of data processing more particularly to a kind of data control methods and terminal device.
Background technique
Payment gateway is the interface between bank finance network system and Internet network, by what is transmitted on Internet Data are converted to one group of server apparatus of financial institution's internal data, or the third party by assigning handle merchant payment information and The payment instruction of customer.Payment gateway externally provides various interfaces, provides service for multiple users.But payment gateway for use When family provides service, network congestion frequent occurrence causes business to occur abnormal, can not provide good service for user.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of data control method and terminal device, to solve existing payment Gateway is when providing service for user, network congestion frequent occurrence, causes business to occur abnormal, high-quality clothes can not be provided for user The problem of business.
The first aspect of the embodiment of the present invention provides a kind of data control method, and the method is applied to payment gateway, The described method includes:
The data message that client is sent is received, the data message carries Internet protocol (Internet Protocol, IP) address, user identifier and order note identification;
The request frequency that the user identifier corresponds to user is obtained, the order note identification corresponds to the repetitive requests frequency of order The request frequency of rate and the IP address;
If the request frequency of the user is lower than pre-set user request frequency threshold value, the repetitive requests frequency of the order is low In default order repetitive requests frequency threshold, and the request frequency of the IP address is lower than preset IP address request frequency threshold value, Then the data message is emitted in buffer queue;
If the token number in token bucket is equal to or more than the byte number of the data message, read from the buffer queue The corresponding number of byte number for taking the data message and sending, and the token number in the token bucket is reduced into the data message Value.
The second aspect of the embodiment of the present invention provides a kind of data control unit, comprising:
Data message receiving unit, the data message sent for receiving client, the data message carrying IP address, User identifier and order note identification;
Request frequency acquiring unit corresponds to the request frequency of user, the order note identification for obtaining the user identifier The repetitive requests frequency of corresponding order and the request frequency of the IP address;
Data message cache unit, if the request frequency for the user is lower than pre-set user request frequency threshold value, institute The repetitive requests frequency for stating order is lower than default order repetitive requests frequency threshold, and the request frequency of the IP address is lower than pre- If the data message, then be emitted in buffer queue by IP address request frequency threshold value;
Data message transmission unit, if being equal to or more than the byte of the data message for the token number in token bucket Number, then read the data message and sent from the buffer queue, and will be described in the token number reduction in the token bucket The corresponding numerical value of the byte number of data message.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program It realizes such as the step of the above method.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, realizes when the computer program is executed by processor such as the step of the above method.
Existing beneficial effect is the embodiment of the present invention compared with prior art: request frequency of the embodiment of the present invention in user Rate is lower than pre-set user request frequency threshold value, and the repetitive requests frequency of order is lower than default order repetitive requests frequency threshold, and When the request frequency of IP address is lower than preset IP address request frequency threshold value, just the data message that client is sent is emitted on slow Deposit in queue, avoid the occurrence of client attacked or temporary fault caused by malice send datagram phenomenon, simultaneously When token number in token bucket is equal to or more than the byte number of above-mentioned data message, above-mentioned data are just read from buffer queue Message is simultaneously sent, and carries out shaping and speed limit to data stream, is avoided that network congestion occurs, is guaranteed that business is normally carried out, mention for user For good service.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of schematic flow diagram of data control method provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides a kind of data control method schematic flow diagram;
Fig. 3 is a kind of schematic flow diagram for data control method that yet another embodiment of the invention provides;
Fig. 4 is a kind of schematic flow diagram for data control method that further embodiment of this invention provides;
Fig. 5 is a kind of schematic flow diagram for data control method that further embodiment of this invention provides;
Fig. 6 is a kind of schematic block diagram of data control unit provided in an embodiment of the present invention;
Fig. 7 be another embodiment of the present invention provides a kind of data control unit schematic block diagram;
Fig. 8 is a kind of schematic block diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
It is a kind of schematic flow diagram of data control method provided in an embodiment of the present invention referring to Fig. 1, Fig. 1, in the implementation It in example, is illustrated by taking the triggering of the angle of payment gateway as an example, here, payment gateway may insure transaction in Internet user Transmitting between trading processing quotient securely, seamlessly.As shown in Figure 1, in this embodiment, the treatment process of payment gateway can be with The following steps are included:
S101: receiving the data message that client is sent, and the data message carries IP address, user identifier and order mark Know.
Here, user identifier, which can be cell-phone number, identification card number, mailbox of user etc., can be used to confirm that user identity Information, order note identification can be the information for the identity that confirms an order such as order title, O/No..IP address refers to internet Protocol address, IP address are a kind of unified address formats that IP agreement provides, it is for each network on internet and often One host assignment, one logical address, the difference of physical address is shielded with this.
After receiving the data message that client is sent, IP address, the Yong Hubiao of data message carrying can also be shown Knowledge and order note identification, facilitate related personnel to audit, while can also save received data message, follow-up data are facilitated to inquire.
S102: obtaining the request frequency that the user identifier corresponds to user, and the repetition that the order note identification corresponds to order is asked Seek the request frequency of frequency and the IP address.
Specifically, corresponding user is determined according to above-mentioned user identifier, and user and request out of a period of time that prestore In the corresponding relationship of frequency, the corresponding request frequency of above-mentioned user is found, similarly, is ordered accordingly according to the above order mark determination It is single, and from order and the corresponding relationship of request frequency, finding the corresponding request frequency of the above order in a period of time prestored. From the corresponding relationship of IP address and request frequency in a period of time prestored, the corresponding request frequency of above-mentioned IP address is found.
The corresponding request frequency of above-mentioned user found is compared with pre-set user request frequency threshold value, by what is found The corresponding request frequency of the above order is compared with default order repetitive requests frequency threshold, and the above-mentioned IP address that will be found Corresponding request frequency is compared with preset IP address request frequency threshold value, wherein pre-set user request frequency threshold value is preset Order repetitive requests frequency threshold and preset IP address request frequency threshold value can be arranged according to the actual situation.
S103: if the request frequency of the user is lower than pre-set user request frequency threshold value, the repetitive requests of the order Frequency is lower than default order repetitive requests frequency threshold, and the request frequency of the IP address is lower than preset IP address request frequency The data message is then emitted in buffer queue by threshold value.
If the request frequency of above-mentioned user is lower than pre-set user request frequency threshold value, the repetitive requests frequency of the above order Lower than default order repetitive requests frequency threshold, and the request frequency of above-mentioned IP address is lower than preset IP address request frequency threshold Value, above-mentioned data message is emitted in buffer queue.
Here, it can also first judge whether above-mentioned user request frequency is lower than pre-set user request frequency threshold value, if It is lower than, judges whether the repetitive requests frequency of the above order is lower than default order repetitive requests frequency threshold, otherwise, stops behaviour Make, generates the excessively high prompt of user's request frequency.If the repetitive requests frequency of the above order is lower than default order repetitive requests Frequency threshold, judges whether the request frequency of above-mentioned IP address is lower than preset IP address request frequency threshold value, otherwise, stops behaviour Make, generates the excessively high prompt of order repetitive requests frequency.If the request frequency of above-mentioned IP address is requested lower than preset IP address Above-mentioned data message is emitted in buffer queue by frequency threshold, otherwise, is stopped operation, and it is excessively high to generate IP address request frequency Prompt.
It specifically, can also be according in the buffer queue after the data message is emitted in buffer queue The dispatching priority of each data message is ranked up the data message in the buffer queue, determines institute according to ranking results State the reading order of data message in buffer queue.
S104: if the token number in token bucket is equal to or more than the byte number of the data message, from the caching team The data message is read in column and is sent, and the token number in the token bucket is reduced to the byte number pair of the data message The numerical value answered.
Here, if the token number in token bucket is less than the byte number of above-mentioned data message, when buffer queue is less than, continue Above-mentioned data message is emitted in buffer queue, waits new token to be generated, and according to token number in above-mentioned token bucket and upper The byte number for stating data message generates new token demand number prompt, once the token number in token bucket is equal to or more than above-mentioned number According to the byte number of message, then above-mentioned data message is read from buffer queue and is sent, and the token number in token bucket is reduced The corresponding numerical value of the byte number of above-mentioned data message.
Specifically, token bucket can be regarded as one storage certain amount token container, system by setting speed to Token is placed in bucket, when token is full in bucket, the token having more overflows, and token is not further added by bucket.Using token bucket convection current It is whether the forwarding of message is met as foundation using the token quantity in token bucket enough when gauge lattice are assessed.Each need Message to be forwarded will get a certain number of tokens from token bucket, just can normally be forwarded.If existed in bucket Enough tokens can be used to E-Packet, and claim flow to abide by or meet about definite value, be otherwise known as not meeting or exceeded.
It is evidenced from the above discussion that data control method of the embodiment of the present invention, is lower than pre-set user in the request frequency of user Request frequency threshold value, the repetitive requests frequency of order are lower than default order repetitive requests frequency threshold, and the request frequency of IP address When rate is lower than preset IP address request frequency threshold value, just the data message that client is sent is emitted in buffer queue, is avoided Phenomenon that appearance client is attacked or the caused malice of temporary fault sends datagram, while in token bucket When token number is equal to or more than the byte number of above-mentioned data message, above-mentioned data message is just read from buffer queue and is sent, Shaping and speed limit are carried out to data stream, avoids that network congestion occurs, guarantees that business is normally carried out, provide good service for user.
Referring to Fig. 2, Fig. 2 be another embodiment of the present invention provides a kind of data control method schematic flow diagram.This The difference of embodiment above-described embodiment is S204, and wherein S201~S203 is identical as S101~S103 in a upper embodiment, S205 is identical as the S104 in a upper embodiment, retouches referring specifically to S101~S103 in above-described embodiment is related to S104's It states, does not repeat herein.Data control method in the present embodiment can also include:
S204: according to the dispatching priority of data message each in the buffer queue to the data in the buffer queue Message is ranked up, and the reading order of data message in the buffer queue is determined according to ranking results.
Specifically, the dispatching priority of each data message can be determined according to the sending time of each data message, It can be arranged according to the actual situation.
The data message in buffer queue is carried out according to the dispatching priority of data message each in above-mentioned buffer queue Sequence, is successively read the data message in buffer queue according to ranking results, in the data message for reading above-mentioned client transmission When, if the token number in token bucket is equal to or more than the byte number of the data message, the data are read from buffer queue Message is simultaneously sent, and the corresponding numerical value of the byte number that the token number in token bucket is reduced the data message.
Here, the data message in buffer queue is ranked up according to the dispatching priority of each data message, it can be with Make the data message priority processing that dispatching priority is high, meets and apply needs.
Referring to Fig. 3, Fig. 3 is a kind of schematic flow diagram for data control method that yet another embodiment of the invention provides.This The difference of embodiment above-described embodiment is S305~S306, wherein S101~S104 in S301~S304 and a upper embodiment It is identical, referring specifically to the associated description of S101~S104 in above-described embodiment, do not repeat herein.Data control in the present embodiment Method processed can also include:
S305: if the token number in token bucket is less than the byte number of the data message, judge that the buffer queue is It is no to have expired.
S306: if the buffer queue is less than, continuing for the data message to be emitted in the buffer queue, waits New token is generated, and new token demand number is generated according to the byte number of token number and the data message in the token bucket Prompt.
Here, if the token number in token bucket is less than the byte number of above-mentioned data message, and buffer queue is less than, continues The data message is emitted in the buffer queue, waits new token to be generated, and according to token number in token bucket and upper The byte number for stating data message generates new token demand number prompt, when the number of the new token of generation is equal in above-mentioned prompt newly When token demand number, above-mentioned data message is read from buffer queue and is sent, and the token number in token bucket is reduced The corresponding numerical value of byte number of data message is stated, application is suitble to.
Referring to Fig. 4, Fig. 4 is a kind of schematic flow diagram for data control method that further embodiment of this invention provides.This The difference of embodiment above-described embodiment is S405, and wherein S401~S404 is identical as S101~S104 in a upper embodiment, Referring specifically to the associated description of S101~S104 in above-described embodiment, do not repeat herein.Data controlling party in the present embodiment Method can also include:
S405: if the request frequency of the user reaches the pre-set user request frequency threshold value, the repetition of the order Request frequency reaches the default order repetitive requests frequency threshold or the request frequency of the IP address reaches preset IP address Request frequency threshold value, then stop operation, and generates alarm prompt.
Here, if the request frequency of user reaches pre-set user request frequency threshold value, the repetitive requests frequency of order reaches Request frequency to default order repetitive requests frequency threshold or IP address reaches preset IP address request frequency threshold value, then It stops operation, generates alarm prompt, notify that corresponding technology and operation maintenance personnel are handled in time, avoid the occurrence of client and attacked Hit or temporary fault caused by malice send datagram phenomenon.
Referring to Fig. 5, Fig. 5 is a kind of schematic flow diagram for data control method that further embodiment of this invention provides.With The difference of the corresponding embodiment of Fig. 1 is: if the token number in the token bucket is equal to or more than the byte of the data message Number, then read the data message and sent from the buffer queue, and will be described in the token number reduction in the token bucket The corresponding numerical value of the byte number of data message may include S504.Wherein the S101 in S501~S503 and a upper embodiment~ S103 is identical, referring specifically to the associated description of S101~S103 in above-described embodiment, does not repeat herein.Specifically, S504 can To include S5041~S5043:
S5041: receiving token bucket enabled instruction, starts the token bucket according to the token bucket enabled instruction, if token Token number in bucket is equal to or more than the byte number of the data message, then the data message is read from the buffer queue And the corresponding numerical value of byte number for sending, and the token number in the token bucket being reduced into the data message.
Or
S5042: if the client sends the time of the data message within a preset period of time, start the token Bucket reads institute if the token number in token bucket is equal to or more than the byte number of the data message from the buffer queue It states data message and sends, and the corresponding numerical value of the byte number that the token number in the token bucket is reduced into the data message.
Or
S5043: if the size of the data message reaches preset data message size threshold value, starting the token bucket, If the token number in token bucket is equal to or more than the byte number of the data message, the number is read from the buffer queue It according to message and sends, and the corresponding numerical value of the byte number that the token number in the token bucket is reduced into the data message.
Specifically, above-mentioned preset time period and preset data message size threshold value can be arranged according to the actual situation, lead to Cross token bucket enabled instruction, client sends the time of the data message or the size of data message, start token bucket, it is other Situation does not start token bucket, token bucket can be made to start as needed in this way, meets the application requirement of several scenes.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to data control method described in foregoing embodiments, Fig. 6 shows a kind of number provided in an embodiment of the present invention According to the schematic block diagram of control device.The each unit that the data control unit 600 of the present embodiment includes is corresponding for executing Fig. 1 Each step in embodiment does not repeat herein referring specifically to the associated description in the corresponding embodiment of Fig. 1 and Fig. 1.This implementation The data control unit 600 of example includes data message receiving unit 601, request frequency acquiring unit 602, data message caching list Member 603 and data packet sending unit 604.
Wherein, data message receiving unit 601, for receiving the data message of client transmission, the data message is taken Band IP address, user identifier and order note identification.Request frequency acquiring unit 602 corresponds to user for obtaining the user identifier Request frequency, the order note identification corresponds to the repetitive requests frequency of order and the request frequency of the IP address.Datagram Literary cache unit 603, if the request frequency for the user is lower than pre-set user request frequency threshold value, the repetition of the order Request frequency is lower than default order repetitive requests frequency threshold, and the request frequency of the IP address is requested lower than preset IP address The data message is then emitted in buffer queue by frequency threshold.Data message transmission unit 604, if in token bucket Token number be equal to or more than the data message byte number, then it is concurrent that the data message is read from the buffer queue It send, and the corresponding numerical value of the byte number that the token number in the token bucket is reduced into the data message.
It is evidenced from the above discussion that data control unit of the embodiment of the present invention, avoids the occurrence of client and is attacked, or temporarily Maliciously send datagram phenomenon caused by when property failure, while carrying out shaping and speed limit to data stream, and generation network is avoided to gather around Plug, guarantees that business is normally carried out, provides good service for user.
Referring to Fig. 7, Fig. 7 be another embodiment of the present invention provides another data control unit schematic block diagram.This The data control unit 700 of embodiment is slow including data message receiving unit 701, request frequency acquiring unit 702, data message Memory cell 703, data message transmission unit 704, data message sequencing unit 705, buffer queue judging unit 706, token number Mesh prompt unit 707 and alarm prompt unit 708.
Wherein, data message receiving unit 701, request frequency acquiring unit 702,703 sum number of data message cache unit According to packet sending unit 704 referring specifically to data message receiving unit 601, request frequency in the corresponding embodiment of Fig. 6 and Fig. 6 The associated description of acquiring unit 602, data message cache unit 603 and data packet sending unit 604, does not repeat herein.
Further, the data message sequencing unit 705, for according to data message each in the buffer queue Dispatching priority is ranked up the data message in the buffer queue, determines number in the buffer queue according to ranking results According to the reading order of message.
Further, the buffer queue judging unit 706, if being less than the datagram for the token number in token bucket The byte number of text, then judge whether the buffer queue has expired.
The token number prompt unit 707 continues to arrange the data message if less than for the buffer queue It is placed in the buffer queue, waits new token to be generated, and according to the token number and the data message in the token bucket Byte number generates new token demand number prompt.
Further, the alarm prompt unit 708, if the request frequency for the user reaches the pre-set user Request frequency threshold value, the repetitive requests frequency of the order reach the default order repetitive requests frequency threshold or described The request frequency of IP address reaches the preset IP address request frequency threshold value, then stops operation, and generates alarm prompt.
Further, the data message transmission unit 704 may include the first transmission unit 7041, the second transmission unit 7042 and third transmission unit 7043.
Wherein, first transmission unit 7041 refers to for receiving token bucket enabled instruction according to token bucket starting It enables and starts the token bucket, if the token number in token bucket is equal to or more than the byte number of the data message, delay from described It deposits and reads the data message in queue and send, and the token number in the token bucket is reduced to the byte of the data message The corresponding numerical value of number.
Second transmission unit 7042, if sending the time of the data message in preset time for the client In section, then start the token bucket, if the token number in token bucket is equal to or more than the byte number of the data message, from institute It states and reads the data message in buffer queue and send, and the token number in the token bucket is reduced into the data message The corresponding numerical value of byte number.
The third transmission unit 7043, if the size for the data message reaches preset data message size threshold Value, then start the token bucket, if the token number in token bucket is equal to or more than the byte number of the data message, from described The data message is read in buffer queue and is sent, and the token number in the token bucket is reduced to the word of the data message The corresponding numerical value of joint number.
It is evidenced from the above discussion that the embodiment of the present invention is lower than pre-set user request frequency threshold value in the request frequency of user, The repetitive requests frequency of order is lower than default order repetitive requests frequency threshold, and the request frequency of IP address is with being lower than default IP When the request frequency threshold value of location, just the data message that client is sent is emitted in buffer queue, client is avoided the occurrence of and is attacked Hit or temporary fault caused by malice send datagram phenomenon, while the token number in token bucket is equal to or greatly When the byte number of above-mentioned data message, above-mentioned data message is just read from buffer queue and is sent, data stream is carried out whole Shape and speed limit avoid that network congestion occurs, guarantee that business is normally carried out, provide good service for user.
It is a kind of schematic block diagram of terminal device provided by one embodiment of the present invention referring to Fig. 8, Fig. 8.As shown in figure 8, The terminal device 80 of the embodiment includes: processor 800, memory 801 and is stored in the memory 801 and can be in institute State the computer program 802 run on processor 800, such as data control program.The processor 800 executes the computer Realize the step in above-mentioned each data control method embodiment when program 802, such as step 101 shown in FIG. 1 is to 104.Or Person, the processor 800 realize the function of each unit in above-mentioned each Installation practice, example when executing the computer program 802 The function of unit 701 to 708 as shown in Figure 7.
The computer program 802 can be divided into one or more module/units, one or more of moulds Block/unit is stored in the memory 801, and is executed by the processor 800, to complete the present invention.It is one or Multiple module/units can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing Implementation procedure of the computer program 802 in the terminal device 80.For example, the computer program 802 can be divided It is cut into data message receiving unit, request frequency acquiring unit, data message cache unit, data message transmission unit, data Message sequencing unit, buffer queue judging unit, token number prompt unit and alarm prompt unit, each unit concrete function is such as Under:
The data message that client is sent is received, the data message carries IP address, user identifier and order note identification;
The request frequency that the user identifier corresponds to user is obtained, the order note identification corresponds to the repetitive requests frequency of order The request frequency of rate and the IP address;
If the request frequency of the user is lower than pre-set user request frequency threshold value, the repetitive requests frequency of the order is low In default order repetitive requests frequency threshold, and the request frequency of the IP address is lower than preset IP address request frequency threshold value, Then the data message is emitted in buffer queue;
If the token number in token bucket is equal to or more than the byte number of the data message, read from the buffer queue The corresponding number of byte number for taking the data message and sending, and the token number in the token bucket is reduced into the data message Value.
Further, each unit concrete function further include:
According to the dispatching priority of data message each in the buffer queue to the data message in the buffer queue It is ranked up, the reading order of data message in the buffer queue is determined according to ranking results.
Further, each unit concrete function further include:
If the token number in token bucket is less than the byte number of the data message, judge the buffer queue whether It is full;
If the buffer queue is less than, continues for the data message to be emitted in the buffer queue, wait to be generated New token, and new token demand number is generated according to the byte number of token number and the data message in the token bucket and is mentioned Show.
Further, each unit concrete function further include:
If the request frequency of the user reaches the pre-set user request frequency threshold value, the repetitive requests frequency of the order Rate reaches the default order repetitive requests frequency threshold or the request frequency of the IP address reaches the preset IP address Request frequency threshold value, then stop operation, and generates alarm prompt.
Further, each unit concrete function further include:
Token bucket enabled instruction is received, the token bucket is started according to the token bucket enabled instruction, if executing described enable Token number in board bucket is equal to or more than the byte number of the data message, then the datagram is read from the buffer queue Text and the step of send;
Or
If the client sends the time of the data message within a preset period of time, starts the token bucket, hold If the token number in the row token bucket is equal to or more than the byte number of the data message, read from the buffer queue The data message and the step of send;
Or
If the size of the data message reaches preset data message size threshold value, start the token bucket, executes institute If the byte number that the token number in token bucket is equal to or more than the data message is stated, from the buffer queue described in reading Data message and the step of send.
Above scheme is lower than pre-set user request frequency threshold value in the request frequency of user, and the repetitive requests frequency of order is low In default order repetitive requests frequency threshold, and when the request frequency of IP address is lower than preset IP address request frequency threshold value, The data message that client is sent is emitted in buffer queue, client is avoided the occurrence of and is attacked or temporary fault Caused malice sends datagram phenomenon, while the token number in token bucket is equal to or more than the byte of above-mentioned data message When number, above-mentioned data message is just read from buffer queue and is sent, shaping and speed limit are carried out to data stream, avoid that network occurs Congestion, guarantees that business is normally carried out, and provides good service for user.
The terminal device 80 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 800, memory 801.It will be understood by those skilled in the art that Fig. 8 is only the example of terminal device 80, does not constitute the restriction to terminal device 80, may include more more or less than illustrating Component, perhaps combine certain components or different components, such as the terminal device can also be set including input and output Standby, network access equipment, bus etc..
Alleged processor 800 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 801 can be the internal storage unit of the terminal device 80, such as the hard disk of terminal device 80 Or memory.The memory 801 is also possible to the External memory equipment of the terminal device 80, such as on the terminal device 80 The plug-in type hard disk of outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) Card, flash card (Flash Card) etc..Further, the memory 801 can also be both interior including the terminal device 80 Portion's storage unit also includes External memory equipment.The memory 801 is for storing the computer program and the terminal Other programs and data needed for equipment.The memory 801, which can be also used for temporarily storing, have been exported or will be defeated Data out.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, Such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and electricity Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of data control method, which is characterized in that the method is applied to payment gateway, which comprises
The data message that client is sent is received, the data message carries internet protocol address, user identifier and order Mark;
The request frequency that the user identifier corresponds to user is obtained, the order note identification corresponds to the repetitive requests frequency of order, with And the request frequency of the IP address;
If the request frequency of the user is lower than pre-set user request frequency threshold value, the repetitive requests frequency of the order is lower than pre- If order repetitive requests frequency threshold, and the request frequency of the IP address is lower than preset IP address request frequency threshold value, then will The data message is emitted in buffer queue;
If the token number in token bucket is equal to or more than the byte number of the data message, institute is read from the buffer queue It states data message and sends, and the corresponding numerical value of the byte number that the token number in the token bucket is reduced into the data message.
2. data control method as described in claim 1, which is characterized in that further include:
The data message in the buffer queue is carried out according to the dispatching priority of data message each in the buffer queue Sequence, the reading order of data message in the buffer queue is determined according to ranking results.
3. data control method as described in claim 1, which is characterized in that further include:
If the token number in token bucket is less than the byte number of the data message, judge whether the buffer queue has expired;
If the buffer queue is less than, continue for the data message to be emitted in the buffer queue, waits new order to be generated Board, and new token demand number is generated according to the byte number of token number and the data message in the token bucket and is prompted.
4. data control method as described in claim 1, which is characterized in that further include:
If the request frequency of the user reaches the pre-set user request frequency threshold value, the repetitive requests frequency of the order reaches Request frequency to the default order repetitive requests frequency threshold or the IP address reaches the preset IP address request Frequency threshold then stops operation, and generates alarm prompt.
5. data control method as described in claim 1, which is characterized in that further include:
Token bucket enabled instruction is received, the token bucket is started according to the token bucket enabled instruction, if executing the token bucket In token number be equal to or more than the data message byte number, then the data message is read from the buffer queue simultaneously The step of transmission;
Or
If the client sends the time of the data message within a preset period of time, start the token bucket, executes institute If the byte number that the token number in token bucket is equal to or more than the data message is stated, from the buffer queue described in reading Data message and the step of send;
Or
If the size of the data message reaches preset data message size threshold value, start the token bucket, if executing described Token number in token bucket is equal to or more than the byte number of the data message, then the data are read from the buffer queue Message and the step of send.
6. a kind of data control unit characterized by comprising
Data message receiving unit, for receiving the data message of client transmission, the data message carries IP address, user Mark and order note identification;
Request frequency acquiring unit, the request frequency of user is corresponded to for obtaining the user identifier, and the order note identification is corresponding The repetitive requests frequency of order and the request frequency of the IP address;
Data message cache unit, it is described to order if the request frequency for the user is lower than pre-set user request frequency threshold value Single repetitive requests frequency is lower than default order repetitive requests frequency threshold, and the request frequency of the IP address is lower than default IP The data message is then emitted in buffer queue by Address requests frequency threshold;
Data message transmission unit, if being equal to or more than the byte number of the data message for the token number in token bucket, The data message is read from the buffer queue and is sent, and the token number in the token bucket is reduced into the datagram The corresponding numerical value of byte number of text.
7. data control unit as claimed in claim 6, which is characterized in that further include:
Data message sequencing unit, for according to the dispatching priority of data message each in the buffer queue to the caching Data message in queue is ranked up, and the reading order of data message in the buffer queue is determined according to ranking results.
8. data control unit as claimed in claim 6, which is characterized in that further include:
Buffer queue judging unit judges institute if being less than the byte number of the data message for the token number in token bucket State whether buffer queue has expired;
Token number prompt unit continues for the data message to be emitted on described slow if less than for the buffer queue It deposits in queue, waits new token to be generated, and generate according to the byte number of token number and the data message in the token bucket New token demand number prompt.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 5 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201880000850.8A 2018-07-20 2018-07-20 data control method and terminal device Pending CN109076024A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/096419 WO2020014954A1 (en) 2018-07-20 2018-07-20 Data control method and terminal device

Publications (1)

Publication Number Publication Date
CN109076024A true CN109076024A (en) 2018-12-21

Family

ID=64789378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880000850.8A Pending CN109076024A (en) 2018-07-20 2018-07-20 data control method and terminal device

Country Status (3)

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

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417888A (en) * 2019-07-30 2019-11-05 中国工商银行股份有限公司 Flow control methods, volume control device and electronic equipment
CN111897838A (en) * 2020-06-28 2020-11-06 中国建设银行股份有限公司 Transaction query method and device, electronic equipment and readable storage medium thereof
CN112396420A (en) * 2020-12-11 2021-02-23 四川长虹电器股份有限公司 System and method for automatically processing repeated payment
CN112752307A (en) * 2021-01-04 2021-05-04 欧普照明股份有限公司 Control method, data processing apparatus, control system, and storage medium
CN113794672A (en) * 2020-06-12 2021-12-14 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN114567674A (en) * 2022-02-25 2022-05-31 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and readable storage medium
CN112134808B (en) * 2020-07-21 2024-02-02 上海寻梦信息技术有限公司 Method and device for issuing bin allocation service speed control, electronic equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382321B (en) * 2020-03-19 2023-10-27 上海连尚网络科技有限公司 Method and equipment for requesting cache materials
CN112436943B (en) * 2020-10-29 2022-11-08 南阳理工学院 Request deduplication method, device, equipment and storage medium based on big data
CN113225263B (en) * 2021-04-20 2022-10-11 新华三半导体技术有限公司 Flow request processing method and device and network chip
CN113691627B (en) * 2021-08-25 2022-09-27 杭州安恒信息技术股份有限公司 Control method, device, equipment and medium for SOAR linkage equipment
CN113722097B (en) * 2021-08-27 2024-04-19 北京天融信网络安全技术有限公司 Surge protection method and device, electronic equipment and storage medium
CN114615203A (en) * 2022-01-30 2022-06-10 阿里云计算有限公司 Access control method, device, storage medium and processor
CN115174485A (en) * 2022-05-27 2022-10-11 中国经济信息社有限公司 Play control management method, system, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968147A (en) * 2006-11-27 2007-05-23 华为技术有限公司 Service processing method, network device, and service processing system
US20130246334A1 (en) * 2011-12-27 2013-09-19 Mcafee, Inc. System and method for providing data protection workflows in a network environment
CN106470204A (en) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 User identification method based on request behavior characteristicss, device, equipment and system
CN107342947A (en) * 2016-04-28 2017-11-10 华为技术有限公司 Flow shaping method, controller, the network equipment and traffic shaping system
CN107391268A (en) * 2016-05-17 2017-11-24 阿里巴巴集团控股有限公司 service request processing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420773A (en) * 2012-01-05 2012-04-18 北京网御星云信息技术有限公司 Token-bucket-algorithm-based data transmission method and traffic control device
CN104331296B (en) * 2014-11-25 2017-04-26 北京奇虎科技有限公司 transaction information processing method, device and system
CN105162793A (en) * 2015-09-23 2015-12-16 上海云盾信息技术有限公司 Method and apparatus for defending against network attacks
CN106411773B (en) * 2016-08-29 2018-10-23 武汉微创光电股份有限公司 Flow shaping method in transmission of video based on token bucket and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968147A (en) * 2006-11-27 2007-05-23 华为技术有限公司 Service processing method, network device, and service processing system
US20130246334A1 (en) * 2011-12-27 2013-09-19 Mcafee, Inc. System and method for providing data protection workflows in a network environment
CN106470204A (en) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 User identification method based on request behavior characteristicss, device, equipment and system
CN107342947A (en) * 2016-04-28 2017-11-10 华为技术有限公司 Flow shaping method, controller, the network equipment and traffic shaping system
CN107391268A (en) * 2016-05-17 2017-11-24 阿里巴巴集团控股有限公司 service request processing method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417888A (en) * 2019-07-30 2019-11-05 中国工商银行股份有限公司 Flow control methods, volume control device and electronic equipment
CN113794672A (en) * 2020-06-12 2021-12-14 北京沃东天骏信息技术有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN111897838A (en) * 2020-06-28 2020-11-06 中国建设银行股份有限公司 Transaction query method and device, electronic equipment and readable storage medium thereof
CN112134808B (en) * 2020-07-21 2024-02-02 上海寻梦信息技术有限公司 Method and device for issuing bin allocation service speed control, electronic equipment and storage medium
CN112396420A (en) * 2020-12-11 2021-02-23 四川长虹电器股份有限公司 System and method for automatically processing repeated payment
CN112752307A (en) * 2021-01-04 2021-05-04 欧普照明股份有限公司 Control method, data processing apparatus, control system, and storage medium
CN114567674A (en) * 2022-02-25 2022-05-31 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and readable storage medium
CN114567674B (en) * 2022-02-25 2024-03-15 腾讯科技(深圳)有限公司 Data processing method, device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
PH12020550861A1 (en) 2021-05-17
WO2020014954A1 (en) 2020-01-23

Similar Documents

Publication Publication Date Title
CN109076024A (en) data control method and terminal device
CN108540536B (en) Block chain-based network mass service processing method, equipment and storage medium
CN109962855A (en) A kind of current-limiting method of WEB server, current-limiting apparatus and terminal device
CN109150904A (en) Interface service call method and terminal device
CN109189509A (en) The response method and server that call method, the interface of interface call
CN109254854A (en) Asynchronous invoking method, computer installation and storage medium
CN111708637A (en) Data processing method and device and computer readable medium
CN110555079A (en) Data processing method, device, equipment and storage medium
CN113329069A (en) Instant messaging method, system and computing equipment
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
JP5479710B2 (en) Processor-server hybrid system and method for processing data
CN105933270B (en) A kind of processing method and processing device of cloud encryption equipment
CN110363638A (en) The method for processing business, device and electronic equipment of non-targeted user in financial business
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN114328731A (en) Information processing method, device, electronic equipment and storage medium
CN113726885A (en) Method and device for adjusting flow quota
CN111144977A (en) Stock order processing method and device
CN109542646A (en) Method and apparatus for calling application programming interface
CN114448703B (en) Request processing method, request processing device, electronic equipment and storage medium
US20230051532A1 (en) Pipelined credit checking
CN115129654B (en) Market quotation snapshot processing method and related device
CN110262756B (en) Method and device for caching data
CN111629038B (en) Virtual resource sharing processing method and device, server and storage medium
CN115002133B (en) Data transmission determining method and device based on multiple interfaces
CN111432357B (en) Information processing method and system and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181221