Data processing method and device, electronic equipment and storage medium
The network prediction model predicts the network status of the MQTT-SN protocol in a smart home environment, adjusts the transmission rate of data packets and resends, solving the problems of data transmission delay, message loss and unstable connection in smart homes, and achieving more reliable and efficient data transmission.
Patent Information
- Application Number
- CN202411811913.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-15
AI Technical Summary
In smart home environments, the MQTT-SN protocol has problems such as data transmission delay, message loss, and unstable connection between devices.
By obtaining the current network data and inputting it into the network prediction model, the congestion rate, packet loss rate and delay rate are predicted, and the packet transmission rate and retransmission are adjusted based on these prediction results to optimize data transmission.
It effectively avoids problems such as delay, message loss and unstable connection between devices during transmission, and improves the reliability and efficiency of data transmission.
Smart Images

Figure CN119835224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, a data processing device, an electronic device and a computer-readable storage medium. Background Art
[0002] With the development of smart homes, more and more common home devices, such as smart light bulbs, thermostats, and security systems, are beginning to use wireless communication protocols for data exchange and control. The MQTT-SN (Message Queuing Telemetry Transport for Sensor Networks) protocol, as an optimized version of the MQTT (Message Queuing Telemetry Transport) protocol for sensor networks, is popular because of its low bandwidth requirements and low power consumption. However, in actual applications, the MQTT-SN protocol still has some problems such as data transmission delays, message loss, and unstable connections between devices in smart home environments. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a data processing method, a data processing device, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In order to solve the above problem, an embodiment of the present invention discloses a data processing method, which includes:
[0005] Acquire current network data, and input the current network data into a network prediction model;
[0006] Obtaining prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate;
[0007] According to the congestion rate, adjusting the current data packet sending rate;
[0008] The current data packet is retransmitted according to the packet loss rate and / or the delay rate.
[0009] Optionally, adjusting the current data packet sending rate according to the congestion rate includes:
[0010] When the congestion rate is greater than the preset congestion rate, adjusting the sending rate of the current data packet to a first preset rate, and adjusting the sending window size of the current data packet to the first preset sending window size;
[0011] When the congestion rate is less than or equal to the preset congestion rate, the sending rate of the current data packet is adjusted to a second preset rate, and the sending window size of the current data packet is adjusted to a second preset sending window size.
[0012] Optionally, the retransmitting the current data packet according to the packet loss rate and / or the delay rate includes:
[0013] When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
[0014] Optionally, when the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, retransmitting the data packet according to the priority of the current data packet includes:
[0015] When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, obtaining the data type and urgency of the current data packet;
[0016] Determining the priority of the current data packet according to the data type and urgency of the current data packet;
[0017] The data packet is resent according to the priority of the current data packet.
[0018] Optionally, the method further includes:
[0019] Obtain the number of retransmissions for the current data packet;
[0020] Determining a maximum number of retransmissions of the current data packet according to the priority of the current data packet;
[0021] When the number of retransmissions is greater than the maximum number of retransmissions, retransmission of the current data packet is stopped.
[0022] Optionally, when the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, retransmitting the data packet according to the priority of the current data packet includes:
[0023] Get the data type of the current data packet;
[0024] Determining a target preset delay rate of the current data packet from a plurality of preset delay rates according to a data type of the current data packet;
[0025] When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than the target preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
[0026] Optionally, the method is applied to a resource management system, and the method further includes:
[0027] Acquire a first performance parameter and a second performance parameter of the resource management system; the first performance parameter is a performance parameter before the current data packet is retransmitted; the second performance parameter is a performance parameter after the current data packet is retransmitted;
[0028] Evaluate the resource management system according to the first performance parameter and the second performance parameter to obtain an evaluation result;
[0029] The network prediction model is optimized according to the evaluation result.
[0030] Optionally, the network prediction model is trained in the following manner:
[0031] Acquire historical network data; the historical network data includes: packet loss rate;
[0032] Segmenting the historical network data to generate multiple time window samples;
[0033] Marking the multiple time window samples according to the packet loss rate to obtain congested samples and non-congested samples;
[0034] Determine a training set and a validation set from the congested samples and the non-congested samples;
[0035] The pre-trained model is trained by using the training set to obtain a pre-selected prediction model;
[0036] The pre-selected prediction model is verified through a verification set to obtain the network prediction model.
[0037] Optionally, marking the multiple time window samples according to the packet loss rate to obtain congestion samples and non-congestion samples includes:
[0038] Determine a first target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the first target time window sample is greater than a preset packet loss rate;
[0039] Marking the first target time window sample as a congestion sample;
[0040] Determine a second target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the second target time window sample is less than or equal to the preset packet loss rate;
[0041] The second target time window sample is marked as a non-congested sample.
[0042] An embodiment of the present invention further provides a data processing device, the device comprising:
[0043] A first acquisition module, used to acquire current network data and input the current network data into a network prediction model;
[0044] A second acquisition module is used to obtain the prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate;
[0045] An adjustment module, used for adjusting the current data packet sending rate according to the congestion rate;
[0046] A retransmission module is used to retransmit the current data packet according to the packet loss rate and / or the delay rate.
[0047] Optionally, the adjustment module includes:
[0048] A first adjustment module, configured to adjust the sending rate of the current data packet to a first preset rate and adjust the sending window size of the current data packet to the first preset sending window size when the congestion rate is greater than a preset congestion rate;
[0049] The second adjustment module is used to adjust the sending rate of the current data packet to a second preset rate and the sending window size of the current data packet to a second preset sending window size when the congestion rate is less than or equal to the preset congestion rate.
[0050] Optionally, the retransmission module includes:
[0051] The retransmission submodule is used to retransmit the data packet according to the priority of the current data packet when the packet loss rate is greater than a preset packet loss rate and / or the delay rate is greater than a preset delay rate.
[0052] Optionally, the retransmission submodule includes:
[0053] A first acquisition unit, configured to acquire the data type and urgency of the current data packet when the packet loss rate is greater than a preset packet loss rate and / or the delay rate is greater than a preset delay rate;
[0054] A first determining unit, configured to determine the priority of the current data packet according to the data type and urgency of the current data packet;
[0055] The first retransmission unit is used to retransmit the data packet according to the priority of the current data packet.
[0056] Optionally, the device further comprises:
[0057] A third acquisition module is used to obtain the number of retransmissions of the current data packet;
[0058] A first determining module, used to determine the maximum number of retransmission times of the current data packet according to the priority of the current data packet;
[0059] The stopping module is used to stop retransmitting the current data packet when the number of retransmissions is greater than the maximum number of retransmissions.
[0060] Optionally, the retransmission submodule includes:
[0061] A second acquisition unit, used to acquire the data type of the current data packet;
[0062] A second determining unit, configured to determine a target preset delay rate of the current data packet from a plurality of preset delay rates according to a data type of the current data packet;
[0063] The second retransmission unit is used to retransmit the data packet according to the priority of the current data packet when the packet loss rate is greater than the preset packet loss rate and / or the delay rate is greater than the target preset delay rate.
[0064] Optionally, the device is applied to a resource management system, and the device further includes:
[0065] A fourth acquisition module, used to acquire a first performance parameter and a second performance parameter of the resource management system; the first performance parameter is a performance parameter before the current data packet is retransmitted; the second performance parameter is a performance parameter after the current data packet is retransmitted;
[0066] An evaluation module, used for evaluating the resource management system according to the first performance parameter and the second performance parameter to obtain an evaluation result;
[0067] An optimization module is used to optimize the network prediction model according to the evaluation result.
[0068] Optionally, the network prediction model is obtained by training the following modules:
[0069] The fifth acquisition module is used to acquire historical network data; the historical network data includes: packet loss rate;
[0070] A segmentation module, used to segment the historical network data to generate multiple time window samples;
[0071] A marking module, used for marking the multiple time window samples according to the packet loss rate to obtain congested samples and non-congested samples;
[0072] A second determination module is used to determine a training set and a validation set from the congested samples and the non-congested samples;
[0073] A training module, used for training the pre-trained model using the training set to obtain a pre-selected prediction model;
[0074] The verification module is used to verify the pre-selected prediction model through a verification set to obtain the network prediction model.
[0075] Optionally, the marking module includes:
[0076] A first determination submodule is configured to determine a first target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the first target time window sample is greater than a preset packet loss rate;
[0077] A first marking submodule, used to mark the first target time window sample as a congestion sample;
[0078] A second determination submodule is used to determine a second target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the second target time window sample is less than or equal to the preset packet loss rate;
[0079] The second marking submodule is used to mark the second target time window sample as a non-congested sample.
[0080] The present invention also discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data processing method when executing the computer program.
[0081] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method described above are implemented.
[0082] The embodiments of the present invention include the following advantages:
[0083] In an embodiment of the present invention, current network data is first obtained, and the current network data is input into a network prediction model, and then a prediction result output by the network prediction model is obtained, wherein the prediction result may include: congestion rate, packet loss rate and delay rate, and then the sending rate of the current data packet is adjusted according to the congestion rate, and the current data packet is retransmitted according to the packet loss rate and / or delay rate, so that the network prediction model is used to make a prediction based on the current network data, and the sending rate of the current data packet is adjusted according to the prediction result, and the retransmission of the current data packet is controlled, thereby effectively avoiding the occurrence of problems such as delays in data packet transmission, message loss, and unstable connection between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 is a flow chart of steps of a data processing method provided by an embodiment of the present invention;
[0085] Figure 2 It is a structural block diagram of a data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0086] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0087] In the related art, communication using the MOTT-SN protocol is prone to data transmission delays, message loss, and unstable connections between devices. The present invention provides a data processing method, the core concept of which is to first obtain the current network data, input the current network data into a network prediction model, and then obtain the prediction results output by the network prediction model, wherein the prediction results may include: congestion rate, packet loss rate, and delay rate, and then adjust the current data packet sending rate according to the congestion rate, and retransmit the current data packet according to the packet loss rate and / or delay rate, so that the network prediction model is used to predict the current network data, and the current data packet sending rate is adjusted according to the prediction results, and the retransmission of the current data packet is controlled, which effectively avoids the occurrence of problems such as delays in data packet transmission, message loss, and unstable connections between devices.
[0088] Reference Figure 1 , shows a flow chart of the steps of a data processing method provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0089] Step 101, obtaining current network data, and inputting the current network data into a network prediction model.
[0090] In an embodiment of the present invention, the current network data may be obtained, and the network data may be network data for a target protocol communication mode, and the target protocol may be a MOTT-SN protocol. After the current network data is obtained, the current network data may be input into a pre-trained network prediction model.
[0091] MQTT-SN (Message Queuing Telemetry Transport for Sensor Networks) is a communication protocol designed specifically for sensor networks and is an extended version of the MQTT (Message Queuing Telemetry Transport) protocol. The MQTT-SN protocol is designed to solve problems such as low power consumption, low bandwidth, and high latency in sensor networks, and is suitable for resource-constrained devices and network environments. The main features of the MQTT-SN protocol are: Low power consumption: The MQTT-SN protocol is designed as a low-power communication protocol and is suitable for battery-powered sensor devices. The protocol supports sleep mode and wake-up mechanism, and the device can enter a low-power state when inactive to reduce energy consumption. Low bandwidth: The MQTT-SN protocol is designed as a low-bandwidth communication protocol and is suitable for network environments with limited bandwidth. The protocol uses a compact binary message format to reduce the overhead of data transmission and improve communication efficiency. High latency: The MQTT-SN protocol is designed as a high-latency communication protocol and is suitable for network environments with high latency. The protocol supports asynchronous communication and message retransmission mechanisms to ensure reliable data transmission even when the network is unstable. Gateway support: The MQTT-SN protocol bridges the MQTT protocol through a gateway to enable communication between the sensor network and the MQTT broker. The gateway is responsible for converting MQTT-SN messages to MQTT messages and converting MQTT messages to MQTT-SN messages. Simplified QoS support: The MQTT-SN protocol simplifies QoS (Quality of Service) support and provides three QoS levels: 0 (at most once), 1 (at least once), and 2 (exactly once). The choice of QoS level depends on the application scenario and network environment. Topic alias: The MQTT-SN protocol supports topic aliases to reduce the transmission overhead of topic names. Devices can register topic aliases when connecting, and subsequent messages can use aliases instead of topic names to reduce data transmission.
[0092] The working principle of the MQTT-SN protocol is as follows: Connection process: The device establishes a connection with the gateway and sends a CONNECT message containing information such as the device identifier, protocol version, and connection time. The gateway returns a CONNACK message to confirm that the connection is successful. Topic registration: The device registers a topic with the gateway and sends a REGISTER message containing the topic name and topic alias. The gateway returns a REGACK message to confirm that the topic registration is successful. Message publishing: The device publishes a message to the gateway and sends a PUBLISH message containing information such as the topic alias, QoS level, and message content. The gateway converts the message into an MQTT message and sends it to the MQTT agent. Message subscription: The device subscribes to a topic with the gateway and sends a SUBSCRIBE message containing the topic name and QoS level. The gateway returns a SUBACK message to confirm that the subscription is successful. The gateway sends a subscription request to the MQTT agent and converts the received message into an MQTT-SN message and sends it to the device. Message reception: The device receives the message sent by the gateway and processes the message content. The device can send a PUBACK message as needed to confirm that the message is successfully received. Disconnection: The device disconnects from the gateway and sends a DISCONNECT message. The gateway returns a DISCONNECT message to confirm that the disconnection is successful.
[0093] The application scenarios of the MQTT-SN protocol are: Smart home: In the smart home system, the MQTT-SN protocol is used to connect various sensor devices (such as temperature sensors, humidity sensors, light sensors, etc.) to achieve low-power, low-bandwidth communication and improve the energy efficiency and reliability of the system. Industrial Internet of Things: In the industrial Internet of Things system, the MQTT-SN protocol is used to connect various industrial sensor devices (such as pressure sensors, vibration sensors, temperature sensors, etc.) to achieve low-power, low-bandwidth communication and improve the stability and reliability of the system. Agricultural Internet of Things: In the agricultural Internet of Things system, the MQTT-SN protocol is used to connect various agricultural sensor devices (such as soil moisture sensors, meteorological sensors, water quality sensors, etc.) to achieve low-power, low-bandwidth communication and improve the energy efficiency and reliability of the system. Smart city: In the smart city system, the MQTT-SN protocol is used to connect various urban sensor devices (such as traffic sensors, environmental sensors, energy sensors, etc.) to achieve low-power, low-bandwidth communication and improve the energy efficiency and reliability of the system.
[0094] In an embodiment of the present invention, a network prediction model is trained in the following manner: historical network data is obtained; the historical network data includes: packet loss rate; the historical network data is segmented to generate multiple time window samples; the multiple time window samples are marked according to the packet loss rate to obtain congested samples and non-congested samples; a training set and a validation set are determined from the congested samples and the non-congested samples; a pre-trained model is trained with the training set to obtain a pre-selected prediction model; the pre-selected prediction model is validated with the validation set to obtain a network prediction model.
[0095] Specifically, when training the pre-trained model, historical network data may be obtained first, wherein the historical network data may include: packet loss rate, queue length data, bandwidth utilization, error rate, and historical congestion data, etc. Then, the obtained historical network data is preprocessed to obtain sample data for training. The historical network data may be segmented first to generate multiple time window samples, wherein each time window sample includes: packet loss rate, queue length data, bandwidth utilization, error rate, delay rate, and historical congestion data, etc. Then, multiple time window samples are marked according to the packet loss rate corresponding to each time window sample to obtain congested samples and non-congested samples, and then from the congested samples and non-congested samples, a training set and a validation set are divided according to a certain score, and the pre-trained model is trained using the training set. During training, the pre-trained model can be iterated multiple times according to the input sample data to gradually improve the accuracy of the prediction results. After the training is completed, the model is verified and evaluated using the validation set to determine its generalization ability on unknown data. If the verification result is not ideal, the model can be further optimized by adjusting the parameters of the pre-trained model or changing the algorithm. After the verification is completed and the verification is passed, the pre-selected training model obtained by the final training can be determined as a network prediction model. The pre-trained model in the present invention can be a model such as a random deep forest, a support vector machine, a deep neural network, or a long short-term memory network.
[0096] In the present invention, the queue length output represents the cache status during data transmission, the bandwidth utilization reflects the actual bandwidth usage, the packet loss rate is a direct indicator for evaluating network quality, and the delay rate affects the performance of real-time data transmission. By learning from these historical network data, the network prediction model can capture the potential trends under different network states, thereby predicting future congestion and packet loss risks.
[0097] In one embodiment, multiple time window samples are marked according to the packet loss rate to obtain congested samples and non-congested samples, which may include: determining a first target time window sample from multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the first target time window sample is greater than a preset packet loss rate; marking the first target time window sample as a congested sample; determining a second target time window sample from multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the second target time window sample is less than or equal to the preset packet loss rate; marking the second target time window sample as a non-congested sample.
[0098] Specifically, when marking multiple time window samples according to the packet loss rate, the present invention can first determine the first target time window sample and the second target time window sample according to the packet loss rate corresponding to each time window sample, the first target time window sample is a time window sample with a packet loss rate greater than a preset packet loss rate, and the second target time window sample is a time window sample with a packet loss rate less than or equal to a preset packet loss rate. Finally, the first target time window sample is marked as a congested sample, and the second target time window sample is marked as a non-congested sample.
[0099] Step 102, obtaining the prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate.
[0100] In an embodiment of the present invention, after the current network data is input into the network prediction model, the prediction result output by the network prediction model can be obtained. The prediction result may include: congestion rate, packet loss rate and delay rate, and may also include other network parameters. For more specific network parameters, the present invention does not make specific limitations here.
[0101] Step 103: adjusting the current data packet sending rate according to the congestion rate.
[0102] In the embodiment of the present invention, after the prediction result output by the network prediction model is obtained, the current data packet sending rate can be adjusted according to the congestion rate in the prediction result.
[0103] In one embodiment, adjusting the sending rate of the current data packet according to the congestion rate may include: when the congestion rate is greater than the preset congestion rate, adjusting the sending rate of the current data packet to a first preset rate, and adjusting the sending window size of the current data packet to the first preset sending window size; when the congestion rate is less than or equal to the preset congestion rate, adjusting the sending rate of the current data packet to a second preset rate, and adjusting the sending window size of the current data packet to the second preset sending window size.
[0104] Specifically, the congestion rate can be compared with the preset congestion rate. When the congestion rate is greater than the preset congestion rate, the sending frequency of the current data packet can be reduced to the first preset rate, and the sending window size of the current data packet can be reduced to the first preset sending window size. For example: when the sending frequency of the current data packet is 1 Gbps and the current congestion rate is greater than the preset congestion rate, the sending frequency of the current data packet can be reduced to 800 Mbps, and the sending window size can be reduced accordingly to reduce the risk of congestion.
[0105] When the congestion rate is less than or equal to the preset congestion rate, the sending rate of the current data packet can be increased to the second preset rate, and the sending window size of the current data packet can be enlarged to the second preset sending window size. In the present invention, the first preset rate can be the same as the second preset rate, or can be set separately according to actual needs. The present invention does not specifically limit the specific rates of the first preset rate and the second preset rate. The first preset sending window size can be the same as the second preset sending window size, or can be set separately according to actual needs. The present invention does not specifically limit the specific sizes of the first preset sending window size and the second sending window size.
[0106] In the present invention, the parameters of the network prediction model can also be adjusted according to the time identifier of the network to improve the accuracy of the network prediction model.
[0107] Step 104: resend the current data packet according to the packet loss rate and / or the delay rate.
[0108] In the embodiment of the present invention, after the prediction result of the network prediction model is obtained, the current data packet can be retransmitted according to the packet loss rate and / or delay rate in the prediction result.
[0109] In one embodiment, retransmitting the current data packet according to the packet loss rate and / or delay rate may include: when the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, retransmitting the data packet according to the priority of the current data packet.
[0110] Specifically, the present invention can control and retransmit the current data packet according to the priority of the current data packet when the packet loss rate is greater than a preset packet loss rate and / or the delay rate is greater than a preset delay rate.
[0111] In one embodiment, when the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, the data packet is retransmitted according to the priority of the current data packet, including: when the packet loss rate is greater than the preset packet loss rate, and / or the delay rate is greater than the preset delay rate, obtaining the data type and urgency of the current data packet; determining the priority of the current data packet according to the data type and urgency of the current data packet; and retransmitting the data packet according to the priority of the current data packet.
[0112] Specifically, for example, the preset packet loss rate is 70%, and the preset delay rate is 100ms. When the packet loss rate in the predicted result is greater than 70%, and the delay rate in the predicted result is greater than 100ms, if one of the conditions is met, the retransmission mechanism can be started. First, the priority level corresponding to the current data packet is determined based on the data type and urgency of the current data packet. For data packets with high priority, they can be retransmitted first to ensure that the network quality will not affect the completion of critical tasks, while also avoiding unnecessary packet loss and delays.
[0113] In one embodiment, when the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, the data packet is retransmitted according to the priority of the current data packet, including: obtaining the data type of the current data packet; determining a target preset delay rate of the current data packet from a plurality of preset delay rates according to the data type of the current data packet; when the packet loss rate is greater than the preset packet loss rate, and / or the delay rate is greater than the target preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
[0114] Specifically, when retransmitting a data packet, the data type of the current data packet can be obtained first, and then the type of the current data packet determines the target delay rate corresponding to the current data packet from multiple preset delay rates. For example, if the current data packet is a data packet for a real-time video conference, then in order to ensure smooth video transmission, the delay rate corresponding to its data packet can be set to 100ms. If the current data packet is a data packet that is not sensitive to delays such as file transfer, the delay rate corresponding to its data packet can be set to 500ms or even higher to prevent frequent retransmissions from affecting transmission efficiency. After determining the target preset delay rate of the current data packet, when the packet loss rate is greater than the preset packet loss rate, and / or the delay rate is greater than the target preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
[0115] In an embodiment of the present invention, the data processing method may further include: obtaining the number of retransmissions for a current data packet; determining the maximum number of retransmissions for the current data packet based on the priority of the current data packet; and stopping retransmission of the current data packet when the number of retransmissions is greater than the maximum number of retransmissions.
[0116] Specifically, first determine the maximum number of retransmissions corresponding to the current data packet according to the priority of the current data packet. For data packets with high priority, the corresponding maximum number of retransmissions can be appropriately set to be relatively larger. Then, obtain the number of retransmissions of the current data packet in real time. When the number of retransmissions is greater than the maximum number of retransmissions, stop retransmission of the current data packet, thereby avoiding frequent retransmissions affecting transmission efficiency.
[0117] In an embodiment of the present invention, a data processing method can be applied to a resource management system, and the method can also include: obtaining a first performance parameter and a second performance parameter of the resource management system; the first performance parameter is a performance parameter before the current data packet is retransmitted; the second performance parameter is a performance parameter after the current data packet is retransmitted; based on the first performance parameter and the second performance parameter, the resource management system is evaluated to obtain an evaluation result; based on the evaluation result, the network prediction model is optimized.
[0118] Specifically, the resource management system can first obtain the first performance parameter of the current data packet before retransmission, or obtain the first performance parameter of the current data packet before adjusting the sending rate. After adjusting the sending rate of the data packet and / or retransmitting, obtain the second performance parameter of the resource management system, and then perform a performance evaluation on the resource management system based on the first performance parameter and the second performance parameter to obtain an evaluation result. The evaluation result also reflects the effect of controlling the sending of the data packet according to the output of the network model. Finally, based on the evaluation result, the network prediction model is optimized to further improve the accuracy of the network prediction model, while also further improving the performance of the resource management system.
[0119] In an embodiment of the present invention, the current network data is obtained and input into the network prediction model; the prediction result output by the network prediction model is obtained; the prediction result includes: congestion rate, packet loss rate and delay rate; according to the congestion rate, the sending rate of the current data packet is adjusted; according to the packet loss rate and / or delay rate, the current data packet is retransmitted. Thus, the network prediction model is used to make a prediction based on the current network data, and the sending rate of the current data packet is adjusted according to the prediction result, and the retransmission of the current data packet is controlled, which effectively avoids the occurrence of problems such as delay in data packet transmission, message loss and unstable connection between devices.
[0120] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0121] Reference Figure 2 , shows a structural block diagram of a data processing device provided by an embodiment of the present invention, which may specifically include the following modules:
[0122] A first acquisition module 201 is used to acquire current network data and input the current network data into a network prediction model;
[0123] The second acquisition module 202 is used to obtain the prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate;
[0124] An adjustment module 203, configured to adjust a current data packet sending rate according to the congestion rate;
[0125] The retransmission module 204 is configured to retransmit the current data packet according to the packet loss rate and / or the delay rate.
[0126] In one embodiment, the adjustment module 203 includes:
[0127] A first adjustment module, configured to adjust the sending rate of the current data packet to a first preset rate and adjust the sending window size of the current data packet to the first preset sending window size when the congestion rate is greater than a preset congestion rate;
[0128] The second adjustment module is used to adjust the sending rate of the current data packet to a second preset rate and the sending window size of the current data packet to a second preset sending window size when the congestion rate is less than or equal to the preset congestion rate.
[0129] In one embodiment, the retransmission module 204 includes:
[0130] The retransmission submodule is used to retransmit the data packet according to the priority of the current data packet when the packet loss rate is greater than a preset packet loss rate and / or the delay rate is greater than a preset delay rate.
[0131] In one embodiment, the retransmission submodule includes:
[0132] A first acquisition unit, configured to acquire the data type and urgency of the current data packet when the packet loss rate is greater than a preset packet loss rate and / or the delay rate is greater than a preset delay rate;
[0133] A first determining unit, configured to determine the priority of the current data packet according to the data type and urgency of the current data packet;
[0134] The first retransmission unit is used to retransmit the data packet according to the priority of the current data packet.
[0135] In one embodiment, the device further comprises:
[0136] A third acquisition module is used to obtain the number of retransmissions of the current data packet;
[0137] A first determining module, used to determine the maximum number of retransmission times of the current data packet according to the priority of the current data packet;
[0138] The stopping module is used to stop retransmitting the current data packet when the number of retransmissions is greater than the maximum number of retransmissions.
[0139] In one embodiment, the retransmission submodule includes:
[0140] A second acquisition unit, used to acquire the data type of the current data packet;
[0141] A second determining unit, configured to determine a target preset delay rate of the current data packet from a plurality of preset delay rates according to a data type of the current data packet;
[0142] The second retransmission unit is used to retransmit the data packet according to the priority of the current data packet when the packet loss rate is greater than the preset packet loss rate and / or the delay rate is greater than the target preset delay rate.
[0143] In one embodiment, the device is applied to a resource management system, and the device further includes:
[0144] A fourth acquisition module, used to acquire a first performance parameter and a second performance parameter of the resource management system; the first performance parameter is a performance parameter before the current data packet is retransmitted; the second performance parameter is a performance parameter after the current data packet is retransmitted;
[0145] An evaluation module, used for evaluating the resource management system according to the first performance parameter and the second performance parameter to obtain an evaluation result;
[0146] An optimization module is used to optimize the network prediction model according to the evaluation result.
[0147] In one embodiment, the network prediction model is obtained by training the following modules:
[0148] The fifth acquisition module is used to acquire historical network data; the historical network data includes: packet loss rate;
[0149] A segmentation module, used to segment the historical network data to generate multiple time window samples;
[0150] A marking module, used for marking the multiple time window samples according to the packet loss rate to obtain congested samples and non-congested samples;
[0151] A second determination module is used to determine a training set and a validation set from the congested samples and the non-congested samples;
[0152] A training module, used for training the pre-trained model using the training set to obtain a pre-selected prediction model;
[0153] The verification module is used to verify the pre-selected prediction model through a verification set to obtain the network prediction model.
[0154] In one embodiment, the marking module includes:
[0155] A first determination submodule is configured to determine a first target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the first target time window sample is greater than a preset packet loss rate;
[0156] A first marking submodule, used to mark the first target time window sample as a congestion sample;
[0157] A second determination submodule is used to determine a second target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the second target time window sample is less than or equal to the preset packet loss rate;
[0158] The second marking submodule is used to mark the second target time window sample as a non-congested sample.
[0159] In the embodiment of the present invention, the first acquisition module is used to acquire the current network data and input the current network data into the network prediction model; the second acquisition module is used to acquire the prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate; the adjustment module is used to adjust the current data packet transmission rate according to the congestion rate; the retransmission module is used to retransmit the current data packet according to the packet loss rate and / or delay rate. Thus, the network prediction model is used to predict the current network data, and the current data packet transmission rate is adjusted according to the prediction results, and the retransmission of the current data packet is controlled, which effectively avoids the occurrence of problems such as delays in data packet transmission, message loss, and unstable connections between devices.
[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] An embodiment of the present invention further provides an electronic device, including:
[0162] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0163] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0164] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0165] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0166] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0169] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0170] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0171] The data processing method, data processing device, electronic device and computer-readable storage medium provided by the present invention are introduced in detail above. The principles and implementation methods of the present invention are explained in this article by using specific examples. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A data processing method, characterized in that: The method comprises: Acquire current network data, and input the current network data into a network prediction model; Obtaining prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate; According to the congestion rate, adjusting the current data packet sending rate; The current data packet is retransmitted according to the packet loss rate and / or the delay rate.
2. The data processing method according to claim 1, characterized in that: The adjusting the current data packet sending rate according to the congestion rate includes: When the congestion rate is greater than the preset congestion rate, adjusting the sending rate of the current data packet to a first preset rate, and adjusting the sending window size of the current data packet to the first preset sending window size; When the congestion rate is less than or equal to the preset congestion rate, the sending rate of the current data packet is adjusted to a second preset rate, and the sending window size of the current data packet is adjusted to a second preset sending window size.
3. The data processing method according to claim 1, characterized in that: The retransmitting the current data packet according to the packet loss rate and / or the delay rate includes: When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
4. The data processing method according to claim 3, characterized in that: When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, retransmitting the data packet according to the priority of the current data packet, comprising: When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, obtaining the data type and urgency of the current data packet; Determining the priority of the current data packet according to the data type and urgency of the current data packet; The data packet is resent according to the priority of the current data packet.
5. The data processing method according to claim 4, characterized in that: The method further comprises: Obtain the number of retransmissions for the current data packet; Determining a maximum number of retransmissions of the current data packet according to the priority of the current data packet; When the number of retransmissions is greater than the maximum number of retransmissions, retransmission of the current data packet is stopped.
6. The data processing method according to claim 4, characterized in that: When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than a preset delay rate, retransmitting the data packet according to the priority of the current data packet, comprising: Get the data type of the current data packet; Determining a target preset delay rate of the current data packet from a plurality of preset delay rates according to a data type of the current data packet; When the packet loss rate is greater than a preset packet loss rate, and / or the delay rate is greater than the target preset delay rate, the data packet is retransmitted according to the priority of the current data packet.
7. The data processing method according to claim 1, characterized in that: The method is applied to a resource management system, and the method further comprises: Acquire a first performance parameter and a second performance parameter of the resource management system; the first performance parameter is a performance parameter before the current data packet is retransmitted; the second performance parameter is a performance parameter after the current data packet is retransmitted; Evaluate the resource management system according to the first performance parameter and the second performance parameter to obtain an evaluation result; The network prediction model is optimized according to the evaluation result.
8. The data processing method according to claim 1, characterized in that: The network prediction model is trained in the following way: Acquire historical network data; the historical network data includes: packet loss rate; Segmenting the historical network data to generate multiple time window samples; Marking the multiple time window samples according to the packet loss rate to obtain congested samples and non-congested samples; Determine a training set and a validation set from the congested samples and the non-congested samples; The pre-trained model is trained by using the training set to obtain a pre-selected prediction model; The pre-selected prediction model is verified through a verification set to obtain the network prediction model.
9. The data processing method according to claim 8, characterized in that: The step of marking the multiple time window samples according to the packet loss rate to obtain congested samples and non-congested samples includes: Determine a first target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the first target time window sample is greater than a preset packet loss rate; Marking the first target time window sample as a congestion sample; Determine a second target time window sample from the multiple time window samples according to the packet loss rate; the packet loss rate corresponding to the second target time window sample is less than or equal to the preset packet loss rate; The second target time window sample is marked as a non-congested sample.
10. A data processing device, characterized in that: The device comprises: A first acquisition module, used to acquire current network data and input the current network data into a network prediction model; A second acquisition module is used to obtain the prediction results output by the network prediction model; the prediction results include: congestion rate, packet loss rate and delay rate; An adjustment module, used for adjusting the current data packet sending rate according to the congestion rate; A retransmission module is used to retransmit the current data packet according to the packet loss rate and / or the delay rate.
11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the data processing method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 9 are implemented.