Intelligent network connection management and data transmission method and related equipment

By implementing heartbeat packet detection and network connection switching mechanisms at the data transmission terminal, combined with data segmentation transmission and cache mechanisms, the problems of traditional data transmission solutions being unstable and difficult to recover quickly in complex network environments are solved, and the reliability and efficiency of data transmission are improved.

CN120128510APending Publication Date: 2025-06-10STATE GRID BEIJING ELECTRIC POWER CO +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510313913.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When facing the modern complex and changing network environment, traditional data transmission solutions lack intelligent monitoring mechanisms and effective response mechanisms, resulting in unstable data transmission, prone to interrupts or errors, and it is difficult to quickly restore connections.

Method used

By implementing a heartbeat packet detection mechanism at the data transmission terminal, the network connection status is monitored in real time, and when an abnormality is detected, the network connection method is switched according to a predetermined priority, and reconnection attempts are performed using exponential incremental time intervals. At the same time, a data segmentation transmission and confirmation mechanism is adopted, and the data to be transmitted will be temporarily stored in the cache area when the network connection is abnormal, and the transmission will continue after the connection is restored.

Benefits of technology

It effectively avoids data transmission interruption or errors caused by connection failure, improves the reliability and efficiency of data transmission, shortens the data transmission stagnation time caused by connection failure, and improves the system's self-recovery ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128510A_ABST
    Figure CN120128510A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent network connection management and data transmission method and related equipment, S1, a data transmission terminal sends a heartbeat packet containing identification information to a server at a preset time interval, if a response packet fed back by the server is not received within a preset overtime threshold, network connection is judged to be abnormal and a step S2 is executed, otherwise, a step S3 is executed; s2, the data transmission terminal switches a network connection mode according to a preset priority and performs reconnection attempt by adopting an index increasing time interval, if the network connection is successful in a preset connection waiting time, a step S3 is executed, and otherwise, a step S4 is executed; s3, the data transmission terminal transmits the to-be-transmitted data in a segmented manner according to a preset size, waits for the server to feed back confirmation information after transmitting each segment of data, transmits the next segment of data if the confirmation information is received, and otherwise, executes the step S4; and S4, the data transmission terminal stores the to-be-transmitted data in the cache region, takes out the to-be-transmitted data from the cache region after the network connection is successful, and executes the step S3. The purpose of the present invention is to improve the reliability of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network data transmission, and particularly relates to an intelligent network connection management and data transmission method and related devices. Background Art

[0002] In many application scenarios of data collection and transmission such as cable tunnel monitoring, ensuring a stable connection between the data transmission terminal and the data server and achieving efficient data sending and receiving are the core elements for the normal operation of the system. These scenarios usually require data to be transmitted to the data server in real time and accurately for subsequent analysis, processing, and decision-making support.

[0003] Traditional data transmission solutions have deficiencies in coping with modern complex and changeable network environments. On the one hand, there is a lack of an intelligent monitoring mechanism for connection status. When the network connection fluctuates or is abnormal during data transmission, the system cannot perceive it in time and make corresponding adjustments or warnings, thus increasing the risk of data transmission. On the other hand, in the face of network fluctuations or server failures, there is a lack of effective coping mechanisms. In the case of unstable networks or server failures, data transmission is easily affected, resulting in problems such as data loss and transmission interruption. More seriously, once the transmission is interrupted, it is often difficult to quickly and automatically restore the connection, which not only affects the integrity of the data but also greatly reduces the availability of the data. Summary of the Invention

[0004] In view of the problems existing in the prior art, the present invention provides an intelligent network connection management and data transmission method and related devices, aiming to improve the reliability of data transmission.

[0005] To solve the above technical problems, the present invention is realized through the following technical solutions: According to a first aspect of the present invention, there is provided an intelligent network connection management and data transmission method, including: S1. The data transmission terminal sends a heartbeat packet containing identification information to the server at a preset time interval. If a response packet feedback from the server is not received within a preset timeout threshold, it is determined that the network connection is abnormal and step S2 is executed; otherwise, step S3 is executed; S2. The data transmission terminal switches the network connection mode according to a predetermined priority and attempts to reconnect at an exponentially increasing time interval. If the network connection is successful within a preset waiting connection time, step S3 is executed; otherwise, step S4 is executed; S3. The data transmission terminal segments the data to be transmitted into predetermined sizes and waits for the server to feedback confirmation information after transmitting each segment. If the confirmation information is received, the next segment of data is transmitted; otherwise, step S4 is executed; S4. The data transmission terminal stores the data to be transmitted in the buffer, and after the network connection is successful, it retrieves the data to be transmitted from the buffer and executes step S3.

[0006] In a possible implementation manner of the first aspect, in step S1, the timeout threshold is set to 1.5 to 2 times the corresponding time interval; The heartbeat packet includes combined identification information of the device ID, protocol version number, and current timestamp.

[0007] In a possible implementation manner of the first aspect, in step S1, it further includes: The data transmission terminal monitors the specified network parameters in real time. If the specified network parameters exceed the preset normal range, it issues an exception warning and executes step S4.

[0008] In a possible implementation manner of the first aspect, the specified network parameters include the network interface traffic fluctuation parameter and the packet error rate; If the network interface traffic fluctuation parameter exceeds the network traffic fluctuation threshold, an exception warning is issued and step S4 is executed; And / or, if the packet error rate exceeds the packet error rate threshold, an exception warning is issued and step S4 is executed.

[0009] In a possible implementation manner of the first aspect, in step S2, the data transmission terminal switches the network connection method according to the predetermined priority and performs reconnection attempts at exponentially increasing time intervals. Specifically: S21. First, attempt to re - establish the communication link using the current connection channel. When the connection fails continuously within the set number of times, execute S22; S22. Switch the connection method in the priority order of wired network, 4G / 5G network, and WiFi network in turn; S23. Based on the initial waiting time T, set the retry interval for the nth time as T n = T × 2 (n-1) where n is a natural number not less than 1, and the maximum retry interval does not exceed the preset waiting connection time.

[0010] In a possible implementation manner of the first aspect, in step S3, before the data transmission terminal segments the data to be transmitted according to the predetermined size, it further includes: Classify the data to be transmitted according to the importance and urgency of the data to be transmitted, and give priority to transmitting the data to be transmitted with high priority.

[0011] In a possible implementation of the first aspect, in step S4, the buffer adopts a circular queue structure, and a maximum buffer capacity is set. When the buffer data volume reaches a set percentage of the maximum buffer capacity, buffer data cleaning is performed, and low-priority data to be transmitted is preferentially cleaned up.

[0012] According to a second aspect of the present invention, there is provided a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the intelligent network connection management and data transmission method described above is implemented.

[0013] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the intelligent network connection management and data transmission method described above is implemented.

[0014] According to a fourth aspect of the present invention, there is provided a computer program product, and when the computer program product is executed by a processor, the intelligent network connection management and data transmission method described above is implemented.

[0015] Compared with the prior art, the present invention has at least the following beneficial effects: The intelligent network connection management and data transmission method provided by the present invention can, through a heartbeat packet detection mechanism, real-time sense the connection status between a data transmission terminal and a data server. Once a connection anomaly is detected, corresponding measures are immediately taken, effectively avoiding data transmission interruption or errors caused by failure to detect connection failures in a timely manner, thereby improving the reliability of data transmission. When a connection problem occurs, the present invention can automatically switch the network connection method according to a preset priority order and attempt to reconnect according to an exponentially increasing time interval strategy. This automatic recovery mechanism greatly reduces the need for manual intervention, shortens the data transmission stagnation time caused by connection failures, and improves the self-recovery ability of the system. The present invention can resume data transmission in a shorter time, ensuring the timeliness of data, enabling relevant systems to make decisions or adjustments based on the latest data faster. In application scenarios such as cable tunnel monitoring, abnormal situations such as abnormal temperature changes or power leakage can be detected and processed in a timely manner, thereby effectively reducing losses caused by potential risks. At the same time, by jointly adopting a data segmentation transmission and confirmation mechanism, the present invention ensures that each part of the data to be transmitted can be accurately confirmed by the server receiving party, avoiding errors and retransmissions that may be caused by large-scale data transmission at one time, and making data transmission orderly and efficient. The present invention's collaborative caching mechanism can temporarily store data to be sent when the network connection is abnormal, avoiding data loss and ensuring the integrity and continuity of the data to be transmitted. In summary, the intelligent network connection management and data transmission method of the present invention can improve the reliability of data transmission.

[0016] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following provides preferred embodiments in conjunction with the accompanying drawings and describes them in detail as follows. Description of the Drawings

[0017] In order to more clearly illustrate the technical solutions in the specific embodiments of the present invention, the following will briefly introduce the drawings required for the description of the specific embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0018] Figure 1 It is a flowchart of a method for intelligent network connection management and data transmission of the present invention; Figure 2 It is a schematic diagram of the execution architecture of a method for intelligent network connection management and data transmission in an embodiment. Specific Embodiments

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions of the present invention in conjunction with the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0020] As Figure 1 shown, the embodiments of the present invention provide a method for intelligent network connection management and data transmission, mainly to solve the problems of unstable connection, data loss, and transmission interruption existing in the data transmission process in the prior art, thereby improving the reliability and efficiency of data transmission. The method for intelligent network connection management and data transmission specifically includes the following steps: S1. The data transmission terminal sends a heartbeat packet containing identification information to the server at a preset time interval. If a response packet feedback from the server is not received within the preset timeout threshold, it is determined that the network connection is abnormal and step S2 is executed; otherwise, step S3 is executed.

[0021] Specifically, a data transmission terminal (such as a monitoring device installed in a cable tunnel) presets a fixed time interval (for example, every 5 seconds) and sends a heartbeat packet containing unique identification information to the data server through the current network connection. The main function of the heartbeat packet is to confirm the network connection status between the data transmission terminal and the server. After receiving the heartbeat packet, the data server immediately generates and returns a response packet containing the same identification information to the data transmission terminal. At the same time, the data transmission terminal sets a timeout threshold (for example, 10 seconds) for waiting for the server's response packet. If the response packet is not received within this timeout threshold, it is determined that the current network connection may be abnormal.

[0022] S2. The data transmission terminal switches the network connection method according to the predetermined priority and attempts to reconnect at exponentially increasing time intervals. If the network connection is successful within the preset waiting connection time, step S3 is executed; otherwise, step S4 is executed.

[0023] Specifically, once a network connection anomaly is detected, the data transmission terminal will attempt to switch to other available network connection methods (such as switching from Wi-Fi to 4G / 5G mobile network or switching to a backup wired network connection) according to the preset priority order. The priority order can be configured according to the actual network environment to ensure that the most stable and lowest-latency connection method is used preferentially.

[0024] After switching the network connection method, the data transmission terminal will attempt to reconnect at exponentially increasing time intervals. For example, the first reconnection attempt interval is 2 seconds. If it fails, the next attempt interval is 4 seconds, and if it fails again, the interval is 8 seconds, and so on, until the preset maximum number of reconnection attempts or the preset waiting connection time (such as 30 minutes) is reached. If the network connection is successfully established during this period, step S3 is executed.

[0025] S3. The data transmission terminal segments the data to be transmitted into segments of a predetermined size and waits for the server to feedback confirmation information after transmitting each segment. If the confirmation information is received, the next segment of data is transmitted; otherwise, step S4 is executed.

[0026] Specifically, after confirming the stable network connection, the data transmission terminal segments the data to be transmitted into segments of a predetermined size (such as 1024 bytes). It should be understood that the choice of the segment size should consider the transmission efficiency of the data packet and the utilization rate of the network bandwidth.

[0027] After each data segment is sent, the data transmission terminal will pause sending and wait for the confirmation message from the data server. After successfully receiving and processing each data segment, the server will return a confirmation message to the data transmission terminal. Only after receiving the confirmation message will the data transmission terminal continue to send the next data segment. This mechanism ensures the orderly transmission of data and the accuracy of transmission, effectively avoiding data loss or transmission errors.

[0028] S4. The data transmission terminal stores the data to be transmitted in the buffer area, and after the network connection is successful, retrieves the data to be transmitted from the buffer area and executes step S3.

[0029] Specifically, when it is detected that the network connection is abnormal or the server is busy and unable to receive data, the data transmission terminal temporarily stores the data to be transmitted in the local buffer area. The size of the buffer area should be reasonably configured according to the actual application scenario and data transmission volume to ensure that sufficient data can be stored even in the case of a long-term network interruption. Once the network connection is successfully restored, the data transmission terminal will automatically retrieve the data to be transmitted from the buffer area and perform transmission according to the data segmentation transmission and confirmation mechanism in step S3, ensuring that the data accumulated during the network interruption can be transmitted in a timely and accurate manner after the connection is restored.

[0030] Preferably, both the data transmission terminal and the server have a logging function for recording information such as network connection status, data transmission progress, and exception handling, so that the system administrator can discover and solve problems in a timely manner. When it is detected that the network connection is abnormal or the data transmission fails, the system can automatically trigger an early warning mechanism to notify the administrator by means of text messages, emails, or system logs, etc., so that the administrator can respond and take measures to reduce the data transmission interruption time caused by network failures.

[0031] In an implementable manner, in step S1, the timeout threshold is set to 1.5 to 2 times the corresponding time interval. For example, if the time interval for sending heartbeat packets is 5 seconds, the timeout threshold can be set between 7.5 seconds and 10 seconds. The selection of this range is based on a reasonable estimate of network latency, which can not only avoid misjudgment caused by short-term network fluctuations but also ensure that problems in the network connection can be discovered and processed in a timely manner.

[0032] The heartbeat packet includes combined identification information of the device ID, protocol version number, and current timestamp. Specifically, each data transmission terminal has a unique device ID, which is used by the server to identify the specific sender, facilitating the accurate tracking of the connection status of each data transmission terminal in a multi-device environment. The heartbeat packet contains the currently used communication protocol version number to ensure that the server can correctly parse and process the heartbeat packet. The heartbeat packet contains the timestamp at the time of sending, which is used by the server to calculate network latency and verify the timeliness of the heartbeat packet. The combined identification information (device ID + protocol version number + current timestamp) ensures the uniqueness of the heartbeat packet and is also convenient for identification.

[0033] Exemplarily, the data transmission terminal sends the constructed heartbeat packet to the server at a preset time interval (such as 5 seconds). After receiving the heartbeat packet, the server immediately returns a response packet containing the same identification information to the data transmission terminal. The data transmission terminal sets a timeout counter to record the time from sending the heartbeat packet to receiving the response packet. If the response packet is not received within the timeout threshold (such as 7.5 seconds to 10 seconds), it is determined that the network connection may be abnormal, and the exception handling process of step S2 is triggered.

[0034] In one implementable manner, in step S1, it further includes: the data transmission terminal monitors the specified network parameters in real time. If the specified network parameters exceed the preset normal range, an exception warning is issued and step S4 is executed.

[0035] That is to say, the data transmission terminal monitors the specified network parameters in real time. If the specified network parameters exceed the preset normal range, the data transmission terminal immediately issues an exception warning. At the same time, in the case of abnormal network parameters, the data transmission terminal is prepared to execute step S4, that is, to cache the data into the local buffer for continued transmission after the network connection is restored.

[0036] Preferably, after issuing the exception warning, the data transmission terminal can pause or slow down the data sending rate to reduce data loss or transmission interruption caused by network problems.

[0037] Preferably, the specified network parameters include the network interface traffic fluctuation parameter and the packet error rate. If the network interface traffic fluctuation parameter exceeds the network traffic fluctuation threshold, an exception warning is issued and step S4 is executed; and / or, if the packet error rate exceeds the packet error rate threshold, an exception warning is issued and step S4 is executed.

[0038] Specifically, the network parameter sniffing technology is adopted to calculate the traffic volatility (i.e., the percentage deviation of the actual traffic from the average traffic) by real-time monitoring the data traffic of the network interface. If the traffic volatility exceeds the network traffic fluctuation threshold (such as ±20%), an abnormal warning is issued. At the same time, the ratio of the number of error packets received within a certain period to the total number of packets is statistically calculated. If the packet error rate exceeds the packet error rate threshold, for example, 5% - 15%, and the specific value can be adjusted according to the application scenario and network environment. In this example, it is set to 10%, then an abnormal warning is issued.

[0039] The network parameter sniffing technology can timely detect abnormal situations of network connections by real-time collecting and analyzing key network parameters such as the data traffic and packet error rate of the network interface.

[0040] In this embodiment, by combining the heartbeat detection mechanism with the network parameter sniffing, abnormal situations of network connections can be timely detected, effectively avoiding data transmission interruption or errors caused by undetected network connection failures. For example, in the data transmission scenario of a cable tunnel, continuous and stable data transmission is crucial for monitoring the cable status. Even if there are short-term network fluctuations or temporary server failures, the present invention can quickly respond to ensure the reliability of the data transmission link, prevent misjudgment or missed judgment of potential cable problems caused by data loss, and thus improve the safety and stability of the entire cable tunnel monitoring system.

[0041] In an implementable manner, in step S2, the data transmission terminal switches the network connection mode according to a predetermined priority and performs reconnection attempts at exponentially increasing time intervals, specifically including the following steps: S21. First, attempt to re-establish the communication link using the current connection channel. After consecutive connection failures within the set number of times, execute S22.

[0042] That is to say, when detecting an abnormal network connection, the data transmission terminal immediately starts the automatic connection recovery program. First, the data transmission terminal attempts to re-establish the communication link with the data server using the current connection channel. During the reconnection process, connection attempts are made according to the previously recorded connection information such as the server address and port number. If the connection cannot be successfully re-established within the set number of retry times (such as 5 times), proceed to the next step.

[0043] S22. Switch the connection mode in the priority order of wired network, 4G / 5G network, and WiFi network in sequence.

[0044] That is to say, when the current connection channel cannot be restored, the data transmission terminal switches the network connection method according to a predetermined priority order. The predetermined priority order is: wired network > 4G / 5G network > WiFi network. That is, the data transmission terminal attempts to use the wired network, 4G / 5G network, and WiFi network for connection attempts in sequence until a connection is successfully established or all available network connection methods have been tried.

[0045] It should be noted that the predetermined priority order can be adjusted according to the actual application scenario and network environment.

[0046] S23. Based on the initial waiting time T, according to T n = T × 2 (n-1) Set the retry interval for the nth time, where n is a natural number not less than 1, and the maximum retry interval does not exceed the preset waiting connection time.

[0047] Specifically, after switching the network connection method, the data transmission terminal performs reconnection attempts at exponentially increasing time intervals. The initial waiting time T can be set according to the actual application scenario and network environment. Exemplarily, T is set to 1 minute. The retry interval T n According to the formula T n = T × 2 (n-1) For calculation. The maximum retry interval does not exceed the preset waiting connection time. Exemplarily, the preset waiting connection time is 30 minutes. If the connection is still not successful after reaching the maximum retry interval, the data transmission terminal enters the sleep state or executes other predetermined fault handling processes.

[0048] In one implementable manner, in step S3, before the data transmission terminal segments the data to be transmitted according to a predetermined size, it further includes: classifying the data to be transmitted according to the importance and urgency of the data to be transmitted, and preferentially transmitting the data to be transmitted with high priority to ensure the timely transmission of key data.

[0049] Specifically, by establishing a priority queue for the data to be transmitted, this queue classifies the data to be transmitted into different priorities according to the importance and urgency of the data, such as high priority, medium priority, and low priority. Exemplarily, for application scenarios such as cable tunnel monitoring, fault alarm data is given the highest priority to ensure that alarm information can be transmitted quickly when a fault occurs, while conventional monitoring data is given medium or low priority. The introduction of the data priority queue enables key data (such as cable fault warning data) to be transmitted in the first time, ensuring the timeliness of important information.

[0050] In one implementable manner, in step S4, the buffer adopts a circular queue structure, with a maximum buffer capacity set. When the buffer data volume reaches a set percentage of the maximum buffer capacity, buffer data cleaning is performed, and the low-priority data to be transmitted is preferentially cleaned up.

[0051] Specifically, by adopting a circular queue structure to manage the buffer, it ensures efficient and orderly storage of data, avoiding disorderly accumulation and waste of data. A maximum buffer capacity is set, such as 100 MB, to limit the data storage volume in the buffer. The buffer adopts a circular queue data structure, that is, when the buffer is almost full, new data will overwrite the earliest stored data, thus realizing circular storage of data. When the buffer data volume reaches a set percentage of the maximum buffer capacity, the low-priority data to be transmitted is preferentially cleaned up to ensure that high-priority data always has sufficient buffer space. Exemplarily, when the buffer data volume reaches 80% of the maximum buffer capacity, according to the order of the data priority queue, the low-priority data to be transmitted is preferentially cleaned up until the buffer data volume drops below the set threshold of the maximum buffer capacity. The data cleaning strategy reasonably releases buffer space according to data priorities, ensuring the preferential storage and transmission of high-priority data in the buffer.

[0052] Preferably, during data transmission, the data that has been sent but has not received an acknowledgment receipt is backed up. The backup function for the sent but unacknowledged data enables these data to be quickly resent after the connection is restored, thus making data transmission more reliable. After the connection is restored, according to the order of the data priority queue, the high-priority backed-up data is preferentially resent.

[0053] In one embodiment, as Figure 2As shown in the figure, the execution system architecture of an intelligent network connection management and data transmission method includes a data transmission terminal module and a data server. Specifically, the data transmission terminal module includes a monitoring and recovery unit, a data transceiver unit, a network sniffing module, and a buffer. Specifically, the monitoring and recovery unit is used to execute sending heartbeat packets containing identification information to the server at a preset time interval. If a response packet feedback from the server is not received within a preset timeout threshold, it is determined that the network connection is abnormal; otherwise, it is normal. At the same time, it is used to switch the network connection method according to a predetermined priority and perform reconnection attempts with an exponentially increasing time interval. The data transceiver unit is used to segment the data to be transmitted according to a predetermined size and wait for the server to feedback confirmation information after transmitting each segment of data. If the confirmation information is received, the next segment of data is transmitted. The network sniffing module is used to monitor specified network parameters in real time. If the specified network parameters exceed the preset normal range, an abnormal warning is issued. The buffer is used to store the data to be transmitted in the buffer. Specifically, the data server includes a heartbeat response module and a data receiving and processing module. The heartbeat response module is used to feedback a response packet to the monitoring and recovery unit. The data receiving and processing module is used to receive the segmented data transmitted by the data transceiver unit and feedback confirmation information for each segment of data to the data transceiver unit.

[0054] In another embodiment of the present invention, a computer device is provided. The computer device includes a processor and a memory. The memory is used to store a computer program. The computer program includes program instructions. The processor is used to execute the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function. The processor described in the embodiment of the present invention can be used for the operation of an intelligent network connection management and data transmission method.

[0055] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the terminal is stored in this storage space. Moreover, one or more instructions suitable for being loaded and executed by the processor are stored in this storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. One or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the method for intelligent network connection management and data transmission in the above embodiments.

[0056] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0057] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0058] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions in Figure 1 one flow or multiple flows and / or blocksFigure 1 The functions specified in one or more boxes.

[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the steps of the functions specified in one process or more processes and / or one box or more boxes. Figure 1 One process or more processes and / or Figure 1 the steps of the functions specified in one box or more boxes.

[0060] The present invention also provides a computer program product, since the computer program product is used to execute any one of the above-mentioned intelligent network connection management and data transmission methods. Since the computer program product provided by the present invention and the above-mentioned intelligent network connection management and data transmission method belong to the same inventive concept, the computer program product provided by the present invention has all the advantages of the above-mentioned intelligent network connection management and data transmission method. Therefore, the beneficial effects of the computer program product provided by the present invention will not be described in detail herein.

[0061] In the present invention, the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0062] Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present invention can still modify or easily conceive of changes to the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. An intelligent network connection management and data transmission method, characterized in that: include: S1, the data transmission terminal sends a heartbeat packet containing identification information to the server at a preset time interval. If no response packet is received from the server within a preset timeout threshold, the network connection is determined to be abnormal and step S2 is executed, otherwise step S3 is executed; S2, the data transmission terminal switches the network connection mode according to the predetermined priority, and attempts to reconnect at an exponentially increasing time interval. If the network connection is successful within the preset waiting time, step S3 is executed, otherwise step S4 is executed; S3, the data transmission terminal transmits the data to be transmitted in segments of a predetermined size, and waits for the server to feedback confirmation information after transmitting each segment of data. If the confirmation information is received, the next segment of data is transmitted, otherwise, step S4 is executed; S4. The data transmission terminal stores the data to be transmitted in the buffer area, and after the network connection is successful, takes out the data to be transmitted from the buffer area and executes step S3.

2. The intelligent network connection management and data transmission method according to claim 1, characterized in that: In step S1, the timeout threshold is set to 1.5 to 2 times of the corresponding time interval; The heartbeat packet includes combined identification information of a device ID, a protocol version number, and a current timestamp.

3. The intelligent network connection management and data transmission method according to claim 1, characterized in that: Step S1 also includes: The data transmission terminal monitors the specified network parameters in real time. If the specified network parameters exceed the preset normal range, an abnormal warning is issued and step S4 is executed.

4. The intelligent network connection management and data transmission method according to claim 3, characterized in that: The specified network parameters include network interface traffic fluctuation parameters and data packet error rate; If the network interface traffic fluctuation parameter exceeds the network traffic fluctuation threshold, an abnormal warning is issued and step S4 is executed; And / or, if the data packet error rate exceeds the data packet error rate threshold, an abnormality warning is issued and step S4 is executed.

5. The intelligent network connection management and data transmission method according to claim 1, characterized in that: In step S2, the data transmission terminal switches the network connection mode according to a predetermined priority and attempts to reconnect at an exponentially increasing time interval, specifically: S21, preferentially try to re-establish the communication link using the current connection channel, and if the connection fails continuously within a set number of times, execute S22; S22. Switch the connection mode in order of priority of wired network, 4G / 5G network and WiFi network; S23. Based on the initial waiting time T, n =T×2 (n-1) Set the nth retry interval, where n is a natural number not less than 1, and the maximum retry interval does not exceed the preset waiting time for connection.

6. The intelligent network connection management and data transmission method according to claim 1, characterized in that: In step S3, before the data transmission terminal transmits the data to be transmitted in segments of a predetermined size, the step further includes: The data to be transmitted is prioritized according to its importance and urgency, and high-priority data is transmitted first.

7. The intelligent network connection management and data transmission method according to claim 6, characterized in that: In step S4, the cache area adopts a circular queue structure and sets a maximum cache capacity. When the cache data volume reaches a set percentage of the maximum cache capacity, the cache data is cleared, with low-priority data to be transmitted being cleared first.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the intelligent network connection management and data transmission method according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, an intelligent network connection management and data transmission method as claimed in any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that When the computer program product is executed by a processor, an intelligent network connection management and data transmission method as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Power equipment safety adjusting system based on data analysis

    CN122418993A

  • A power equipment safety adjusting system based on data analysis

    CN122418993B

  • Control system for state anomaly alarm

    CN122795712A