Data transmission method based on long link management and related equipment

Through dynamic link management and multi-layer encryption transmission strategy, the problems of inconvenient link status management and low data security in long link communication are solved, and the stability and high security of long link communication system are achieved.

CN119211329APending Publication Date: 2024-12-27BEIJING SOHU NEW MOMENTUM INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411315269.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In long-link communication, link status management and low data security lead to communication interruption or delay, affecting system stability and user experience, and data transmission is susceptible to interception and tampering.

Method used

Monitor the long link status through the dynamic link management mechanism, automatically reconnect, and use preset security encryption policies to perform multi-layer encryption transmission, encrypt the data using the target key, and update the key in time to ensure security.

Benefits of technology

It improves the stability and data security of the long-link communication system, ensures the continuity of links and high security of data transmission, and meets the high requirements of long-link communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211329A_ABST
    Figure CN119211329A_ABST
Patent Text Reader

Abstract

The invention discloses a long link management-based data transmission method and related equipment, and belongs to the technical field of communication, the disclosed method can be applied to first equipment, and the long link management-based data transmission method applied to the first equipment comprises the steps of obtaining a link request initiated by second equipment and used for requesting to establish a long link; establishing a long link with a second device based on the link request; performing state detection on the long link, and if a state detection result represents that the long link is abnormal, sending a reconnection request to the second equipment to reestablish the long link between the first equipment and the second equipment; and based on the long link, executing data transmission processing with the second equipment by using a preset security encryption strategy. According to the application, the continuity and stability of the link are ensured through a dynamic link management mechanism, the stability of the long link communication system is remarkably improved, and meanwhile, the problem of low data transmission security in the long link communication is solved through multiple encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a data transmission method and related equipment based on long link management. Background Art

[0002] With the rapid development of the Internet and mobile communication technologies, long connection technology has been widely used in real-time communication, Internet of Things (IoT), online games, video conferencing, etc. Long connection allows the client to maintain a persistent connection with the server, thus achieving instant data transmission and real-time interaction.

[0003] In the development of long link technology, WebSocket protocol and HTTP / 2 protocol are two important milestones. WebSocket protocol realizes two-way communication, which greatly improves the efficiency of real-time communication. HTTP / 2 protocol further optimizes data transmission performance through multiplexing, header compression and server push. Although these protocols have solved some problems in long link communication to a certain extent, long link communication still faces many technical challenges in practical applications.

[0004] Inconvenience in link status management is one of the many challenges faced by long link communications. In the process of establishing and maintaining long links, known technologies often lead to communication interruptions or delays due to uncontrollable link status and inconvenient management, making it difficult to ensure the continuity and stability of the link, affecting the stability of the long link communication system and user experience. In addition, during the data transmission process based on long links, the transmitted data is easily intercepted and tampered with, and security cannot be guaranteed. Summary of the invention

[0005] In view of this, the present application discloses a data transmission method and related equipment based on long link management, so as to at least solve the problems of inconvenient link status management and low data security in long link communication, ensure the continuity and stability of the link, and improve the stability and data security of the long link communication system.

[0006] The specific plan is as follows:

[0007] A data transmission method based on long link management is applied to a first device, the method comprising:

[0008] Obtaining a link request initiated by the second device for requesting to establish a long link;

[0009] Based on the link request, establish a long link with the second device;

[0010] Performing a status detection on the long link to obtain a status detection result;

[0011] If the status detection result indicates that the long link has a link abnormality, sending a reconnection request to the second device; the reconnection request is used to trigger the second device to re-initiate a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device;

[0012] Based on the long link between the second device, a preset security encryption strategy is used to perform data transmission processing between the second device; wherein, the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0013] Optionally, performing status detection on the long link to obtain a status detection result includes:

[0014] Receiving a heartbeat packet periodically sent by the second device based on the heartbeat mechanism;

[0015] Based on the reception of the heartbeat packet, the state of the long link is detected to obtain the state detection result.

[0016] Optionally, after sending the reconnection request to the second device, the method further includes:

[0017] In response to detecting that the long link reconstruction fails and the number of reconstruction failures reaches a set number, notification information for indicating link abnormality is sent to the target object.

[0018] Optionally, the performing data transmission processing between the second device and the second device based on the long link between the second device and the second device using a preset security encryption strategy includes at least one of the following:

[0019] Encrypt the first data to be sent by using the target key to obtain first encrypted data, and send the first encrypted data to the second device through the long link, so that the second device decrypts the first encrypted data by using the target key to obtain the first data;

[0020] receiving second encrypted data sent by the second device, and decrypting the second encrypted data using the target key to obtain second data corresponding to the second encrypted data;

[0021] Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

[0022] Optionally, the method further includes:

[0023] If the target key meets the update condition, the target key for data encryption is regenerated based on the preset generation method to update the target key held by the first device and the second device.

[0024] Optionally, the performing of data transmission processing between the second device and the second device based on the long link with the second device using a preset security encryption strategy includes at least one of the following data sending processing and data receiving processing:

[0025] Data sending and processing:

[0026] Encrypt the first data to be sent using the target key to obtain first encrypted data;

[0027] In response to the first encrypted data satisfying a compression condition, compressing the first encrypted data to obtain first compressed data;

[0028] In response to the first compressed data satisfying a slicing condition, slicing the first compressed data to obtain a plurality of first slicing data;

[0029] Sending the plurality of first fragmented data in batches to the second device through the long link, so that the second device obtains the first compressed data by integrating the plurality of first fragmented data, decompresses the first compressed data, and uses the target key to decrypt the first encrypted data obtained by decompression to obtain the first data;

[0030] Data reception and processing:

[0031] receiving in batches a plurality of second fragmented data sent by the second device through the long link; each second fragmented data is data obtained by the second device encrypting the second data to be sent using the target key, and compressing and slicing the encrypted second encrypted data;

[0032] Integrate the plurality of second fragmented data to obtain second compressed data;

[0033] decompressing the second compressed data to obtain the second encrypted data;

[0034] Decrypting the second encrypted data using the target key to obtain the second data;

[0035] Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

[0036] Optionally, after receiving in batches a plurality of second fragment data sent by the second device through the long link, the method further includes:

[0037] Based on the check code corresponding to each second shard data, perform integrity or correctness check on each second shard data;

[0038] If there is target second fragment data that fails the verification, sending a retransmission request for requesting retransmission of the target second fragment data to the second device;

[0039] The target second fragment data retransmitted by the second device is received through the long link.

[0040] Optionally, the performing of data transmission processing with the second device includes at least one of the following:

[0041] Through the long link, each data to be sent is sent to the second device in sequence according to the order matching the corresponding transmission priority;

[0042] Through the long link, each data to be sent is received by the second device in sequence according to the transmission priority corresponding to each data to be sent.

[0043] A data transmission method based on long link management, applied to a second device, the method comprising:

[0044] Initiating a link request for requesting to establish a long link to the first device, so that the first device establishes a long link with the second device based on the link request;

[0045] In response to receiving the reconnection request sent by the first device, re-initiating a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device;

[0046] Based on the long link between the first device, a preset security encryption strategy is used to perform data transmission processing between the second device; wherein, the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0047] A data transmission device based on long link management, applied to a first device, the device comprising:

[0048] A request acquisition module, used to acquire a link request initiated by the second device for requesting to establish a long link;

[0049] A link establishing module, configured to establish a long link with the second device based on the link request;

[0050] A status detection module, used to perform status detection on the long link to obtain a status detection result;

[0051] an exception handling module, configured to send a reconnection request to the second device if the status detection result indicates that the long link generates a link exception; the reconnection request is used to trigger the second device to re-initiate a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device;

[0052] The first transmission processing module is used to perform data transmission processing between the second device and the second device based on the long link between the second device and the preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0053] A data transmission device based on long link management is applied to a second device, and the method includes:

[0054] a request initiating module, configured to initiate a link request for requesting to establish a long link to the first device, so that the first device establishes a long link with the second device based on the link request; and in response to receiving a reconnection request sent by the first device, re-initiate a link request for requesting to establish a long link to the first device, so that the first device re-establishes the long link with the second device;

[0055] A second transmission processing module is used to perform data transmission processing between the second device and the first device based on the long link between the first device and the second device using a preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0056] An electronic device, comprising:

[0057] A memory for storing at least one set of computer instructions;

[0058] A processor, configured to implement the data transmission method based on long link management applied to the first device as described in any one of the above items, or the data transmission method based on long link management applied to the second device as described in the above items, by executing the instruction set stored in the memory.

[0059] A computer-readable medium having a computer instruction set stored thereon, which, when executed by a processor, is used to implement a data transmission method based on long link management applied to a first device as described in any one of the above items, or a data transmission method based on long link management applied to a second device as described in the above items.

[0060] In summary, in the data transmission method and related devices based on long link management provided by the present application, after the first device establishes a long link with the second device based on the link request initiated by the second device, it monitors the status of the long link through a dynamic link management mechanism, and automatically reconnects when the long link is abnormal (such as disconnected), which solves the problem of inconvenient and imperfect link status management in the known technology, ensures the continuity and stability of the link, and significantly improves the stability of the long link communication system. In addition, the present application further ensures the high security of data transmission by using multiple encryption methods based on a secure encryption strategy to encrypt and transmit data based on a long link, solves the problem of low data transmission security in long link communication of the known technology, and meets the high requirements of long link communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] For ease of reference and clarity, the nouns, abbreviations or related terms involved in the embodiments of the present application are first explained as follows:

[0062] HTTP: Hypertext Transfer Protocol, Hypertext Transfer Protocol.

[0063] HTTPS: Hypertext Transfer Protocol Secure, Hypertext Transfer Protocol Secure.

[0064] AES: Advanced Encryption Standard (AES) is a symmetric encryption algorithm used to protect electronic data.

[0065] RSA: An asymmetric encryption algorithm that uses a pair of keys for encryption and decryption: a public key and a private key.

[0066] WebSocket: A network protocol that maintains a long TCP (Transmission Control Protocol) connection between a client and a server so that they can exchange information at any time.

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0068] Figure 1 is a flow chart of a data transmission method based on long link management applied to a first device provided by the present application;

[0069] Figure 2 is a data transmission processing flow chart of the first device end provided by the present application;

[0070] Figure 3 is a data receiving and processing flow chart of the first device end provided by the present application;

[0071] Figure 4 is a flow chart of a data transmission method based on long link management applied to a second device provided by the present application;

[0072] Figure 5 It is a composition structure diagram of a data transmission device based on long link management applied to a first device provided by the present application;

[0073] Figure 6 It is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] The embodiment of the present application provides a data transmission method based on long link management and related devices to solve the problems existing in long link communication and meet the high requirements of long link communication. The method provided in the embodiment of the present application includes a data transmission method based on long link management applied to a first device and a data transmission method based on long link management applied to a second device.

[0076] The first device and the second device are respectively two-end devices that need to perform data transmission in long link communication, and the first device and the second device can be a sending device and a receiving device to each other based on actual communication needs. For example, when the first device sends data to the second device based on the long link, the first device is the sending device and the second device is the receiving device; when the first device receives data sent by the second device based on the long link, the first device is the receiving device and the second device is the sending device.

[0077] Optionally, the first device and the second device may be a server and a client device in a long link communication scenario, respectively.

[0078] See also Figure 1 As shown in the method flow chart, the data transmission method based on long link management applied to the first device provided in the embodiment of the present application may at least include the following steps 101 to 105, and these steps are described in detail below.

[0079] Step 101: Obtain a link request initiated by a second device for requesting to establish a long link.

[0080] When a second device such as a client device has a need for data transmission with a first device, it can optionally initiate a connection request to a first device such as a server via the WebSocket or HTTP / 2 protocol, and the first device such as the server can correspondingly obtain the connection request initiated by the second device via the WebSocket or HTTP / 2 protocol.

[0081] Step 102: Establish a long link with the second device based on the link request.

[0082] After receiving the link request initiated by the second device, the first device, such as a server, establishes a long link between itself and the second device.

[0083] In addition, optionally, the first device may also record information about the established long link, including but not limited to recording an identifier of the established long link and a link status.

[0084] Step 103: Perform a status detection on the long link to obtain a status detection result.

[0085] In the embodiment of the present application, after the long link is established, the first device further monitors the status of the long link in real time through a dynamic link management mechanism.

[0086] Optionally, the health status of the long link can be detected by periodically sending heartbeat packets between the first device and the second device using the established long link based on the heartbeat mechanism. In implementation, the heartbeat packet can be sent by the second device to the first device, or by the first device to the second device. There is no limitation on this, and it can be determined according to the actual application situation.

[0087] In the case where the first device is a server and the second device is a client device, preferably, the second device periodically sends a heartbeat packet to the first device, for example, the client device periodically sends a heartbeat packet to the server. Under this embodiment, the first device can correspondingly receive the heartbeat packet periodically sent by the second device based on the heartbeat mechanism, and based on the reception of the heartbeat packet, detect the state of the long link to obtain a state detection result. Among them, if the first device does not receive the heartbeat packet within the specified time, that is, the heartbeat packet reception times out, it is considered that the link is abnormal. On the contrary, if the heartbeat packet can be received normally within the specified time, there is no abnormality in the link, that is, the long link is in a healthy state.

[0088] It is easy to understand that when the first device periodically sends a heartbeat packet to the second device, if the heartbeat packet fails to receive a response within a specified time period, it can be regarded as a link abnormality.

[0089] Step 104: If the status detection result indicates that the long link has a link abnormality, a reconnection request is sent to the second device; the reconnection request is used to trigger the second device to re-initiate a link request to the first device for requesting to establish a long link, so that the first device can rebuild the long link with the second device.

[0090] When a link abnormality is detected, the first device can record the abnormal information (such as the long link identifier where the abnormality occurred, the identifier of the second device corresponding to the long link, etc.), and start the link reconstruction mechanism, and send a reconnection request to the corresponding second device based on the link reconstruction mechanism to trigger the second device to re-initiate a link request to the first device for requesting to establish a long link, thereby re-initiating the link establishment process.

[0091] Subsequently, when the second device re-initiates a link request to the first device to request establishment of a long link, the first device can rebuild the long link with the second device based on the re-initiated link request, thereby achieving automatic reconnection when a link abnormality occurs, such as link disconnection, to avoid communication interruption or delay.

[0092] In implementation, optionally, for the dynamic link management mechanism, three functional layers, namely, link monitoring layer, link management layer and link maintenance layer, can be set on the first device such as a server, and each functional layer is provided with a corresponding functional module / unit to provide corresponding functions. Through the collaborative work of these three layers, real-time monitoring, management and maintenance of long links can be achieved. It is easy to understand that a corresponding functional layer can be set on the second device to cooperate with the first device.

[0093] The following provides exemplary specific functions of the link monitoring layer, the link management layer, and the link maintenance layer on the first device.

[0094] 1. Link monitoring layer

[0095] It is mainly used to provide the following functions:

[0096] Step 1-1: Link building

[0097] The second device such as the client device initiates a connection request to the server through the WebSocket or HTTP / 2 protocol. After the first device such as the server receives the request, it establishes a long link and records the link status.

[0098] 1-2: Link status monitoring: Real-time monitoring of the status of long links through the heartbeat packet mechanism.

[0099] After the long link is established, a first device such as a server and a second device such as a client device periodically send heartbeat packets to detect the health status of the long link.

[0100] The sending or receiving of heartbeat packets is the responsibility of the heartbeat detection module of the link monitoring layer. If no heartbeat packet is received within the specified time or no response is received to the heartbeat packet within the specified time, the link is considered abnormal.

[0101] 2. Link management layer:

[0102] It is mainly used to provide the following functions:

[0103] 2-1: Link anomaly detection: When the link monitoring layer detects a link anomaly, the anomaly handling module of the link management layer is triggered. The anomaly handling module records the anomaly information and starts the link reconstruction mechanism.

[0104] 2-2: Link reconstruction: The reconstruction module of the link management layer attempts to reestablish the link.

[0105] The reconstruction process includes a first device such as a server sending a reconnection request to a second device such as a client device, and the second device such as the client device re-initiating a link establishment process after receiving the reconnection request.

[0106] Optionally, the first device such as the server may also detect the reconstruction status of the long link reconstruction, and in response to detecting that the long link reconstruction fails and the number of reconstruction failures reaches a set number, send notification information for characterizing the link abnormality to the target object. For example, when multiple reconstruction failures are detected and the number of failures reaches a set number, the exception handling module notifies the user or administrator of the abnormal information so that the user or administrator can troubleshoot in time.

[0107] 3. Link Maintenance Layer

[0108] Mainly used for link maintenance, specifically, the link maintenance layer ensures the continuity of the link through an automatic reconnection mechanism. At the same time, the link maintenance layer is also responsible for regular inspection and optimization of the link status to ensure that the link runs in an efficient state.

[0109] Step 105: Based on the long link between the second device, use a preset security encryption strategy to perform data transmission processing between the second device; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0110] The preset security encryption strategy adopts a multi-layer encryption algorithm to implement data encryption. Optionally, the multi-layer encryption algorithm includes AES (symmetric encryption) and RSA (asymmetric encryption) algorithms.

[0111] The target key is generated by the first device based on a preset generation method.

[0112] Optionally, a first device such as a server may generate a random AES key based on a random symmetric key generation method, and use the AES key as a target key for encrypting data, so as to perform symmetric encryption on the data.

[0113] After generating the target key, a first device such as a server can use a preset public key to encrypt the target key, and send the encrypted target encryption key to a second device such as a client device through a secure channel. After receiving the target encryption key, the second device uses a preset private key to decrypt it to obtain the target key, which is used for encrypting and transmitting data based on symmetric encryption between the first device and the second device based on the target key, that is, the AES key.

[0114] The data encrypted with the target key can be transmitted between the first device and the second device through a long link. The embodiment of the present application ensures the security of the data during transmission by encrypting the data, and at the same time ensures the security of the target key by encrypting the target key used for data encryption using the RSA public key, so as to further improve the security of data transmission in long link communication.

[0115] The preset public key and the preset private key are respectively an RSA public key and an RSA private key of a second device such as a client device.

[0116] In summary, in the data transmission method based on long link management provided by the embodiment of the present application, after the first device establishes a long link with the second device based on the link request initiated by the second device, it monitors the status of the long link through a dynamic link management mechanism, and automatically reconnects when the long link is abnormal (such as disconnected), which solves the problem of inconvenient and imperfect link status management in the known technology, ensures the continuity and stability of the link, and significantly improves the stability of the long link communication system. In addition, the present application further ensures the high security of data transmission by using multiple encryption methods based on a secure encryption strategy to encrypt and transmit data based on a long link, solves the problem of low data transmission security in long link communication of the known technology, and meets the high requirements of long link communication.

[0117] In an optional embodiment, the present application is applied to a data transmission method based on long link management of a first device, and step 105 may be implemented to include at least one of the following:

[0118] 11) Using the target key to encrypt the first data to be sent to obtain first encrypted data, and sending the first encrypted data to the second device through the long link, so that the second device obtains the first data by decrypting the first encrypted data using the target key.

[0119] When the first device needs to send data to the second device, for example, when the server needs to send data to the client device, the first device such as the server can specifically use the target key to encrypt the first data to be sent, and send the encrypted first encrypted data to the second device through the long link.

[0120] After a second device such as a client device receives the first encrypted data transmitted by a first device such as a server through a long link, it uses the target key it holds to decrypt the received first encrypted data, thereby restoring the original data transmitted by the first device, that is, restoring the first data.

[0121] 12) Receive second encrypted data sent by the second device, use the target key to decrypt the second encrypted data, and obtain second data corresponding to the second encrypted data.

[0122] Similarly, when the second device needs to send data to the first device, for example, when the client device needs to send data to the server, the second device such as the client device can specifically use the target key to encrypt the second data to be sent, and send the encrypted second encrypted data to the first device through a long link.

[0123] After a first device such as a server receives the second encrypted data transmitted by a second device such as a client device through a long link, the server uses the target key it holds to decrypt the received second encrypted data to obtain the second data.

[0124] Optionally, in order to prevent security risks caused by long-term use of the same encryption key (ie, the target key), the first device may also update the target key based on an update policy.

[0125] Specifically, a first device such as a server can detect whether the target key meets the update conditions. If the update conditions are met, the target key for data encryption is regenerated based on the preset generation method to update the target key held by the first device and the second device.

[0126] The update condition may be, but is not limited to, set to any one of the following conditions:

[0127] Condition 1: The time interval from the last update of the target key reaches the set time length.

[0128] Based on the first condition, it is possible to periodically replace the target key, such as the AES key used for data encryption.

[0129] Condition 2: A new round of data transmission is detected.

[0130] Based on the second condition, a dynamic encryption key such as a dynamic AES key may be used to encrypt data for each round of data transmission.

[0131] After the first device such as the server updates the target key such as the AES key, the encryption of the AES key (the first device uses the RSA public key to encrypt the target key such as the AES key), secure transmission (transmitting the encrypted target key to the second device such as the client device based on a secure channel) and decryption process (the second device uses the RSA private key to decrypt the encrypted target key) described above are repeated to achieve synchronous update of the target key on the second device.

[0132] In long-link communication, this embodiment uses a multi-level encryption mechanism (such as a combination of AES and RSA) to encrypt and transmit data, ensuring the security of key exchange and data transmission. And by updating the key used for data encryption based on the key update mechanism, it can effectively prevent the key from being cracked, further improving the security of long-term data transmission, and avoiding the risk of data being intercepted and tampered to a higher degree.

[0133] In an optional embodiment, the present application is applied to a data transmission method based on long link management of a first device, and step 105 can be implemented to include at least one of the following data sending processing and data receiving processing.

[0134] 1. Data transmission and processing

[0135] See also Figure 2 As shown in the data transmission processing flow chart, the first device can specifically implement the data transmission processing to the second device through the following processing process:

[0136] Step 201: Use the target key to encrypt first data to be sent to obtain first encrypted data.

[0137] As described above, the target key is generated by the first device based on a preset generation method, and specifically may be a random AES key generated by the first device such as a server.

[0138] When a first device such as a server needs to send data to a second device such as a client device, the first device may first use a target key such as an AES key to encrypt the first data to be sent to obtain first encrypted data.

[0139] Step 202: In response to the first encrypted data satisfying a compression condition, compress the first encrypted data to obtain first compressed data.

[0140] Optionally, the compression condition may be set as: the data volume of the first encrypted data reaches a set first data volume threshold.

[0141] After obtaining the first encrypted data by encrypting the first data, the first device may further determine whether the data volume of the first encrypted data reaches a first data volume threshold. If the first data volume threshold is reached, the compression condition is met, and the first encrypted data is compressed to obtain first compressed data.

[0142] When compressing the first encrypted data, the type of the first encrypted data may be determined, and the first encrypted data may be compressed in a matching processing manner according to the type of the first encrypted data.

[0143] The type of the first encrypted data and the compression processing of the first encrypted data may include but are not limited to:

[0144] 21) Text Data

[0145] Segment type: plain text, JSON, XML, HTML, etc.

[0146] Compression processing method: You can use gzip or other compression algorithms to compress text data to reduce the amount of data transmitted.

[0147] 22) Image data

[0148] Segment types: JPEG, PNG, GIF, BMP, etc.

[0149] Compression processing: Image data can be further compressed using compression algorithms such as JPEG compression. In addition, the image resolution or quality can be adjusted according to transmission requirements.

[0150] 23) Audio data

[0151] Subdivision types: MP3, AAC, WAV, OGG, etc.

[0152] Compression processing method: Audio data can be compressed using an audio compression algorithm (such as MP3 compression), and the sampling rate and bit rate can be adjusted as needed.

[0153] 24) Video data

[0154] Segment types: MP4, AVI, MKV, MOV, etc.

[0155] Compression processing method: Video data can be compressed using video compression algorithms (such as H.264, H.265), and the resolution and frame rate can be adjusted as needed.

[0156] 25) Binary Data

[0157] Segment type: file data, binary stream, etc.

[0158] Compression processing method: Binary data can be compressed using common compression algorithms (such as gzip, bzip2).

[0159] 26) Structured Data

[0160] Segment types: database records, tabular data (CSV, Excel), serialized objects (such as Protobuf, Thrift).

[0161] Compression processing method: Structured data can be compressed using a dedicated compression algorithm and may require serialization and deserialization.

[0162] 27) Log data

[0163] Segment types: system logs, application logs, etc.

[0164] Compression processing method: Log data can be compressed using compression algorithms and may require preprocessing such as log aggregation and filtering.

[0165] On the contrary, if the set first data volume threshold is not reached, the compression condition is not met. In this case, there is no need to compress the first encrypted data and perform subsequent slicing and other processing. The first encrypted data can be sent directly to the second device through the long link between the second device.

[0166] For example, in the case where the first encrypted data is metadata, since metadata usually has a small amount of data, it can usually be transmitted directly without performing encryption, slicing, etc. However, the integrity and accuracy of the metadata need to be guaranteed during the transmission process.

[0167] Metadata refers to information used to describe files or data, such as file name, size, type, timestamp, etc.

[0168] In this implementation, the first data is first encrypted and then compressed. In practical applications, the first data may also be first compressed and then encrypted. For example, first determine whether the data volume of the first data reaches a first data volume threshold. If the first data volume threshold is reached, compress the first data according to the data type of the first data, and encrypt the obtained compression result on this basis.

[0169] Step 203: In response to the first compressed data satisfying a slicing condition, slicing the first compressed data is performed to obtain a plurality of first slicing data.

[0170] The slicing condition may be set as the amount of the first compressed data reaching a set second data amount threshold.

[0171] In this step, it can be first determined whether the data volume of the first compressed data reaches the second data volume threshold. If the second data volume threshold is reached, it indicates that the data packet of the first compressed data is large. In this case, the first compressed data is divided into a plurality of fragmented data by slicing, that is, the larger data packet is divided into a plurality of small data packets to avoid excessive data volume in a single transmission. In this embodiment, the fragmented data here is referred to as the first fragmented data.

[0172] On the contrary, if the data volume of the first compressed data does not reach the second data volume threshold, the data packet representing the first compressed data is small. In this case, there is no need to slice the first compressed data, and the first compressed data can be directly sent to the second device through the long link between the first device and the second device.

[0173] Step 204: Send the multiple first shard data in batches to the second device through the long link, so that the second device obtains a first integration result by integrating the multiple first shard data, decompresses the first integration result and uses the target key to decrypt the first decompression result obtained by decompression to obtain the first data.

[0174] After slicing the first compressed data to obtain a plurality of first sliced ​​data, the first device sends the plurality of first sliced ​​data to the second device in batches to avoid excessive amount of data transmitted in a single time.

[0175] Optionally, a sequence number may be added to each first fragment data to ensure sequential transmission of the first fragment data and sequential reassembly of each first fragment data by the second device.

[0176] After the second device receives each first fragment data, it can specifically reorganize and integrate each first fragment data according to the serial numbers corresponding to each first fragment data to obtain the first compressed data, and decompress the integrated first compressed data to obtain the first encrypted data, and then use the target key to decrypt the first encrypted data to obtain the first data.

[0177] 2. Data Reception and Processing

[0178] See also Figure 3 As shown in the data receiving process flow chart, the first device can specifically implement data receiving process of the data sent by the second device through the following process:

[0179] Step 301: Receive multiple second fragmented data sent by the second device in batches through the long link; each second fragmented data is the data obtained by encrypting the second data to be sent by the second device using the target key, and compressing and slicing the encrypted second encrypted data.

[0180] When a second device such as a client device needs to send data to a first device such as a server, the second device may first use a target key such as an AES key to encrypt the second data to be sent to obtain second encrypted data. The second encrypted data is compressed, sliced, and processed to obtain a plurality of second shard data. On this basis, the plurality of second shard data are sent to the first device based on the long link with the first device. The compression, slicing, and other processing processes performed by the second device on the second encrypted data are similar to the compression, slicing, and other processing processes performed by the first device on the first encrypted data. For details, please refer to the description of the compression and slicing process performed by the first device above, which will not be repeated here.

[0181] Among them, as described above, the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

[0182] The preset public key and the preset private key are respectively the RSA public key and the RSA private key of the second device, such as the client device.

[0183] It is easy to understand that if the data volume of the second encrypted data is small and does not reach the first data volume threshold, the second device does not need to compress the second encrypted data and can directly send the second encrypted data to the first device. Alternatively, if the data volume of the second compressed data obtained after compressing the second encrypted data is small and does not reach the second data volume threshold, the second device does not need to slice the second compressed data and can directly send the second compressed data to the first device.

[0184] In this implementation manner, the second device first encrypts and then compresses the second data to be sent to the first device. In actual applications, the second device may also first compress and then encrypt the second data.

[0185] The first device, such as a server, can correspondingly receive multiple second fragment data sent by the second device, such as a client device, in batches through the long link.

[0186] Step 302: Integrate the plurality of second fragmented data to obtain the second compressed data.

[0187] After receiving the plurality of second fragment data sent in batches by the second device, the first device may reorganize and integrate the second fragment data according to the sequence number corresponding to each second fragment data to obtain the second compressed data.

[0188] Step 303: decompress the second compressed data to obtain the second encrypted data.

[0189] Step 304: Use the target key to decrypt the second encrypted data to obtain the second data.

[0190] The implementation method provided in this embodiment is to first encrypt the data to be sent (such as the first data and the second data mentioned above), and then split the encrypted data. In actual applications, the data to be sent can also be split first, and then each fragmented data obtained by the split can be encrypted separately. This embodiment does not limit the encryption and splitting order of the data to be sent, which can be determined according to the actual application situation.

[0191] In long link communication, this embodiment uses a multi-level encryption mechanism (such as a combination of AES and RSA) to encrypt and transmit data, ensuring the security of key exchange and data transmission. By compressing the data to be transmitted, the amount of data in long link communication is reduced, and by dividing the large data packet obtained after compression into several small data packets, the amount of data transmitted in a single time is effectively avoided, and accordingly the problem of communication abnormality caused by the large amount of data transmitted in a single time is avoided.

[0192] In an optional embodiment, the present application is applied to a data transmission method based on long link management of a first device. Before the first device performs data transmission processing with the second device through the long link between the first device and the second device, the first device may first set different transmission priorities for each data to be sent according to the importance and / or urgency of each data to be sent.

[0193] On this basis, the first device can send each data to be sent to the second device in sequence according to the transmission priority corresponding to each data to be sent through the long link. For example, the server sends each data packet to the client device in sequence according to the transmission priority of each data packet.

[0194] Similarly, the first device can also receive, through the long link, each piece of data to be sent, which is sent by the second device in sequence according to the transmission priority corresponding to each piece of data to be sent.

[0195] Among them, the scheduling module in the transmission protocol can schedule and transmit data packets according to the transmission priority of the data packets to be sent, so as to ensure that high-priority data packets are transmitted first when the network is congested, thereby reducing delays.

[0196] This embodiment sets different transmission priorities for different data according to the importance and / or urgency of the data, and schedules and transmits the data based on the transmission priority of the data, thereby effectively ensuring that high-priority data is transmitted first, thereby ensuring the transmission efficiency and real-time performance of critical data.

[0197] In an optional embodiment, the data transmission method based on long link management applied to the first device of the present application may further include the following processing after receiving in batches the plurality of second fragment data sent by the second device through the long link:

[0198] Based on the check code corresponding to each second fragment data, perform integrity or correctness check on each second fragment data; if there is target second fragment data that fails the check, send a retransmission request to the second device for requesting retransmission of the target second fragment data; receive the target second fragment data retransmitted by the second device through the long link.

[0199] In this embodiment, a check code is added to each data packet, such as each second fragment data, for data integrity verification. After the receiver (such as the first device or the second device) receives the data packet, it can verify the received data packet based on the check code corresponding to the data packet to detect whether the data packet is complete / correct. If the verification fails, the receiver requests the sender to retransmit the erroneous data packet. The sender responds to the receiver's retransmission request and resends the erroneous data packet to ensure the integrity / correctness of the data received by the receiver.

[0200] For each second fragment data received by the first device, the first device can specifically perform integrity or correctness verification on each second fragment data based on the verification code corresponding to each second fragment data. If the verification fails, a retransmission request for requesting retransmission of the target second fragment data that fails the verification is sent to the second device, so as to request the second device to retransmit the target second fragment data, thereby ensuring the integrity / correctness of each second fragment data received by the first device.

[0201] For the data packet received by the first device which is a whole data packet that does not participate in slicing processing (rather than a data packet of sliced ​​data), the integrity / correctness of the whole data packet is specifically checked based on the check code of the whole data packet.

[0202] In this embodiment, a check code is added to each data packet so that the receiver can perform integrity check on the received data packet and retransmit the erroneous data packet if the check fails. This effectively ensures the integrity / correctness of the data packet received by the receiver in the long link communication and ensures the quality of data transmission.

[0203] See also Figure 4 As shown in the method flow chart, the data transmission method based on long link management for application to the second device provided in the embodiment of the present application may at least include the following processing steps:

[0204] Step 401: Initiate a link request for requesting to establish a long link to a first device, so that the first device establishes a long link with the second device.

[0205] When a second device such as a client device has a need to transmit data with a first device, it can optionally initiate a link request to the first device such as a server via the WebSocket or HTTP / 2 protocol. The first device can correspondingly obtain the link request initiated by the second device via the WebSocket or HTTP / 2 protocol, and establish a long link with the second device based on the link request.

[0206] After the first device establishes a long link with the second device, the second device may periodically send heartbeat packets to the first device so that the first device can detect the status of the long link and send a reconnection request to the second device when a link abnormality is detected.

[0207] Step 402: In response to receiving the reconnection request sent by the first device, re-initiate a link request for requesting to establish a long link to the first device, so that the first device can rebuild the long link between the first device and the second device based on the link request.

[0208] After receiving the reconnection request from the first device, the second device, such as a client device, re-initiates the link establishment process, and based on the re-initiated link establishment process, re-initiates a link request to the first device for requesting to establish a long link, so that the first device can rebuild the long link with the second device.

[0209] Step 403: Based on the long link between the first device, use a preset security encryption strategy to perform data transmission processing between the second device; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the security key negotiated between the first device and the second device, and the security key includes an encrypted target key.

[0210] Based on the established long link, the second device can use a preset security encryption strategy to perform data transmission processing between the second device according to its actual needs, including sending data to the first device and / or receiving data transmitted by the second device.

[0211] It should be noted that the data transmission method based on long link management applied to the second device provided in the embodiment of the present application corresponds to the data transmission method based on long link management applied to the first device provided in the above embodiments. The second device and the first device perform communication cooperation in the long link communication through methods based on their respective applications, realize the communication between the two-end devices based on the long link, and achieve the stability, security and transmission efficiency of the long link communication system effectively improved through the dynamic link management mechanism, enhanced security encryption measures and optimized data transmission protocols (such as compression, slicing, data transmission based on transmission priority, integrity verification, etc.) in this application, thereby improving the overall user experience and system performance. Based on this, for the data transmission method based on long link management applied to the second device provided in the present application, please refer to the relevant description of the data transmission method based on long link management applied to the first device in the above embodiments, which will not be repeated here.

[0212] Corresponding to the above-mentioned data transmission method based on long link management applied to the first device, the embodiment of the present application also provides a data transmission device based on long link management applied to the first device, and its composition structure is as follows: Figure 5 As shown, including:

[0213] The request acquisition module 501 is used to acquire a link request initiated by the second device for requesting to establish a long link;

[0214] A link establishing module 502, configured to establish a long link with the second device based on the link request;

[0215] A status detection module 503 is used to perform status detection on the long link to obtain a status detection result;

[0216] The exception handling module 504 is used to send a reconnection request to the second device if the status detection result indicates that the long link has a link exception; the reconnection request is used to trigger the second device to re-initiate a link request for requesting to establish a long link to the first device, so that the first device can rebuild the long link with the second device;

[0217] The first transmission processing module 505 is used to perform data transmission processing between the second device and the second device based on the long link between the second device and the preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0218] In an optional implementation manner, the state detection module 503 is specifically configured to:

[0219] Receiving a heartbeat packet periodically sent by the second device based on the heartbeat mechanism;

[0220] Based on the reception of the heartbeat packet, the state of the long link is detected to obtain the state detection result.

[0221] In an optional embodiment, the above-mentioned device also includes an exception notification module, which is used to: after sending a reconnection request to the second device, in response to detecting that the long link reconstruction fails and the number of reconstruction failures reaches a set number, send notification information used to characterize the link abnormality to the target object.

[0222] In an optional implementation manner, the first transmission processing module 505 is specifically configured to perform at least one of the following:

[0223] Encrypt the first data to be sent by using the target key to obtain first encrypted data, and send the first encrypted data to the second device through the long link, so that the second device decrypts the first encrypted data by using the target key to obtain the first data;

[0224] receiving second encrypted data sent by the second device, and decrypting the second encrypted data using the target key to obtain second data corresponding to the second encrypted data;

[0225] Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

[0226] In an optional embodiment, the above-mentioned device also includes a key update module, which is used to: if the target key meets the update condition, regenerate the target key for data encryption based on the preset generation method to update the target key held by the first device and the second device.

[0227] In an optional implementation manner, the first transmission processing module 505 is specifically configured to perform at least one of the following data sending processing and data receiving processing:

[0228] Data sending and processing:

[0229] Encrypt the first data to be sent using the target key to obtain first encrypted data;

[0230] In response to the first encrypted data satisfying a compression condition, compressing the first encrypted data to obtain first compressed data;

[0231] In response to the first compressed data satisfying a slicing condition, slicing the first compressed data to obtain a plurality of first slicing data;

[0232] Sending the plurality of first fragmented data in batches to the second device through the long link, so that the second device obtains the first compressed data by integrating the plurality of first fragmented data, decompresses the first compressed data, and uses the target key to decrypt the first encrypted data obtained by decompression to obtain the first data;

[0233] Data reception and processing:

[0234] receiving in batches a plurality of second fragmented data sent by the second device through the long link; each second fragmented data is data obtained by the second device encrypting the second data to be sent using the target key, and compressing and slicing the encrypted second encrypted data;

[0235] Integrate the plurality of second fragmented data to obtain second compressed data;

[0236] decompressing the second compressed data to obtain the second encrypted data;

[0237] Decrypting the second encrypted data using the target key to obtain the second data;

[0238] Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

[0239] In an optional implementation, the above device further includes a verification module, which is used to:

[0240] After receiving multiple second fragment data sent by the second device in batches through the long link, perform integrity or correctness verification on each second fragment data based on the verification code corresponding to each second fragment data; if there is target second fragment data that fails the verification, send a retransmission request for requesting retransmission of the target second fragment data to the second device; and receive the target second fragment data retransmitted by the second device through the long link.

[0241] In an optional implementation manner, the first transmission processing module 505, when performing data transmission processing with the second device, is specifically configured to perform at least one of the following:

[0242] Through the long link, each data to be sent is sent to the second device in sequence according to the order matching the corresponding transmission priority;

[0243] Through the long link, each data to be sent is received by the second device in sequence according to the transmission priority corresponding to each data to be sent.

[0244] For the data transmission device based on long link management applied to the first device provided in the embodiment of the present application, since it corresponds to the data transmission method based on long link management applied to the first device provided in the above method embodiment, the description is relatively simple. For relevant similarities, please refer to the description of the corresponding method embodiment above, and it will not be described in detail here.

[0245] Corresponding to the above-mentioned data transmission method based on long link management applied to the second device, the embodiment of the present application also provides a data transmission device based on long link management applied to the second device, and its composition structure includes:

[0246] a request initiating module, configured to initiate a link request for requesting to establish a long link to the first device, so that the first device establishes a long link with the second device based on the link request; and in response to receiving a reconnection request sent by the first device, re-initiate a link request for requesting to establish a long link to the first device, so that the first device re-establishes the long link with the second device;

[0247] A second transmission processing module is used to perform data transmission processing between the second device and the first device based on the long link between the first device and the second device using a preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

[0248] For the data transmission device based on long link management applied to the second device provided in the embodiment of the present application, since it corresponds to the data transmission method based on long link management applied to the second device provided in the above method embodiment, the description is relatively simple. For relevant similarities, please refer to the description of the corresponding method embodiment above, and it will not be described in detail here.

[0249] The present application also discloses an electronic device, the composition structure of the electronic device, such as Figure 6 As shown, including at least:

[0250] A memory 10, for storing a computer instruction set;

[0251] A set of computer instructions can be implemented in the form of a computer program.

[0252] The processor 20 is used to implement the data transmission method based on long link management applied to the first device or the data transmission method based on long link management applied to the second device as disclosed in any of the above method embodiments by executing a computer instruction set.

[0253] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices.

[0254] Optionally, the electronic device may also include a display device and / or a display interface and may be connected to an external display device.

[0255] Optionally, the electronic device may further include a camera assembly, and / or be connected to an external camera assembly.

[0256] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, the processor and the communication interface communicate with each other through the communication bus.

[0257] The communication interface is used for communication between electronic devices and other devices. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0258] An embodiment of the present application also provides a computer-readable medium having a computer instruction set stored thereon. When the computer instruction set is executed by a processor, it is used to implement a data transmission method based on long link management applied to a first device as provided in any of the method embodiments above, or a data transmission method based on long link management applied to a second device.

[0259] In summary, the data transmission method and related device based on long link management provided in the embodiments of the present application have at least the following technical advantages compared with the known technologies:

[0260] Through the dynamic link management mechanism, the status of the long link is monitored in real time, and the link is automatically reconnected when the link is abnormal, such as when the link is disconnected, which solves the problem of imperfect link status management in the known technology and significantly improves the stability of the system. By using a multi-layer encryption algorithm based on enhanced security encryption measures to encrypt and transmit data and update the key based on the key update strategy, the high security of data transmission is ensured, solving the problem of low data transmission security in the known technology. By compressing data, sharding transmission and priority scheduling based on the optimized data transmission protocol, data redundancy and transmission delay are effectively reduced, and transmission efficiency is improved. These improvements have enabled the long link communication system to reach a higher level in terms of stability, security and efficiency, meeting the high requirements of long link communication.

[0261] It should be noted that 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.

[0262] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0263] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or the part that makes a creative contribution can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0264] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are 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 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 device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0265] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data transmission method based on long link management, characterized in that: Applied to a first device, the method includes: Obtaining a link request initiated by the second device for requesting to establish a long link; Based on the link request, establish a long link with the second device; Performing a status detection on the long link to obtain a status detection result; If the status detection result indicates that the long link has a link abnormality, sending a reconnection request to the second device; the reconnection request is used to trigger the second device to re-initiate a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device; Based on the long link between the second device, a preset security encryption strategy is used to perform data transmission processing between the second device; wherein, the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

2. The data transmission method based on long link management according to claim 1 is characterized in that: After sending the reconnection request to the second device, the method further includes: In response to detecting that the long link reconstruction fails and the number of reconstruction failures reaches a set number, notification information for indicating link abnormality is sent to the target object.

3. The data transmission method based on long link management according to claim 1 is characterized in that: The performing data transmission processing between the second device and the second device based on the long link between the second device and the second device using a preset security encryption strategy includes at least one of the following: Encrypt the first data to be sent by using the target key to obtain first encrypted data, and send the first encrypted data to the second device through the long link, so that the second device decrypts the first encrypted data by using the target key to obtain the first data; receiving second encrypted data sent by the second device, and decrypting the second encrypted data using the target key to obtain second data corresponding to the second encrypted data; Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

4. The data transmission method based on long link management according to claim 3 is characterized in that: Also includes: If the target key meets the update condition, the target key for data encryption is regenerated based on the preset generation method to update the target key held by the first device and the second device.

5. The data transmission method based on long link management according to claim 1, characterized in that: The performing of data transmission processing between the second device and the second device based on the long link between the second device and the second device using a preset security encryption strategy includes at least one of the following data sending processing and data receiving processing: Data sending and processing: Encrypt the first data to be sent using the target key to obtain first encrypted data; In response to the first encrypted data satisfying a compression condition, compressing the first encrypted data to obtain first compressed data; In response to the first compressed data satisfying a slicing condition, slicing the first compressed data to obtain a plurality of first slicing data; Sending the plurality of first fragmented data in batches to the second device through the long link, so that the second device obtains the first compressed data by integrating the plurality of first fragmented data, decompresses the first compressed data, and uses the target key to decrypt the first encrypted data obtained by decompression to obtain the first data; Data reception and processing: receiving in batches a plurality of second fragmented data sent by the second device through the long link; each second fragmented data is data obtained by the second device encrypting the second data to be sent using the target key, and compressing and slicing the encrypted second encrypted data; Integrate the plurality of second fragmented data to obtain second compressed data; decompressing the second compressed data to obtain the second encrypted data; Decrypting the second encrypted data using the target key to obtain the second data; Among them, the target key is generated by the first device based on a preset generation method, and the target key held by the second device is obtained by the first device encrypting the target key by using a preset public key, sending the encrypted target encryption key to the second device, and the second device decrypting the target encryption key by using a preset private key.

6. The data transmission method based on long link management according to claim 5 is characterized in that: After receiving the plurality of second fragment data sent by the second device in batches through the long link, the method further includes: Based on the check code corresponding to each second shard data, perform integrity or correctness check on each second shard data; If there is target second fragment data that fails the verification, sending a retransmission request for requesting retransmission of the target second fragment data to the second device; The target second fragment data retransmitted by the second device is received through the long link.

7. The data transmission method based on long link management according to claim 1 is characterized in that: The performing of data transmission processing between the second device and the second device includes at least one of the following: Through the long link, each data to be sent is sent to the second device in sequence according to the order matching the corresponding transmission priority; Through the long link, each data to be sent is received by the second device in sequence according to the transmission priority corresponding to each data to be sent.

8. A data transmission method based on long link management, characterized in that: Applied to the second device, the method includes: Initiating a link request for requesting to establish a long link to the first device, so that the first device establishes a long link with the second device based on the link request; In response to receiving the reconnection request sent by the first device, re-initiating a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device; Based on the long link between the first device, a preset security encryption strategy is used to perform data transmission processing between the second device; wherein, the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

9. A data transmission device based on long link management, characterized in that: Applied to a first device, the apparatus comprises: A request acquisition module, used to acquire a link request initiated by the second device for requesting to establish a long link; A link establishing module, configured to establish a long link with the second device based on the link request; A status detection module, used to perform status detection on the long link to obtain a status detection result; an exception handling module, configured to send a reconnection request to the second device if the status detection result indicates that the long link generates a link exception; the reconnection request is used to trigger the second device to re-initiate a link request for requesting to establish a long link to the first device, so that the first device can re-establish the long link with the second device; The first transmission processing module is used to perform data transmission processing between the second device and the second device based on the long link between the second device and the preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.

10. A data transmission device based on long link management, characterized in that: Applied to the second device, the method includes: a request initiating module, configured to initiate a link request for requesting to establish a long link to the first device, so that the first device establishes a long link with the second device based on the link request; and in response to receiving a reconnection request sent by the first device, re-initiate a link request for requesting to establish a long link to the first device, so that the first device re-establishes the long link with the second device; A second transmission processing module is used to perform data transmission processing between the second device and the first device based on the long link between the first device and the second device using a preset security encryption strategy; wherein the preset security encryption strategy is used to encrypt the data to be transmitted based on the target key agreed upon by the first device, and the target key is encrypted by the first device into a security key before being synchronized from the first device to the second device.