CN117376256A - Connection request processing method, device, medium and electronic equipment - Google Patents

Connection request processing method, device, medium and electronic equipment Download PDF

Info

Publication number
CN117376256A
CN117376256A CN202311584787.6A CN202311584787A CN117376256A CN 117376256 A CN117376256 A CN 117376256A CN 202311584787 A CN202311584787 A CN 202311584787A CN 117376256 A CN117376256 A CN 117376256A
Authority
CN
China
Prior art keywords
application
connection request
bandwidth
data packet
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311584787.6A
Other languages
Chinese (zh)
Inventor
陈健斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Bodun Xiyan Technology Co ltd
Original Assignee
Hangzhou Bodun Xiyan 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 Hangzhou Bodun Xiyan Technology Co ltd filed Critical Hangzhou Bodun Xiyan Technology Co ltd
Priority to CN202311584787.6A priority Critical patent/CN117376256A/en
Publication of CN117376256A publication Critical patent/CN117376256A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • 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/27Evaluation or update of window size, e.g. using information derived from acknowledged [ACK] packets
    • 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/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Abstract

The invention provides a connection request processing method, a device, a medium and equipment, and relates to the technical field of computers, wherein the method can be used for solving the problem of easy response timeout caused by determining whether to limit the current according to the number of requests in the related technology.

Description

Connection request processing method, device, medium and electronic equipment
Technical Field
The present invention relates to the field of computer technology, and in particular, to a connection request processing method, a connection request processing apparatus, a computer readable storage medium, and an electronic device.
Background
Flow restriction refers to limiting the input and output flow of the system to achieve the purpose of protecting the system. Generally, the throughput of the system can be measured, and in order to ensure stable operation of the system, once the threshold of the flow limit is reached, some measures need to be taken to achieve the purpose of limiting the flow, for example: delay processing, reject processing, or partial reject processing, etc.
Generally, after a specified number of requests are received, the system will initiate a throttling operation, the throttling module will refuse to read new requests, and the received requests will be processed sequentially or in parallel. However, when multiple requests are sent simultaneously, the system is difficult to determine the current limit time in time, and is easy to receive too many requests at the same time, so that the problem that the current limit cannot be started immediately and the requests cannot be responded in time is caused.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form an existing solution known to those of ordinary skill in the art.
Disclosure of Invention
The present invention provides a connection request processing method, a connection request processing device, a computer readable storage medium, and an electronic device, which can divide a connection request into a plurality of data packets according to a response timeout problem caused by determining whether to limit a flow according to the number of requests in a related art, and determine whether to reject the connection request or continue to receive a class two data packet according to a comparison result of an allocated bandwidth and a threshold of limiting the flow when receiving a part of the data packets (i.e., a class one data packet) for the same connection request, so as to avoid the problem that the bandwidth is insufficient after receiving a plurality of requests at the same time.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the present application, there is provided a connection request processing method, including:
when a class of data packet in the connection request is received, determining an allocated bandwidth; wherein the connection request is sent by a first application which does not establish a connection;
if the allocated bandwidth is greater than the current limiting threshold, before receiving the second class data packet in the connection request, returning a feedback message for rejecting the connection request to the first application;
and if the allocated bandwidth is smaller than or equal to the current limiting threshold, executing the current limiting operation based on the preset maximum delay of the second application of the established connection, and continuously receiving the class II data packet in the connection request.
In an exemplary embodiment of the present application, a class of data packets includes an application layer data packet, a transport layer data packet, a network layer data packet, and a network interface layer data packet; and the second class data packet comprises a physical layer data packet, a data link layer data packet, a session layer data packet and a presentation layer data packet.
In one exemplary embodiment of the present application, performing a current limiting operation based on a preset maximum delay of a second application of an established connection includes:
If the number of the second applications which have established the connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application;
if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
In an exemplary embodiment of the present application, adjusting the second bandwidth window of the at least one second application based on the preset maximum delay to limit the current for the at least one second application includes:
determining the response emergency degree corresponding to each second application;
determining at least one second application that is adjustable based on the responsive urgency;
the second bandwidth window of the at least one second application is adjusted to limit the current of the at least one second application based on a preset maximum delay corresponding to the at least one second application.
In an exemplary embodiment of the present application, further comprising:
updating the allocated bandwidth based on the adjusted second bandwidth window;
a first bandwidth window for the first application is determined based on the updated allocated bandwidth.
In an exemplary embodiment of the present application, further comprising:
establishing a connection with a first application;
receiving a data stream sent by a first application based on a first bandwidth window;
and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
In an exemplary embodiment of the present application, further comprising:
determining a current limit threshold in response to the threshold setting operation, and synchronizing the current limit threshold to a proxy layer of the server;
the agent layer is used for comparing the allocated bandwidth with the current limiting threshold value, sending a feedback message for rejecting the connection request to the first application, and continuously receiving the second class data packet in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
According to an aspect of the present application, there is provided a connection request processing apparatus including:
an allocated bandwidth determining unit, configured to determine an allocated bandwidth when a type of data packet in the connection request is received; wherein the connection request is sent by a first application which does not establish a connection;
a request rejecting unit, configured to return a feedback message for rejecting the connection request to the first application before receiving the second class data packet in the connection request when the allocated bandwidth is greater than the current limit threshold;
And the continuous receiving unit is used for executing the current limiting operation based on the preset maximum delay of the second application of the established connection when the allocated bandwidth is smaller than or equal to the current limiting threshold value, and continuously receiving the class II data packet in the connection request.
In an exemplary embodiment of the present application, a class of data packets includes an application layer data packet, a transport layer data packet, a network layer data packet, and a network interface layer data packet; and the second class data packet comprises a physical layer data packet, a data link layer data packet, a session layer data packet and a presentation layer data packet.
In an exemplary embodiment of the present application, the continuing receiving unit performs the current limiting operation based on a preset maximum delay of the second application of the established connection, including:
if the number of the second applications which have established the connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application;
if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
In an exemplary embodiment of the present application, the continuing receiving unit adjusts the second bandwidth window of the at least one second application based on the preset maximum delay to limit the current for the at least one second application, including:
determining the response emergency degree corresponding to each second application;
determining at least one second application that is adjustable based on the responsive urgency;
the second bandwidth window of the at least one second application is adjusted to limit the current of the at least one second application based on a preset maximum delay corresponding to the at least one second application.
In an exemplary embodiment of the present application, further comprising:
a bandwidth updating unit for updating the allocated bandwidth based on the adjusted second bandwidth window;
and the bandwidth allocation unit is used for determining a first bandwidth window of the first application based on the updated allocated bandwidth.
In an exemplary embodiment of the present application, further comprising:
the connection establishment unit is used for establishing connection with the first application;
a data stream receiving unit, configured to receive a data stream sent by a first application based on a first bandwidth window; and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
In an exemplary embodiment of the present application, further comprising:
A current limit threshold processing unit for determining a current limit threshold in response to a threshold setting operation and synchronizing the current limit threshold to a proxy layer of the server;
the agent layer is used for comparing the allocated bandwidth with the current limiting threshold value, sending a feedback message for rejecting the connection request to the first application, and continuously receiving the second class data packet in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
According to an aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of any of the above.
According to an aspect of the present application, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any of the above via execution of executable instructions.
Exemplary embodiments of the present application may have some or all of the following benefits:
in the connection request processing method provided in an exemplary embodiment of the present application, for the problem of easy response timeout caused by determining whether to limit the flow according to the number of requests in the related art, the present application may divide the connection request into a plurality of data packets, and for the same connection request, when a portion of data packets (i.e., one type of data packets) are received, whether to reject the connection request or continue to receive the second type of data packets may be determined according to a comparison result of the allocated bandwidth and the threshold of the flow limit, so as to avoid the problem that the bandwidth is insufficient after a plurality of requests are received simultaneously, and compared with the related art, for each request, the problem that the flow limit/rejection may be determined when a portion of data packets are received, and the problem of response timeout may be avoided when a plurality of requests are received at the same time. In addition, the current limit detection can be carried out according to one type of data packet in the connection request, rather than carrying out the current limit detection after receiving the whole data packet of the connection request, so that the condition that too many requests are received at the same time can be avoided, the running smoothness of a system for responding to the requests is further ensured, and the stability of the request response process is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 schematically illustrates a flow chart of a connection request processing method according to one embodiment of the present application;
FIG. 2 schematically illustrates a flow diagram of a current limiting process according to one embodiment of the present application;
FIG. 3 schematically illustrates a flow diagram of a responsive emergency-based current limiting process according to one embodiment of the present application;
FIG. 4 schematically illustrates a flow chart of a connection request processing method according to another embodiment of the present application;
FIG. 5 schematically illustrates a block diagram of a connection request processing apparatus in one embodiment according to the present application;
Fig. 6 schematically shows a schematic of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known aspects have not been shown or described in detail to avoid obscuring aspects of the present application.
Furthermore, the drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
Referring to fig. 1, fig. 1 schematically illustrates a flowchart of a connection request processing method according to an embodiment of the present application. As shown in fig. 1, the connection request processing method may include: step S110 to step S130.
Step S110: when a class of data packet in the connection request is received, determining an allocated bandwidth; wherein the connection request is sent by the first application not establishing the connection. If the allocated bandwidth is greater than the current limit threshold, step S120 is performed. If the allocated bandwidth is less than or equal to the current limit threshold, step S130 is performed.
Step S120: before receiving the second class data packet in the connection request, a feedback message for rejecting the connection request is returned to the first application.
Step S130: and executing the current limiting operation based on the preset maximum delay of the second application of the established connection, and continuously receiving the class II data packet in the connection request.
The steps S110 to S130 may be executed by the server or the terminal device, which is not limited in this embodiment. The server side will be exemplarily described as an execution body.
By implementing the method shown in fig. 1, the problem of easy response timeout caused by determining whether to limit the current according to the number of requests in the related art can be solved, the connection request can be divided into a plurality of data packets, when a part of data packets (namely, one type of data packets) are received for the same connection request, whether to reject the connection request or continue to receive two types of data packets can be determined according to the comparison result of the allocated bandwidth and the current limiting threshold value, the problem that the bandwidth is insufficient after a plurality of requests are received simultaneously is avoided, compared with the related art, the problem that the number of requests exceeding the bandwidth capability is received at the same time can not occur in the present application, the problem that the current limit/rejection can be determined when a part of data packets are received for each request, the response timeout and the like can be avoided. In addition, the current limit detection can be carried out according to one type of data packet in the connection request, rather than carrying out the current limit detection after receiving the whole data packet of the connection request, so that the excessive request can be avoided being received, the running smoothness of a system for responding to the request can be further ensured, and the stability of the request response process is improved.
Next, the above steps of the present exemplary embodiment will be described in more detail.
In step S110, when a class of data packet in the connection request is received, determining an allocated bandwidth; wherein the connection request is sent by the first application not establishing the connection. If the allocated bandwidth is greater than the current limit threshold, step S120 is performed. If the allocated bandwidth is less than or equal to the current limit threshold, step S130 is performed.
The connection request refers to a request for establishing connection with the server, and may be understood as a handshake request, where the first application sending the connection request may be configured in the user, and when the connection request is successfully responded, it indicates that a connection is established between the first application and the server, and then the first application may upload a data stream to the server or download required data.
In addition, the structure of the connection request depends on the network model, which may be a OSI (Open System Interconnection) reference model or the like, and the embodiment of the present application is not limited.
In particular, OSI is a standard architecture for interconnection between computer or communication systems established by the international organization for standardization (ISO). It is a seven-layer, abstract model that includes not only a series of abstract terms or concepts, but also concrete protocols. Seven layers herein refer to: a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer.
The physical layer is used for establishing, maintaining and disconnecting physical connection, and the data unit of the physical layer is bit. The data link layer is used for realizing the functions of establishing logical connection, carrying out hardware address addressing, error checking and the like, and the data unit of the data link layer is a frame. The network layer is used for carrying out logic address addressing to realize path selection among different networks, and at least comprises the following protocols: ICMP, IGMP, IPV4, IPV6, ARP, RARP; the data units of the network layer are packets. The transmission layer is used for defining protocol port numbers, flow control and error check of transmission data, and at least comprises the following protocols: TCP, UDP, the data packet of the transport layer enters the network transport layer once leaving the network card, the data unit of the transport layer is the section. The session layer is used for establishing, managing, maintaining and terminating a session, the session layer corresponds to a host process, the session refers to the ongoing session between the local host and the remote host, and the data unit of the session layer is SPDU; the presentation layer is used for carrying out data format conversion and encryption, and at least comprises the following formats: JPEG, ASCll, DECOIC, encryption format, etc., the data unit of the presentation layer is PPDU; the application layer is configured to provide services for application programs (e.g., a first application and a second application in the present application), and defines at least one communication protocol: HTTP, FTP, TFTP, SMTP, SNMP, DNS, TELNET, HTTPS, POP3, DHCP, etc.
Based on the above definition of the seven-layer model, the connection request generated based on the seven-layer model may generally be composed of a plurality of data packets, specifically, the plurality of data packets include at least: an application layer packet, a transport layer packet, a network layer packet, a physical layer packet, a data link layer packet, a session layer packet, and a presentation layer packet.
In the related art, the server side generally needs to determine whether to execute the current limiting operation after receiving the application layer data packet, the transmission layer data packet, the network layer data packet, the physical layer data packet, the data link layer data packet, the session layer data packet and the presentation layer data packet, but after the connection request is sent, that is, after the server side receives all the data packets of the connection request, the connection request cannot be refused, if no bandwidth is allocated in the server side at this time, the connection request can only be processed when waiting for an available bandwidth, which causes the problems of longer request response time, response timeout and the like.
The present application considers that the core problem in the related art is that the current limiting scheme can only be implemented after receiving the full data packet of the connection request, i.e. the triggering condition of the current limiting scheme is the full data packet. To avoid the above problems, the present application optimizes the overall current limiting scheme such that the current limiting scheme no longer relies on the full amount of data packets as trigger conditions.
Therefore, the present application abstracts the plurality of data packets in the connection request into two types, namely, a class one data packet and a class two data packet, when receiving the class one data packet sent by the first application, the present allocated bandwidth (e.g., 800 kb) is obtained, if the allocated bandwidth is greater than the current limit threshold (e.g., 900 kb), step S120 may be executed; if the allocated bandwidth is less than or equal to the current limit threshold, step S130 is performed.
Furthermore, optionally, the method may further comprise the steps of: and determining a total volume section to which the total bandwidth (1 MB, for example) belongs, and determining a current limit threshold corresponding to the total bandwidth according to a threshold determination mode (threshold determination mode=total bandwidth (1-20%)) corresponding to the total volume section. For example, the total interval may be divided in a plurality of ways, and in one case, the total interval may be expressed as: the present application is not limited to a specific division manner, and thus the specific division result of the total amount section may be determined according to actual requirements.
Furthermore, it should be noted that different total amount intervals may correspond to different threshold determination manners, so as to ensure that bandwidth is utilized to the greatest extent on the premise of requesting stable response.
As an alternative embodiment, one type of data packet includes an application layer data packet, a transport layer data packet, a network layer data packet, and a network interface layer data packet; and the second class data packet comprises a physical layer data packet, a data link layer data packet, a session layer data packet and a presentation layer data packet.
Therefore, the implementation of the alternative embodiment can be beneficial to triggering the current limiting scheme immediately when a class of data packet is received, and is beneficial to rejecting the connection request in time when the bandwidth is insufficient, so that smooth and stable network transmission is ensured, and the problems of response overtime and the like are avoided.
Specifically, the application may abstract a network interface layer packet, where the network interface layer packet is used to define a network communication interface, and determine an application layer packet, a transport layer packet, a network layer packet, and a network interface layer packet as a class one packet, and determine other packets as a class two packet.
It should be noted that, the division of the first class data packet and the second class data packet in the present application is only exemplary, and in the actual application process, the first class data packet and the second class data packet may be determined according to the requirements, which is not limited in the embodiments of the present application.
In step S120, a feedback message for rejecting the connection request is returned to the first application before receiving the class two data packet in the connection request.
Specifically, if the allocated bandwidth is greater than the current limit threshold, the second class of data packets for forming the connection request continue to be received, and even if all the data packets of the connection request are received, if the allocated bandwidth is greater than the current limit threshold (i.e., if the bandwidth is insufficient to be allocated to the first application), the connection request cannot be processed in time, and the bandwidth for transmitting the data stream cannot be allocated to the first application, which may cause problems such as response timeout. The method and the device can reject the connection request when the allocated bandwidth is larger than the current limiting threshold and before the second-class data packet in the connection request is received, avoid the condition that the connection request must be processed after the second-class data packet is received, and ensure the smoothness of system response.
In step S130, the current limiting operation is performed based on the preset maximum delay of the second application of the established connection, and the second class data packet in the connection request is continuously received.
Specifically, if the allocated bandwidth is less than or equal to the current limiting threshold, the second application which has established the connection may be limited, and the second class data packet of the connection request may be continuously received, and after the full data packet of the connection request is received, the connection request may be responded, and the bandwidth is allocated to the first application, so as to receive the data stream uploaded by the first application.
As an alternative embodiment of step S130, performing the current limiting operation based on the preset maximum delay of the second application of the established connection includes:
step S1301: if the number of the second applications which have established the connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application;
step S1302: if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
It can be seen that, by implementing this alternative embodiment, two processing modes when the number of the second applications is 1 and greater than 1 can be distinguished, so as to adapt to the actual current limiting scene, and improve the robustness of the system. In addition, the method and the device can realize timely current limiting in different processing modes, and give up a proper amount of bandwidth for the first application in a space time changing mode.
Specifically, as shown in fig. 2, after step S120, step S1301 or step S1302 may be performed, with steps S1301 and S1302 being further subdivisions of step S130. The second application that has established a connection with the server may be one or more, and when there are multiple second applications, the second bandwidth windows (e.g., 50 kb/s) allocated by different second applications may be different or the same.
In addition, it should be noted that the second application may correspond to a preset maximum delay (e.g., 2 s), and the preset maximum delays corresponding to different second applications may be different, where the default delay in the system may be used as the preset maximum delay of the second application when the second application is not configured with the preset maximum delay.
Wherein optionally, based on the preset maximum delay of the second application, adjusting the second bandwidth window of the second application to limit the current for the second application includes: determining a minimum bandwidth window corresponding to the second application based on a preset maximum delay of the second application; determining an allocable bandwidth according to the minimum bandwidth window of the second application; determining a minimum bandwidth window corresponding to the first application based on a preset maximum delay of the first application; if the minimum bandwidth window of the first application is smaller than the allocatable bandwidth, determining a target bandwidth window corresponding to the second application according to the preset maximum delay of the second application and the preset maximum delay of the first application, adjusting the bandwidth window corresponding to the second application to be the target bandwidth window, configuring the maximum bandwidth window which can be allocated currently for the first application, and guaranteeing the transmission rate of the second application to the greatest extent; if the minimum bandwidth window of the first application is larger than or equal to the allocatable bandwidth, determining the allocatable bandwidth as a bandwidth window corresponding to the first application, further determining a target bandwidth window of the second application based on the allocatable bandwidth, and adjusting the bandwidth window corresponding to the second application as the target bandwidth window.
As an alternative embodiment of step S1302, as shown in fig. 3, adjusting the second bandwidth window of the at least one second application based on the preset maximum delay to limit the current for the at least one second application includes:
step S13021: determining the response emergency degree corresponding to each second application;
step S13022: determining at least one second application that is adjustable based on the responsive urgency;
step S13023: the second bandwidth window of the at least one second application is adjusted to limit the current of the at least one second application based on a preset maximum delay corresponding to the at least one second application.
Therefore, by implementing the alternative embodiment, differentiated current limiting can be performed for each second application based on the response emergency degree corresponding to the second application, and the bandwidth is saved and the utilization rate of the bandwidth is improved.
Specifically, when the number of second applications is greater than 1, in one case, the personalized current limit may be performed according to the corresponding response urgency of each second application, where the response urgency may be defined by an identification (e.g., 0 (most urgent), 1 (second urgent), 2 (non-urgent)) corresponding to the second application. Wherein optionally, determining at least one adjustable second application according to the response urgency comprises: and determining at least one adjustable second application according to the response emergency degree, and respectively corresponding adjustable ranges of the at least one second application. Based on this, adjusting the second bandwidth window of the at least one second application based on the preset maximum delay corresponding to the at least one second application to limit the at least one second application, comprising: the second bandwidth window of the at least one second application is adjusted to limit the current of the at least one second application based on the preset maximum delay and the adjustable range corresponding to the at least one second application. This avoids shrinking the second application bandwidth window where the response urgency is high.
As an alternative embodiment, further comprising:
step S140: updating the allocated bandwidth based on the adjusted second bandwidth window; a first bandwidth window for the first application is determined based on the updated allocated bandwidth.
Therefore, by implementing the alternative embodiment, the first bandwidth window can be timely allocated to the first application after the second application is limited, so that the data stream uploaded by the first application can be timely processed.
Specifically, the adjusted second bandwidth window (e.g., 30 kb/s) is smaller than the pre-adjusted second bandwidth window (e.g., 80 kb/s), based on which the allocated bandwidth may be updated to a difference between the sum of the respective adjusted second bandwidth windows and the total amount of bandwidth (e.g., 1M), based on which the first application may be allocated the first bandwidth window. Wherein optionally, determining the first bandwidth window of the first application based on the updated allocated bandwidth includes: a first bandwidth window of the first application is determined based on the updated allocated bandwidth and a preset maximum delay of the first application.
As an alternative embodiment, further comprising:
step S150: establishing a connection with a first application;
step S160: receiving a data stream sent by a first application based on a first bandwidth window; and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
It can be seen that, by implementing this alternative embodiment, the second application may be limited and the first application may be allocated with the first bandwidth window when the allocated bandwidth is less than or equal to the limit threshold, so as to implement parallel processing for multiple applications, and improve high concurrency capability of the system.
Specifically, under the condition of sufficient bandwidth, connection with the first application can be established, the data flow of the first application can be responded in time based on the first bandwidth window, and meanwhile, the data flow sent by the second application is processed in parallel through the second bandwidth window, so that a multi-request parallel processing scheme is realized. Wherein the size of the first bandwidth window has an interactive relationship with the size of the second bandwidth window.
As an alternative embodiment, further comprising:
step S100: determining a current limit threshold in response to the threshold setting operation, and synchronizing the current limit threshold to a proxy layer of the server;
the agent layer is used for comparing the allocated bandwidth with the current limiting threshold value, sending a feedback message for rejecting the connection request to the first application, and continuously receiving the second class data packet in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
It can be seen that implementing this alternative embodiment, the impact of connection requests on the system can be reduced by managing the throttling threshold and performing throttling detection by the isolated proxy layer.
Specifically, the present application may configure a proxy layer that is isolated from the system but serves the system, and synchronize the current limit threshold to the proxy layer of the server, so that the proxy layer executes steps S110 to S130, where when the proxy layer determines that the allocated bandwidth is less than or equal to the current limit threshold, the proxy layer may continue to receive the second class data packet in the connection request, and further, the proxy layer may send the first class data packet and the second class data packet to the system, so that the system responds to the connection request.
Referring to fig. 4, fig. 4 schematically illustrates a flowchart of a connection request processing method according to an embodiment of the present application. As shown in fig. 4, the connection request processing method may include: step S410 to step S470.
Step S410: determining a current limit threshold in response to the threshold setting operation, and synchronizing the current limit threshold to a proxy layer of the server; the agent layer is used for comparing the allocated bandwidth with the current limiting threshold value, sending a feedback message for rejecting the connection request to the first application, and continuously receiving the second class data packet in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
Step S420: when a class of data packet in the connection request is received, determining the allocated bandwidth through the proxy layer; wherein the connection request is sent by the first application not establishing the connection. If the allocated bandwidth is greater than the current limit threshold, step S430 is performed; if the allocated bandwidth is less than or equal to the current limit threshold, step S440 is performed.
Step S430: before receiving the second class data packet in the connection request, a feedback message for rejecting the connection request is returned to the first application.
Step S440: if the number of the second applications which have established the connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application; if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
Step S450: and continuing to receive the second-class data packet in the connection request.
Step S460: the allocated bandwidth is updated based on the adjusted second bandwidth window, and a first bandwidth window of the first application is determined based on the updated allocated bandwidth.
Step S470: and establishing connection with the first application, receiving the data stream sent by the first application based on the first bandwidth window, and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
It should be noted that, the steps S410 to S470 correspond to the steps and embodiments shown in fig. 1, and for the specific implementation of the steps S410 to S470, please refer to the steps and embodiments shown in fig. 1, and the description thereof is omitted here.
As can be seen, implementing the method shown in fig. 4 can solve the problem of easy response timeout caused by determining whether to limit the current according to the number of requests in the related art, the present application can divide the connection request into a plurality of data packets, and determine, when a part of data packets (i.e., one type of data packets) are received for the same connection request, whether to reject the connection request or continue to receive the two types of data packets according to the comparison result of the allocated bandwidth and the current limit threshold, so as to avoid the problem that the bandwidth is insufficient after receiving a plurality of requests at the same time. In addition, the current limit detection can be carried out according to one type of data packet in the connection request, rather than carrying out the current limit detection after receiving the whole data packet of the connection request, so that the problem of receiving too many requests can be avoided, the running smoothness of a system for responding to the requests can be further ensured, and the stability of the request response process is improved.
Referring to fig. 5, fig. 5 schematically shows a block diagram of a connection request processing apparatus in an embodiment according to the present application. The connection request processing apparatus 500 corresponds to the method shown in fig. 1, and as shown in fig. 5, the connection request processing apparatus 500 includes:
an allocated bandwidth determining unit 501, configured to determine, when a class of data packet in the connection request is received, an allocated bandwidth; wherein the connection request is sent by a first application which does not establish a connection;
a request rejecting unit 502, configured to return, when the allocated bandwidth is greater than the current limit threshold, a feedback message for rejecting the connection request to the first application before receiving the second class data packet in the connection request;
and a continuous receiving unit 503, configured to perform a current limiting operation based on a preset maximum delay of the second application of the established connection when the allocated bandwidth is less than or equal to the current limiting threshold, and continuously receive the second class data packet in the connection request.
As can be seen, implementing the apparatus shown in fig. 5 can solve the problem of easy response timeout caused by determining whether to limit the flow according to the number of requests in the related art, the present application can divide the connection request into a plurality of data packets, and determine, when a part of data packets (i.e., one type of data packets) are received for the same connection request, whether to reject the connection request or continue to receive the two types of data packets according to the comparison result of the allocated bandwidth and the threshold value of the flow limit, so as to avoid the problem that the bandwidth is insufficient after receiving a plurality of requests at the same time. In addition, the current limit detection can be carried out according to one type of data packet in the connection request, rather than carrying out the current limit detection after receiving the whole data packet of the connection request, so that the problem of receiving too many requests can be avoided, the running smoothness of a system for responding to the requests can be further ensured, and the stability of the request response process is improved.
In an exemplary embodiment of the present application, a class of data packets includes an application layer data packet, a transport layer data packet, a network layer data packet, and a network interface layer data packet; and the second class data packet comprises a physical layer data packet, a data link layer data packet, a session layer data packet and a presentation layer data packet.
Therefore, the implementation of the alternative embodiment can be beneficial to triggering the current limiting scheme immediately when a class of data packet is received, and is beneficial to rejecting the connection request in time when the bandwidth is insufficient, so that smooth and stable network transmission is ensured, and the problems of response overtime and the like are avoided.
In an exemplary embodiment of the present application, the continuous receiving unit 503 performs a current limiting operation based on a preset maximum delay of the second application of the established connection, including:
if the number of the second applications which have established the connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application;
if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
It can be seen that, by implementing this alternative embodiment, two processing modes when the number of the second applications is 1 and greater than 1 can be distinguished, so as to adapt to the actual current limiting scene, and improve the system robustness. In addition, the method and the device can realize timely current limiting in different processing modes, and give up a proper amount of bandwidth for the first application in a space time changing mode.
In an exemplary embodiment of the present application, the continuous receiving unit 503 adjusts the second bandwidth window of the at least one second application based on the preset maximum delay to limit the current of the at least one second application, including:
determining the response emergency degree corresponding to each second application;
determining at least one second application that is adjustable based on the responsive urgency;
the second bandwidth window of the at least one second application is adjusted to limit the current of the at least one second application based on a preset maximum delay corresponding to the at least one second application.
Therefore, by implementing the alternative embodiment, differentiated current limiting can be performed for each second application based on the response emergency degree corresponding to the second application, and the bandwidth is saved and the utilization rate of the bandwidth is improved.
In an exemplary embodiment of the present application, further comprising:
A bandwidth updating unit for updating the allocated bandwidth based on the adjusted second bandwidth window;
and the bandwidth allocation unit is used for determining a first bandwidth window of the first application based on the updated allocated bandwidth.
Therefore, by implementing the alternative embodiment, the first bandwidth window can be timely allocated to the first application after the second application is limited, so that the data stream uploaded by the first application can be timely processed.
In an exemplary embodiment of the present application, further comprising:
the connection establishment unit is used for establishing connection with the first application;
a data stream receiving unit, configured to receive a data stream sent by a first application based on a first bandwidth window; and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
It can be seen that, by implementing this alternative embodiment, the second application may be limited and the first application may be allocated with the first bandwidth window when the allocated bandwidth is less than or equal to the limit threshold, so as to implement parallel processing for multiple applications, and improve high concurrency capability of the system.
In an exemplary embodiment of the present application, further comprising:
a current limit threshold processing unit for determining a current limit threshold in response to a threshold setting operation and synchronizing the current limit threshold to a proxy layer of the server;
The agent layer is used for comparing the allocated bandwidth with the current limiting threshold value, sending a feedback message for rejecting the connection request to the first application, and continuously receiving the second class data packet in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
It can be seen that implementing this alternative embodiment, the impact of connection requests on the system can be reduced by managing the throttling threshold and performing throttling detection by the isolated proxy layer.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Since each functional module of the connection request processing apparatus according to the exemplary embodiment of the present application corresponds to a step of the exemplary embodiment of the connection request processing method described above, for details not disclosed in the embodiment of the apparatus of the present application, please refer to the embodiment of the connection request processing method described above.
Referring to fig. 6, fig. 6 shows a schematic diagram of a computer system suitable for implementing the electronic device of the embodiments of the present application.
It should be noted that, the computer system 600 of the electronic device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The computer program, when executed by a Central Processing Unit (CPU) 601, performs the various functions defined in the methods and apparatus of the present application.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: 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 or 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. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. 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 of the foregoing. 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.

Claims (10)

1. A connection request processing method, comprising:
when a class of data packet in the connection request is received, determining an allocated bandwidth; wherein the connection request is sent by a first application that does not establish a connection;
if the allocated bandwidth is greater than the current limiting threshold, before receiving the class II data packet in the connection request, returning a feedback message for rejecting the connection request to the first application;
and if the allocated bandwidth is smaller than or equal to the current limiting threshold, executing the current limiting operation based on the preset maximum delay of the second application of the established connection, and continuously receiving the class II data packet in the connection request.
2. The method of claim 1, wherein the class of packets comprises an application layer packet, a transport layer packet, a network interface layer packet; and the second class data packet comprises a physical layer data packet, a data link layer data packet, a session layer data packet and a presentation layer data packet.
3. The method of claim 1, wherein performing the current limit operation based on a preset maximum delay of the second application for which the connection has been established comprises:
if the number of the second applications with the established connection is 1, adjusting a second bandwidth window of the second application based on a preset maximum delay of the second application so as to limit the current of the second application;
if the number of the second applications which have established the connection is greater than 1, acquiring a preset maximum delay of each second application, and adjusting a second bandwidth window of at least one second application based on the preset maximum delay so as to limit the current of the at least one second application.
4. A method according to claim 3, wherein adjusting the second bandwidth window of the at least one second application based on the preset maximum delay to limit the at least one second application comprises:
Determining the response emergency degree corresponding to each second application;
determining at least one second application that is adjustable according to the response urgency;
and adjusting a second bandwidth window of the at least one second application based on a preset maximum delay corresponding to the at least one second application so as to limit the at least one second application.
5. A method according to claim 3, further comprising:
updating the allocated bandwidth based on the adjusted second bandwidth window;
a first bandwidth window for the first application is determined based on the updated allocated bandwidth.
6. The method as recited in claim 5, further comprising:
establishing a connection with the first application;
receiving a data stream sent by the first application based on the first bandwidth window;
and receiving the data stream sent by the corresponding second application based on the adjusted second bandwidth window.
7. The method as recited in claim 1, further comprising:
determining the current limiting threshold value in response to a threshold value setting operation, and synchronizing the current limiting threshold value to a proxy layer of a server;
the proxy layer is used for comparing the allocated bandwidth with the current limiting threshold, sending a feedback message for rejecting the connection request to the first application, and continuously receiving class II data packets in the connection request; and the proxy layer comprises a connection establishment thread, a reading request thread and a response result sending thread.
8. A connection request processing apparatus, comprising:
an allocated bandwidth determining unit, configured to determine an allocated bandwidth when a type of data packet in the connection request is received; wherein the connection request is sent by a first application that does not establish a connection;
a request rejecting unit, configured to return, to the first application, a feedback message for rejecting the connection request before receiving the second class data packet in the connection request when the allocated bandwidth is greater than a current limit threshold;
and the continuous receiving unit is used for executing the current limiting operation based on the preset maximum delay of the second application of the established connection when the allocated bandwidth is smaller than or equal to the current limiting threshold value, and continuously receiving the class II data packet in the connection request.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
CN202311584787.6A 2023-11-24 2023-11-24 Connection request processing method, device, medium and electronic equipment Pending CN117376256A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311584787.6A CN117376256A (en) 2023-11-24 2023-11-24 Connection request processing method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311584787.6A CN117376256A (en) 2023-11-24 2023-11-24 Connection request processing method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117376256A true CN117376256A (en) 2024-01-09

Family

ID=89393071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311584787.6A Pending CN117376256A (en) 2023-11-24 2023-11-24 Connection request processing method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117376256A (en)

Similar Documents

Publication Publication Date Title
EP3737016A1 (en) Data transmission method, apparatus and system
EP3585095A1 (en) Method for controlling quality of service, and device, smf, upf, ue, pcf and an therefor
JP7154399B2 (en) DATA TRANSMISSION METHOD, APPARATUS, COMPUTER-READABLE MEDIUM AND ELECTRONIC DEVICE
CN107395572B (en) Data processing method and Internet of things gateway
US20080083013A1 (en) Methods and apparatus for policy enforcement in a wireless communication system
CN112291366B (en) Data transmission method and device, storage medium and electronic equipment
CN114342332B (en) Communication method, device and system
US20230161541A1 (en) Screen projection method and system
WO2021134446A1 (en) Information processing method, communication device and communication system
CN112261094A (en) Message processing method and proxy server
CN110312283B (en) Information processing method and device
CN114302426B (en) Method, device, medium and electronic equipment for controlling service quality in heterogeneous network
US20120140640A1 (en) Apparatus and method for dynamically processing packets having various characteristics
WO2022222674A1 (en) Message processing method and apparatus, electronic device, and computer-readable storage medium
US8416754B2 (en) Network location based processing of data communication connection requests
CN106686635B (en) Data transmission method and device based on control and configuration protocol of wireless access point
CN114286391B (en) Processing multiple fine timing measurement ranging requests
CN115914164A (en) Tunnel connection method and device, electronic equipment and storage medium
US11196649B2 (en) Processing local area network diagnostic data
CN117376339A (en) OTA-based vehicle ECU upgrading method, device, equipment and medium
WO2023173876A1 (en) Data communication method and apparatus, device and medium
CN117376256A (en) Connection request processing method, device, medium and electronic equipment
US20220286532A1 (en) Method and apparatus for obtaining shared maximum segment size mss
CN107566476B (en) Access method, SDN controller, forwarding equipment and user access system
CN106850871B (en) Method for realizing DHCP server with single physical network card and multiple VLANs

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