Power network traffic service classification method, device, terminal and storage medium
By obtaining the transmission and reception information of power network data packets, determining the target delay and prioritization, the problem of poor real-time data transmission in power network is solved, effectively grading and efficient transmission of data packets are realized, and the real-time needs of big data applications are met.
Patent Information
- Application Number
- CN202211411963.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Poor real-time performance in power network data transmission leads to conflicts between big data applications and network transmission. Traditional data processing technology cannot meet the analysis needs of quickly obtaining knowledge and information from massive data.
By obtaining the sending and receiving information of the pending data packet, determining its target delay, and determining the priority of the data packet based on the target delay and the sending delay of the current queue, realizing the preprocessing analysis and grading of the data packet, meeting different real-time requirements .
It alleviates the contradiction between big data applications and network transmission, realizes effective grading of data packets, improves the transmission efficiency of data packets, and meets the different real-time requirements between multiple data packets.
Smart Images

Figure CN115883474B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a service classification method, device, terminal and storage medium for power network traffic. Background Art
[0002] With the rapid development of mobile Internet in recent years, the requirements for information transmission security and stability are getting higher and higher. For the power system, power network data is one of the important foundations of power data interconnection, which undoubtedly puts forward higher requirements for the stable transmission of power information.
[0003] The long-distance transmission of power data mainly relies on the power communication network, which is a dedicated communication network for power grid production, management and marketing. It carries various services belonging to security areas such as I, II, and management information. The services corresponding to areas I and II are production services; the rest are management information services. The production services and management information services have different requirements for the network.
[0004] Among them, the production dispatching business system includes two categories: power system proprietary business and dispatching system business. Proprietary business includes system relay protection and safety and stability control signals, which are essential transmission signals to ensure the safe and stable operation of the power grid, and require extremely high reliability and short transmission delay. Dispatching system business includes data business such as power angle measurement system, electric energy metering system, and power market operation system. Dispatching system business is mainly carried on the power dispatching data network.
[0005] Management information services mainly include financial management systems, material management systems, engineering management systems, human resource management systems, production safety management systems, office automation systems, etc. Enterprise management information data is sensitive information of the enterprise, and there are no special requirements for transmission delay and transmission rate, but there are high requirements for security and reliability, and reliable paths and sufficient bandwidth must be provided.
[0006] Although power information transmission can adopt a variety of communication modes, during the power network transmission process, different business types, complex transmission systems, various transmission destinations and transmission directions make the already crowded power information transmission channel even more congested.
[0007] On the other hand, with the development of condition monitoring technology and the interaction of various automated information application systems in the power grid, power equipment data has shown characteristics such as large data scale, fast update speed, multi-source heterogeneity and low value density, which fully meets all the characteristics of big data and is typical big data.
[0008] Under the new situation of explosive growth of big data of power equipment, traditional data processing technology has encountered bottlenecks and cannot meet the analytical needs of quickly acquiring knowledge and information from massive data. The integration of big data of power equipment is an inevitable requirement for the information and intelligent development of the power industry.
[0009] In the face of the two dilemmas mentioned above, power communication networks should classify power network traffic according to the differentiated needs of different power services, and on the premise that multi-source data contain different data attributes, classify power network traffic according to different real-time requirements, which is an important measure to make up for the current two shortcomings.
[0010] Based on this, it is necessary to develop and design a business classification method for power network traffic. Summary of the invention
[0011] The embodiments of the present invention provide a method, device, terminal and storage medium for classifying business of power network traffic, which are used to solve the problem of poor real-time performance of power network data transmission in the prior art.
[0012] In a first aspect, an embodiment of the present invention provides a service classification method for power network traffic, comprising:
[0013] Obtaining a pending data packet, wherein the pending data packet contains sending and receiving information;
[0014] Determine the target delay of the pending data packet according to the sending and receiving information of the pending data packet, wherein the target delay represents the time difference target from the reception to the forwarding of the pending data packet;
[0015] The priority of the pending data packet is determined according to the target delay and the sending delays of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are sent.
[0016] In a possible implementation, determining a target delay of the pending data packet according to the receiving and sending information of the pending data packet includes:
[0017] Acquire the source address, destination address and communication protocol of the pending data packet according to the pending data packet;
[0018] According to the source address, the destination address and the communication protocol, the target delay is found from a target delay comparison table, wherein the target delay comparison table records a plurality of entries, each entry records a source address, a destination address, a communication protocol and a delay duration.
[0019] In a possible implementation, each entry in the comparison table is obtained according to the following steps:
[0020] Acquire multiple communication record pairs between an entry source address and an entry destination address using an entry communication protocol;
[0021] According to the multiple communication record pairs, the response duration, the sending interval duration, the response difference and the sending interval difference are respectively obtained, wherein the response duration is the response duration of the entry source address to the entry destination address, the sending interval duration is the interval duration between two adjacent data packets sent by the entry source address, the response difference represents the change rate of multiple response durations, and the sending interval difference represents the change rate of multiple sending interval durations;
[0022] The delay duration is determined according to the response duration, the sending interval duration, the corresponding difference and the sending interval difference.
[0023] In a possible implementation, the response time is determined according to the plurality of communication record pairs and a first formula, wherein the first formula is:
[0024]
[0025] In the formula, is the response time, t ri is the time when the i-th entry destination address data packet is received, t ti is the time when the entry source address data packet is received for the i-th time, N i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs;
[0026] The response difference is determined according to the plurality of communication record pairs and a second formula, wherein the second formula is:
[0027]
[0028] In the formula, is the response differential, t r(i+1) is the time when the entry destination address data packet is received for the i+1th time, t t(i+1) is the time when the entry source address data packet is received for the i+1th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0029] In a possible implementation, the sending interval duration is determined according to the multiple communication record pairs and a third formula, wherein the third formula is:
[0030]
[0031] In the formula, is the sending interval duration, t t(i+1)is the time when the entry source address data packet is received for the i+1th time, t ti is the time when the entry source address data packet is received for the i-th time, N i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs;
[0032] The sending interval difference is determined according to the plurality of communication record pairs and a fourth formula, wherein the fourth formula is:
[0033]
[0034] In the formula, is the sending interval difference, t t(i+2) is the time when the entry source address data packet is received for the i+2th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0035] In a possible implementation manner, determining the delay duration according to the response duration, the sending interval duration, the corresponding difference, and the sending interval difference includes:
[0036] The response duration, the sending interval duration, the corresponding difference and the sending interval difference are respectively input into a delay determination model, and an output of the delay determination model is obtained as the delay duration;
[0037] The delay determination model is obtained by training a basic model based on the fifth formula, wherein the fifth formula is:
[0038]
[0039] Where f(x) is the output of the basic model, e is a natural constant, and x i is the dependent variable, w i is the weight;
[0040] The training steps of the basic model include:
[0041] Acquire multiple history sets, wherein the history sets include response duration, sending interval duration, corresponding difference, and sending interval difference of corresponding historical time nodes;
[0042] Acquire multiple demand delay durations that meet the power network service demand, wherein the multiple demand delay durations correspond to the multiple history sets and represent the demand delay durations in different history sets;
[0043] Inputting the multiple history sets into the basic model respectively to obtain multiple training outputs, wherein the response duration, the sending interval duration, the corresponding difference and the sending interval difference in the history set are input into the basic model as dependent variables;
[0044] According to the deviations between the multiple training outputs and the multiple required delay durations, adjusting the weight of the basic model until the deviations between the multiple training outputs and the multiple required delay durations are less than a threshold;
[0045] The weight of the basic model is fixed, and the basic model is used as the delay determination model.
[0046] In a possible implementation, determining the priority of the pending data packet according to the target delay and the transmission delays of multiple data packets in the current queue includes:
[0047] Initialize multiple particles, each particle is configured with a position vector and a velocity vector, wherein the position vector is used to represent the priority of the pending data packet and multiple data packets in the current queue, and the velocity vector is used to represent the moving direction and speed of the iteration of the position vector;
[0048] Obtain the data length of the pending data packet and the data length of multiple data packets corresponding to the current queue;
[0049] Fitness calculation step: determining a plurality of fitnesses according to the position vectors of the plurality of particles, the data length of the pending data packet and the data length of the plurality of data packets in the current queue, wherein the fitnesses represent the deviation between the delay of the pending data packet determined by the particles and the target delay, and the deviation between the delay of the plurality of data packets in the current queue determined by the particles and the target delay of the plurality of data packets in the current queue;
[0050] For each particle of the plurality of particles, adjusting the velocity vector, the position vector and the iteration count value of the particle according to the velocity vector of the particle, the optimal value of the individual position vector and the optimal values of the position vectors of the plurality of particles;
[0051] If the iteration count value does not reach the preset value, jump to the fitness calculation step;
[0052] Otherwise, a particle with the highest fitness among the multiple particles is selected as a target particle, and the priority of the pending data packet is determined according to the position of the target particle.
[0053] In a second aspect, an embodiment of the present invention provides a service classification device for power network traffic, which is used to implement the steps of the method described in the first aspect or any possible implementation manner of the first aspect, and the service classification device for power network traffic includes:
[0054] A pending data packet acquisition module is used to acquire a pending data packet, wherein the pending data packet contains sending and receiving information;
[0055] A target delay determination module, used to determine the target delay of the pending data packet according to the receiving and sending information of the pending data packet, wherein the target delay represents the time difference target from the reception to the forwarding of the pending data packet;
[0056] as well as,
[0057] The grading module is used to determine the priority of the pending data packet according to the target delay and the sending delay of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are sent.
[0058] In a third aspect, an embodiment of the present invention provides a terminal, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0059] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0060] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0061] The embodiment of the present invention discloses a service classification method for power network traffic, which first obtains a pending data packet, wherein the pending data packet contains sending and receiving information; then, according to the sending and receiving information of the pending data packet, the target delay of the pending data packet is determined, wherein the target delay represents the time difference target from receiving to forwarding of the pending data packet; finally, according to the target delay and the sending delay of multiple data packets in the current queue, the priority of the pending data packet is determined, wherein the priority represents the order in which the data packets are sent. The embodiment of the present invention performs preprocessing analysis on the power network traffic data packet, determines the target delay by analyzing the obtained data, and then determines the priority according to the target delay, and finally sends the data packet according to the priority. Therefore, the embodiment of the present invention realizes the classification of data packets based on the method of data packet preprocessing, meets the different real-time requirements between multiple data packets, and alleviates the contradiction between big data application and network transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0063] Figure 1 is a flow chart of a method for classifying business of power network traffic provided by an embodiment of the present invention;
[0064] Figure 2 It is a functional block diagram of a service classification device for power network traffic provided by an embodiment of the present invention;
[0065] Figure 3 It is a functional block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary details.
[0067] In order to make the purpose, technical solutions and advantages of the present invention more clear, a specific implementation method will be described below in conjunction with the accompanying drawings.
[0068] The following is a detailed description of an embodiment of the present invention. This example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0069] Figure 1 A flow chart of a method for business classification of power network traffic provided in an embodiment of the present invention.
[0070] like Figure 1 As shown, it shows a flowchart of the implementation of the service classification method of the power network traffic provided by the embodiment of the present invention, which is described in detail as follows:
[0071] In step 101, a pending data packet is obtained, wherein the pending data packet includes sending and receiving information.
[0072] In step 102, a target delay of the pending data packet is determined according to the receiving and sending information of the pending data packet, wherein the target delay represents a time difference target from the reception to the forwarding of the pending data packet.
[0073] In some implementations, step 102 includes:
[0074] Acquire the source address, destination address and communication protocol of the pending data packet according to the pending data packet;
[0075] According to the source address, the destination address and the communication protocol, the target delay is found from a target delay comparison table, wherein the target delay comparison table records a plurality of entries, each entry records a source address, a destination address, a communication protocol and a delay duration.
[0076] In some implementations, a plurality of communication record pairs between an entry source address and an entry destination address using an entry communication protocol are obtained;
[0077] According to the multiple communication record pairs, the response duration, the sending interval duration, the response difference and the sending interval difference are respectively obtained, wherein the response duration is the response duration of the entry source address to the entry destination address, the sending interval duration is the interval duration between two adjacent data packets sent by the entry source address, the response difference represents the change rate of multiple response durations, and the sending interval difference represents the change rate of multiple sending interval durations;
[0078] The delay duration is determined according to the response duration, the sending interval duration, the corresponding difference and the sending interval difference.
[0079] In some implementations, the response duration is determined according to the plurality of communication record pairs and a first formula, wherein the first formula is:
[0080]
[0081] In the formula, is the response time, t ri is the time when the i-th entry destination address data packet is received, t ti is the time when the entry source address data packet is received for the i-th time, N i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs;
[0082] The response difference is determined according to the plurality of communication record pairs and a second formula, wherein the second formula is:
[0083]
[0084] In the formula, is the response differential, t r(i+1) is the time when the entry destination address data packet is received for the i+1th time, t t(i+1)is the time when the entry source address data packet is received for the i+1th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0085] In some implementations, the sending interval duration is determined according to the plurality of communication record pairs and a third formula, wherein the third formula is:
[0086]
[0087] In the formula, is the sending interval duration, t t(i+1) is the time when the entry source address data packet is received for the i+1th time, t ti is the time when the entry source address data packet is received for the i-th time, N i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs;
[0088] The sending interval difference is determined according to the plurality of communication record pairs and a fourth formula, wherein the fourth formula is:
[0089]
[0090] In the formula, is the sending interval difference, t t(i+2) is the time when the entry source address data packet is received for the i+2th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0091] In some implementations, determining the delay duration according to the response duration, the sending interval duration, the corresponding difference, and the sending interval difference includes:
[0092] The response duration, the sending interval duration, the corresponding difference and the sending interval difference are respectively input into a delay determination model, and an output of the delay determination model is obtained as the delay duration;
[0093] The delay determination model is obtained by training a basic model based on the fifth formula, wherein the fifth formula is:
[0094]
[0095] Where f(x) is the output of the basic model, e is a natural constant, and x i is the dependent variable, w i is the weight;
[0096] The training steps of the basic model include:
[0097] Acquire multiple history sets, wherein the history sets include response duration, sending interval duration, corresponding difference, and sending interval difference of corresponding historical time nodes;
[0098] Acquire multiple demand delay durations that meet the power network service demand, wherein the multiple demand delay durations correspond to the multiple history sets and represent the demand delay durations in different history sets;
[0099] Inputting the multiple history sets into the basic model respectively to obtain multiple training outputs, wherein the response duration, the sending interval duration, the corresponding difference and the sending interval difference in the history set are input into the basic model as dependent variables;
[0100] According to the deviations between the multiple training outputs and the multiple required delay durations, adjusting the weight of the basic model until the deviations between the multiple training outputs and the multiple required delay durations are less than a threshold;
[0101] The weight of the basic model is fixed, and the basic model is used as the delay determination model.
[0102] For example, in an electric power network, data packets are transmitted in order of their priority. This means that the data packets are not transmitted in the order in which they arrive, following the first-in-first-out principle. Instead, after receiving the data packet, it is necessary to first parse the data packet and determine its priority.
[0103] The priority of a data packet is determined when the data packet is received. The newly received data packet is treated as a pending data packet, and after data preprocessing together with the previously received data packets that have not yet been transmitted, they together form a priority data packet queue.
[0104] One method of pre-processing and prioritizing pending packets is to determine a target delay for the pending packets.
[0105] The so-called delay refers to the interval from the time a data packet is received to the time it is sent out. Obviously, the longer the interval, the greater the delay, and the smaller the interval, the smaller the delay. From the perspective of the power business, data packets with large delays usually mean that the real-time requirements are not high and the priority is lower, while data packets with small delays mean that the real-time requirements are high and the priority is higher.
[0106] In the implementation mode of the present invention, the target delay is determined according to the source address of the data packet (the initial sending address of the data packet), the destination address (the final received address), and the communication protocol. This is because, generally speaking, the source address, the destination address, and the communication protocol characterize the real-time requirements of the data packet to a certain extent.
[0107] In the implementation manner of the present invention, the source address, destination address, and delay duration of the communication protocol of the corresponding data packet are consulted from a comparison table.
[0108] For each entry in the comparison table, it can be recorded in different forms, for example, in the form of row records. The row record has four data, namely, the source address, the destination address and the communication protocol used for the table lookup input and the delay time for returning the table lookup output result. The comparison table stores multiple rows of such records. Whenever a data packet is obtained and the table lookup input is parsed from the data packet, the delay time is queried and returned through the comparison table.
[0109] Each entry in the comparison table is determined through pre-calculation. Specifically, for each entry, according to the source address of the entry, the destination address of the entry and the communication protocol of the entry, the historical communication record pairs that meet the above conditions can be found. Based on these communication record pairs, pre-processing analysis is performed to obtain the response duration, sending interval duration, response difference and sending interval difference.
[0110] For example, there are d pairs of communication records between address a and address b using communication protocol c (the number of sent data and received data is 2*d). These d pairs of communication records are analyzed to obtain the response duration, sending interval duration, response difference, and sending interval difference.
[0111] Then, the delay duration is determined based on the response duration, the sending interval duration, the response difference, and the sending interval difference, and is stored in the query return data of the entry.
[0112] As for the corresponding duration, it is determined according to the first formula:
[0113]
[0114] In the formula, is the response time, t ri is the time when the i-th entry destination address data packet is received, t ti is the time when the entry source address data packet is received for the i-th time, n i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs.
[0115] In the above formula, applying the above example, the response time represents the average interval for returning the response data after address b receives the data packet from address a. Obviously, the more timely the return, the more important the data is and the higher the real-time performance is.
[0116] For the response difference, it is determined according to the second formula:
[0117]
[0118] In the formula, is the response differential, t r(i+1) is the time when the entry destination address data packet is received for the i+1th time, t t(i+1) is the time when the entry source address data packet is received for the i+1th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0119] In the above formula, is the average of the differences of multiple response times, which represents the volatility of the response time. Obviously, the lower the volatility, the more stable the data transmission and the higher the real-time performance.
[0120] As for the sending interval duration, it is determined according to the third formula:
[0121]
[0122] In the formula, is the sending interval duration, t t(i+1) is the time when the entry source address data packet is received for the i+1th time, t ti is the time when the entry source address data packet is received for the i-th time, N i is the length of data sent by the source address of the i-th entry, S is the sending rate, and N is the number of multiple communication record pairs.
[0123] In the above formula, is the average interval length of multiple data transmissions. Applying the above example, it means the time interval between two consecutive data transmissions from address a to address b. Obviously, if the interval is shorter, it means that the data must be forwarded more promptly and the real-time performance is higher. Otherwise, when the data is not forwarded in time, the arrival of subsequent data will cause data stacking and bring a burden to the data processing of address b.
[0124] For the sending interval difference, it is determined according to the fourth formula:
[0125]
[0126] In the formula, is the sending interval difference, t t(i+2) is the time when the entry source address data packet is received for the i+2th time, N (i+1) The length of data sent by the source address of the i+1th entry.
[0127] Similarly, the above sending interval difference reflects the fluctuation of the sending interval. The smaller the fluctuation, the smaller the change of the sending time difference, and the higher the real-time performance.
[0128] As described above, after obtaining the response time, the sending interval time, the corresponding difference and the sending interval difference, the delay time can be determined. However, it is obvious that the response time, the sending interval time, the corresponding difference and the sending interval difference are not linearly related to the delay time. Therefore, we established the fifth formula to adjust the relationship between the response time, the sending interval time, the corresponding difference and the sending interval difference and the delay time. The fifth formula is:
[0129]
[0130] Where f(x) is the output of the basic model, e is a natural constant, and x i is the dependent variable, w i is the weight.
[0131] It can be seen that w i The weight is determined according to the relationship between the response time, sending interval time, corresponding difference, sending interval difference and the required delay time to meet the business needs of the power network in the actual historical set. If the idea of artificial neural network is applied, it is the training method.
[0132] The training method includes the following steps:
[0133] First, multiple history sets are obtained, each of which includes the response duration, sending interval duration, corresponding difference and sending interval difference corresponding to each time node.
[0134] Then, obtain the delay duration corresponding to each history set.
[0135] Next, multiple history sets are respectively input into the fifth formula to obtain multiple outputs of the fifth formula, wherein the response duration, the sending interval duration, the corresponding difference and the sending interval difference are respectively input into the dependent variable.
[0136] Next, according to the deviations between the outputs of the plurality of fifth formulas and the time lengths of the plurality of demand delays, the weights are adjusted until the deviations between the outputs of the plurality of fifth formulas and the time lengths of the plurality of demand delays are small enough to be acceptable.
[0137] At this point, the weights of the fifth formula are fixed and the delay determination model is established.
[0138] In step 103, the priority of the pending data packet is determined according to the target delay and the transmission delays of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are transmitted.
[0139] In some embodiments, step 103 includes:
[0140] Initialize multiple particles, each particle is configured with a position vector and a velocity vector, wherein the position vector is used to represent the priority of the pending data packet and multiple data packets in the current queue, and the velocity vector is used to represent the moving direction and speed of the iteration of the position vector;
[0141] Obtain the data length of the pending data packet and the data length of multiple data packets corresponding to the current queue;
[0142] Fitness calculation step: determining a plurality of fitnesses according to the position vectors of the plurality of particles, the data length of the pending data packet and the data length of the plurality of data packets in the current queue, wherein the fitnesses represent the deviation between the delay of the pending data packet determined by the particles and the target delay, and the deviation between the delay of the plurality of data packets in the current queue determined by the particles and the target delay of the plurality of data packets in the current queue;
[0143] For each particle of the plurality of particles, adjusting the velocity vector, the position vector and the iteration count value of the particle according to the velocity vector of the particle, the optimal value of the individual position vector and the optimal values of the position vectors of the plurality of particles;
[0144] If the iteration count value does not reach the preset value, jump to the fitness calculation step;
[0145] Otherwise, a particle with the highest fitness among the multiple particles is selected as a target particle, and the priority of the pending data packet is determined according to the position of the target particle.
[0146] For example, in determining the priority, an arrangement method or a particle swarm optimization algorithm can be used, wherein the arrangement method is to rank the data packets from short to long according to the delay of each data packet, and the ranking number is the priority.
[0147] The particle swarm optimization algorithm is to find the optimal solution of priority by initially testing multiple particles and adjusting the positions of multiple particles in an iterative manner. Specifically:
[0148] First, multiple particles are initialized, each particle is configured with a position vector and a velocity vector, the position vector is used to represent the priority of the pending data packet and multiple data packets in the current queue, and the velocity vector is used to represent the moving direction and speed of the iteration of the position vector;
[0149] Then, the data length of the pending data packet and the data lengths of the corresponding multiple data packets in the current queue are obtained;
[0150] Next, enter the fitness calculation step: determine multiple fitnesses according to the position vectors of the multiple particles, the data length of the pending data packet and the data length of the multiple data packets in the current queue, wherein the fitness represents the deviation between the delay of the pending data packet determined by the particle and the target delay, and the deviation between the delay of the multiple data packets in the current queue determined by the particle and the target delay of the multiple data packets in the current queue;
[0151] Next, for each particle of the plurality of particles, according to the velocity vector of the particle, the optimal value of the individual position vector and the optimal values of the position vectors of the plurality of particles, the velocity vector, the position vector and the iteration count value of the particle are adjusted;
[0152] Finally, if the iteration count value does not reach the preset value, jump to the fitness calculation step;
[0153] Otherwise, a particle with the highest fitness among the multiple particles is selected as a target particle, and the priority of the pending data packet is determined according to the position of the target particle.
[0154] The implementation method of the service classification of the power network traffic of the present invention first obtains a pending data packet, wherein the pending data packet contains sending and receiving information; then, according to the sending and receiving information of the pending data packet, the target delay of the pending data packet is determined, wherein the target delay represents the time difference target from the reception to the forwarding of the pending data packet; finally, according to the target delay and the sending delay of multiple data packets in the current queue, the priority of the pending data packet is determined, wherein the priority represents the order in which the data packets are sent. The implementation method of the present invention performs preprocessing analysis on the power network traffic data packet, determines the target delay by analyzing the obtained data, and then determines the priority according to the target delay, and finally sends the data packet according to the priority. Therefore, the implementation method of the present invention realizes the classification of data packets based on the method of data packet preprocessing, meets the different real-time requirements between multiple data packets, and alleviates the contradiction between big data application and network transmission.
[0155] It should be understood that the size of the serial numbers of the steps in the above implementation does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation method of the present invention.
[0156] The following is an implementation of the device of the present invention. For details not described in detail, reference may be made to the corresponding method implementation described above.
[0157] Figure 2 is a functional block diagram of a service classification device for power network traffic provided by an embodiment of the present invention, referring to Figure 2The service classification device 2 for power network traffic includes: a pending data packet acquisition module 201, a target delay determination module 202 and a classification module 203.
[0158] The pending data packet acquisition module 201 is used to acquire a pending data packet, wherein the pending data packet contains sending and receiving information;
[0159] A target delay determination module 202 is used to determine a target delay of the pending data packet according to the receiving and sending information of the pending data packet, wherein the target delay represents a time difference target from receiving to forwarding the pending data packet;
[0160] The classification module 203 is used to determine the priority of the pending data packet according to the target delay and the transmission delay of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are transmitted.
[0161] Figure 3 is a functional block diagram of a terminal provided by an embodiment of the present invention. Figure 3 As shown, the terminal 3 of this embodiment includes: a processor 300 and a memory 301, wherein the memory 301 stores a computer program 302 that can be run on the processor 300. When the processor 300 executes the computer program 302, the steps in the above-mentioned service classification method and implementation of each power network flow are implemented, such as Figure 1 Steps 101 to 103 are shown.
[0162] Exemplarily, the computer program 302 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 301 and executed by the processor 300 to implement the present invention.
[0163] The terminal 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal 3 may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will appreciate that Figure 3 It is only an example of terminal 3 and does not constitute a limitation on terminal 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.
[0164] The processor 300 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0165] The memory 301 may be an internal storage unit of the terminal 3, such as a hard disk or memory of the terminal 3. The memory 301 may also be an external storage device of the terminal 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 3. Further, the memory 301 may also include both an internal storage unit of the terminal 3 and an external storage device. The memory 301 is used to store the computer program and other programs and data required by the terminal. The memory 301 may also be used to temporarily store data that has been output or is to be output.
[0166] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, 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. The functional units and modules in the implementation method can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, which will not be repeated here.
[0167] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0168] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0169] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0171] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0172] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various methods and device implementation methods. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.
[0173] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A service classification method for power network traffic, characterized in that: include: Obtaining a pending data packet, wherein the pending data packet contains sending and receiving information; Determine the target delay of the pending data packet according to the sending and receiving information of the pending data packet, wherein the target delay represents the time difference target from the reception to the forwarding of the pending data packet; Determine the priority of the pending data packet according to the target delay and the transmission delay of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are transmitted; in, Determining the priority of the pending data packet according to the target delay and the sending delays of multiple data packets in the current queue includes: Initialize multiple particles, each particle is configured with a position vector and a velocity vector, wherein the position vector is used to represent the priority of the pending data packet and multiple data packets in the current queue, and the velocity vector is used to represent the moving direction and speed of the iteration of the position vector; Obtain the data length of the pending data packet and the data length of multiple data packets corresponding to the current queue; Fitness calculation step: determining a plurality of fitnesses according to the position vectors of the plurality of particles, the data length of the pending data packet and the data length of the plurality of data packets in the current queue, wherein the fitnesses represent the deviation between the delay of the pending data packet determined by the particles and the target delay, and the deviation between the delay of the plurality of data packets in the current queue determined by the particles and the target delay of the plurality of data packets in the current queue; For each particle of the plurality of particles, adjusting the velocity vector, the position vector and the iteration count value of the particle according to the velocity vector of the particle, the optimal value of the individual position vector and the optimal values of the position vectors of the plurality of particles; If the iteration count value does not reach the preset value, jump to the fitness calculation step; Otherwise, a particle with the highest fitness among the multiple particles is selected as a target particle, and the priority of the pending data packet is determined according to the position of the target particle.
2. The service classification method for power network traffic according to claim 1, characterized in that: The step of determining a target delay of the pending data packet according to the receiving and sending information of the pending data packet comprises: Acquire the source address, destination address and communication protocol of the pending data packet according to the pending data packet; According to the source address, the destination address and the communication protocol, the target delay is found from a target delay comparison table, wherein the target delay comparison table records a plurality of entries, each entry records a source address, a destination address, a communication protocol and a delay duration.
3. The service classification method for power network traffic according to claim 2 is characterized in that: Each entry in the comparison table is obtained according to the following steps: Acquire multiple communication record pairs between an entry source address and an entry destination address using an entry communication protocol; According to the multiple communication record pairs, the response duration, the sending interval duration, the response difference and the sending interval difference are respectively obtained, wherein the response duration is the response duration of the entry source address to the entry destination address, the sending interval duration is the interval duration between two adjacent data packets sent by the entry source address, the response difference represents the change rate of multiple response durations, and the sending interval difference represents the change rate of multiple sending interval durations; The delay duration is determined according to the response duration, the sending interval duration, the response difference and the sending interval difference.
4. The service classification method for power network traffic according to claim 3 is characterized in that: The response time is determined according to the plurality of communication record pairs and a first formula, wherein the first formula is: In the formula, For response time, For the The time when the entry destination address data packet is received for the first time, For the The time when the source address data packet of the entry is received for the first time, For the The length of data sent by the source address of this entry, is the sending rate, The number of pairs recorded for multiple communications; The response difference is determined according to the plurality of communication record pairs and a second formula, wherein the second formula is: In the formula, For the response differential, For the The time when the entry destination address data packet is received for the first time, For the The time when the source address data packet of the entry is received for the first time, For the The length of data sent by the source address of this entry.
5. The service classification method for power network traffic according to claim 3 is characterized in that: The sending interval duration is determined according to the plurality of communication record pairs and a third formula, wherein the third formula is: In the formula, is the sending interval length, For the The time when the source address data packet of the entry is received for the first time, For the The time when the source address data packet of the entry is received for the first time, For the The length of data sent by the source address of this entry, is the sending rate, The number of pairs recorded for multiple communications; The sending interval difference is determined according to the plurality of communication record pairs and a fourth formula, wherein the fourth formula is: In the formula, To send the interval differential, For the The time when the source address data packet of the entry is received for the first time, For the The length of data sent by the source address of this entry.
6. The service classification method for power network traffic according to claim 5, characterized in that: Determining the delay duration according to the response duration, the sending interval duration, the response difference, and the sending interval difference includes: The response duration, the sending interval duration, the response difference and the sending interval difference are respectively input into a delay determination model, and an output of the delay determination model is obtained as the delay duration; The delay determination model is obtained by training a basic model based on the fifth formula, wherein the fifth formula is: In the formula, is the output of the basic model, is a natural constant, is the dependent variable, is the weight; The training steps of the basic model include: Acquire multiple history sets, wherein the history sets include response duration, sending interval duration, response difference, and sending interval difference of corresponding historical time nodes; Acquire multiple demand delay durations that meet the power network service demand, wherein the multiple demand delay durations correspond to the multiple history sets and represent the demand delay durations in different history sets; Inputting the multiple history sets into the basic model respectively to obtain multiple training outputs, wherein the response duration, the sending interval duration, the response difference and the sending interval difference in the history set are input into the basic model as dependent variables; According to the deviations between the multiple training outputs and the multiple required delay durations, adjusting the weight of the basic model until the deviations between the multiple training outputs and the multiple required delay durations are less than a threshold; The weight of the basic model is fixed, and the basic model is used as the delay determination model.
7. A service classification device for power network traffic, characterized in that: Used to implement the service classification method of power network traffic according to any one of claims 1 to 6, the service classification device of power network traffic comprises: A pending data packet acquisition module is used to acquire a pending data packet, wherein the pending data packet contains sending and receiving information; A target delay determination module, used to determine the target delay of the pending data packet according to the receiving and sending information of the pending data packet, wherein the target delay represents the time difference target from the reception to the forwarding of the pending data packet; as well as, A classification module, used to determine the priority of the pending data packet according to the target delay and the transmission delay of multiple data packets in the current queue, wherein the priority represents the order in which the data packets are transmitted; Wherein, the grading module includes: An initialization module, used to initialize multiple particles, each particle is configured with a position vector and a velocity vector, wherein the position vector is used to represent the priority of the pending data packet and multiple data packets in the current queue, and the velocity vector is used to represent the moving direction and speed of the iteration of the position vector; A data acquisition module, used to acquire the data length of the pending data packet and the data length of multiple data packets corresponding to the current queue; A calculation module, used for a fitness calculation step: determining a plurality of fitnesses according to the position vectors of the plurality of particles, the data length of the pending data packet and the data length of the plurality of data packets in the current queue, wherein the fitnesses represent the deviation between the delay of the pending data packet determined by the particles and the target delay, and the deviation between the delay of the plurality of data packets in the current queue determined by the particles and the target delay of the plurality of data packets in the current queue; An adjustment module, configured to adjust, for each particle of the plurality of particles, a velocity vector, a position vector and an iteration count value of the particle according to the velocity vector of the particle, an optimal value of an individual position vector and the optimal values of the position vectors of the plurality of particles; A determination module, used for jumping to the fitness calculation step when the iteration count value does not reach a preset value; The priority determination module is used to select the particle with the highest fitness among the multiple particles as the target particle, and determine the priority of the pending data packet according to the position of the target particle.
8. A terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 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 method according to any one of claims 1 to 6 are implemented.
