Control Method, Device, Equipment and Storage Medium of Single-Chip Switch
By obtaining the priority and type of network data packets in a single chip switch for allocation, and combining PoE information to generate power supply strategies, and using parallel processing methods for resource allocation, the problems of low processing efficiency and difficulty in PoE management of a single chip switch are solved, and efficient network transmission and power resource utilization are achieved.
Patent Information
- Application Number
- CN202411385325.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing single-chip switches are less efficient when processing network data packets, resulting in network congestion, large delays, and difficulty in effectively managing and distributing PoE power.
By obtaining the priority and type of network data packets, it is allocated to the corresponding processing queue, and power demand analysis is performed based on the device PoE information, a PoE power supply strategy is generated, resource allocation is adopted using parallel processing methods, and task execution instructions are generated to optimize task execution.
It improves network transmission efficiency, ensures that data packets of different priority levels are processed in sequence, optimizes power resource utilization, and improves equipment operation stability and switch work efficiency.
Smart Images

Figure CN119094471B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer network communication, and in particular, to a control method, device, equipment and storage medium for a single-chip switch. Background Art
[0002] At present, with the rapid development of network technology and the acceleration of the informatization process, the importance of switches in network communication has become increasingly prominent. Traditional switches usually use fixed paths and static priority queues to process network data packets. This method is difficult to adapt to the dynamic changes of network traffic, and is prone to network congestion and delay. Especially when dealing with complex network data, there are often problems such as slow processing speed and low resource utilization. And with the increasing power demand, how to effectively manage and allocate PoE (Power over Ethernet) has also become an urgent problem to be solved.
[0003] The above-mentioned prior art solutions have the following defects: The existing single-chip switches have low efficiency in data processing, so there is room for improvement. Summary of the Invention
[0004] In order to improve the task processing efficiency of a single-chip switch, the present application provides a control method, device, equipment and storage medium for a single-chip switch.
[0005] The first invention object of the present application is achieved through the following technical solutions:
[0006] A control method for a single-chip switch, the control method for the single-chip switch includes:
[0007] Obtain the priority and type of the network data packet, and allocate the network data packet to the corresponding processing queue according to the priority and / or type of the network data packet, so as to obtain the sequential processing strategy of the network data packet;
[0008] Obtain the device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packet;
[0009] Through a system-predefined parallel processing method, perform resource allocation according to the sequential processing strategy of the network data packet and the PoE power supply strategy, and generate a corresponding task execution instruction, and control the switch to perform task allocation according to the task execution instruction.
[0010] By adopting the above technical solutions, by obtaining the priority and type of network data packets and allocating the network data packets to the corresponding processing queues according to the priority and / or type of the network data packets, it is possible to ensure that data packets with different priorities are processed in a predetermined order, thereby improving the efficiency of network transmission; by obtaining the device PoE information of multiple connected devices and analyzing the power requirements of the multiple connected devices according to the device PoE information to obtain the power requirement analysis result, it is possible to accurately evaluate and allocate the power requirements of each device, ensure the rational use of power resources, and thereby improve the overall operation stability of the device; by using the parallel processing method preset in the system, allocating resources according to the sequential processing strategy of network data packets and the PoE power supply strategy, and generating corresponding task execution instructions, it is possible to effectively coordinate various resources, enable the switch to make dynamic adjustments according to actual needs, thereby optimizing the task execution process and improving the working efficiency of the switch.
[0011] In a preferred example, the present application can be further configured as: the obtaining the priority and / or type of the network data packet and allocating the network data packet to the corresponding processing queue according to the priority and type of the network data packet specifically includes:
[0012] When the priority of the network data packet is high priority, the network data packet corresponding to the high priority is promoted to the head position of the priority processing queue;
[0013] When the type of the network data packet is a real-time data packet, the real-time data packet is allocated to the fast queue.
[0014] By adopting the above technical solutions, when the priority of the network data packet is high priority, promoting the network data packet corresponding to the high priority to the head position of the priority processing queue can give priority to processing key data, reduce latency, and ensure the timely execution of key tasks; when the type of the network data packet is a real-time data packet, allocating the real-time data packet to the fast queue can process real-time data faster, ensure that data packets with high timeliness requirements can be transmitted in time, and thereby improve the response speed of network transmission.
[0015] In a preferred example, the present application can be further configured as: after allocating the network data packet to the corresponding processing queue according to the priority and type of the network data packet, it further includes:
[0016] Adopting the time slice rotation rule to rotate and process the network data packets in different processing queues to ensure that the network data packets with different priorities and types can all be processed within a predetermined time.
[0017] By adopting the above technical solution and the time slice rotation rule, network data packets in different processing queues are processed in rotation, which can ensure that all types of data packets can get fair processing opportunities and prevent low priority or non-real-time data packets from being accumulated for a long time, thereby improving the balance and fairness of the overall network processing.
[0018] In a preferred example, the present application may be further configured as follows: the time slice rotation rule is adopted to perform rotation processing on the network data packets in different processing queues, specifically including:
[0019] Allocate a different time slice length to each processing queue, wherein the priority processing queue and the fast queue are allocated a preset short rotation time slice, and the common processing queue is allocated a preset normal rotation time slice;
[0020] The task processing efficiency of the different processing queues is obtained. When the task processing efficiency corresponding to the common processing queue is lower than the preset warning efficiency threshold, the time slice lengths of the different processing queues are dynamically adjusted to adapt to changes in network traffic and processing requirements of different types of network data packets.
[0021] By adopting the above technical solution, by allocating different time slice lengths to each processing queue, wherein the priority processing queue and the fast queue are allocated preset short rotation time slices, it is possible to ensure that high priority and real-time data packets are processed quickly and delays are reduced; by allocating preset normal rotation time slices to the ordinary processing queue, it is possible to maintain stable processing of non-critical tasks; by obtaining the task processing efficiency of different processing queues, when the task processing efficiency corresponding to the ordinary processing queue is lower than the preset warning efficiency threshold, the time slice lengths of different processing queues are dynamically adjusted, which can flexibly adapt to fluctuations in network traffic and ensure that all types of data packets can be effectively processed, thereby improving the working efficiency and adaptability of the switch.
[0022] In a preferred example, the present application can be further configured as follows: the device PoE information of the connected device is obtained, and the power demand analysis of the connected device is performed, and a corresponding PoE power supply strategy is generated according to the power demand analysis result and the sequential processing strategy of the network data packet, specifically including:
[0023] Calculate and set the power output of each port of the switch according to the power demand analysis results of the plurality of connected devices and the available power of the bus;
[0024] The current total system power is obtained. When the current total system power exceeds the power supply capacity, the power distribution data is dynamically adjusted according to the sequential processing strategy of the network data packet, and the PoE power supply strategy of each port of the switch is generated according to the power distribution data.
[0025] By adopting the above technical solutions, by calculating and setting the power output of each port of the switch according to the power demand analysis results of multiple connected devices and the available power of the bus, it is possible to ensure that the power demands of each device are met and optimize the power distribution efficiency; by obtaining the current total system power, when the current total system power exceeds the power supply capacity, dynamically adjusting the power distribution data according to the sequential processing strategy of network data packets, and generating the PoE power supply strategy for each port of the switch according to the power distribution data, it is possible to preferentially guarantee the power supply of key devices when power resources are tense, avoid system overload or failure, and thus improve the stability and security of the system.
[0026] In a preferred example of the present application, it can be further configured that: the control method of the single-chip switch further includes:
[0027] Real-time monitoring the operating state of the switch and network communication anomalies, and triggering an error diagnosis program and generating a corresponding diagnosis result when detecting anomalies in data packet transceiver and / or power distribution;
[0028] According to the diagnosis result, executing a system-customized recovery program, and storing the diagnosis result and its corresponding recovery program in a failure database.
[0029] By adopting the above technical solutions, by real-time monitoring the operating state of the switch and network communication anomalies, potential problems can be discovered and located in a timely manner, preventing the further expansion of faults; by triggering an error diagnosis program and generating a corresponding diagnosis result when detecting anomalies in data packet transceiver and / or power distribution, it is possible to quickly respond to and handle abnormal situations, reducing the impact on the system; by executing a system-customized recovery program according to the diagnosis result and storing the diagnosis result and its corresponding recovery program in a failure database, it is possible to improve the system recovery speed and stability, and at the same time provide reference data for future fault troubleshooting.
[0030] The second above-mentioned inventive object of the present application is achieved by the following technical solutions:
[0031] A control device for a single-chip switch, the control device for the single-chip switch includes:
[0032] A data packet distribution module, configured to obtain the priority and type of network data packets, and distribute the network data packets to corresponding processing queues according to the priority and / or type of the network data packets, to obtain a sequential processing strategy for the network data packets;
[0033] The power demand analysis module is used to obtain the device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain the power demand analysis result, and generate the corresponding PoE power supply strategy according to the power demand analysis result and the sequence processing strategy of network data packets;
[0034] The task allocation module is used to perform resource allocation through the preset parallel processing method of the system, and generate the corresponding task execution instruction according to the sequence processing strategy of network data packets and the PoE power supply strategy, and control the switch to perform task allocation according to the task execution instruction.
[0035] By adopting the above technical solutions, by obtaining the priority and type of network data packets, and allocating the network data packets to the corresponding processing queues according to the priority and / or type of network data packets, it is possible to ensure that data packets of different priorities are processed in a predetermined order, thereby improving the efficiency of network transmission; by obtaining the device PoE information of multiple connected devices, and performing power demand analysis on the multiple connected devices according to the device PoE information to obtain the power demand analysis result, it is possible to accurately evaluate and allocate the power demands of each device, ensure the rational use of power resources, and thus improve the overall operation stability of the device; by using the preset parallel processing method of the system, performing resource allocation according to the sequence processing strategy of network data packets and the PoE power supply strategy, and generating the corresponding task execution instruction, it is possible to effectively coordinate various resources, enable the switch to perform dynamic adjustment according to actual needs, thereby optimizing the task execution process and improving the working efficiency of the switch.
[0036] The above object three of the present application is achieved through the following technical solutions:
[0037] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the control method of the above single-chip switch are implemented.
[0038] The above object four of the present application is achieved through the following technical solutions:
[0039] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the control method of the above single-chip switch are implemented.
[0040] In summary, the present application includes at least one of the following beneficial technical effects:
[0041] 1. By obtaining the priorities and types of network data packets and allocating the network data packets to corresponding processing queues according to the priorities and / or types of the network data packets, it is possible to ensure that data packets with different priorities are processed in a predetermined order, thereby improving the efficiency of network transmission; by obtaining the device PoE information of multiple connected devices and analyzing the power demands of the multiple connected devices based on the device PoE information to obtain a power demand analysis result, it is possible to accurately evaluate and allocate the power demands of each device, ensure the rational utilization of power resources, and thereby improve the overall operational stability of the devices; by using the parallel processing method preset in the system, allocating resources according to the sequential processing strategy of network data packets and the PoE power supply strategy, and generating corresponding task execution instructions, it is possible to effectively coordinate various resources, enable the switch to make dynamic adjustments according to actual needs, thereby optimizing the task execution process and improving the working efficiency of the switch.
[0042] 2. By allocating different time slice lengths to each processing queue, where the priority processing queue and the fast queue are allocated preset short-term round-robin time slices, it is possible to ensure that high-priority and real-time data packets are processed quickly and reduce latency; by allocating a preset normal round-robin time slice to the normal processing queue, it is possible to maintain stable processing of non-critical tasks; by obtaining the task processing efficiency of different processing queues and dynamically adjusting the time slice lengths of different processing queues when the task processing efficiency corresponding to the normal processing queue is lower than the preset warning efficiency threshold, it is possible to flexibly adapt to fluctuations in network traffic, ensure that all types of data packets can be effectively processed, and thereby improve the working efficiency and adaptability of the switch.
[0043] 3. By calculating and setting the power output of each port of the switch according to the power demand analysis result of multiple connected devices and the available power on the bus, it is possible to ensure that the power demands of each device are met and optimize the power distribution efficiency; by obtaining the current total system power and dynamically adjusting the power distribution data according to the sequential processing strategy of network data packets when the current total system power exceeds the power supply capacity, and generating a PoE power supply strategy for each port of the switch based on the power distribution data, it is possible to give priority to ensuring the power supply of critical devices when power resources are scarce, avoid system overload or failure, and thereby improve the stability and security of the system. Description of the Drawings
[0044] Figure 1 is a flowchart of a control method for a single-chip switch according to an embodiment of the present application;
[0045] Figure 2 is an implementation flowchart of step S10 in the control method for a single-chip switch according to an embodiment of the present application;
[0046] Figure 3It is another implementation flowchart of step S10 in the control method of a single-chip switch in an embodiment of the present application;
[0047] Figure 4 It is the implementation flowchart of step S13 in the control method of a single-chip switch in an embodiment of the present application;
[0048] Figure 5 It is the implementation flowchart of step S20 in the control method of a single-chip switch in an embodiment of the present application;
[0049] Figure 6 It is another implementation flowchart of the control method of a single-chip switch in an embodiment of the present application;
[0050] Figure 7 It is a principle block diagram of a control device of a single-chip switch in an embodiment of the present application;
[0051] Figure 8 It is a schematic diagram of a device in an embodiment of the present application. Detailed implementation manners
[0052] The following further describes the present application in detail with reference to the accompanying drawings.
[0053] In one embodiment, as Figure 1 shown, the present application discloses a control method for a single-chip switch, which specifically includes the following steps:
[0054] S10: Obtain the priority and type of network data packets, and allocate the network data packets to corresponding processing queues according to the priority and / or type of the network data packets, so as to obtain the sequential processing strategy of the network data packets.
[0055] Specifically, when the switch device receives a large number of data packets, the network monitoring system analyzes the header information of each data packet to identify its priority and type, and based on different priority markings and the type of data packets, these data packets are initially allocated to different processing queues. At the same time, by introducing an adaptive algorithm, based on the real-time network traffic and device resource conditions, the priority sorting of network data packets is dynamically adjusted. According to the historical priority processing time and network load of the data packets, the execution order of high-priority tasks is predicted and adjusted in advance, so as to effectively reduce latency and improve processing efficiency in a busy network environment, so as to ensure that different data packets can be processed in corresponding ways.
[0056] S20: Obtain the device PoE information of multiple connected devices, perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of network data packets.
[0057] Specifically, data collection is carried out on the PoE information of all connected devices, including the power requirements of the devices, connection time, historical power consumption, etc., and these data are analyzed to evaluate the power requirements of each connected device, generating a preliminary power distribution strategy. Subsequently, combined with the network data packet sequence processing strategy, the PoE power supply of each port is dynamically adjusted to ensure that critical devices obtain sufficient power resources when executing high-priority tasks. By real-time monitoring the power requirements and network traffic changes of each device, the power load is automatically redistributed, thereby optimizing the utilization of the overall power resources. For example, sufficient power resources are preferentially allocated to the devices that process high-priority data packets to ensure that critical devices can operate normally under high load. Furthermore, according to the real-time network traffic and power demand conditions, the power distribution strategy is dynamically adjusted to ensure the efficient and stable operation of the entire network system.
[0058] S30: Through the parallel processing method preset by the system, and according to the network data packet sequence processing strategy and PoE power supply strategy, resource allocation is carried out, and corresponding task execution instructions are generated. According to the task execution instructions, the switch is controlled to perform task allocation.
[0059] Specifically, an intelligent resource scheduling mechanism is adopted to real-time monitor the switch load and task execution progress. Combining multi-threading technology, the execution order of various tasks is dynamically adjusted according to the priority and real-time requirements of the tasks. Through the preset parallel processing method, according to the network data packet sequence processing strategy and PoE power supply strategy, the processing resource allocation of the switch is coordinated. Each task execution instruction will be refined into multiple micro-operations. The switch system will real-time allocate the processing capacity of the switch according to the current network traffic and power load conditions to ensure that different types of tasks can be efficiently executed in parallel.
[0060] In one embodiment, as Figure 2 shown, in step S10, that is, obtaining the priority and / or type of the network data packet, and allocating the network data packet to the corresponding processing queue according to the priority and type of the network data packet, specifically including:
[0061] S11: When the priority of the network data packet is high priority, the network data packet corresponding to the high priority is promoted to the head position of the priority processing queue.
[0062] Specifically, by analyzing the priority field in the data packet header, the high-priority data packet is extracted from the regular queue and placed at the forefront of the priority processing queue, ensuring that the high-priority data packet can be processed as soon as possible, thereby meeting its low-latency requirements.
[0063] S12: When the type of the network data packet is a real-time data packet, the real-time data packet is allocated to the fast queue.
[0064] Specifically, real-time data packets are usually sensitive to latency. The system will identify these packets and directly allocate them to the fast queue to prioritize the processing speed of real-time data packets, thereby improving real-time performance and response capabilities.
[0065] In one embodiment, as Figure 3 shown, in step S10, that is, after allocating network data packets to corresponding processing queues according to the priority and type of the network data packets, it further includes:
[0066] S13: Adopt the round-robin time slice rule to rotate and process the network data packets in different processing queues to ensure that network data packets of different priorities and types can be processed within a predetermined time.
[0067] Specifically, the round-robin time slice rule is used to determine the size of the time slice allocated to each processing queue, the number of data packets or the processing time that each queue can process within a time slice, and to determine the rotation order of the processing queues, that is, to determine the processing priority or rotation order of different queues. For example, the processing order is from the fast queue to the normal queue. Subsequently, each queue processes the data packets in the queue according to the set time slice size or processing capacity until the time slice is exhausted or all the data packets in the queue are processed. If the time slice is not exhausted and there are still unprocessed data packets in the queue, the current queue will be temporarily suspended and switched to the next queue for processing until all queues have completed rotation, and then the next round of loop will be carried out to reduce the situation where low-priority data packets are not processed due to high-priority data packets and real-time data packets occupying the processing time for a long time.
[0068] In one embodiment, as Figure 4 shown, in step S13, that is, adopting the round-robin time slice rule to rotate and process the network data packets in different processing queues, specifically including:
[0069] S131: Allocate different time slice lengths to each processing queue. Among them, the priority processing queue and the fast queue are allocated preset short-term rotation time slices, and the normal processing queue is allocated a preset normal rotation time slice.
[0070] Specifically, the system will allocate shorter time slice lengths to the priority processing queue and the fast queue according to the priority of the data packets and the processing requirements of the queues to ensure that the data packets in these queues can be processed faster. The normal processing queue is allocated a slightly longer time slice to adapt to its processing speed requirements while ensuring the processing speed of the fast queue and the priority queue.
[0071] S132: Obtain the task processing efficiency of different processing queues. When the task processing efficiency corresponding to the normal processing queue is lower than the preset warning efficiency threshold, dynamically adjust the time slice length of different processing queues to adapt to the changes in network traffic and the processing requirements of different types of network data packets.
[0072] Specifically, monitor the task processing efficiency of different processing queues and compare it with the preset warning efficiency threshold. If the processing efficiency of the normal processing queue is lower than the threshold, dynamically adjust the time slice length, and reduce the time slice length corresponding to the normal queue according to different efficiency processing stages to increase its total processing time, so as to adapt to the actual network traffic and data packet processing requirements, thereby optimizing the overall processing performance.
[0073] In one embodiment, as Figure 4 shown, in step S20, that is, obtain the device PoE information of the connected device, perform power demand analysis on the connected device, and generate the corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of network data packets, specifically including:
[0074] S21: Calculate and set the power output of each port of the switch according to the power demand analysis results of multiple connected devices and the available power of the bus.
[0075] Specifically, the switch will regularly or when a device is connected obtain device reports from each connected device. These reports contain information such as the power requirements of the device. The switch calculates the power output of each port based on these demand reports and the current available power capacity of the bus. This calculation process needs to consider the maximum power demand of the device and the power supply capacity of the bus. The switch uses this information to dynamically set the power output of each port to ensure that each device can obtain appropriate power supply according to its actual needs, thereby optimizing the allocation and use of power resources.
[0076] S22: Obtain the current total system power. When the current total system power exceeds the power supply capacity, dynamically adjust the power distribution data according to the sequential processing strategy of network data packets, and generate the PoE power supply strategy for each port of the switch according to the power distribution data.
[0077] Specifically, the switch monitors the total power of the current system in real time. When it detects that the total power exceeds the power supply capacity of the system, the switch will activate the dynamic adjustment mechanism. Specifically, first, it classifies the priorities and types of network packets to generate an order processing strategy for network packets. This order processing strategy is implemented through a rule-based algorithm or a machine learning model, which can dynamically evaluate the task priorities and data types in the current network environment. For example, the system automatically generates the priority sorting of different queues according to the header information of different packets, such as source, destination, priority marking, quality of service (QoS) requirements, etc. In a high-load situation, the system will give priority to processing packets with real-time requirements, such as video streams or voice data, while delaying or throttling low-priority tasks with lower latency sensitivity, such as file transfers.
[0078] Furthermore, in combination with the current power supply situation, a corresponding Power over Ethernet (PoE) power supply strategy is generated. This power supply strategy not only considers the static power requirements of devices but also dynamically adjusts according to the order processing strategy of current network packets. For example, when a high-priority task occupies a large amount of network resources, the system will give priority to allocating sufficient power resources to ensure the smooth completion of this task. Correspondingly, for low-priority devices or tasks, the system may temporarily reduce their power supply or suspend the power supply when necessary until the critical task is processed. The entire power distribution process is continuously adjusted through real-time monitoring and feedback mechanisms to cope with the dynamic changes in network traffic and device power requirements, ensuring that the system can operate efficiently and stably under various working conditions.
[0079] In one embodiment, as Figure 6 shown, that is, the control method of the single-chip switch further includes:
[0080] S40: Monitor the operating state of the switch and network communication anomalies in real time. When detecting anomalies in packet transceiver and / or power distribution, trigger an error diagnosis program and generate corresponding diagnostic results.
[0081] Specifically, monitor the operating state of the system and network communication in real time. Monitoring the operating state includes CPU usage rate, memory usage, port status, traffic conditions, etc. Monitoring network communication includes packet sending and receiving conditions, error rate, packet loss rate, etc. Detect the operating state of the system and network communication. When abnormal situations are found, such as high CPU load, port failures, network communication interruptions, etc., trigger an error diagnosis program, such as hardware failures, network failures, software anomalies, etc., and obtain corresponding diagnostic results, including information such as anomaly type, occurrence time, and impact scope.
[0082] S50: According to the diagnosis result, execute the system-customized recovery program, and store the diagnosis result and its corresponding recovery program in the fault database.
[0083] Specifically, execute the system-customized recovery program according to the diagnosis result. The recovery program includes operations such as automatically restarting the affected modules, switching backup devices, and adjusting network configurations to quickly restore the normal operation of the system. When the error diagnosis program generates the diagnosis result and executes the recovery program, relevant information is stored in the fault database.
[0084] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0085] In one embodiment, a control device for a single-chip switch is provided, and the control device for the single-chip switch corresponds one-to-one with the control method of the single-chip switch in the above embodiment. As Figure 7 shown, the control device for the single-chip switch includes a data packet distribution module, a power demand analysis module, and a task distribution module. The detailed descriptions of each functional module are as follows:
[0086] The data packet distribution module is used to obtain the priority and type of network data packets, and distribute the network data packets to the corresponding processing queues according to the priority and / or type of the network data packets to obtain the sequential processing strategy of the network data packets;
[0087] The power demand analysis module is used to obtain the device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain the power demand analysis result, and generate the corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packets;
[0088] The task distribution module is used to perform resource allocation through the system-preset parallel processing method, and generate the corresponding task execution instructions according to the sequential processing strategy of the network data packets and the PoE power supply strategy, and control the switch to perform task distribution according to the task execution instructions.
[0089] Optionally, the data packet distribution module specifically includes:
[0090] The priority processing module is used to promote the network data packets corresponding to the high priority to the head position of the priority processing queue when the priority of the network data packets is high priority;
[0091] The type processing module is used to distribute the real-time data packets to the fast queue when the type of the network data packets is real-time data packets.
[0092] Optionally, after the data packet distribution module, the following is further included:
[0093] A round-robin processing module, which is used to adopt the round-robin rule of time slices to rotate and process network data packets in different processing queues, so as to ensure that network data packets of different priorities and types can be processed within a predetermined time.
[0094] Optionally, the round-robin processing module specifically includes:
[0095] A time slice allocation module, which is used to allocate different time slice lengths for each processing queue. Among them, the priority processing queue and the fast queue are allocated preset short-term round-robin time slices, and the normal processing queue is allocated preset normal round-robin time slices;
[0096] A dynamic adjustment module, which is used to obtain the task processing efficiency of different processing queues. When the task processing efficiency corresponding to the normal processing queue is lower than the preset warning efficiency threshold, it dynamically adjusts the time slice lengths of different processing queues to adapt to the changes in network traffic and the processing requirements of different types of network data packets.
[0097] Optionally, the power demand analysis module specifically includes:
[0098] A power calculation module, which is used to calculate and set the power output of each port of the switch according to the power demand analysis results of multiple connected devices and the available power of the bus;
[0099] A dynamic power adjustment module, which is used to obtain the current total system power. When the current total system power exceeds the power supply capacity, it dynamically adjusts the power distribution data according to the sequential processing strategy of network data packets, and generates a PoE power supply strategy for each port of the switch according to the power distribution data.
[0100] Optionally, the control method of the single-chip switch further includes:
[0101] A status monitoring module, which is used to monitor the running status of the switch and network communication anomalies in real time. When detecting anomalies in data packet transceiver and / or power distribution, it triggers an error diagnosis program and generates corresponding diagnostic results;
[0102] A recovery program module, which is used to execute the system-defined recovery program according to the diagnostic results, and store the diagnostic results and their corresponding recovery programs in the fault database.
[0103] For the specific limitations of the control device of the single-chip switch, reference can be made to the limitations of the control method of the single-chip switch in the foregoing text, which will not be elaborated here. Each module in the above control device of the single-chip switch can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0104] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the abnormal problem diagnosis results and their corresponding recovery reports. The network interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a control method for a single-chip switch.
[0105] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0106] Obtain the priority and type of network data packets, and allocate the network data packets to the corresponding processing queues according to the priority and / or type of the network data packets to obtain the sequential processing strategy of the network data packets;
[0107] Obtain the device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packets;
[0108] Through a system-predefined parallel processing method, and perform resource allocation according to the sequential processing strategy of the network data packets and the PoE power supply strategy, and generate corresponding task execution instructions, and control the switch to perform task allocation according to the task execution instructions.
[0109] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the following steps are implemented:
[0110] Obtain the priorities and types of network data packets, and allocate the network data packets to corresponding processing queues according to the priorities and / or types of the network data packets, so as to obtain an ordered processing strategy for the network data packets;
[0111] Obtain the device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the ordered processing strategy of the network data packets;
[0112] Through a preset parallel processing method of the system, perform resource allocation according to the ordered processing strategy of the network data packets and the PoE power supply strategy, and generate corresponding task execution instructions, and control the switch to perform task allocation according to the task execution instructions.
[0113] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0114] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used for illustration. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0115] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A control method for a single-chip switch, characterized in that: The control method of the single-chip switch comprises: Obtaining the priority and type of a network data packet, the type of the network data packet including a real-time data packet and a non-real-time data packet, and assigning the network data packet to a corresponding processing queue according to the priority and / or type of the network data packet to obtain a sequential processing strategy for the network data packet; Acquire device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packet; By using the system preset parallel processing method, and according to the sequential processing strategy of the network data packet and the PoE power supply strategy, resources are allocated, and corresponding task execution instructions are generated, and the switch is controlled to perform task allocation according to the task execution instructions; The obtaining of device PoE information of a plurality of connected devices, and performing power demand analysis on the plurality of connected devices according to the device PoE information to obtain a power demand analysis result, and generating a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packet, specifically includes: Calculate and set the power output of each port of the switch according to the power demand analysis results of the plurality of connected devices and the available power of the bus; The current total system power is obtained. When the current total system power exceeds the power supply capacity, the power distribution data is dynamically adjusted according to the sequential processing strategy of the network data packet, and the PoE power supply strategy of each port of the switch is generated according to the power distribution data.
2. The control method of the single-chip switch according to claim 1, characterized in that: The obtaining the priority and type of the network data packet, and allocating the network data packet to a corresponding processing queue according to the priority and / or type of the network data packet, specifically includes: When the priority of the network data packet is high, the network data packet corresponding to the high priority is promoted to the head position of the priority processing queue; In case the type of the network data packet is a real-time data packet, the real-time data packet is allocated to a fast queue.
3. The control method of the single-chip switch according to claim 2, characterized in that: After allocating the network data packets to corresponding processing queues according to the priority and type of the network data packets, the method further includes: The network data packets in different processing queues are processed in turn by adopting the time slice rotation rule, so as to ensure that the network data packets of different priorities and types can be processed within the predetermined time.
4. The control method of the single-chip switch according to claim 3, characterized in that: The adopting of the time slice rotation rule to perform rotation processing on the network data packets in different processing queues specifically includes: Allocate a different time slice length to each processing queue, wherein the priority processing queue and the fast queue are allocated a preset short rotation time slice, and the common processing queue is allocated a preset normal rotation time slice; Obtain the task processing efficiency of the different processing queues. When the task processing efficiency corresponding to the common processing queue is lower than the preset warning efficiency threshold, dynamically adjust the time slice lengths of the different processing queues to adapt to changes in network traffic and processing requirements of different types of network data packets.
5. The control method of the single-chip switch according to claim 1, characterized in that: The control method of the single-chip switch also includes: Monitor the operation status of the switch and network communication anomalies in real time, and trigger an error diagnosis program and generate corresponding diagnosis results when abnormalities in data packet reception and / or power distribution are detected; According to the diagnosis result, execute the system-defined recovery program and send the diagnosis result and its corresponding recovery program to The program is stored in the fault database.
6. A control device for a single-chip switch, characterized in that: The control device of the single-chip switch comprises: A network data packet allocation module, used to obtain the priority and type of the network data packet, and allocate the network data packet to a corresponding processing queue according to the priority and / or type of the network data packet, so as to obtain a sequential processing strategy for the network data packet; A power demand analysis module, used to obtain device PoE information of multiple connected devices, and perform power demand analysis on the multiple connected devices according to the device PoE information to obtain a power demand analysis result, and generate a corresponding PoE power supply strategy according to the power demand analysis result and the sequential processing strategy of the network data packet; A task allocation module, used to allocate resources according to the sequential processing strategy of the network data packet and the PoE power supply strategy through a system preset parallel processing method, and generate corresponding task execution instructions, and control the switch to perform task allocation according to the task execution instructions; The power demand analysis module includes: A power calculation module, used to calculate and set the power output of each port of the switch according to the power demand analysis results of the plurality of connected devices and the available power supply of the bus; A dynamic power adjustment module is used to obtain the current total system power. When the current total system power exceeds the power supply capacity, the power distribution data is dynamically adjusted according to the sequential processing strategy of the network data packet, and the PoE power supply strategy of each port of the switch is generated according to the power distribution data.
7. The control device of the single-chip switch according to claim 6, characterized in that: The data packet distribution module specifically includes: A priority processing module, used for promoting the network data packet corresponding to the high priority to the head position of the priority processing queue when the priority of the network data packet is high priority; The type processing module is used to allocate the real-time data packet to a fast queue when the type of the network data packet is a real-time data packet.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the control method of the single-chip switch according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the control method of the single-chip switch according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Network equipment and power supply method
CN107979474A
Control method and system for providing power for powered equipment and POE (Power Over Ethernet) equipment
CN118540171A