CN113259261A - Network flow control method and electronic equipment - Google Patents

Network flow control method and electronic equipment Download PDF

Info

Publication number
CN113259261A
CN113259261A CN202110318599.3A CN202110318599A CN113259261A CN 113259261 A CN113259261 A CN 113259261A CN 202110318599 A CN202110318599 A CN 202110318599A CN 113259261 A CN113259261 A CN 113259261A
Authority
CN
China
Prior art keywords
processed
user request
sub
user
data stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110318599.3A
Other languages
Chinese (zh)
Other versions
CN113259261B (en
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.)
China Academy of Railway Sciences Corp Ltd CARS
Institute of Computing Technologies of CARS
Beijing Jingwei Information Technology Co Ltd
Original Assignee
China Academy of Railway Sciences Corp Ltd CARS
Institute of Computing Technologies of CARS
Beijing Jingwei Information 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 China Academy of Railway Sciences Corp Ltd CARS, Institute of Computing Technologies of CARS, Beijing Jingwei Information Technology Co Ltd filed Critical China Academy of Railway Sciences Corp Ltd CARS
Priority to CN202110318599.3A priority Critical patent/CN113259261B/en
Publication of CN113259261A publication Critical patent/CN113259261A/en
Application granted granted Critical
Publication of CN113259261B publication Critical patent/CN113259261B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/24Traffic characterised by specific attributes, e.g. priority or QoS
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a network flow control method and electronic equipment, and relates to the technical field of internet. The network flow control method comprises the following steps: first, a user request data stream sent by the task dispatching device can be received. It may then be determined whether the user request data stream contains a number of pending user requests greater than a first threshold. If the value is larger than the first threshold value, the sub thread used for processing the user request to be processed is increased. Secondly, each user request to be processed in the user request data stream can be distributed to each sub-thread. And finally, receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information. Therefore, the automatic control of the network flow can be realized, the response speed of the system is improved, and the protection of the system is realized.

Description

Network flow control method and electronic equipment
[ technical field ] A method for producing a semiconductor device
The present application relates to the field of internet technologies, and in particular, to a network traffic control method and an electronic device.
[ background of the invention ]
Today, various types of online service systems are widespread, such as railway online ticketing systems, online shopping systems, and the like. At some special times, such as "spring time ticket snatching", "e-commerce twenty-one", etc., the system will receive a large number of user requests, which may cause the system to crash due to high load if the received user requests are not controlled due to the limited processing resources within the system. The technique of controlling a received user request to achieve protection of a system is generally referred to as flow control.
Currently, a common flow control method is to monitor and analyze the user request amount received by the system, and when it is determined that the user request amount reaches the maximum limit that the system can handle, no new user request is received. However, this method has a delay in receiving and processing the user request, which is not favorable for increasing the response speed of the system. And, when the user request volume reaches the maximum limit that the system can handle, manual intervention is often required.
[ summary of the invention ]
The embodiment of the application provides a network flow control method and electronic equipment, so that automatic control over network flow can be achieved, the response speed of a system is improved, and the system is protected.
In a first aspect, an embodiment of the present application provides a method for controlling network traffic, where the method includes: receiving a user request data stream sent by a task dispatching device; determining whether the number of the user requests to be processed contained in the user request data stream is greater than a first threshold value; if the number of the user requests to be processed is larger than a first threshold value, increasing sub-threads for processing the user requests to be processed; distributing each user request to be processed in the user request data stream to each sub-thread; and receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information, wherein the first prompt information is used for prompting the user to complete the processing of the data stream.
In one possible implementation manner, adding a child thread for processing the to-be-processed user request includes: determining whether the current number of the sub threads for processing the user request to be processed reaches a maximum threshold value; and if the current number of the sub-threads does not reach the maximum threshold value, increasing the number of the sub-threads to the maximum threshold value.
In one possible implementation manner, the method further includes: if the current number of the sub threads reaches the maximum threshold value, second prompt information is sent to the task dispatching device; the second prompt information is used for prompting to reduce the number of the user requests to be processed contained in the subsequently dispatched user request data stream.
In one possible implementation manner, the method further includes: and if the number of the user requests to be processed is smaller than or equal to the first threshold, reducing the number of the sub-threads used for processing the user requests to be processed according to the number of the user requests to be processed.
In one possible implementation manner, distributing each to-be-processed user request in the user request data stream to each sub-thread includes: and distributing the user requests to be processed to sub-threads which accord with a preset matching principle and are in an idle state respectively.
In one possible implementation manner, the sub-thread in the idle state includes: a sub thread which is requested by the user to be processed is not allocated; and requesting the processed sub-thread for the allocated to-be-processed user.
In one possible implementation manner, before sending the first prompt information to the task serving device according to the feedback information, the method further includes: determining abnormal feedback contained in each piece of feedback information; and redistributing and processing the user request to be processed corresponding to the abnormal feedback.
In one possible implementation manner, sending first prompt information to the task serving device according to the feedback information includes: and determining that all the user requests to be processed contained in the user request data stream are processed according to the feedback information, and sending first prompt information to the task dispatching device.
In a second aspect, an embodiment of the present application provides a network flow control apparatus, including: the receiving module is used for receiving a user request data stream sent by the task dispatching device; a determining module, configured to determine whether the number of to-be-processed user requests included in the user request data stream is greater than a first threshold; if the number of the user requests to be processed is larger than a first threshold value, increasing sub-threads for processing the user requests to be processed; the distribution module is used for distributing each user request to be processed in the user request data stream to each sub-thread; and the sending module is used for receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information, wherein the first prompt information is used for prompting the user to complete the processing of the data stream requested by the user.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, the processor being capable of performing the method of the first aspect when invoked by the processor.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing computer instructions for causing a computer to perform the method according to the first aspect.
In the above technical solution, first, a user request data stream sent by the task dispatching device may be received. It may then be determined whether the user request data stream contains a number of pending user requests greater than a first threshold. If the value is larger than the first threshold value, the sub thread used for processing the user request to be processed is increased. Secondly, each user request to be processed in the user request data stream can be distributed to each sub-thread. And finally, receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information. Therefore, the automatic control of the network flow can be realized, the response speed of the system is improved, and the protection of the system is realized.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a network traffic control method according to an embodiment of the present application;
fig. 2 is a flowchart of another network traffic control method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a network traffic control method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another network traffic control method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a network flow control device according to an embodiment of the present disclosure;
fig. 6 is a schematic view of an electronic device according to an embodiment of the present application.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present application, the following detailed descriptions of the embodiments of the present application are provided with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In the embodiment of the present application, a network flow control device may be provided, and the network flow control device may be located in any one of online service systems such as a railway online ticketing system and an online shopping system.
The network traffic control device provided by the embodiment of the application can be used for executing the network traffic control method provided by the embodiment of the application, so that the network traffic of any one online service system is controlled, and the protection of any one online service system is realized.
In a specific application scenario, the network traffic control device may be any one of main threads in a main thread pool.
Fig. 1 is a flowchart of a network traffic control method according to an embodiment of the present application. As shown in fig. 1, the network traffic control method may include:
step 101, receiving a user request data stream sent by a task dispatching device.
In the embodiment of the application, the task dispatching device can be used for receiving user requests initiated by user terminals. After receiving user requests from the user terminals, the task dispatching device can send user request data streams to the main threads in the main thread pool. After each main thread receives a corresponding user request data stream, the network traffic control method provided by the embodiment of the application can be executed.
Taking any one main thread in the main thread pool as an example, in a possible implementation manner, the task dispatch device may send the user request data stream received within a preset time period to the main thread according to a preset time interval. Based on the implementation manner, the number of the to-be-processed user requests contained in the user request data stream received by the main thread from the task dispatching device at each time may be different.
In another possible implementation manner, the task dispatching device may send the user request data streams of the preset size to the main thread in batches according to the number of the received user requests. Based on the implementation manner, the number of the to-be-processed user requests contained in the user request data stream received by the main thread from the task dispatching device at each time can be the same.
Step 102, determining whether the number of the user requests to be processed contained in the user request data stream is greater than a first threshold. If yes, go to step 103; otherwise, step 103' is performed.
The flow of the method to be executed is the same for each received user request data stream. In the embodiment of the present application, an execution method after a user request data stream is received any time is taken as an example, and the network traffic control method provided in the embodiment of the present application is described.
In the embodiment of the application, after receiving the user request data stream sent by the task dispatching device, the main thread can determine the number of the to-be-processed user requests contained in the task request data stream. Then, the number of sub-threads for processing the user request to be processed can be adjusted according to the number of the user request to be processed.
Specifically, if it is determined that the number of pending user requests is greater than the first threshold, step 103 may be performed. Otherwise, step 103' is performed. The value of the first threshold can be determined according to the number of the current sub-threads. For example, the value of the first threshold may be equal to the number of the current sub-threads; or, the value of the first threshold may be slightly larger than the number of the current sub-threads.
For example, if the number of current child threads is 100, the value of the first threshold may be determined to be 100. If it is determined that the number of pending user requests is 150, then the number of pending user requests is deemed to be greater than the first threshold, at which point step 103 may be performed. If it is determined that the number of pending user requests is 50, then the number of pending user requests is deemed to be less than the first threshold, at which point step 103' may be performed.
And 103, adding a sub thread for processing the user request to be processed.
If it is determined that the number of pending user requests is greater than the first threshold, the number of child threads currently in use for processing pending user requests may be considered to be in short supply. In order to improve the processing speed of the user request to be processed, the embodiment of the application can add a sub-thread for processing the user request to be processed.
Fig. 2 is a flowchart of another network flow control method provided in the embodiment of the present application, and as shown in fig. 2, when a child thread is added in the embodiment of the present application, the method may include the following steps:
step 201, judging the current number of the sub-threads to determine whether the current number of the sub-threads reaches the maximum threshold value.
In the embodiment of the present application, the maximum threshold refers to the number of sub-threads that can be called at most. If the current number of the sub-threads is determined not to reach the maximum threshold value, the sub-threads which can still be called are indicated. At this point, step 202 may be performed.
In step 202, the number of child threads is increased to a maximum threshold.
Or, the number of the sub-threads can be increased according to the number of the user requests to be processed.
If the current number of child threads is determined to have reached the maximum threshold, it is indicated that there are no child threads that can be invoked. At this point, step 203 may be performed to prevent accumulation of a large number of pending user requests.
And step 203, sending second prompt information to the task dispatching device.
In this embodiment of the application, the second prompt information may be used to prompt the task dispatching device to reduce the number of the to-be-processed user requests included in the subsequently dispatched user request data stream.
And 103', reducing the number of the sub-threads for processing the user request to be processed according to the number of the user requests to be processed.
If it is determined that the number of pending user requests is less than the first threshold, the number of child threads currently used to process the pending user requests may be considered sufficient. At this time, the main thread may reduce the number of sub-threads according to the number of the user requests to be processed. Specifically, the number of the sub-threads can be reduced to be equal to the number of the user requests to be processed; alternatively, the number of child threads may be reduced to a preset constant value.
And 104, distributing each user request to be processed in the user request data stream to each sub-thread.
In the embodiment of the present application, after determining each sub-thread for processing a user request to be processed, as shown in fig. 3, a main thread may distribute each user request to be processed to sub-threads that are in an idle state and meet a preset matching principle, respectively. Furthermore, each sub thread can process the received user request to be processed. The preset matching principle may be set according to the needs of the actual situation, and may include, for example: service type matching, protocol type matching, etc.
In the distribution process, the user requests to be processed received first can be preferentially distributed according to the receiving sequence of the user requests to be processed and a first-in first-out principle.
In an embodiment of the present application, the sub thread in the idle state includes: the sub-thread requested by the user to be processed is not allocated, and the allocated sub-thread requested by the user to be processed is processed.
Specifically, since the number of the user requests to be processed may be greater than the number of the sub-threads, after one distribution is completed, the user requests to be processed may still not be distributed to the corresponding sub-threads. At this time, the current state of the sub thread corresponding to the user request to be processed can be monitored. When it is monitored that the sub-thread finishes processing the allocated to-be-processed user request, a new to-be-processed user request can be distributed to the sub-thread. And the process is circulated until all the requests of the users to be processed are completely distributed.
In the embodiment of the application, the main thread does not participate in the processing process of the user request to be processed, but automatically adjusts the number of the sub-threads according to the number of the user request to be processed, and sequentially distributes the received user request to be processed to each sub-thread for processing. Therefore, the network flow control method provided by the embodiment of the application can receive more user requests and realize automatic control of the network flow.
And 105, receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information.
In this embodiment of the application, the received feedback information may include normal feedback sent by each sub-thread after the distributed to-be-processed user requests processing to be completed, and may also include exception feedback sent by each sub-thread when the distributed to-be-processed user requests processing to be abnormal.
As shown in fig. 4, in the embodiment of the present application, in the process of processing a user request to be processed, if a processing exception occurs, a sub-thread may send an exception feedback to a main thread. And then, when the main thread receives the exception feedback, automatically processing the exception of the user request to be processed corresponding to the exception feedback according to a preset exception processing rule. For example, the pending user requests corresponding to the exception feedback may be redistributed and processed.
After determining that all the user requests to be processed contained in the user data traffic are processed according to the received feedback information, the main thread may send first prompt information to the task dispatching device. The first prompt information is used for prompting the task dispatching device user to request the completion of the data stream processing. Thus, the task dispatching device can dispatch the new user request data stream again according to the first prompt message.
In this embodiment of the application, first, the main thread may receive a user request data stream sent by the task dispatching device. The main thread may then determine whether the user request data stream contains a number of pending user requests greater than a first threshold. If the value is larger than the first threshold value, the sub thread used for processing the user request to be processed is increased. Secondly, the main thread can distribute each user request to be processed in the user request data stream to each sub-thread. And finally, the main thread can receive feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sends first prompt information to the task dispatching device according to the feedback information. Therefore, the automatic control of the network flow can be realized, the response speed of the system is improved, and the protection of the system is realized.
Fig. 5 is a schematic structural diagram of a network flow control device according to an embodiment of the present application. As shown in fig. 5, a network flow control device provided in an embodiment of the present application may include: a receiving module 41, a determining module 42, a distributing module 43 and a sending module 44.
And the receiving module 41 is configured to receive a user request data stream sent by the task dispatching device.
The determining module 42 is configured to determine whether the number of the to-be-processed user requests included in the user request data stream is greater than a first threshold, and increase sub-threads for processing the to-be-processed user requests when the number of the to-be-processed user requests is greater than the first threshold.
And the distributing module 43 is configured to distribute each to-be-processed user request in the user request data stream to each sub-thread.
The sending module 44 is configured to receive feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and send first prompt information to the task dispatching device according to the feedback information, where the first prompt information is used to prompt the user to complete the processing of the request data stream.
In a specific implementation process, when adding the sub-threads for processing the user request to be processed, the determining module 42 is specifically configured to determine whether the current number of the sub-threads for processing the user request to be processed has reached a maximum threshold, and if the current number of the sub-threads has not reached the maximum threshold, increase the number of the sub-threads to the maximum threshold.
In a specific implementation process, when the determining module 42 determines that the current number of the sub-threads has reached the maximum threshold value, the second prompt message is sent to the task dispatching device. The second prompt information is used for prompting to reduce the number of the user requests to be processed contained in the subsequently dispatched user request data stream.
In a specific implementation process, the determining module 42 is further configured to reduce the number of sub-threads used for processing the user request to be processed according to the number of the user requests to be processed when determining whether the number of the user requests to be processed included in the user request data stream is smaller than or equal to a first threshold.
In a specific implementation process, the distributing module 43 is configured to, when distributing each to-be-processed user request in the user request data stream to each sub-thread, specifically, distribute each to-be-processed user request to the sub-thread that meets a preset matching principle and is in an idle state, respectively.
In a specific implementation process, before the sending module 44 sends the first prompt information to the task dispatching device according to the feedback information, the sending module is further configured to determine an abnormal feedback included in each feedback information, and redistribute and process the user request to be processed corresponding to the abnormal feedback.
In a specific implementation process, the sending module 44 sends the first prompt information to the task dispatching device according to the feedback information, including: and determining that all the user requests to be processed contained in the user request data stream are processed according to the feedback information, and sending first prompt information to the task dispatching device.
In this embodiment, first, the receiving module 41 may receive a user request data stream sent by the task dispatching device. Then, determination module 42 may determine whether the number of pending user requests contained in the user request data stream is greater than a first threshold. If the value is larger than the first threshold value, the sub thread used for processing the user request to be processed is increased. Second, the distribution module 43 may distribute each pending user request in the user request data stream to each sub-thread. Finally, the sending module 44 may receive feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and send the first prompt information to the task dispatching device according to the feedback information. Therefore, the automatic control of the network flow can be realized, the response speed of the system is improved, and the protection of the system is realized.
Fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device may include at least one processor, as shown in fig. 6; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the network traffic control method provided by the embodiment of the application.
The electronic device may be a network traffic control device, and the embodiment does not limit the specific form of the electronic device.
FIG. 6 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the electronic device is in the form of a general purpose computing device. Components of the electronic device may include, but are not limited to: one or more processors 410, a memory 430, a communication interface 420, and a communication bus 440 that connects the various system components (including the memory 430 and the processors 410).
Communication bus 440 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Electronic devices typically include a variety of computer system readable media. Such media may be any available media that is accessible by the electronic device and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 430 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) and/or cache Memory. The electronic device may further include other removable/non-removable, volatile/nonvolatile computer system storage media. Although not shown in FIG. 6, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the communication bus 440 by one or more data media interfaces. Memory 430 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility having a set (at least one) of program modules, including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in memory 430, each of which examples or some combination may include an implementation of a network environment. The program modules generally perform the functions and/or methodologies of the embodiments described herein.
The electronic device may also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), one or more devices that enable a user to interact with the electronic device, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device to communicate with one or more other computing devices. Such communication may occur via communication interface 420. Furthermore, the electronic device may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via a Network adapter (not shown in FIG. 6) that may communicate with other modules of the electronic device via the communication bus 440. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape Drives, and data backup storage systems, among others.
The processor 410 executes various functional applications and data processing by executing programs stored in the memory 430, for example, implementing the network traffic control method provided by the embodiment of the present application.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, and the computer instruction enables the computer to execute the network traffic control method provided in the embodiment of the present application.
The computer-readable storage medium described above may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable compact disc Read Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be noted that the terminal according to the embodiments of the present application may include, but is not limited to, a Personal Computer (Personal Computer; hereinafter, referred to as PC), a Personal Digital Assistant (Personal Digital Assistant; hereinafter, referred to as PDA), a wireless handheld device, a Tablet Computer (Tablet Computer), a mobile phone, an MP3 player, an MP4 player, and the like.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A method for controlling network traffic, the method comprising:
receiving a user request data stream sent by a task dispatching device;
determining whether the number of the user requests to be processed contained in the user request data stream is greater than a first threshold value;
if the number of the user requests to be processed is larger than a first threshold value, increasing sub-threads for processing the user requests to be processed;
distributing each user request to be processed in the user request data stream to each sub-thread;
and receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information, wherein the first prompt information is used for prompting the user to complete the processing of the data stream.
2. The method of claim 1, wherein adding child threads for processing the pending user request comprises:
determining whether the current number of the sub threads for processing the user request to be processed reaches a maximum threshold value;
and if the current number of the sub-threads does not reach the maximum threshold value, increasing the number of the sub-threads to the maximum threshold value.
3. The method of claim 2, further comprising:
if the current number of the sub threads reaches the maximum threshold value, second prompt information is sent to the task dispatching device; the second prompt information is used for prompting to reduce the number of the user requests to be processed contained in the subsequently dispatched user request data stream.
4. The method of claim 1, further comprising:
and if the number of the user requests to be processed is smaller than or equal to the first threshold, reducing the number of the sub-threads used for processing the user requests to be processed according to the number of the user requests to be processed.
5. The method according to claim 1, wherein distributing each of the pending user requests in the user request data stream to each of the child threads comprises:
and distributing the user requests to be processed to sub-threads which accord with a preset matching principle and are in an idle state respectively.
6. The method of claim 5, wherein the child thread in an idle state comprises:
a sub thread which is requested by the user to be processed is not allocated;
and requesting the processed sub-thread for the allocated to-be-processed user.
7. The method according to claim 1, wherein before sending the first prompt information to the task serving device according to the feedback information, the method further comprises:
determining abnormal feedback contained in each piece of feedback information;
and redistributing and processing the user request to be processed corresponding to the abnormal feedback.
8. The method according to claim 1, wherein sending first prompt information to the task serving device according to the feedback information comprises:
and determining that all the user requests to be processed contained in the user request data stream are processed according to the feedback information, and sending first prompt information to the task dispatching device.
9. A network flow control apparatus, comprising:
the receiving module is used for receiving a user request data stream sent by the task dispatching device;
a determining module, configured to determine whether the number of to-be-processed user requests included in the user request data stream is greater than a first threshold; if the number of the user requests to be processed is larger than a first threshold value, increasing sub-threads for processing the user requests to be processed;
the distribution module is used for distributing each user request to be processed in the user request data stream to each sub-thread;
and the sending module is used for receiving feedback information sent by each sub-thread after the processing of the user request to be processed is completed, and sending first prompt information to the task dispatching device according to the feedback information, wherein the first prompt information is used for prompting the user to complete the processing of the data stream requested by the user.
10. An electronic device, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 8.
CN202110318599.3A 2021-03-25 2021-03-25 Network flow control method and electronic equipment Active CN113259261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110318599.3A CN113259261B (en) 2021-03-25 2021-03-25 Network flow control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110318599.3A CN113259261B (en) 2021-03-25 2021-03-25 Network flow control method and electronic equipment

Publications (2)

Publication Number Publication Date
CN113259261A true CN113259261A (en) 2021-08-13
CN113259261B CN113259261B (en) 2023-04-18

Family

ID=77181157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110318599.3A Active CN113259261B (en) 2021-03-25 2021-03-25 Network flow control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN113259261B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429783A (en) * 2018-01-16 2018-08-21 重庆金融资产交易所有限责任公司 Electronic device, configuration file method for pushing and storage medium
CN108429780A (en) * 2017-06-25 2018-08-21 平安科技(深圳)有限公司 Data calling system between interconnected system and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429780A (en) * 2017-06-25 2018-08-21 平安科技(深圳)有限公司 Data calling system between interconnected system and method
CN108429783A (en) * 2018-01-16 2018-08-21 重庆金融资产交易所有限责任公司 Electronic device, configuration file method for pushing and storage medium

Also Published As

Publication number Publication date
CN113259261B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
WO2019205371A1 (en) Server, message allocation method, and storage medium
CN109451051B (en) Service request processing method and device, electronic equipment and storage medium
US9197579B2 (en) Allocating a pool of shared bandwidth
CN103593234A (en) Adaptive process importance
CN113849271B (en) Cloud desktop display method, device, equipment, system and storage medium
CN115904761B (en) System on chip, vehicle and video processing unit virtualization method
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN110851276A (en) Service request processing method, device, server and storage medium
CN114116092A (en) Cloud desktop system processing method, cloud desktop system control method and related equipment
CN112600761A (en) Resource allocation method, device and storage medium
CN111603767A (en) Method, terminal and storage medium for adjusting resolution
CN112799824A (en) Current limiting method, device, equipment and storage medium
CN110515749B (en) Method, device, server and storage medium for queue scheduling of information transmission
CN113259261B (en) Network flow control method and electronic equipment
CN109951737B (en) Video processing method, video processing device, electronic equipment and computer-readable storage medium
CN112165572A (en) Image processing method, device, terminal and storage medium
CN114584826B (en) Video dynamic downloading method and device, electronic equipment and storage medium
CN112882826A (en) Resource cooperative scheduling method and device
CN114116231A (en) Data loading method and device, computer equipment and storage medium
CN106484536B (en) IO scheduling method, device and equipment
CN111580882A (en) Application program starting method, device, computer system and medium
CN110798398A (en) Group message management method, device, equipment and medium
CN113992587B (en) Flow control method and device, computer equipment and storage medium
CN113162982B (en) Buried point information reporting method and device and electronic equipment
US20230136226A1 (en) Techniques for auto-tuning compute load resources

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