Queue optimization method and device
By dynamically adjusting the initial message queue length of the upper-layer protocol module in the BRAS device, the performance problem caused by the fixed queue length in the prior art is solved, and more efficient end-user up-and-down processing is achieved.
Patent Information
- Application Number
- CN202411223310.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-05-13
AI Technical Summary
When existing BRAS devices deal with the fact that a large number of terminals are online, the cache queue length is fixed and it is difficult to set appropriately, resulting in insufficient performance and affecting the real-time and performance of end users.
By setting up the upper-layer protocol module in the network device, and dynamically adjusting the size of the initial message queue corresponding to the upper-layer protocol module according to the terminal access authentication method and network operation status, the appropriate queue length setting is achieved.
By dynamically adjusting the message queue length, the performance of BRAS devices is improved and the real-time and performance of end users are guaranteed.
Smart Images

Figure CN119996334A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a queue optimization method and device. Background Art
[0002] IP access based on Ethernet (IP over Ethernet, abbreviated as IPoE) is a common IPoX access method. Typical IPoE networking methods are as follows: Figure 1 shown. Figure 1 This is a schematic diagram of the existing IPoE network. Figure 1 In the IPoE network, the user host, BRAS (access device), AAA server, security policy server, DHCP server and Portal server are included.
[0003] For example, a DHCP single-stack terminal access is briefly described. The specific access process is as follows: the DHCP client sends a DHCP-DISCOVER message. The BRAS inserts Option 82 in the DHCP-DISCOVER message, and then hands the message over to the DHCP relay device for processing. The DHCP relay device creates an IPoE session based on the DHCP-DISCOVER message and sends an authentication request to the AAA server. The user name in the authentication request message contains user information, such as the Client ID option in the DHCP message and the source MAC address of the message.
[0004] The AAA server returns the authentication result. If the user authentication is successful, an authentication acceptance message is sent with authorization information; otherwise, an authentication rejection message is sent. The DHCP relay obtains the user's authentication and authorization results and updates the authentication status of the IPoE session to pass or fail. If the user authentication is successful, the DHCP relay sends a DHCP-DISCOVER message to the DHCP server; if the authentication fails, the DHCP relay discards the DHCP-DISCOVER message.
[0005] The DHCP server responds with a DHCP-OFFER message. Then, the DHCP relay agent forwards the DHCP-OFFER message to the DHCP client. The DHCP client selects a DHCP server based on the DHCP-OFFER message and sends a DHCP-REQUEST message to the selected DHCP server. Then, the DHCP relay agent forwards the DHCP-REQUEST message to the DHCP server. The DHCP server responds with a DHCP-ACK message.
[0006] The DHCP relay agent parses the user's IP address and other address parameter information from the DHCP-ACK message, updates the IPoE session, and issues the User Profile policy, then sets the IPoE session status to online. The DHCP relay agent forwards the DHCP-ACK message to the DHCP client.
[0007] The DHCP client obtains the IP address and related address parameter information based on the received DHCP-ACK message. The BRAS sends an accounting start message to the AAA server to start charging the user.
[0008] In the above process, when BRAS processes the terminal online, a large number of message interactions will be carried out in a short period of time. In addition, the existing BRAS supports thousands of terminals online per second, and the messages of these terminals must be cached in the queue. Since the performance of BRAS can be reflected by the number of online users, the more online users there are, the more the BRAS performance is superior. However, this also makes the length of the cache queue increase. In the existing BRAS, the length of the cache queue is fixed. Therefore, how to properly set the length of the cache queue has always been a problem that tests equipment manufacturers. Summary of the invention
[0009] In view of this, the present application provides a queue optimization method and device to achieve appropriate setting of the length of the cache queue and improve BRAS performance.
[0010] In a first aspect, the present application provides a queue optimization method, which is applied to a network device, wherein at least one upper layer protocol module is provided in the network device, and each upper layer protocol module has been configured with a corresponding initial message queue, and the method comprises:
[0011] Determine the access authentication method for terminal access to the network;
[0012] According to the access authentication mode, determining, in the at least one upper layer protocol module, an upper layer protocol module matching the access authentication mode;
[0013] The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0014] In a second aspect, the present application provides a queue optimization device, which is applied to a network device, wherein at least one upper layer protocol module is provided in the network device, each upper layer protocol module has been configured with a corresponding initial message queue, and the device comprises:
[0015] A first determining unit, used to determine an access authentication method for a terminal to access a network;
[0016] A second determining unit, configured to determine, according to the access authentication mode, in the at least one upper layer protocol module, an upper layer protocol module that matches the access authentication mode;
[0017] An adjustment unit is used to adjust the size of the corresponding initial message queue according to the protocol identifier of the upper layer protocol module and a first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0018] In a third aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0019] Therefore, by applying the queue optimization method and device provided in the present application, the network device determines the access authentication method for the terminal to access the network; according to the access authentication method, in at least one upper-layer protocol module, the network device determines the upper-layer protocol module that matches the access authentication method; according to the protocol identifier of the upper-layer protocol module and the first message queue adjustment value, the network device adjusts the size of the corresponding initial message queue, and the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper-layer protocol module indicated by the protocol identifier.
[0020] In this way, combined with the terminal access authentication method and networking operation, the queue length of the initial message queue corresponding to the upper layer protocol module in the network device is dynamically adjusted to keep the network device in the optimal working state. The dynamic setting of the message queue length is achieved, the BRAS performance is improved, and the real-time performance and performance of the terminal user's online and offline are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of the existing IPoE network;
[0022] Figure 2 A flowchart of a queue optimization method provided in an embodiment of the present application;
[0023] Figure 3 A structural diagram of a queue optimization device provided in an embodiment of the present application;
[0024] Figure 4 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0026] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0027] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] The queue optimization method provided in the embodiment of the present application is described in detail below. Figure 2 , Figure 2 A flowchart of a queue optimization method provided in an embodiment of the present application. The method is applied to a network device, which may be an access device, such as a BRAS. The queue optimization method provided in an embodiment of the present application may include the following steps.
[0029] Step 210: Determine the access authentication method for the terminal to access the network;
[0030] Specifically, network devices are deployed as access devices in the network to provide network access services for terminals. For example, before authentication, terminals are prevented from accessing Internet resources; during the authentication process, they interact with the AAA server to complete identity authentication, authorization, and billing functions; after authentication, terminals are allowed to access authorized Internet resources.
[0031] It is understandable that after the network is deployed, the network device as an access device can determine the type of network it is in, for example, IPoE network, PPPoeE network, etc.
[0032] After the terminal establishes a communication connection (e.g., TCP) with the network device, the network device can also determine the user scenario in which the terminal is located, the service to be executed, and the access authentication method for accessing the network. For example, the terminal uses the IPoE access authentication method instead of the 802.1X access authentication method.
[0033] In an embodiment of the present application, the network device is deployed in an IPoE network, and the terminal accesses the network using an IPoE access authentication method.
[0034] Step 220: According to the access authentication mode, determine an upper layer protocol module that matches the access authentication mode in the at least one upper layer protocol module.
[0035] Specifically, according to the description of step 210, after the network device determines the access authentication mode for the terminal to access the network, it determines an upper layer protocol module matching the access authentication mode from at least one upper layer protocol module set locally according to the access authentication mode.
[0036] In the embodiment of the present application, the network device determines that the access authentication mode of the terminal accessing the network is the IPoE access authentication mode. The network device determines that the upper layer protocol module matching the access authentication mode is the DHCP protocol module.
[0037] Optionally, before executing step 210, the network device will further execute the step of locally configuring at least one upper layer protocol module.
[0038] Furthermore, the network device includes a flash memory (flash), and a configuration file (definequeue.ini file) is stored in the flash memory. When the network device is powered on, the network device reads and parses the configuration file. According to the configuration file, at least one upper layer protocol module and an initial message queue corresponding to each upper layer protocol module are initialized locally.
[0039] Furthermore, when developing a version of a network device, the developer configures the initial length of the initial message queue corresponding to each upper-layer protocol module supported by the network device based on the preset performance indicators of the network device (for example, the maximum number of terminals allowed to access the network device), the importance of each upper-layer protocol module supported (primary support, secondary support of the network device), and the priority (the priority of the CPU processing of the protocol message).
[0040] The developer writes the name, subclass, description, priority and message length of each upper layer protocol module in the configuration file. The developer can send the configuration file to the network device through the intelligent gateway center, and the network device stores the configuration file in its own flash memory. The configuration directory of the configuration file is shown in Table 1 below.
[0041] Table 1 Configuration directory
[0042]
[0043] In the above Table 1, the network device supports some upper-layer protocol modules as an example for illustrative description. In actual applications, the upper-layer protocol modules supported by the network device are not limited thereto.
[0044] Step 230: Adjust the size of the initial message queue corresponding to the upper layer protocol module according to the protocol identifier of the upper layer protocol module and the first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0045] Specifically, according to the description of step 220, after the network device determines the upper-layer protocol module that matches the access authentication mode, it obtains the protocol identifier of the upper-layer protocol module.
[0046] When the network device obtains the protocol identifier, it can also obtain the queue length of the initial message queue corresponding to the upper layer protocol module and the queue lengths of the initial message queues corresponding to other upper layer protocol modules.
[0047] The network device determines the first message queue adjustment value by the queue length of the initial message queue corresponding to the upper layer protocol module, the queue lengths of the initial message queues corresponding to other upper layer protocol modules, and the total length of the message queues. According to the protocol identifier of the upper layer protocol module and the first message queue adjustment value, the network device adjusts the size of the initial message queue corresponding to the upper layer protocol module.
[0048] The first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0049] It should be noted that in the embodiment of the present application, the process of the network device determining the adjustment value of the first message queue is: while expanding / reducing the queue length of one message queue, the queue length of another message queue needs to be reduced / increased so that the total length of the message queue remains unchanged.
[0050] For example, the network device determines that the access authentication method for the terminal to access the network is the IPoE access authentication method, rather than the 802.1X access authentication method. At this time, the network device determines the upper layer protocol module 1 that matches the IPoE access authentication method and the upper layer protocol module 2 that matches the 802.1X, and obtains the protocol identifier of each upper layer protocol module and the queue length of the initial message queue.
[0051] As shown in Table 1 above, the upper layer protocol module 1 is DHCP, which includes 3 subclass protocol modules, and the queue length corresponding to each subclass protocol module is 4000; the upper layer protocol module 2 is 802.1X, which includes 2 subclass protocol modules, and the queue length corresponding to each subclass protocol module is 3000.
[0052] The network device wants to increase the queue length of the Discover subclass protocol module in the upper-layer protocol module 1. At this time, the network device reduces the queue length of the 802.1X multicast message subclass protocol module in the upper-layer protocol module 2 from 3000 to 1000. The reduced 2000 is used as the first message queue adjustment value and is expanded to the queue length of the Discover subclass protocol module, that is, 6000.
[0053] It is understandable that the total length of the message queue remains unchanged. The network device can also simultaneously expand each sub-class protocol module in the upper layer protocol module 1, and at this time, the network device can also simultaneously reduce each sub-class protocol module in the upper layer protocol module 2. The expansion / reduction scheme is not limited to this, and the above is an exemplary description.
[0054] Optionally, in this step, the network device adjusts the size of the corresponding initial message queue according to the protocol identifier and the first message queue adjustment value, and the specific process is:
[0055] Furthermore, according to the protocol identifier, the network device determines the initial message queue corresponding to the upper-layer protocol module indicated by the protocol identifier; through the mutex lock, the network device locks the initial message queue; according to the first message queue adjustment value, the network device creates a new message queue (allocates memory space for the new queue, initializes the queue structure (sets the head and tail pointers of the queue, and the queue size)); the network device processes the messages cached in the initial message queue, and transfers the processed messages to the new message queue in sequence (in order to ensure data integrity and sequence, the processed messages need to be transferred to the new message queue, and the head and tail pointers of the new message queue need to be updated); the network device releases the mutex lock, and releases the software and hardware resources occupied by the initial message queue.
[0056] Therefore, by applying the queue optimization method provided by the present application, the network device determines the access authentication method for the terminal to access the network; according to the access authentication method, in at least one upper-layer protocol module, the network device determines the upper-layer protocol module that matches the access authentication method; according to the protocol identifier of the upper-layer protocol module and the first message queue adjustment value, the network device adjusts the size of the corresponding initial message queue, and the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper-layer protocol module indicated by the protocol identifier.
[0057] In this way, combined with the terminal access authentication method and networking operation, the queue length of the initial message queue corresponding to the upper layer protocol module in the network device is dynamically adjusted to keep the network device in the optimal working state. The dynamic setting of the message queue length is achieved, the BRAS performance is improved, and the real-time performance and performance of the terminal user's online and offline are guaranteed.
[0058] Optionally, in an embodiment of the present application, the network device may also adjust the size of the initial message queue corresponding to each upper-layer protocol module in other ways.
[0059] Specifically, in one implementation, in an actual networking environment, there are often situations in which terminals cannot go online and offline in time or the online and offline time is long during peak hours in the morning and evening. During the concentrated online process of terminals, network equipment will encounter the following problems, resulting in message retransmission and performance degradation: 1) Message overload. During the peak period of online access, a large number of terminals attempt to access the network at the same time, resulting in a large number of messages received by the network equipment that exceeds its processing capacity. Excessive messages will also exceed the capacity of the message queue, resulting in buffer overflow and message loss; 2) Message retransmission. Due to message loss, the upper-layer protocol module will try to retransmit unconfirmed messages. This will further increase the network load, forming a vicious cycle and reducing the performance of network equipment.
[0060] In an embodiment of the present application, the management module included in the network device will perform flow statistics on the protocol message. According to the characteristics of each protocol message (for example, the destination MAC address, IP address+port number, that is, the description field in the aforementioned Table 1 is the characteristic of the protocol message), the reception of each upper layer protocol module can be counted. If the number of protocol messages received is large and exceeds the size of the initial message queue corresponding to the upper layer protocol module, the upper layer protocol module will be caused to discard the protocol message.
[0061] Therefore, the network device counts the number of message processing of each upper layer protocol module; the network device obtains the health of the network device; according to the health and the number of message processing, the network device adjusts the size of the initial message queue corresponding to each upper layer protocol module.
[0062] In another implementation, it can be seen from the above that the terminal going online and offline is a more complicated process, involving more network devices and multiple message interactions, which can ensure that the terminal goes online and offline successfully within the specified time. In actual applications, since the server corresponds to multiple network devices (referring to access devices), it is often the case that the number of terminals online is small and the health of the network devices is also very good, and the terminal goes online slowly, which also leads to more and more message retransmissions, so that the terminal cannot go online and offline in the end. After a long period of operation and maintenance observation, the reason is: there is a problem with the interaction between the network device and the server. For example, 1) server response delay, the server takes too long to process the request, which may be caused by high server load, insufficient resources and other problems; 2) network delay or packet loss, there is a delay or packet loss in the network path between the network device and the server, resulting in a longer transmission time for the authentication request and response; 3) the number of authentication requests is too large. During peak hours, a large number of terminals initiate authentication requests at the same time, resulting in the network device and server being unable to process them in time.
[0063] Therefore, the network device counts the number of online terminals of the network device; the network device obtains the health of the network device; and according to the health and the number of online terminals, the network device adjusts the size of the initial message queue corresponding to each upper layer protocol module.
[0064] Optionally, the network device adjusts the size of the initial message queue corresponding to each upper layer protocol module according to the health status and the number of message processing. The specific process is as follows:
[0065] If the health is in the first state or the second state and the number of message processing exceeds the maximum capacity of the initial message queue corresponding to the upper-layer protocol module, the network device determines the second message queue adjustment value; according to the protocol identifier of the upper-layer protocol module and the second message queue adjustment value, the network device adjusts the size of the corresponding initial message queue.
[0066] According to the health status and the number of online terminals, the network device adjusts the size of the initial message queue corresponding to each upper-layer protocol module. The specific process is as follows:
[0067] If the health is in the first state or the second state and the number of online terminals does not exceed the maximum number of terminals allowed to access the network device, the network device determines the third message queue adjustment value; according to the protocol identifier of the upper-layer protocol module and the third message queue adjustment value, the network device adjusts the size of the corresponding initial message queue.
[0068] Optionally, the network device adjusts the size of the corresponding initial message queue according to the protocol identifier and the message queue adjustment value, and the specific process is as follows:
[0069] According to the protocol identifier, the network device determines the initial message queue corresponding to the upper-layer protocol module indicated by the protocol identifier; through the mutex lock, the network device locks the initial message queue; according to the second message queue adjustment value or the third message queue adjustment value, the network device creates a new message queue (allocates memory space for the new queue, initializes the queue structure (sets the head and tail pointers of the queue, and the queue size)); the network device processes the messages cached in the initial message queue, and transfers the processed messages to the new message queue in sequence (in order to ensure data integrity and sequence, the processed messages need to be transferred to the new message queue, and the head and tail pointers of the new message queue are updated); the network device releases the mutex lock and releases the software and hardware resources occupied by the initial message queue.
[0070] The health of the above network devices is described below.
[0071] Currently, the health of network devices includes five states: Healthy, Good, Fair, Poor, and Critical. The above states are obtained by weighting the scores of multiple indicators, including but not limited to the following indicators:
[0072] Hardware status: including the health status of key hardware components such as temperature, fan status, and power status;
[0073] Software status: operating status and versions of operating systems and key network software;
[0074] Configuration management: whether the device configuration complies with best practices or corporate standards, including configuration errors and potential security vulnerabilities;
[0075] Performance data: CPU, memory, bandwidth and other resource usage, which directly affect the operation and response speed of the device;
[0076] Log information: Analyze errors, warnings, and events in device logs to assess potential risks and issues;
[0077] Security status: including the device's firewall settings, access control lists (ACLs), patch status, and vulnerability status;
[0078] Connectivity and connectivity: The connection status between the device and other network devices, whether there are problems such as packet loss and latency.
[0079] Therefore, by monitoring and scoring the above indicators, the health of network equipment can be dynamically assessed. For example, a score range and weight can be set for each indicator, and a score can be scored based on the obtained monitoring results. Finally, the score of each indicator is weighted and summed to obtain the final score.
[0080] It is understandable that the above five states are also set with score ranges. For example, [81,100] is healthy; [61,80] is good; [41,60] is fair; [21,40] is poor; and [0,20] is severe. The health of the network device is the state corresponding to the score range to which the final score belongs.
[0081] In the above two implementations, the health level being in the first state specifically means that the health level is healthy, and the health level being in the second state specifically means that the health level is good.
[0082] In the first implementation, if the health is healthy or good and the number of message processing exceeds the maximum capacity of the initial message queue corresponding to the upper layer protocol module, the network device determines that the queue length of the initial message queue needs to be expanded. The network device can determine the second message queue adjustment value with reference to the aforementioned process of determining the first message queue adjustment value, which will not be repeated here.
[0083] In the second implementation, if the health is healthy or good and the number of online terminals does not exceed the maximum number of terminals allowed to access the network device, the network device determines that the queue length of the initial message queue needs to be reduced. The network device can determine the third message queue adjustment value with reference to the aforementioned process of determining the first message queue adjustment value, which will not be repeated here.
[0084] It is understandable that the second message queue adjustment value is an enlarged value, and the third message queue adjustment value is a reduced value. The second message queue adjustment value and the third queue adjustment value are both used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0085] In the embodiment of the present application, if the health is fair, poor or severe, the network device no longer adjusts the size of the initial message queue corresponding to the upper layer protocol module according to the health and the number of message processing. The network device generates a first alarm message to prompt the administrator that there is a problem with the health of the network device.
[0086] Similarly, if the health is fair, poor or severe, the network device will no longer adjust the size of the initial message queue corresponding to the upper layer protocol module according to the health and the number of online terminals. The network device generates a second alarm message to prompt the administrator that there is a problem with the health of the network device.
[0087] Thus, in an embodiment of the present application, the network device flexibly adjusts the queue length of the initial message queue corresponding to the upper-layer protocol module according to the networking environment and business requirements of the terminal, so that the network device is in the optimal working state. Generally speaking, after the queue length of the initial message queue is adjusted, the performance requirements of the IPoE network can be met. However, during peak concurrency periods or when the server or network device is abnormal, the terminal cannot go online or offline in time. At this point, the network device can continue to adjust the queue length of the initial message queue corresponding to the upper-layer protocol module according to the health, the number of message processing, or the number of terminals online, so that the network device is in the best operating state.
[0088] Based on the same inventive concept, the embodiment of the present application also provides a queue optimization device corresponding to the queue optimization method. Figure 3 , Figure 3 A queue optimization device provided in an embodiment of the present application is applied to a network device, wherein at least one upper layer protocol module is provided in the network device, each upper layer protocol module is configured with a corresponding initial message queue, and the device comprises:
[0089] The first determining unit 310 is used to determine the access authentication mode for the terminal to access the network;
[0090] A second determining unit 320 is configured to determine, according to the access authentication mode, an upper layer protocol module matching the access authentication mode in the at least one upper layer protocol module;
[0091] The adjustment unit 330 is used to adjust the size of the corresponding initial message queue according to the protocol identifier of the upper layer protocol module and the first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
[0092] Optionally, the network device includes a flash memory, and the configuration file is stored in the flash memory;
[0093] The device also includes:
[0094] A reading unit (not shown in the figure), used to read and parse the configuration file after the network device is powered on;
[0095] An initialization unit (not shown in the figure) is used to locally initialize the initial message queue corresponding to each upper layer protocol module according to the configuration file.
[0096] Optionally, the device further comprises:
[0097] A statistical unit (not shown in the figure), used to count the number of message processing of each upper layer protocol module;
[0098] An acquisition unit (not shown in the figure), used to acquire the health of the network device;
[0099] The adjusting unit 330 is further configured to adjust the size of the initial message queue corresponding to each upper layer protocol module according to the health level and the message processing quantity.
[0100] Optionally, the statistical unit (not shown in the figure) is further used to count the number of online terminals of the network device;
[0101] The acquisition unit (not shown in the figure) is also used to acquire the health of the network device;
[0102] The adjusting unit 330 is further configured to adjust the size of the initial message queue corresponding to each upper layer protocol module according to the health status and the number of online terminals.
[0103] Optionally, the adjustment unit 330 is specifically configured to determine a second message queue adjustment value if the health is in the first state or the second state and the message processing quantity exceeds the maximum capacity of the initial message queue corresponding to the upper layer protocol module;
[0104] The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the second message queue adjustment value.
[0105] Optionally, the adjustment unit 330 is specifically configured to determine a third message queue adjustment value if the health level is in the first state or the second state and the number of online terminals does not exceed the maximum number of terminals allowed to access the network device;
[0106] The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the third message queue adjustment value.
[0107] Optionally, the adjustment unit 330 is further specifically configured to determine, according to the protocol identifier, an initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier;
[0108] Locking the initial message queue through a mutex lock;
[0109] Creating a new message queue according to the message queue adjustment value;
[0110] Processing the messages cached in the initial message queue, and transferring the processed messages to the new message queue in sequence;
[0111] The mutex lock is released, and the software and hardware resources occupied by the initial message queue are released.
[0112] Therefore, by applying the queue optimization device provided by the present application, the network device determines the access authentication method for the terminal to access the network; according to the access authentication method, in at least one upper-layer protocol module, the network device determines the upper-layer protocol module that matches the access authentication method; according to the protocol identifier of the upper-layer protocol module and the first message queue adjustment value, the network device adjusts the size of the corresponding initial message queue, and the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper-layer protocol module indicated by the protocol identifier.
[0113] In this way, combined with the terminal access authentication method and networking operation, the queue length of the initial message queue corresponding to the upper layer protocol module in the network device is dynamically adjusted to keep the network device in the optimal working state. The dynamic setting of the message queue length is achieved, the BRAS performance is improved, and the real-time performance and performance of the terminal user's online and offline are guaranteed.
[0114] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 4 As shown, it includes a processor 410, a transceiver 420 and a machine-readable storage medium 430, the machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410, and the processor 410 is prompted by the machine-executable instructions to execute the queue optimization method provided in the embodiment of the present application. Figure 3 The queue optimization device shown can be used as follows Figure 4 The network device hardware structure shown is implemented.
[0115] The computer-readable storage medium 430 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the computer-readable storage medium 430 may also be at least one storage device located away from the processor 410.
[0116] The processor 410 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components.
[0117] In the embodiment of the present application, the processor 410 reads the machine executable instructions stored in the machine readable storage medium 430, and the machine executable instructions enable the processor 410 itself and the transceiver 420 to execute the queue optimization method described in the aforementioned embodiment of the present application.
[0118] In addition, an embodiment of the present application provides a machine-readable storage medium 430, which stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions prompt the processor 410 itself and the calling transceiver 420 to execute the queue optimization method described in the aforementioned embodiment of the present application.
[0119] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0120] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0121] As for the queue optimization device and the machine-readable storage medium embodiments, since the method contents involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and the relevant parts may refer to the partial description of the method embodiments.
[0122] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A queue optimization method, characterized in that: The method is applied to a network device, wherein at least one upper layer protocol module is provided in the network device, and each upper layer protocol module has been configured with a corresponding initial message queue, and the method comprises: Determine the access authentication method for terminal access to the network; According to the access authentication mode, determining, in the at least one upper layer protocol module, an upper layer protocol module matching the access authentication mode; The size of the initial message queue corresponding to the upper layer protocol module is adjusted according to the protocol identifier of the upper layer protocol module and the first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
2. The method according to claim 1, characterized in that: The network device comprises a flash memory, and the configuration file is stored in the flash memory; Before determining the access authentication mode for the terminal to access the network, the method further includes: When the network device is powered on and started, reading and parsing the configuration file; The initial message queue corresponding to each upper layer protocol module is initialized locally according to the configuration file.
3. The method according to claim 1, characterized in that The method further comprises: Counting the number of messages processed by each upper layer protocol module; Obtaining the health of the network device; According to the health degree and the number of message processing, the size of the initial message queue corresponding to each upper layer protocol module is adjusted.
4. The method according to claim 1, characterized in that: The method further comprises: Counting the number of online terminals of the network device; Obtaining the health of the network device; According to the health status and the number of online terminals, the size of the initial message queue corresponding to each upper layer protocol module is adjusted.
5. The method according to claim 3, characterized in that: According to the health and the number of message processing, the size of the initial message queue corresponding to each upper layer protocol module is adjusted, specifically including: If the health is in the first state or the second state and the number of message processing exceeds the maximum capacity of the initial message queue corresponding to the upper layer protocol module, determining a second message queue adjustment value; The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the second message queue adjustment value.
6. The method according to claim 4, characterized in that According to the health status and the number of online terminals, the size of the initial message queue corresponding to each upper layer protocol module is adjusted, specifically including: If the health is in the first state or the second state and the number of online terminals does not exceed the maximum number of terminals allowed to access the network device, determining a third message queue adjustment value; The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the third message queue adjustment value.
7. The method according to any one of claims 1, 5 or 6, characterized in that: According to the protocol identifier and the message queue adjustment value, the size of the corresponding initial message queue is adjusted, specifically including: Determine, according to the protocol identifier, an initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier; Locking the initial message queue through a mutex lock; Creating a new message queue according to the message queue adjustment value; Processing the messages cached in the initial message queue, and transferring the processed messages to the new message queue in sequence; The mutex lock is released, and the software and hardware resources occupied by the initial message queue are released.
8. A queue optimization device, characterized in that: The device is applied to a network device, wherein at least one upper layer protocol module is provided in the network device, each upper layer protocol module is configured with a corresponding initial message queue, and the device comprises: A first determining unit, used to determine an access authentication method for a terminal to access a network; A second determining unit, configured to determine, according to the access authentication mode, in the at least one upper layer protocol module, an upper layer protocol module that matches the access authentication mode; An adjustment unit is used to adjust the size of the corresponding initial message queue according to the protocol identifier of the upper layer protocol module and a first message queue adjustment value, wherein the first message queue adjustment value is used to adjust the queue size of the initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier.
9. The device according to claim 8, characterized in that The network device comprises a flash memory, and the configuration file is stored in the flash memory; The device also includes: A reading unit, used for reading and parsing the configuration file after the network device is powered on and started; An initialization unit is used to locally initialize the initial message queue corresponding to each upper layer protocol module according to the configuration file.
10. The device according to claim 8, characterized in that The device also includes: A statistical unit, used to count the number of messages processed by each upper layer protocol module; An acquisition unit, configured to acquire the health of the network device; The adjustment unit is further configured to adjust the size of the initial message queue corresponding to each upper layer protocol module according to the health level and the message processing quantity.
11. The device according to claim 10, characterized in that The statistical unit is also used to count the number of online terminals of the network device; The acquisition unit is further used to acquire the health of the network device; The adjustment unit is further configured to adjust the size of the initial message queue corresponding to each upper layer protocol module according to the health status and the number of online terminals.
12. The device according to claim 10, characterized in that The adjustment unit is specifically configured to determine a second message queue adjustment value if the health level is in the first state or the second state and the message processing quantity exceeds the maximum capacity of the initial message queue corresponding to the upper layer protocol module; The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the second message queue adjustment value.
13. The device according to claim 11, characterized in that The adjustment unit is specifically configured to determine a third message queue adjustment value if the health level is in the first state or the second state and the number of online terminals does not exceed the maximum number of terminals allowed to access the network device; The size of the corresponding initial message queue is adjusted according to the protocol identifier of the upper layer protocol module and the third message queue adjustment value.
14. The device according to any one of claims 8, 12 or 13, characterized in that: The adjustment unit is further specifically configured to determine, according to the protocol identifier, an initial message queue corresponding to the upper layer protocol module indicated by the protocol identifier; Locking the initial message queue through a mutex lock; Creating a new message queue according to the message queue adjustment value; Processing the messages cached in the initial message queue, and transferring the processed messages to the new message queue in sequence; The mutex lock is released, and the software and hardware resources occupied by the initial message queue are released.