CN109802895B - Data processing system, method and token management method - Google Patents
Data processing system, method and token management method Download PDFInfo
- Publication number
- CN109802895B CN109802895B CN201711138960.4A CN201711138960A CN109802895B CN 109802895 B CN109802895 B CN 109802895B CN 201711138960 A CN201711138960 A CN 201711138960A CN 109802895 B CN109802895 B CN 109802895B
- Authority
- CN
- China
- Prior art keywords
- token
- tokens
- unit
- service
- management unit
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/108—Network architectures or network communication protocols for network security for controlling access to devices or network resources when the policy decisions are valid for a limited amount of time
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/06—Network architectures or network communication protocols for network security for supporting key management in a packet data network
- H04L63/068—Network architectures or network communication protocols for network security for supporting key management in a packet data network using time-dependent keys, e.g. periodically changing keys
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- Accounting & Taxation (AREA)
- Signal Processing (AREA)
- Finance (AREA)
- Computer Networks & Wireless Communication (AREA)
- Strategic Management (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Development Economics (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Marketing (AREA)
- Economics (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a data processing system, a method and a token management method, wherein the data processing system comprises: the system comprises a business unit, a token management unit and a processing unit, wherein the business unit is used for sending a token acquisition request to the token management unit so as to obtain the token and then provide business data to the processing unit for processing; the token management unit is used for managing at least one token set and maintaining the number of tokens in the token set according to a specified rule; the token management unit sends the tokens in the token set to a service unit sending the token acquisition request under the condition of receiving the token acquisition request; the processing unit is used for processing the service data provided by the service unit with the token according to a specified processing rule. The data processing system provided by the specification limits the speed of data flow in a network, reduces the possibility of system overload, and improves the performance of data processing.
Description
Technical Field
The present disclosure relates to the field of computer network technologies, and in particular, to a data processing system, a method and a token management method.
Background
In the context of large data, the throughput of network data is increasingly large, which may cause overload of the network system and network congestion.
For a network system, there may be multiple service units in the system, where each service unit may be a physical machine or a virtual machine installed on a physical machine. These service units may run in parallel, there may be multiple service units or multiple processes of the same service unit initiating concurrent access to the same resource at the same time, and if not controlling it, the ability of the system to process data will be affected.
Disclosure of Invention
An object of embodiments of the present specification is to provide a data processing system, a method, and a computer storage medium. The method can perform flow shaping and rate limitation in the flow input and output links.
The embodiment of the specification provides a data processing system, which comprises a business unit, a token management unit and a processing unit, wherein the business unit is used for sending a token acquisition request to the token management unit so as to obtain the token and then provide business data to the processing unit for processing; the token management unit is used for managing at least one token set and maintaining the number of tokens in the token set according to a specified rule; the token management unit sends the tokens in the token set to a service unit sending the token acquisition request under the condition of receiving the token acquisition request; the processing unit is used for processing the service data provided by the service unit with the token according to a specified processing rule.
The embodiment of the specification provides a data processing method, which is applied to a service unit; the method comprises the following steps: the service unit sends a token acquisition request to the token management unit; receiving a token fed back by the token management unit; the token management unit manages at least one token set and maintains the number of tokens in the token set according to a specified rule; providing the service data and the token to a processing unit; and the processing unit processes the service data with the token according to a specified processing rule.
The embodiment of the specification provides a data processing method, which is applied to a token management unit; the method comprises the following steps:
receiving a token acquisition request sent by a service unit; sending the token in the token set to the business unit, so that the business unit provides the token and the business data to a processing unit; the processing unit processes service data provided by the service unit with the token; wherein the number of token sets is at least one, the number of tokens in the token set being maintained in accordance with a specified rule.
The embodiment of the specification provides a data processing method, which is applied to a processing unit and comprises the following steps: receiving a service processing request of a service unit; processing the business data attached to the business processing request according to a specified processing rule under the condition that the business processing request has a token; wherein the service unit obtains the token from a token management unit.
The embodiment of the specification provides a token management method, which is applied to a token management unit, wherein the token management unit maintains at least two token sets; the method comprises the following steps: selecting one of said token sets; comparing the token set with the adjacent token set in terms of token quantity, and increasing the specified quantity of tokens in the token set with less quantity; or comparing the token set with the adjacent token set in terms of token number, and reducing the specified number of tokens in the token set with a larger number.
As can be seen from the technical solutions provided by the embodiments of the present specification, in the embodiments of the present specification, a token is sent to a service unit by a token management unit, and when the service unit obtains the token, a processing unit processes service data of the service unit, so that a speed of data traffic in a network is limited, a data traffic output rate is adjusted, a possibility of system overload is reduced, and efficiency and performance of service data processing are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of embodiments of the specification, are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the principles of the specification. It should be apparent that the drawings in the following description are merely some embodiments of the present description, and that other drawings may be obtained from these drawings by those skilled in the art without inventive exercise. In the drawings:
FIG. 1 is a schematic workflow diagram of a data processing system provided by an embodiment of the present description;
FIG. 2 is a block diagram of a data processing system in accordance with an embodiment of the present description;
FIG. 3 is a schematic diagram of an example scenario of a data processing system provided in an embodiment of the present description;
FIG. 4 is a diagram illustrating an example scenario for replenishing and consuming tokens with only one token set provided by embodiments of the present specification;
FIG. 5 is a diagram illustrating an example scenario for replenishing and consuming tokens when there are multiple token sets provided by an embodiment of the present specification;
fig. 6 is a schematic workflow diagram of a data processing method applied to a service unit according to an embodiment of the present disclosure;
fig. 7 is a schematic workflow diagram of a data processing method applied to a token management unit according to an embodiment of the present specification;
fig. 8 is a schematic workflow diagram of a data processing method applied to a processing unit according to an embodiment of the present specification;
fig. 9 is a schematic workflow diagram of a token management method according to an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art without any inventive work based on the embodiments in the present specification shall fall within the protection scope of the present specification.
Referring to fig. 1 and 2, an embodiment of the present disclosure provides a data processing system including a service unit 20, a token management unit 22, and a processing unit 24.
In this embodiment, the data processing system may be a system in which hardware or software components are distributed on different networked computers or networked hardware devices, and can communicate and coordinate with each other through message passing. More common computers can be adopted to provide services to the outside. The more computers, the more CPUs, memories, storage resources, etc., the greater the amount of concurrent access that can be handled.
In the present embodiment, the service unit 20 sends a token acquisition request to the token management unit 22, as shown in step S10 in fig. 1. The service unit 20 is configured to send a token obtaining request to the token management unit 22, so as to obtain the token and then provide service data to the processing unit 24 for processing.
In this embodiment, the service unit 20 may include a network node device having data to be processed in the network and having a network address and software necessary for driving the hardware device to operate. Of course, the service unit 20 may also be a hardware device with data processing capability only, or only software running in a hardware device. Network data communication with the network node device is possible via the network address. The service unit 20 includes: workstations, servers, computers, user terminals, other network devices, and service unit 20 may provide a network interface for data interaction. The service unit 20 may exchange data information in compliance with a network communication protocol.
In this embodiment, the service unit 20 may implement a certain service function, and obtain a token from the token management unit 22, and provide the service data to the processing unit for processing 24 after obtaining the token, so as to implement the service function.
In this embodiment, the token may be data conforming to a certain format, which is used to represent a certain right. After the service unit 20 has obtained the token, it has the rights indicated by the token, so that resource access can be made on the basis of the rights. When data information is sent from one network node to another, only the network node that obtained the token has the right to send the data.
In this embodiment, the token obtaining request may be a character string or a code satisfying a communication protocol and following a certain format, which is used to indicate that the service unit 20 issuing the token obtaining request requests to obtain a corresponding token.
In this embodiment, the token management unit 22 is configured to manage at least one token set, and maintain the number of tokens in the token set according to a specified rule; the token management unit 22, upon receiving the token obtaining request, sends the tokens in the token set to the service unit 20 that issued the token obtaining request.
In this embodiment, the token management unit 22 may be a server or another electronic device. The token management unit 22 may include a hardware device having a data information processing function and software necessary for driving the hardware device to operate. Of course, the token management unit 22 may be only a hardware device with data processing capability, or only software running in the hardware device. The token management unit 22 may be provided with an interface through which data interaction may take place. The token management unit 22 may perform network data information interaction based on the network communication protocol. The token management unit 22 is preset with a certain number of tokens.
In this embodiment, the token set may be a set of the tokens in the token management unit 22. When the token management unit 22 receives a token acquisition request sent by the service unit 20, the token management unit 22 may take at least one token from one token set of the at least one token set to allocate to the service unit 20, so as to ensure that all service units 20 corresponding to a plurality of token acquisition requests can acquire tokens.
In this embodiment, the token set may have a maximum token number limit. The maximum token number of the token set is less than or equal to the capacity of the processing unit for processing the service data, and if the maximum token number is greater than the capacity of the processing unit 24 for processing the service data, the service data for obtaining the token is greater than the processing capacity of the processing unit 24, so that some service data cannot be processed, and the effect of limiting the current cannot be achieved.
In the present embodiment, the token management unit 22 may maintain the number of tokens in the token set according to a predetermined rule, which may be set in advance or may be set according to the current network status. When the number of token sets satisfies at least one specified rule, the token sets are supplemented with tokens by the token management unit 22. By specifying rules to maintain the number of tokens in the token set, the processing unit 24 can process the traffic data at a predetermined rate and manner or change the processing rate and manner according to the current network condition to adapt to the current network condition, so as to maintain the network condition within a controllable range.
In this embodiment, specifying a rule may include: adding a specified number of tokens to the token set at specified intervals; after the service unit 20 has obtained tokens for use, the token management unit 22 adds a corresponding number of tokens to the token set.
In this embodiment, sending the tokens in the token set to the service unit 20 that issued the token obtaining request may include, as shown in step 11 in fig. 1, the token management unit 22 receiving the token obtaining request. After the token management unit 22 receives the token obtaining request sent by the service unit 20, as shown in step 12 in fig. 1, the token management unit 22 checks whether the number of tokens in the token set is greater than the token obtaining amount, and the token management unit 20 may check the number of tokens in the at least one token set currently and compare the number with the token obtaining amount sent by the service unit 20. If the token management unit 22 currently has the number of tokens in the at least one token set greater than the token acquisition amount sent by the service unit, as shown in step S13 in fig. 1, the token is sent to the service unit 20. In particular, a corresponding number of tokens may be deducted from the set of tokens, which are sent to the traffic unit 20 according to the network address of the traffic unit 20 requesting the token. If the current total token number of the token management unit 22 is smaller than the token obtaining amount sent by the service unit 20, as shown in step S15 in fig. 1, the service unit waits for the token management unit to supplement the token. Specifically, the token management unit 22 may feed back information to the service unit 20, and queue an acquisition request sent by the service unit 20 in a request queue, to wait for the token management unit 22 to supplement a token; the token obtaining request may also be put into a request queue, and when the token set has a token, the notification information is sent to the service unit 20 corresponding to the token obtaining request, so as to notify the service unit 20 to resend the token obtaining request. After the token management unit completes token supplementation, as shown in step S16 in fig. 1, the token management unit sends the token to the service unit 20, and specifically, the token management unit 22 may send the token to the service unit 20 according to the network address of the service unit 20 that requests the token.
In this embodiment, the processing unit 24 is configured to process the service data provided by the service unit 20 having the token according to a specified processing rule.
In this embodiment, the processing unit 24 may include a server capable of processing parallel data or other electronic devices and software necessary for driving hardware devices to operate. Of course, the process may also be a hardware device having data processing capability only, or software running in a hardware device only. The parallel data may be a set of processing units contained within a server or other electronic device, each processing unit storing one or more data elements. When the machine executes sequential programs, it may operate concurrently with all or a portion of the data stored in the internal processing units. The processing unit 24 may be provided with an interface through which data interaction may take place. The processing unit can perform network data information interaction based on the network communication protocol.
Specifically, the processing unit 24 may be a gateway, and in the message delivery process, at least one service unit 20 simultaneously sends a message to the user terminal, and by calling a gateway interface, the gateway repacks the message sent by at least one service unit 20 and sends the repackaged message to the user terminal; the processing unit 24 may also be a search engine, and a user inputs search information through a user terminal, and a thread executing a search task calls a search engine interface, and the search engine searches for corresponding information. Of course, other modifications can be made by those skilled in the art in light of the technical spirit of the present disclosure, and the processing unit 24 can also process other business functions, but the scope of the present disclosure should be covered as long as the achieved functions or effects are the same or similar to the present disclosure.
In the present embodiment, the specified processing rule may be preset or may be changed according to the current network status. As shown in steps S14 and S17 in fig. 1, the service unit 24 processes the service data, and when the service data provided by the service unit 24 satisfies at least one preset specified processing rule, the service data is processed. The specified processing rule may include that, when the service data provided by the service unit 20 includes a token, the processing unit 24 processes the service data; when a plurality of service data with different priorities and containing tokens arrive at the same time, the service data with high priority is processed preferentially.
Referring to FIG. 3, in an exemplary scenario, a data processing system is configured as a platform server, a token server, and a message delivery gateway.
In the example of the scenario, the platform is to organize the time-limited promotional program, and when the time-limited promotional program has not started, the platform server is to send the information related to the time-limited promotional program to the mobile phone of the registered member of the platform in the form of a short message.
In this scenario example, the number of short messages to be sent by the platform server is 20 ten thousand, an interface of the information sending gateway needs to be called to send the 20 ten thousand short messages to the mobile phone of the registered member in the process of sending the 20 ten thousand short messages, in addition, the platform server needs to send a token obtaining request to the token server to obtain the token, so that the 20 ten thousand short messages can be sent to the mobile phone of the registered member through the information sending gateway, and the platform server specifies that the token obtaining request is not sent to the token server any longer when no short message needs to be sent.
In the present scenario example, the capability of the information delivery gateway to process and deliver a short message to the registered member's handset is 2 ten thousand per second.
In the present scenario example, the token server manages 1 token set, and this token set contains 2 ten thousand tokens, and the token server sets to replenish the token set with tokens every 1 second, and the capacity of the token set is replenished every time.
In this scenario example, the token server receives 20 ten thousand token acquisition requests sent by the platform server, queries that 2 ten thousand tokens exist in the token set, sends the 2 ten thousand tokens to the platform server, sends feedback information to the platform server, notifies the platform server that the number of tokens in the current token set is 0, and allows the platform server to send 2 ten thousand token acquisition requests every 1 second after receiving the tokens until data processing is completed. And after the token and the feedback information are sent, the token supplementing unit starts to supplement the token. After receiving 2 ten thousand tokens and feedback information sent by the token server, the service server randomly distributes the received 2 ten thousand tokens to 2 ten thousand threads for executing short message sending tasks, each thread executes 1 short message sending task, the 2 ten thousand threads simultaneously call an interface of an information sending gateway, and the information sending gateway sends the 2 ten thousand short messages to a mobile phone of a registered member.
In the example of the scenario, the platform server sends 2 ten thousand token acquisition requests to the token server 1 second after receiving the token, the token server sends 2 ten thousand supplementary tokens to the platform server, the platform server distributes the 2 ten thousand tokens to 2 ten thousand threads for executing the short message sending task at random again, and the threads call the information sending gateway interface and send out 2 ten thousand short messages to the mobile phone of the registered member. After repeating for 8 times again, 20 ten thousand short messages are sent to the mobile phone of the registered member.
In this scenario example, only after the service unit obtains the token from at least one token set of the token management unit, the service data provided by the service unit is processed by the processing unit, so that the situation of network congestion and data packet loss caused by network data transmission can be reduced, and the network traffic can be further controlled by controlling the token replenishment rate of the token set.
Referring to FIG. 4, in one example scenario, a data processing system is configured with a plurality of mobile terminals, a token server, and a search engine.
In this scenario example, there are 3 users who send search requests for searching for world cup information through the mobile terminal, and the search engine responds to and processes these search requests to search for world cup information.
In this scenario, a user sends a token acquisition request to a token server through a mobile terminal, the token server takes out a token from a token set managed by the token server and sends the token to a corresponding mobile terminal, and after the mobile terminal acquires the token, a search engine processes a search request sent by the mobile terminal.
In this scenario example, the token server manages 1 token set, the maximum number of tokens in the token set is 2 tokens, and 2 tokens are set to be added at intervals of 1 second, and if the number of tokens reaches the maximum number of tokens, the addition is not performed, and if the number of tokens does not reach the maximum number of tokens, the addition is continued.
In this scenario example, 3 users search for world cup information through mobile terminals, the 3 user terminals successively send token obtaining requests for obtaining 1 token to the token server, 2 token obtaining requests arrive at the token server at the same time, the token server takes out 2 tokens from the token set, respectively sends the 2 tokens to the mobile terminals sending the two token obtaining requests, and supplements the tokens after 1 second. The search request for searching for the world cup information transmitted from the 2 mobile terminals that obtain the token is processed by the search engine, and the two users obtain the world cup information through the search engine.
In this scenario example, the 3 rd token obtaining request reaches the token server after the first 2 token obtaining requests reach the token server, no token exists in the token set managed by the token server, the token server feeds back information to the mobile terminal that sends the third token obtaining request, and notifies the third mobile terminal to send the token obtaining request again after 1 second, the third mobile terminal sends the token obtaining request again after 1 second, the token server takes out 1 token from 2 tokens in the token set after receiving the token obtaining request and distributes the token to the mobile terminal, and the token server supplements the token again after 1 second. After the token is obtained, a search request for searching for the world cup information sent by the third mobile terminal is processed by the search engine, and the user obtains the world cup information through the search engine. Then, no user terminal sends a token acquisition request again, the token set managed by the token server always has 2 tokens, and the tokens are not replenished under the condition that the tokens are not consumed.
Referring to FIG. 5, in one example scenario, a data processing system is structured with a plurality of mobile terminals, a token management unit, and a search engine.
In this embodiment, 1 user sends a search request for searching for world cup information through the mobile terminal, and the search engine responds to and processes the search request to search for world cup information.
In this scenario, a user sends a token acquisition request to a token server through a mobile terminal, the token server takes out a token from a token set managed by the token server and sends the token to a corresponding mobile terminal, and after the mobile terminal acquires the token, a search engine processes a search request sent by the mobile terminal.
In this scenario example, the token server manages 5 token sets, the maximum number of tokens of the 5 token sets is 10, 7, 9, 4, 8, the current number of tokens of each token set is 9, 6, 8, 3, 7, and the current number of tokens is numbered for the 5 token sets. And setting 1 token to be added at intervals of 1 second, if the number of tokens reaches the maximum number of tokens, adding the tokens no longer, and if the number of tokens does not reach the maximum number of tokens, continuing adding the tokens.
In the example of the scene, 1 user searches for world cup information through a mobile terminal, the mobile terminal firstly sends a token acquisition request for requesting to acquire 1 token to a token server, the token acquisition request simultaneously reaches the token server, the token server randomly selects a token set 2, inquires the number of tokens in the token set, 1 token is taken out from 6 tokens in the token set 2 and sent to the mobile terminal of the user, after the mobile terminal acquires the token, the sent search request is processed by a search engine, and the user acquires the search result of the world cup information.
In this scenario example, if the number of tokens in the selected token set 2 is 0, the token server queries 9 tokens and 8 tokens in the token set 1 and the token set 3 that are adjacent to the token set 2 in front and back, respectively, the token server selects to take out 1 token from the token set 1 and send the token to the mobile terminal, after the mobile terminal obtains the token, the sent search request is processed by the search engine, and the user obtains the search result of the world cup information.
In this scenario example, the token server adds 1 token per second, randomly selects one token set, selects token set 3, and has 8 tokens in token set 3, and the token server queries the numbers of tokens in token set 2 and token set 4 that are adjacent to the front and back of token set 3, where the numbers of tokens in token set 4 are the minimum and the number of tokens in token set 4 does not reach the maximum number of tokens, and adds 1 token to token set 4.
In one embodiment, the token obtaining request is sent to the token management unit only after the service unit has service data that needs to be processed by the processing unit.
In this embodiment, when a service unit has service data to be processed by the processing unit, the service unit may send a token acquisition request to the token management unit, so as to acquire a token from the token management unit; when the service unit does not have data which needs to be processed by the processing unit, the service unit cannot send a token acquisition request to the token management unit, and further cannot acquire a token.
In this embodiment, by limiting the manner in which the service unit sends the token acquisition request to the token management unit, that is, only when the service unit has service data that needs to be processed by the processing unit, the service unit may send the token acquisition request to the token management unit, so that token allocation efficiency is improved, and network resource waste caused by that when the service unit that has service data that needs to be processed needs a token, no token is available in a token set, and the service unit that has no service data that needs to be processed has an idle token is reduced.
In one embodiment, the business unit includes a plurality of tasks having different task priorities; tasks with a given task priority can send the token acquisition request to the token management unit before having traffic data.
In this embodiment, the service unit includes a plurality of tasks. The service unit may implement a certain service function, and the implementation of the service function requires the service unit to perform a plurality of different tasks. The service unit is provided with threads for executing different tasks, at least one corresponding service data can be distributed to different threads for execution, and the threads acquire tokens from the token management unit or/and call a processing unit interface to enable the processing unit to process the service data so as to realize a service function.
In the present embodiment, the plurality of tasks have different task priorities. The service unit may have threads for executing different tasks, and the corresponding service data may be allocated to different threads for execution, and the service unit sets different priorities for different task threads, where the service data in the thread with the higher priority may be preferentially executed.
In this embodiment, the assigned priority may be preset, and when a task meets a preset priority requirement, a thread executing the task may give priority to other threads, and a token obtaining request may be sent by the token management unit before the service data required to be processed by the processing unit is generated.
Specifically, for example, the platform server pushes a message to a user client, the user client may be divided into a VIP user and a general user, and the platform server sets a thread for executing VIP user message pushing as a high priority and sets a thread for executing general user message pushing as a low priority. The thread executing the VIP user message pushing can send a token acquisition request to the token management unit in advance before the message pushing is carried out, and can immediately acquire the token when the token has the service data, so that the message pushed to the VIP user can be guaranteed to be processed preferentially.
In this embodiment, by setting different priorities for different tasks of the service unit, the task with the designated priority may send the token acquisition request to the token management unit before having service data. Important service data can be preferentially processed, the possibility that the important service data is lost is reduced, and the efficiency and the performance of data processing are further improved.
In one embodiment, the service units have different service priorities therebetween; the task of the service unit with the assigned service priority can send the token acquisition request to the token management unit before having the service data.
In this embodiment, the service units have different service priorities. Different service functions can be realized for different service units, the realization of the service functions requires to execute certain tasks, and the service units are provided with at least one thread for executing the tasks. Different service functions to be implemented by different service units may have different priorities, and thus different priorities are set for different service units. Corresponding service data can be allocated to the execution thread of each corresponding service unit for execution, wherein the service data in the thread with high priority can be executed preferentially.
In this embodiment, the specified service priority may be preset, when a service unit meets a preset priority requirement, a thread executing service data of the service unit may prioritize other threads, and a token acquisition request may be sent to the token management unit before the service data that needs to be processed by the processing unit is generated.
Specifically, for example, a user accesses a website through a user terminal, the user may be divided into a VIP user and a general user, and in the case of a large website access amount, the VIP user logs in the user terminal, and at this time, the user terminal sets priority information with a high priority in a thread for executing a website access task; and the common user logs in the user terminal, and the user terminal is provided with priority information with low priority in a thread for executing website access. The VIP user terminal executes the thread of website access, the token acquisition request can be sent to the token management unit before the user accesses the website, and the ordinary user terminal can only send the token acquisition request to the token management unit when the user accesses the website, so that the VIP user can access the website preferentially.
In this embodiment, by setting different priorities for the service units, the service unit with the designated service priority may send the token acquisition request to the token management unit before having service data. The method and the device ensure that the service data of the important service unit can be processed preferentially, reduce the possibility that the service data of the important service unit is lost, and further improve the efficiency and the performance of data processing.
In one embodiment, the specified rules include at least one of: adding a specified number of tokens to the token set at specified intervals; or, after the service unit uses the obtained token, the token management unit adds a corresponding number of tokens to the token set.
In this embodiment, the specified time may be set in advance or may be set according to the current network condition, and the token management unit adds tokens to the token set every time the specified time elapses. The specified time may be constant or variable.
Specifically, the token management unit is preset, and a certain number of tokens are added to the token set every 2 seconds; or the token management unit is preset, the tokens are supplemented to the token set at intervals of 2 seconds after the tokens are sent to the service unit for the first time, the tokens are supplemented to the token set at intervals of 5 seconds after the tokens are sent to the service unit for the second time, and the tokens are supplemented at intervals of different times after the tokens are sent to the service unit each time; or when the network data needing to be processed is more, the token set is supplemented with the tokens at intervals of 1 second, and when the network data needing to be processed is less, the specified time is adjusted, and the token set is supplemented at intervals of 5 seconds.
In this embodiment, the predetermined number may be set in advance or may be set according to a current network condition, and the token management unit may add the predetermined number of tokens to the token set every predetermined time interval. The specified number may be constant or variable.
Specifically, the token management unit is preset, and 2 tokens are added to the token set every 2 seconds, and two tokens are added each time no matter how long the token issuing interval time is; or the token management unit is preset, 2 tokens are supplemented to the token set at intervals of 2 seconds after the tokens are sent to the service unit for the first time, 5 tokens are supplemented to the token set at intervals of 5 seconds after the tokens are sent to the service unit for the second time, and different numbers of tokens are sent at intervals of different time after the tokens are added to the token set each time; or when the network data needing to be processed is more, 5 tokens are supplemented each time, and when the network data needing to be processed is less, the appointed number is adjusted, and 1 token is supplemented each time.
In this embodiment, the token management unit sets in advance or according to the current acquired network condition, and after the service unit acquires and uses the token acquired from the token management unit, the token management unit supplements how many tokens to the token set.
Specifically, the token management unit sends 5 tokens to the service unit, and the service unit uses all the 5 tokens, and then the token management unit supplements 5 tokens to the token set.
In this embodiment, a token management unit supplements tokens to the token set by specifying a certain rule. According to the network condition, the rate and the quantity of token supplement are controlled, the shaping of network flow is further perfected, and network congestion is avoided.
In one embodiment, adding tokens to the set of tokens is stopped when the number of tokens in the set of tokens reaches a maximum number of tokens.
In this embodiment, the number of the token sets may reach the maximum number of tokens, where the token sets have a number threshold, and the threshold is the maximum capacity of the token set. The threshold number of tokens must be less than or equal to the maximum processing capacity of the processing unit, otherwise it cannot serve as a current limit.
In this embodiment, the token management unit may preset that when the number of tokens in the token set reaches the maximum number of tokens, no token is supplemented to the token set any more no matter any token supplementing rule is satisfied. And supplementing the token set with the token only when the number of the tokens in the token set does not reach the maximum token number of the token and meets a preset token supplementing rule.
In this embodiment, the token management unit is restricted from supplementing the token set with tokens by setting a maximum number of tokens. Stopping the token replenishment for the token set after the token set reaches the maximum number of tokens may conserve network resources.
In one embodiment, when the token management unit receives the token obtaining request and there is no token in the token set, the token management unit processes the token obtaining request in at least one of the following manners: sending feedback information to the service unit which sends the token acquisition request so as to inform the service unit to send the token acquisition request again; or, the token acquisition request is put into a request queue, and when the token set has a token, the token is distributed to a service unit corresponding to the token acquisition request in the request queue; or, the token acquisition request is put into a request queue, and when the token set has a token, notification information is sent to a service unit corresponding to the token acquisition request in the request queue to notify the service unit to resend the token acquisition request.
In this embodiment, the feedback information may be a character string or a code written in a fixed format, the token management unit queries the number of tokens in the current token set, and sends the feedback information to the service unit if the number of tokens in the token set is 0. Wherein, the feedback information may include: the number of tokens in the current token set, how long the interval is, the service unit may send a token acquisition request again, the number of tokens that may be requested, and the like. And informing the service unit of the failure of token acquisition, and sending time information of the token acquisition request again after a certain time interval or immediately, and the like.
Specifically, the service unit sends a token acquisition request to the token management unit, the token management unit queries the number of tokens in the current token set, the number of tokens in the current token set is 0, the token management unit sends feedback information to the service unit, notifies the service unit that the number of tokens in the current token set is 0, and notifies the service unit to send the token acquisition request to the token management unit again after 1 second.
In this embodiment, the request queue may be a buffer or a storage unit, and is configured to store the token obtaining request that is not requested to the token. The request queue obtains a request number for a token entering the request queue, and the numbering mode can comprise numbering according to the entering time; and according to the priority number of the service unit or the task sending the token obtaining request, the higher the priority, the more advanced the number, and after the token is supplemented by the token set, distributing tokens to the service units corresponding to the token obtaining request in sequence according to the numbers.
Specifically, a plurality of business units may send token obtaining requests to the token management unit at the same time, the token management unit queries the number of tokens in the current token set, when the number of tokens in the token set is 0, the token obtaining requests may be sequentially placed in a request queue according to request time and numbered, and after the token set supplements the tokens, the business units corresponding to the token obtaining requests in the request queue sequentially distribute the tokens according to the numbers.
In this embodiment, after the token set supplements the token, the token supplementing unit may sequentially send notification information to the service units corresponding to the token obtaining requests in the request queue according to the numbers, and notify the service units that the token obtaining requests may be sent again immediately or after a period of time.
In this embodiment, in the case where there are no tokens in the token set, the tokens are allocated by sending feedback information to the traffic unit and/or placing token acquisition requests in a request queue. The method and the device reduce the condition that the service data processing fails due to the fact that no token exists in the token set when the service unit sends the token acquisition request, and improve the efficiency and the stability of processing the service data.
In one embodiment, the number of token sets is plural; the specified rule includes: a token set is selected from a plurality of token sets, the token set is compared with the number of adjacent token sets, and a specified number of tokens are added to a smaller number of token sets.
In this embodiment, the token management unit may manage a plurality of token sets, and manage a plurality of token sets, thereby preventing a decrease in system reliability due to an increase in the number of times per second that the service unit reads and writes a single token set.
In the plurality of token sets, the token management unit may select one token set at random, or may select one token set directionally or according to a predetermined rule. And inquiring the current token quantity of the selected token set, and inquiring the token quantity of the token set adjacent to the front and back, or adjacent to the left and right, or adjacent to the top and bottom of the selected token set. The number of tokens in these token sets is compared, a smaller number of token sets is selected, and the smaller number of token sets is supplemented with tokens.
In this embodiment, the specified number may be preset or set according to the current network condition, and may include increasing a fixed number of tokens; increasing the number of tokens that change; increasing the number of fixed tokens at fixed intervals; increasing the number of changed tokens at fixed intervals; increasing the number of tokens by a fixed amount at intervals of varying time; the time at which the interval changes increases the number of changed tokens, etc.
In this embodiment, by managing a plurality of token sets, selecting one token set from the token sets, and comparing the number of tokens in the selected token set with the number of tokens in an adjacent token set, and supplementing the token set with a smaller number of tokens with the token set, the possibility that the token management unit assigns tokens to the service unit when selecting an empty token set after the service unit sends a token acquisition request is further reduced, and the waiting time for token acquisition is reduced.
In one embodiment, the adding of the tokens is stopped when the number of tokens in the selected token set and the adjacent token sets reaches the maximum number of tokens.
In this embodiment, the token management unit may be configured to query, after selecting a token set, the current number of tokens in the selected token set and the current number of tokens in a token set adjacent to the selected token set, and stop token replenishment regardless of whether any token replenishment rule is satisfied if the numbers of tokens in the selected token set and the token set adjacent to the selected token set reach the respective maximum token numbers.
In the present embodiment, the token management means is restricted to supplement tokens to the selected token set and the token sets adjacent to the selected token set by setting the maximum number of tokens. Stopping the token replenishment for the token set after the token set reaches the maximum number of tokens may conserve network resources.
In one embodiment, the number of token sets is plural; each token set corresponds to a maximum number of tokens; wherein the maximum number of tokens of at least part of the token sets is different from the maximum number of tokens of the other tokens.
In this embodiment, the token management unit manages a plurality of token sets, where each token set corresponds to a maximum number of tokens, and the maximum number of tokens is smaller than or equal to the service data processing capacity of the processing unit. At least one of the token sets managed by the token management unit may have a different number of tokens from the other token sets, or all of the token sets may have a different number of tokens.
Specifically, the token management unit manages 5 token sets, and the maximum token numbers in the 5 token sets are 5, 4, 6, 7 and 2 respectively, and the maximum token numbers in the token sets are different from each other.
In this embodiment, the token management unit may set the maximum token number of the plurality of token sets at will, and the total token number managed by the token management unit may be smaller than or equal to the processing capacity of the processing unit, and it is not necessary to set the maximum token number of each token set to be the same.
In one embodiment, the number of token sets is plural; the token management unit selects a token set after receiving a token acquisition request, compares the number of tokens in the token set with the number of tokens in an adjacent token set, and distributes the tokens in the token set with a large number to a service unit which sends the token acquisition request.
In this embodiment, the token management unit may compare the number of tokens of the selected token set with the number of tokens of a token set adjacent to the selected token set. And selecting a token set with a larger number of tokens from the service units, and distributing the tokens to the corresponding service units from the token set with the larger number of tokens.
In this embodiment, the number of tokens in the selected token set and the number of tokens in a token set adjacent to the selected token set are compared to each other, thereby selecting a scheme in which a token set having a large number of tokens is assigned to a corresponding service unit. The possibility that the service unit can obtain the token without waiting after sending the token acquisition request is improved, and the efficiency of processing corresponding service data is improved.
In one embodiment, the number of the token sets is multiple, the token management unit selects one token set after receiving the token obtaining request, and when the number of the tokens in the token set cannot match the token obtaining request, the token management unit allocates tokens to the service unit that issued the token obtaining request in the token set adjacent to the token set.
In this embodiment, the token management unit may select one token set to allocate tokens to the service unit after receiving the token acquisition request sent by the service unit.
In this embodiment, if the number of tokens in the selected token set is smaller than the number of tokens requested in the token obtaining request, the token management unit may query the current number of tokens in the token set adjacent to the selected token set.
In this embodiment, if one of the token sets adjacent to the selected token set satisfies the requested number of token acquisition requests, tokens are assigned to the service unit from the token set satisfying the requested number of token acquisition requests.
In this embodiment, if the adjacent token sets all satisfy the request amount of the token obtaining request, one token set may be randomly selected from the adjacent token sets, and the tokens are distributed to the service unit from the selected token set; or selecting the token set with the largest number of current tokens from the adjacent token sets, and distributing the tokens to the service unit.
In this embodiment, if none of the current token numbers of the neighboring token sets can satisfy the request amount of the token obtaining request, the service unit is notified to wait for a period of time to obtain again.
In this embodiment, the problem that the service unit cannot acquire tokens or can acquire tokens only by waiting when the token set selected by the token management unit cannot satisfy the number of requests in the token acquisition requests sent by the service unit is solved by allocating tokens to the service unit from the token set adjacent to the selected token set. Therefore, the possibility that the service unit acquires the token is further improved, and the efficiency of service data processing is improved.
In the data processing system provided in the embodiments of the present specification, a token acquisition request is sent to a token management unit by a service unit, the token management unit centrally allocates a token to the service unit from at least one token managed by the token management unit, and service data of the service unit can be processed by the processing unit in the presence of the token, so that the speed of data traffic in a network is limited, the output rate of the data traffic is adjusted, the possibility of system overload is reduced, and the processing efficiency and performance of the service data are improved.
Referring to fig. 6, an embodiment of the present disclosure provides a data processing method, where the data processing method may be applied to a service unit. The method may comprise the following steps.
Step S60: the service unit sends a token acquisition request to the token management unit.
Step S62: receiving a token fed back by the token management unit; the token management unit manages at least one token set and maintains the number of tokens in the token set according to a specified rule.
Step S64: providing the service data and the token to a processing unit; and the processing unit processes the service data with the token according to a specified processing rule.
In this embodiment, the main body performing the above steps may be a service unit.
In this embodiment, the service unit may send a token obtaining request, receive a token fed back by the token management unit, and provide service data and the token to a processing unit. The service unit may be provided with a predetermined port through which token acquisition request information may be transmitted to the token management unit, a configuration token fed back by the token management unit may be received, and service data and the token may be provided to a processing unit. The service server can perform network data interaction with the token management unit based on network protocols such as HTTP, TCP/IP or FTP.
The terms and functions mentioned in this embodiment are explained with reference to other embodiments, and are not repeated herein.
Referring to fig. 7, an embodiment of the present disclosure provides a data processing method, which may be applied to a token management unit. The method may include the following steps.
Step S70: and receiving a token acquisition request sent by the service unit.
Step S72: sending the token in the token set to the business unit, so that the business unit provides the token and the business data to a processing unit; the processing unit processes the service data provided by the service unit with the token; wherein the number of token sets is at least one, the number of tokens in the token set being maintained in accordance with a specified rule.
The terms and functions mentioned in the present embodiment are explained with reference to other embodiments, and are not repeated herein.
Referring to fig. 8, an embodiment of the present disclosure provides a data processing method, which can be applied to a processing unit. The method may include the following steps.
Step S80: and receiving a service processing request of the service unit.
Step S82: processing the business data attached to the business processing request according to a specified processing rule under the condition that the business processing request has a token; wherein the service unit obtains the token from a token management unit.
In this embodiment, the service processing request may be a character string or a code that satisfies a communication protocol and follows a certain format, and may be used to indicate that the service unit that issued the service processing request has service data that needs to be processed by the processing unit. The service processing request can comprise a search request sent to a search engine by a user through a client; a push request for pushing a message to a user by the platform, and the like.
In this embodiment, after the service unit obtains the token, the token may be attached to the service processing request and sent to the processing unit, and the processing unit may select whether to process the service data attached to the service processing request according to whether the service processing request has the token. In case of having a token, the processing unit may process the corresponding service data according to the service processing request. Specifically, 2 users simultaneously use the client to send search requests for searching entertainment news to a search engine, wherein one of the two search requests has a token and the other search request has no token, and the search engine can process the search requests with the tokens to search related entertainment news; no processing may be done for search requests without tokens.
In the present embodiment, the specified processing rule may be preset or may be changed according to the current network status. When the service data provided by the service unit meets at least one preset specified processing rule, the service data can be processed. The specifying processing rule may include that, when the service data provided by the service unit includes a token, the processing unit processes the service data; when a plurality of service data with different priorities and containing tokens arrive at the same time, the service data with high priority is processed preferentially.
In this embodiment, the processing unit processes the service processing request with the token by receiving the service processing request sent by the service unit, so as to adjust the data traffic output rate, reduce the possibility of system overload, and improve the efficiency and performance of service data processing.
Referring to fig. 9, the present specification provides a token management method, which may be applied to a token management unit, where the token management unit may maintain at least two token sets. The method may include the following steps.
S90: one of the token sets is selected.
S92: comparing the token set with the adjacent token set in terms of token quantity, and increasing the tokens in a specified quantity in the token set with a small quantity; or comparing the token set with the adjacent token set to reduce the specified number of tokens in the token set with a larger number.
In this embodiment, the selecting one of the token sets may include randomly selecting one of the token sets from the at least two token sets; selecting a specific token set from the at least two token sets, specifically, for example, numbering the at least two token sets, selecting a token set with a specific number, or selecting a token set according to the positions of the token sets in the at least two token sets, for example, selecting the leftmost token set or the rightmost token set, etc.
In this embodiment, the adjacent token sets may include a front-back adjacent token set, a left-right adjacent token set, a top-bottom adjacent token set, and the like.
In this embodiment, the token management unit may query the selected one of the token sets and the number of tokens in the token set adjacent to the selected one of the token sets, and increase the specified number of tokens in a token set with a small number or decrease the specified number of tokens in a token set with a large number.
In this embodiment, the specified number may be preset or set according to the current network condition, and may include increasing the number of fixed tokens; increasing the number of tokens that change; increasing the number of fixed tokens at fixed intervals; increasing the number of changed tokens at fixed intervals; increasing the number of tokens by a fixed amount at intervals of varying time; the time at which the interval changes increases the number of changed tokens, etc.
In this embodiment, the token management unit reduces the possibility that the token management unit selects an empty token set to allocate tokens to the service unit after the service unit sends a token acquisition request by managing at least two token sets, selecting one token set from the two token sets, comparing the number of tokens of the selected token set with the number of tokens of an adjacent token set, supplementing the tokens to the token set with a smaller number of tokens, and reducing the number of tokens from the token set with a larger number of tokens, and reduces the waiting time for token acquisition.
This specification provides a data processing system, a method and a token management method, the data processing system comprising: the system comprises a business unit, a token management unit and a processing unit, wherein the business unit is used for sending a token acquisition request to the token management unit so as to obtain the token and then provide business data to the processing unit for processing; the token management unit is used for managing at least one token set and maintaining the number of tokens in the token set according to a specified rule; the token management unit sends the tokens in the token set to a service unit sending the token acquisition request under the condition of receiving the token acquisition request; the processing unit is used for processing the service data provided by the service unit with the token according to a specified processing rule. The data processing system provided by the specification limits the speed of data flow in a network, adjusts the output rate of the data flow, reduces the possibility of system overload, and improves the efficiency and performance of service data processing.
The foregoing description of various embodiments of the present specification is provided for the purpose of illustration to those skilled in the art. It is not intended to be exhaustive or to limit the invention to a single disclosed embodiment. As described above, various alternatives and modifications of the present specification will be apparent to those skilled in the art to which the above-described technology pertains. Thus, while some alternative embodiments have been discussed in detail, other embodiments will be apparent or relatively easy to derive by those of ordinary skill in the art. This specification is intended to embrace all alternatives, modifications, and variations of the present invention that have been discussed herein, as well as other embodiments that fall within the spirit and scope of the above-mentioned application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the data processing method applied to the business unit, the data processing method applied to the token management unit, the data processing method applied to the processing unit, and the token management method, since they are basically similar to the embodiments of the data processing system, the description is relatively simple, and the relevant points can be referred to the partial description of the embodiments of the data processing system.
The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
While the specification has been described with respect to the embodiments, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that fall within the spirit and scope of the specification, and it is intended that the appended claims include such variations and modifications as fall within the spirit and scope of the specification.
Claims (21)
1. A data processing system, comprising: a service unit, a token management unit and a processing unit, wherein,
the service unit is used for sending a token acquisition request to the token management unit so as to obtain the token and then provide service data for the processing unit for processing;
the token management unit is used for managing at least one token set and maintaining the number of tokens in the token set according to a specified rule; the token management unit sends the tokens in the token set to a service unit sending the token acquisition request under the condition of receiving the token acquisition request; wherein the number of the token sets is multiple; the specified rule includes: selecting one token set from a plurality of token sets, comparing the token set with the adjacent token set in terms of token quantity, and increasing a specified number of tokens in the token set with a small number;
the processing unit is used for processing the service data provided by the service unit with the token according to a specified processing rule.
2. The system of claim 1, wherein the token acquisition request is sent to the token management unit after the business unit has business data that needs to be processed by the processing unit.
3. The system of claim 1, wherein the business unit comprises a plurality of tasks having different task priorities; tasks with a given task priority can send the token acquisition request to the token management unit before having traffic data.
4. The system of claim 1, wherein the service units have different service priorities therebetween; the task of the service unit with the assigned service priority can send the token acquisition request to the token management unit before having the service data.
5. The system of claim 1, wherein the specified rule comprises at least one of: adding a specified number of tokens to the token set at specified intervals; or, after the service unit uses the obtained token, the token management unit adds a corresponding number of tokens to the token set.
6. The system of claim 5, wherein adding tokens to the set of tokens is stopped when the number of tokens in the set of tokens reaches a maximum number of tokens.
7. The system according to claim 1, wherein when the token management unit receives the token obtaining request and there is no token in the token set, the token management unit processes the token obtaining request in at least one of the following manners: sending feedback information to the service unit sending the token acquisition request to inform the service unit to send the token acquisition request again; or, the token acquisition request is put into a request queue, and when the token set has a token, the token is distributed to a service unit corresponding to the token acquisition request in the request queue; or, the token acquisition request is put into a request queue, and when the token set has a token, notification information is sent to a service unit corresponding to the token acquisition request in the request queue to notify the service unit to resend the token acquisition request.
8. The system of claim 1, wherein adding tokens is stopped when the number of tokens in the selected token set and its neighboring token sets each reaches a maximum number of tokens.
9. The system of claim 1, wherein the number of token sets is plural; each token set corresponds to a maximum token number; wherein the maximum number of tokens of at least some of the token sets is different from the maximum number of tokens of the other token sets.
10. The system of claim 1, wherein the number of token sets is plural; the token management unit selects a token set after receiving the token acquisition request, compares the token number of the token set with that of an adjacent token set, and distributes tokens to the service unit sending the token acquisition request in the token set with a large number.
11. The system according to claim 1, wherein the number of the token sets is plural, the token management unit selects one token set after receiving the token obtaining request, and when the number of tokens in the token set cannot match the token obtaining request, assigns tokens to the service unit that issued the token obtaining request in a token set adjacent to the token set.
12. A data processing method, characterized by being applied to a service unit; the method comprises the following steps:
the service unit sends a token acquisition request to the token management unit;
receiving a token fed back by the token management unit; the token management unit manages at least one token set and maintains the number of tokens in the token set according to a specified rule; the number of the token sets is multiple; the specified rule includes: selecting one token set from a plurality of token sets, comparing the token set with the adjacent token set in terms of token quantity, and increasing a specified number of tokens in the token set with a small number;
providing the service data and the token to a processing unit; and the processing unit processes the service data with the token according to a specified processing rule.
13. The method of claim 12, wherein the token acquisition request is sent to the token management unit after a business unit has business data that needs to be processed by the processing unit.
14. The method of claim 12, wherein the business unit comprises a plurality of tasks, the plurality of tasks having different task priorities; tasks with a given task priority can send the token acquisition request to the token management unit before having traffic data.
15. The method of claim 12, wherein the service units have different service priorities; the service unit having the assigned service priority can send the token acquisition request to the token management unit before having the service data.
16. A data processing method is applied to a token management unit; the method comprises the following steps:
receiving a token acquisition request sent by a service unit;
sending the token in the token set to the business unit, so that the business unit provides the token and the business data to a processing unit; the processing unit processes the service data provided by the service unit with the token; wherein the number of the token sets is multiple, and the number of the tokens in the token sets is maintained according to a specified rule; the specified rule includes: selecting one token set from a plurality of token sets, comparing the token set with the adjacent token set in terms of token quantity, and adding a specified quantity of tokens in the token set with a small quantity.
17. The method of claim 16, wherein the specified rule comprises at least one of: adding a specified number of tokens to the token set at specified intervals; or, after the service unit uses the obtained token, the token management unit adds a corresponding number of tokens to the token set.
18. The method of claim 17, wherein adding tokens to the set of tokens is stopped when a number of tokens in the set of tokens reaches a maximum number of tokens.
19. The method according to claim 16, wherein when the token management unit receives the token obtaining request and there is no token in the token set, the token management unit processes the token obtaining request in at least one of the following manners: sending feedback information to the service unit which sends the token acquisition request so as to inform the service unit to send the token acquisition request again; or, the token acquisition request is put into a request queue, and when the token set has a token, the token is distributed to a service unit corresponding to the token acquisition request in the request queue; or, the token acquisition request is put into a request queue, and when the token set has a token, notification information is sent to a service unit corresponding to the token acquisition request in the request queue to notify the service unit to resend the token acquisition request.
20. A data processing method applied to a processing unit, the method comprising:
receiving a service processing request of a service unit;
processing the business data attached to the business processing request according to a specified processing rule under the condition that the business processing request has a token; the business unit obtains the token from a token management unit; the token management unit is used for managing at least one token set and maintaining the number of tokens in the token set according to a specified rule; the number of the token sets is multiple; the specified rule includes: selecting one token set from a plurality of token sets, comparing the token set with the adjacent token set in terms of token quantity, and adding a specified quantity of tokens in the token set with a small quantity.
21. A token management method is applied to a token management unit, wherein the token management unit maintains at least two token sets; the method comprises the following steps:
selecting one of said token sets;
comparing the token set with the adjacent token set in terms of token quantity, and increasing the specified quantity of tokens in the token set with less quantity; or comparing the token set with the adjacent token set in terms of token number, and reducing the specified number of tokens in the token set with a larger number.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711138960.4A CN109802895B (en) | 2017-11-16 | 2017-11-16 | Data processing system, method and token management method |
PCT/CN2018/114348 WO2019096046A1 (en) | 2017-11-16 | 2018-11-07 | Data processing system and method, and token management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711138960.4A CN109802895B (en) | 2017-11-16 | 2017-11-16 | Data processing system, method and token management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109802895A CN109802895A (en) | 2019-05-24 |
CN109802895B true CN109802895B (en) | 2023-01-13 |
Family
ID=66539376
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711138960.4A Active CN109802895B (en) | 2017-11-16 | 2017-11-16 | Data processing system, method and token management method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109802895B (en) |
WO (1) | WO2019096046A1 (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110175078B (en) * | 2019-05-30 | 2020-12-01 | 口碑(上海)信息技术有限公司 | Service processing method and device |
CN110708234B (en) * | 2019-09-24 | 2022-05-17 | 深圳证券交易所 | Message transmission processing method, message transmission processing device and storage medium |
CN110912794B (en) * | 2019-11-15 | 2021-07-16 | 国网安徽省电力有限公司安庆供电公司 | Approximate matching strategy based on token set |
CN111027033B (en) * | 2019-11-27 | 2022-05-27 | 中国银行股份有限公司 | Interface access method and device |
CN111585913B (en) * | 2020-04-30 | 2023-04-07 | 武汉众邦银行股份有限公司 | Service flow limiting method based on recovery token and storage medium |
CN112866136B (en) * | 2021-03-31 | 2023-05-02 | 中国工商银行股份有限公司 | Service data processing method and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100454897C (en) * | 2005-08-25 | 2009-01-21 | 华为技术有限公司 | A method for effectively defending network equipment against attacks |
US7719968B2 (en) * | 2005-12-30 | 2010-05-18 | Extreme Networks, Inc. | Multi-priority multi-color markers for traffic metering |
CN101360049B (en) * | 2008-09-23 | 2011-02-09 | 福建星网锐捷网络有限公司 | Packet forwarding method and apparatus |
US8966086B2 (en) * | 2009-11-23 | 2015-02-24 | Telefonaktiebolaget Lm Ericsson (Publ) | License redistributing method, moderator and license controlling system thereof |
US9471393B2 (en) * | 2013-06-25 | 2016-10-18 | Amazon Technologies, Inc. | Burst-mode admission control using token buckets |
KR101865318B1 (en) * | 2013-06-25 | 2018-06-08 | 아마존 테크놀로지스, 인크. | Burst mode control |
CN106375238A (en) * | 2015-07-21 | 2017-02-01 | 深圳市中兴微电子技术有限公司 | A traffic monitoring method and device |
-
2017
- 2017-11-16 CN CN201711138960.4A patent/CN109802895B/en active Active
-
2018
- 2018-11-07 WO PCT/CN2018/114348 patent/WO2019096046A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN109802895A (en) | 2019-05-24 |
WO2019096046A1 (en) | 2019-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109802895B (en) | Data processing system, method and token management method | |
CN102611735B (en) | A kind of load-balancing method of application service and system | |
US8149846B2 (en) | Data processing system and method | |
CN112765119B (en) | HDFS API calling method, device, equipment and storage medium | |
WO2022188578A1 (en) | Method and system for multiple services to share same gpu, and device and medium | |
US10728050B2 (en) | Method of terminal-based conference load-balancing, and device and system utilizing same | |
US11316916B2 (en) | Packet processing method, related device, and computer storage medium | |
US8539089B2 (en) | System and method for vertical perimeter protection | |
CN113938435B (en) | Data transmission method, device, electronic equipment, storage medium and program product | |
CN101674257A (en) | A method and device for storing message and a message processing system | |
JPWO2018220708A1 (en) | Resource allocation system, management device, method and program | |
CN114911602B (en) | A server cluster load balancing method, device, equipment and storage medium | |
CN105791254A (en) | Network request processing method, device and terminal | |
CN105978938A (en) | Service processing equipment service status determining method and scheduling equipment | |
US10154116B1 (en) | Efficient synchronization of locally-available content | |
CN110290009B (en) | Data scheduling method and device and computer readable storage medium | |
KR20130130295A (en) | System and method for assigining server to terminal and efficiently delivering messages to the terminal | |
US10728291B1 (en) | Persistent duplex connections and communication protocol for content distribution | |
CN113364888B (en) | Service scheduling method, system, electronic device and computer readable storage medium | |
CN117472557A (en) | Cloud platform-based resource scheduling method and device and computer readable storage medium | |
CN107528884B (en) | User request processing method and device of aggregation server | |
Freund et al. | Competitive on-line switching policies | |
CN115509749A (en) | Task execution method and device, storage medium and electronic device | |
CN117056064A (en) | Resource allocation method, device, server, storage medium and program product | |
CN115878309A (en) | Resource allocation method, device, processing core, equipment and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240206 Address after: # 01-21, Lai Zan Da Building 1, 51 Belarusian Road, Singapore Patentee after: Alibaba Singapore Holdings Ltd. Country or region after: Singapore Address before: Greater Cayman, British Cayman Islands Patentee before: ALIBABA GROUP HOLDING Ltd. Country or region before: Cayman Islands |
|
TR01 | Transfer of patent right |