A method and apparatus for determining the remaining resources of a network device.
By configuring correction parameters to associate the computing resources and time allocation of storage network devices, the problem of network devices being unable to detect remaining resources in real time under the polling method is solved, and balanced allocation and efficient scheduling of packet processing are achieved.
Patent Information
- Application Number
- CN202210902346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-07-29
AI Technical Summary
In existing technologies, when network devices process packets using a polling method, they cannot detect remaining resources in real time, resulting in low packet processing efficiency and an inability to achieve balanced scheduling.
By pre-configuring multiple correction parameters, the ratio between the time percentage of packets and the remaining resources of network devices is characterized. Combined with the real-time acquired time percentage and computing resources, the remaining resources of network devices are determined.
It enables real-time acquisition of remaining resources during the packet processing process of network devices, supporting balanced packet distribution and efficient processing.
Smart Images

Figure CN115269189B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication message processing technology, and in particular to a method and apparatus for determining the remaining resources of a network device. Background Technology
[0002] Currently, some network devices, such as x86 servers, no longer use interrupt-driven methods for sending, receiving, and processing communication packets. Instead, they use polling, where the central processing unit (CPU) in the network device checks for received packets at set intervals. However, polling prevents the server from knowing its remaining processing resources and from reporting relevant data to the backend monitoring and scheduling platform. This hinders balanced packet distribution and results in low packet processing efficiency. Summary of the Invention
[0003] This application provides a method and apparatus for determining the remaining resources of a network device, which is used to obtain the remaining resources of the network device for processing messages in real time, so as to facilitate the monitoring and message distribution of the device used to forward messages to the network device.
[0004] In a first aspect, embodiments of this application provide a method for determining the remaining resources of a network device, including:
[0005] The time percentage for obtaining the target message, where the target message is the message that has been processed and completed; the time percentage for the target message is the proportion of the time spent processing the target message within the task cycle of the target message.
[0006] Based on the time percentage of the target packet and the computing resources of the target network device used to process the target packet, a target correspondence is determined from a pre-configured set of correspondences, and the target correction parameters included in the target correspondence are determined; wherein any set of correspondences is the relationship between the time percentage of the packet, the computing resources of the network device, and the correction parameters; the target correction parameters are used to characterize the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device;
[0007] Based on the time percentage of the target packets and the target correction parameters, the remaining resources of the target network device are determined.
[0008] Based on the above scheme, this application proposes pre-configuring multiple correction parameters to characterize the proportional relationship between the time proportion of packets and the remaining resources of network devices. It also proposes storing these correction parameters in association with the network device's computing resources and time proportion. In practical implementation, a target correction parameter can be determined based on the real-time acquired time proportion and the network device's computing resources. The remaining resources of the network device are then obtained after correcting the time proportion based on the target correction parameter. This allows for real-time acquisition of the network device's remaining resources during packet processing, facilitating packet allocation by devices used for forwarding packets to the network device.
[0009] In some embodiments, the method further includes:
[0010] Obtain the computing resources of network devices, as well as the time percentage of packets;
[0011] Based on the computing resources, the time percentage of the message, and the remaining resources of the network device when processing the message, determine any one of the correction parameters included in the multiple sets of correspondences.
[0012] In some embodiments, configuring the multiple sets of correspondence relationships includes:
[0013] The network device model, the time ratio of the message, and any one of the correction parameters are used to form any one of the multiple sets of correspondence relationships.
[0014] In some embodiments, the time percentage for acquiring the target message includes:
[0015] Obtain the input timestamp and output timestamp of any sub-message included in the target message;
[0016] The duration between the input timestamp and the output timestamp is used as the processing duration of any one of the sub-messages;
[0017] The processing time for processing the target message is determined based on the processing time of the sub-messages included in the target message;
[0018] Calculate the proportion of the time spent processing the target message to the task cycle of the target message to obtain the time percentage of the target message.
[0019] In some embodiments, the method further includes:
[0020] The percentage of remaining resources of the target network device is determined based on the remaining resources and computing resources of the target network device.
[0021] When the remaining resource percentage of the target network device is less than a set threshold, an indication message is generated to indicate that the target network device has insufficient remaining resources;
[0022] The instruction information is sent to the equipment of the operation and maintenance personnel.
[0023] Secondly, embodiments of this application provide a device for determining the remaining resources of a network device, comprising:
[0024] The acquisition unit is used to acquire the time percentage of a target message, wherein the target message is a message that has been processed and completed; the time percentage of the target message is the proportion of the time spent processing the target message within the task cycle of the target message.
[0025] The processing unit is configured to execute:
[0026] Based on the time percentage of the target packet and the computing resources of the target network device used to process the target packet, a target correspondence is determined from a pre-configured set of correspondences, and the target correction parameters included in the target correspondence are determined; wherein any set of correspondences is the relationship between the time percentage of the packet, the computing resources of the network device, and the correction parameters; the target correction parameters are used to characterize the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device;
[0027] Based on the time percentage of the target packets and the target correction parameters, the remaining resources of the target network device are determined.
[0028] In some embodiments, the acquisition unit is further configured to acquire the computing resources of the network device and the time percentage of the packets;
[0029] The processing unit is further configured to determine any one of the correction parameters included in the multiple sets of correspondences based on the computing resources, the time proportion of the packet, and the remaining resources of the network device when processing the packet.
[0030] In some embodiments, the processing unit is further configured to:
[0031] The network device model, the time ratio of the message, and any one of the correction parameters are used to form any one of the multiple sets of correspondence relationships.
[0032] In some embodiments, the acquisition unit is specifically used for:
[0033] Obtain the input timestamp and output timestamp of any sub-message included in the target message;
[0034] Executed by the processing unit:
[0035] The duration between the input timestamp and the output timestamp is used as the processing duration of any one of the sub-messages;
[0036] The processing time for processing the target message is determined based on the processing time of the sub-messages included in the target message;
[0037] Calculate the proportion of the time spent processing the target message to the task cycle of the target message to obtain the time percentage of the target message.
[0038] In some embodiments, the processing unit is further configured to:
[0039] The percentage of remaining resources of the target network device is determined based on the remaining resources and computing resources of the target network device.
[0040] When the remaining resource percentage of the target network device is less than a set threshold, an indication message is generated to indicate that the target network device has insufficient remaining resources;
[0041] The instruction information is sent to the equipment of the operation and maintenance personnel.
[0042] Thirdly, an electronic device is provided, comprising a controller and a memory. The memory stores computer-executable instructions, and the controller executes the computer-executable instructions in the memory to perform operational steps of any possible implementation of the method of the first aspect using hardware resources in the controller.
[0043] Fourthly, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0044] Furthermore, the beneficial effects of the second to fourth aspects can be found in the beneficial effects described in the first aspect, and will not be repeated here. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A flowchart illustrating a method for determining the remaining resources of a network device, provided as an embodiment of this application;
[0047] Figure 2 A schematic diagram of a matrix provided for an embodiment of this application;
[0048] Figure 3 A flowchart illustrating another method for determining the remaining resources of a network device provided in an embodiment of this application;
[0049] Figure 4 A schematic diagram of a device for determining the remaining resources of a network device provided in an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0052] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data used can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0053] To facilitate understanding of the proposed solution, the technical terms used in this application will be introduced first:
[0054] (1) The Data Plane Development Kit (DPDK) is a collection of function libraries and drivers for fast packet processing, which can greatly improve data processing performance and throughput, and improve the efficiency of data plane applications.
[0055] (2) Time slice: The time allocated by the CPU to each program to be processed. Each program is allocated a time period called its time slice, which is the time that the program is allowed to run, so that the programs appear to be running simultaneously. If a program is still running when the time slice ends, the CPU will be preempted and allocated to another program. If a program is blocked or terminated before the time slice ends, the CPU will switch immediately without wasting CPU resources.
[0056] In related technologies, DPDK uses a polling method to occupy the CPU, so the CPU utilization rate will always remain at 100%, and DPDK cannot detect the actual remaining processing resources of the CPU in real time. Similarly, devices that transmit packets to network devices and devices that forward packets to network devices will also not know the remaining processing resources of the network devices, which may lead to uneven distribution of packet processing tasks.
[0057] To address this issue, embodiments of this application provide a method and apparatus for determining the remaining resources of a network device. Since the proportion of time a network device spends processing packets within the entire packet task cycle is not linearly related to the actual remaining processing resources of the network device, this application proposes pre-configuring multiple correction parameters to characterize the proportional relationship between the time proportion and the remaining resources of the network device. Furthermore, it proposes storing these correction parameters in association with the network device's computing resources and the time proportion. In practical implementation, a target correction parameter can be determined based on the real-time acquired time proportion and the network device's computing resources. The remaining resources of the network device are then obtained after correcting the time proportion based on the target correction parameter.
[0058] The following describes in detail a method and apparatus for determining the remaining resources of a network device according to this application. In the embodiments of this application, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. The singular expressions "a," "an," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context explicitly indicates otherwise. Furthermore, unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the order, sequence, priority, or importance of multiple objects. For example, "first task execution device" and "second task execution device" are only used to distinguish different task execution devices, and do not indicate a difference in priority or importance between the two task execution devices.
[0059] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0060] The solution provided in this application will be described in detail below. (See also...) Figure 1 This is a flowchart illustrating a method for determining the remaining resources of a network device according to an embodiment of this application. It should be noted that this application does not limit the executing entity for the method of determining the remaining resources of a network device; for example, it can be executed by a processing chip, processor, or other processing module capable of computation. Figure 1 The method flow shown specifically includes:
[0061] 101, the percentage of time spent acquiring the target message.
[0062] The target message is the message that the network device has currently completed processing. The target percentage is the proportion of the processing time of the target message to the task cycle of the target message. For example, if the network device receives the target message, determines that the task cycle of the target message is 10 seconds, and after processing the target message, the actual processing time is recorded as 7 seconds, then the time percentage of the target message is 7 / 10.
[0063] 102. Based on the time proportion of the target message and the computing resources of the target network device, determine the target correspondence from multiple pre-configured correspondences, and determine the target correction parameters contained in the target correspondence.
[0064] Among them, the target network device is the network device used to process the target packet, and the computing resources of the target network device are the maximum processing resources that the target network device can support. Generally, different models of network devices have different computing resources.
[0065] Optionally, the correspondence is the correspondence between the time proportion of the packets, the computing resources of the network device, and the correction parameters, which can be pre-configured in the network device. Based on the obtained time proportion of the target packets and the computing resources of the target network device, the target correspondence can be determined from multiple pre-configured correspondences, and the target correction parameters included in the target correspondence can be determined.
[0066] The target correction parameter characterizes the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device. As described in the above embodiments, there is no linear relationship between the time percentage of the packet and the remaining resources of the network device. Therefore, this application proposes to link the remaining resources of the device and the time percentage of the packet through a pre-configured correction parameter. In other words, different time percentages of packets and different remaining resources of network devices can correspond to different correction parameters. The correction parameter can be understood as a parameter used to correct the time percentage of the packet to the remaining resources of the network device used to process the packet.
[0067] 103. Based on the time percentage of the target packets and the target correction parameters, determine the remaining resources of the target network device.
[0068] Optionally, the time percentage of the acquired target packets can be corrected based on the target correction parameters to obtain the remaining resources of the target network device.
[0069] Based on the above scheme, this application proposes pre-configuring multiple correction parameters to characterize the proportional relationship between the time proportion of packets and the remaining resources of network devices. It also proposes storing these correction parameters in association with the network device's computing resources and time proportion. In practical implementation, a target correction parameter can be determined based on the real-time acquired time proportion and the network device's computing resources. The remaining resources of the network device are then obtained after correcting the time proportion based on the target correction parameter. This allows for real-time acquisition of the network device's remaining resources during packet processing, facilitating packet allocation by devices used for forwarding packets to the network device.
[0070] In some scenarios, network devices may include a CPU for processing packets and a processor (or processing chip, which is not limited to this application) for executing the aforementioned method for determining remaining resources. The processor can obtain the percentage of time the CPU spends processing packets. The following section will continue with an example of obtaining the percentage of time spent processing the target packet.
[0071] In one possible implementation, when the CPU receives a target message, it can determine the task cycle of the target message based on the message type. Further, after processing the target message, the CPU can calculate the processing time of the target message, and determine the proportion of that processing time to the target message's task cycle, thus obtaining the time percentage of the target message. Further still, the CPU can store this time percentage of the target message in memory. The processor used to execute the above-described remaining resource determination method can retrieve the time percentage of the target message from memory.
[0072] As an example, when processing a target message, the CPU can divide the processing of the target message into multiple sub-processes, each corresponding to a processing time slice. The sum of the time slices of all sub-processes is the CPU's processing time for the target message. Optionally, the process of the CPU running each sub-process can be regarded as the process of the CPU processing each sub-message of the target message. When calculating the processing time of the target message, the CPU can obtain the input timestamp and output timestamp of each sub-message, and use the time between the input timestamp and the output timestamp as the processing time of the sub-message. Further, the sum of the processing times of all sub-messages is used as the CPU's processing time for the target message. Further still, the CPU can calculate the ratio of the target message's processing time to the target message's task cycle time to obtain the time percentage of the target message.
[0073] It is known that the time percentage of a packet and the remaining resources of a network device are not linearly related; therefore, after obtaining the time percentage of the target packet, the remaining resources of the target network device cannot be directly determined. Based on this, embodiments of this application propose pre-configuring multiple correction parameters. The process of configuring the correction parameters proposed in this application is described below.
[0074] In one possible implementation, correction parameters can be trained using a training set consisting of the network device's computing resources, the time percentage of each packet, and the remaining resources of the network device when processing a packet. For example, let's take the target packet and the target network device as an example. Optionally, the computing resources of the target network device, the time percentage of the target packet, and the remaining resources of the target network device when processing the target packet can be obtained. Further, correction parameters for correcting the time percentage of the target packet to the remaining resources of the target network device are determined based on these three parameters. Similarly, the computing resources of multiple network devices, the time percentage of multiple packets, and the remaining resources of each network device when processing each packet can be used to form a training set to obtain multiple correction parameters. As an example, the correction parameters can be determined using the following formula (1):
[0075]
[0076] Where 'a' represents the number of corrective adoptions, and 'pps' represents the number of adoptions. max For network device computing resources, tsc n For the time percentage of the message, PPS n The percentage of processing time for network devices is tsc. n The remaining resources when the message is sent.
[0077] In some embodiments, multiple configured correction parameters can be stored directly, or the correction parameters, packet time percentages, and network device computing resources can be associated and stored. Optionally, they can be stored in the form of multiple sets of correspondences, each set representing the relationship between correction parameters, packet time percentages, and network device computing resources.
[0078] In one possible implementation, multiple sets of correspondences can be stored in the form of a table. The rows of the table represent the computing resources of the network devices, and the columns represent the time percentage of the packets. Each value in the table is a correction parameter for the corresponding network device when processing the corresponding packet using its computing resources. Optionally, since different models of network devices have different computing resources, the rows of the table can also represent the model of the network device.
[0079] In another possible implementation, multiple sets of correspondences can be stored in the form of a matrix. The rows of the matrix represent the computing resources of the network devices, the columns represent the time percentage of the packets, and each element in the matrix represents the correction parameters for the corresponding network device's computing resources when processing the corresponding packet. Optionally, since different models of network devices have different computing resources, the rows of the matrix can also represent the model of the network device. For example, see... Figure 2 This is a schematic diagram of a matrix provided in an embodiment of this application, where any element a in the matrix... i,j This refers to the correction parameters when the network device model is i and the time percentage of the message is j.
[0080] Optionally, after obtaining the time percentage of the currently processed target packets and the computing resources of the target network device, the target correction parameters can be determined based on the multiple sets of correspondences described in the above embodiments. Further, the remaining resources of the target network device are obtained by correcting the obtained time percentage of the target packets based on the target correction parameters. For example, the remaining resources of the target network device can be determined using the following formula (2):
[0081] pps t =pps max *a ij *tsc t ; Formula (2)
[0082] Among them, pps t For the remaining resources of the target network device, PPS max For the computing resources of the target network device, a ij For the target correction parameter, tsc t The percentage of time for the target message.
[0083] In some embodiments, after determining the remaining resources of the target network device, the percentage of remaining resources of the target network device can be further calculated based on the remaining resources and the computing resources of the target network device, that is, the percentage of remaining resources relative to the total resources of the target network device. When the percentage of remaining resources of the target network device is less than a set threshold, an indication message indicating insufficient remaining resources of the target network device is generated and sent to the maintenance personnel's equipment.
[0084] In other embodiments, the remaining resource percentage of the target network device can also be determined based on the time proportion of the target packets and the target correction parameters. For example, the remaining resource percentage of the target network device can be calculated using the following formula (3):
[0085] pps % =a ij *tsc t ; Formula (3)
[0086] Among them, pps % a represents the percentage of remaining resources of the target network device. ij For the target correction parameter, tsc t The percentage of time for the target message.
[0087] To further understand the solutions provided in the embodiments of this application, the following description is provided in conjunction with specific processing modules in a network device. See [link to relevant documentation]. Figure 3 This application provides a flowchart of a method for determining the remaining resources of a network device. This method is executed by various processing modules included in the network device, and the specific steps of the method include:
[0088] 301. The message processing module receives the target message and determines the task cycle of the target message.
[0089] 302. After the target message is processed, the message processing module calculates the processing time of the target message.
[0090] The specific statistical process can be found in the description in the above embodiments, and will not be repeated here.
[0091] 303. The message processing module calculates the time percentage of the target message based on the processing time and task cycle of the target message.
[0092] 304, the message processing module stores the time percentage of the target message in the memory.
[0093] 305. The time percentage acquisition module retrieves the time percentage of the target message from the memory and sends it to the correction module.
[0094] 306. The correction module determines the target correspondence and the target correction parameters included in the target correspondence from multiple pre-configured correspondences based on the time proportion of the target packets and the model of the target network device.
[0095] Each set of correspondences includes the time percentage of the message, the model of the network device, and the correspondence of the correction parameters up to the present.
[0096] 307. The correction module corrects the time percentage of the target packets based on the target correction parameters to obtain the remaining resources of the target network device.
[0097] 308, the alarm module obtains the remaining resources of the target network device and calculates the percentage of remaining resources of the target network device.
[0098] 309. The alarm module sends an alarm message to the maintenance personnel's equipment when the remaining resource percentage of the target network device is less than a set threshold.
[0099] The alarm information is used to indicate that the target network device has insufficient remaining resources.
[0100] Based on the same concept as the method described above, see [link to relevant documentation]. Figure 4 This application provides a device 400 for determining the remaining resources of a network device. The device 400 is used to execute the steps in the above-described method; to avoid repetition, these steps will not be described again here. The device 400 includes an acquisition unit 401 and a processing unit 402.
[0101] The acquisition unit 401 is used to acquire the time percentage of a target message, wherein the target message is a message that has been processed and completed; the time percentage of the target message is the proportion of the time spent processing the target message within the task cycle of the target message.
[0102] Processing unit 402 is configured to execute:
[0103] Based on the time percentage of the target packet and the computing resources of the target network device used to process the target packet, a target correspondence is determined from a pre-configured set of correspondences, and the target correction parameters included in the target correspondence are determined; wherein any set of correspondences is the relationship between the time percentage of the packet, the computing resources of the network device, and the correction parameters; the target correction parameters are used to characterize the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device;
[0104] Based on the time percentage of the target packets and the target correction parameters, the remaining resources of the target network device are determined.
[0105] In some embodiments, the acquisition unit 401 is further configured to acquire the computing resources of the network device and the time percentage of the packets;
[0106] The processing unit 402 is further configured to determine any one of the correction parameters included in the multiple sets of correspondences based on the computing resources, the time proportion of the packet, and the remaining resources of the network device when processing the packet.
[0107] In some embodiments, the processing unit 402 is further configured to:
[0108] The network device model, the time ratio of the message, and any one of the correction parameters are used to form any one of the multiple sets of correspondence relationships.
[0109] In some embodiments, the acquisition unit 401 is specifically used for:
[0110] Obtain the input timestamp and output timestamp of any sub-message included in the target message;
[0111] Executed by the processing unit 402:
[0112] The duration between the input timestamp and the output timestamp is used as the processing duration of any one of the sub-messages;
[0113] The processing time for processing the target message is determined based on the processing time of the sub-messages included in the target message;
[0114] Calculate the proportion of the time spent processing the target message to the task cycle of the target message to obtain the time percentage of the target message.
[0115] In some embodiments, the processing unit 402 is further configured to:
[0116] The percentage of remaining resources of the target network device is determined based on the remaining resources and computing resources of the target network device.
[0117] When the remaining resource percentage of the target network device is less than a set threshold, an indication message is generated to indicate that the target network device has insufficient remaining resources;
[0118] The instruction information is sent to the equipment of the operation and maintenance personnel.
[0119] Figure 5 A schematic diagram of the structure of an electronic device 500 provided in an embodiment of this application is shown. The electronic device 500 in this embodiment may further include a communication interface 503, such as a network port, through which the electronic device can transmit data.
[0120] In this embodiment, the memory 502 stores instructions that can be executed by at least one controller 501. By executing the instructions stored in the memory 502, the at least one controller 501 can perform various steps in the above-described method. For example, the controller 501 can implement the above-described... Figure 4 The functions of the acquisition unit 401 and the processing unit 402 are described.
[0121] The controller 501 is the control center of the electronic device, capable of connecting various parts of the device via various interfaces and lines. It executes instructions stored in the memory 502 and retrieves data stored in the memory 502. Optionally, the controller 501 may include one or more processing units. The controller 501 may integrate an application controller and a modem controller. The application controller primarily handles the operating system and applications, while the modem controller primarily handles wireless communication. It is understood that the modem controller may not be integrated into the controller 501. In some embodiments, the controller 501 and the memory 502 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0122] Controller 501 can be a general-purpose controller, such as a central processing unit (CPU), digital signal controller, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose controller can be a microcontroller or any conventional controller. The steps performed by the data statistics platform disclosed in the embodiments of this application can be directly executed by the hardware controller, or executed by a combination of hardware and software modules within the controller.
[0123] Memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 502 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 502 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0124] By designing and programming the controller 501, for example, the code corresponding to the neural network model training method described in the foregoing embodiments can be embedded into the chip, so that the chip can execute the steps of the aforementioned neural network model training method when running. How to design and program the controller 501 is a technique known to those skilled in the art, and will not be described in detail here.
[0125] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a controller of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the controller of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0127] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0129] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0130] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for determining the remaining resources of a network device, characterized in that, include: The percentage of time spent acquiring the target message, where the target message is the message that has been processed and completed at the moment. The time percentage of the target message is the proportion of the time spent processing the target message within the task cycle of the target message. Based on the time proportion of the target packets and the computing resources of the target network device used to process the target packets, a target correspondence is determined from a pre-configured set of correspondences, and the target correction parameters included in the target correspondence are determined; wherein any set of correspondences is the relationship between the time proportion of packets, the computing resources of the network device, and the correction parameters; The target correction parameter is used to characterize the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device. Based on the time percentage of the target packets and the target correction parameters, the remaining resources of the target network device are determined; The method further includes: obtaining the computing resources of the network device and the time percentage of the packets; and determining any one of the correction parameters included in the multiple sets of correspondences based on the computing resources, the time percentage of the packets, and the remaining resources of the network device when processing the packets. Configuring the multiple sets of correspondences includes: forming any one set of correspondences among the multiple sets of correspondences by combining the network device model, the packet time ratio, and any one of the correction parameters.
2. The method according to claim 1, characterized in that, The percentage of time spent acquiring the target message includes: Obtain the input timestamp and output timestamp of any sub-message included in the target message; The duration between the input timestamp and the output timestamp is used as the processing duration of any one of the sub-messages; The processing time for processing the target message is determined based on the processing time of the sub-messages included in the target message; Calculate the proportion of the time spent processing the target message to the task cycle of the target message to obtain the time percentage of the target message.
3. The method according to claim 1 or 2, characterized in that, The method further includes: The percentage of remaining resources of the target network device is determined based on the remaining resources and computing resources of the target network device. When the remaining resource percentage of the target network device is less than a set threshold, an indication message is generated to indicate that the target network device has insufficient remaining resources; The instruction information is sent to the equipment of the operation and maintenance personnel.
4. A device for determining the remaining resources of a network device, characterized in that, include: The acquisition unit is used to acquire the time percentage of the target message, wherein the target message is the message that has been processed and completed. The time percentage of the target message is the proportion of the time spent processing the target message within the task cycle of the target message. The processing unit is configured to execute: Based on the time proportion of the target packets and the computing resources of the target network device used to process the target packets, a target correspondence is determined from a pre-configured set of correspondences, and the target correction parameters included in the target correspondence are determined; wherein any set of correspondences is the relationship between the time proportion of packets, the computing resources of the network device, and the correction parameters; The target correction parameter is used to characterize the proportional relationship between the time percentage of the target packet and the remaining resources of the target network device. Based on the time percentage of the target packets and the target correction parameters, the remaining resources of the target network device are determined; The acquisition unit is also used to acquire the computing resources of the network device and the time percentage of the packets; The processing unit is further configured to determine any one of the correction parameters included in the multiple sets of correspondences based on the computing resources, the time proportion of the packet, and the remaining resources of the network device when processing the packet; The processing unit is further configured to combine the network device model, the time percentage of the packet, and any one of the correction parameters into any one of the multiple sets of correspondence relationships.
5. The apparatus according to claim 4, characterized in that, The acquisition unit is specifically used for: Obtain the input timestamp and output timestamp of any sub-message included in the target message; Executed by the processing unit: The duration between the input timestamp and the output timestamp is used as the processing duration of any one of the sub-messages; The processing time for processing the target message is determined based on the processing time of the sub-messages included in the target message; Calculate the proportion of the time spent processing the target message to the task cycle of the target message to obtain the time percentage of the target message.
6. The apparatus according to claim 4 or 5, characterized in that, The processing unit is further configured to: The percentage of remaining resources of the target network device is determined based on the remaining resources and computing resources of the target network device. When the remaining resource percentage of the target network device is less than a set threshold, an indication message is generated to indicate that the target network device has insufficient remaining resources; The instruction information is sent to the equipment of the operation and maintenance personnel.
Citation Information
Patent Citations
Method and apparatus for realizing load balance of resources in data center
CN102232282A
CPU utilization rate determination method and system, storage medium and electronic equipment
CN112162901A
