Heartbeat packet transmission method, communication equipment and storage medium

By employing a strategy of aggregation window and cached sequence number in heartbeat packet transmission, the problem of multiple heartbeat packets not being sent in order was solved, achieving in-order transmission of heartbeat packets and improving the stability and reliability of the system.

CN122137876APending Publication Date: 2026-06-02SHENZHEN AI LINK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN AI LINK CO LTD
Filing Date
2026-04-15
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, multiple heartbeat data packets cannot be sent in sequence, which affects system stability and reliability.

Method used

The strategy of using aggregated windows and caching heartbeat packet sequence numbers is adopted. By obtaining the heartbeat packet sending strategy of the target device, it is determined whether the caching conditions are met. If they are met, the current heartbeat packet is cached and encapsulated, and then sent to the receiving device to ensure that the heartbeat packet is transmitted in order.

Benefits of technology

Even if the heartbeat packets are delayed due to the industrial private network scheduling strategy, the receiving devices can still receive the heartbeat packets in order, which improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137876A_ABST
    Figure CN122137876A_ABST
Patent Text Reader

Abstract

This application provides a heartbeat packet transmission method, communication device, and storage medium, relating to the field of communication technology. The method includes: obtaining a heartbeat packet transmission strategy for a target industrial device; obtaining the current heartbeat packet generated by the sending device; determining whether a heartbeat packet caching condition is met based on the sequence number of the current heartbeat packet and the sequence number of the cached heartbeat packet; if the heartbeat packet caching condition is met, caching the current heartbeat packet and encapsulating the cached heartbeat packet of the target industrial device according to an aggregation window to obtain a heartbeat packet to be transmitted; and sending the heartbeat packet to be transmitted to a second device in an industrial private network, so that the second device sends the heartbeat packet to be transmitted to a receiving device. The sending device is the target industrial device, and the receiving device is a service server; or the sending device is a service server, and the receiving device is the target industrial device. Even if a heartbeat packet is delayed in transmission, the encapsulated heartbeat packet can still be transmitted to ensure that the receiving device receives the heartbeat packets in order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to a heartbeat packet transmission method, communication device, and storage medium. Background Technology

[0002] Heartbeat data has a wide range of applications, including sequential transmission of process data, real-time status monitoring and fault detection, synchronous control and coordinated motion, safety interlocking and emergency response, and prevention of state machine chaos. Reliable transmission of heartbeat data is crucial for the stable operation of the system.

[0003] In related technologies, the guarantee mechanisms provided by the RLC (Radio Link Control) layer and the PDCP (Packet Data Convergence Protocol) layer ensure that the data within a single IP (Internet Protocol) packet or Ethernet frame is delivered in order. Typically, each heartbeat packet corresponds to one IP packet or Ethernet frame.

[0004] In related technologies, only the delivery of data within a single heartbeat packet can be guaranteed in order. However, multiple heartbeat packets cannot be sent in order. Summary of the Invention

[0005] The purpose of this application is to provide a heartbeat packet transmission method, communication device, and storage medium to address the shortcomings of the prior art and solve the aforementioned technical problems.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a heartbeat packet transmission method, applied to a first device in an industrial private network, comprising: The heartbeat packet sending strategy of the target industrial equipment is obtained. The heartbeat packet sending strategy includes: an aggregation window and a cached heartbeat packet sequence number; wherein, the aggregation window is used to represent the maximum number of encapsulated heartbeat packets. Get the current heartbeat packet generated by the sending device; Based on the sequence number of the current heartbeat packet and the sequence number of the cached heartbeat packet, determine whether the heartbeat packet caching condition is met; If the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the cached heartbeat packet of the target industrial device is encapsulated according to the aggregation window to obtain the heartbeat packet to be transmitted. The heartbeat packet to be transmitted is sent to a second device in the industrial private network, so that the second device sends the heartbeat packet to the receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device.

[0007] Optionally, the cached heartbeat sequence number includes: a header sequence number; determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number includes: If the sequence number of the current heartbeat packet is less than the sequence number of the header packet, then it is determined that the heartbeat packet caching condition is not met. The method further includes: The current heartbeat packet is sent to the second device, so that the second device sends the current heartbeat packet to the receiving device.

[0008] Optionally, the cached heartbeat sequence number includes: a header sequence number; the step of determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number further includes: If the sequence number of the current heartbeat packet is equal to the sequence number of the header packet, then it is determined that the heartbeat packet caching condition is not met. The method further includes: Discard the current heartbeat packet.

[0009] Optionally, the cached heartbeat sequence number includes: a header sequence number; determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number includes: If the sequence number of the current heartbeat packet is greater than the sequence number of the header packet, then the heartbeat packet caching condition is satisfied.

[0010] Optionally, the cached heartbeat sequence number further includes: a tail sequence number; if the heartbeat caching condition is met, the current heartbeat packet is cached, and the cached heartbeat packet of the target industrial equipment is encapsulated according to the aggregation window to obtain the heartbeat packet to be transmitted, including: Determine whether the aggregation window is greater than the difference between the tail number and the head number to obtain the determination result; Based on the judgment result, the current heartbeat packet is cached; Based on the aggregation window, all heartbeat packets in the cached heartbeat packets are encapsulated to obtain the heartbeat packet to be transmitted.

[0011] Optionally, caching the current heartbeat packet based on the judgment result includes: If the judgment result indicates that the aggregation window is greater than the difference, then the current heartbeat packet is cached, and the header sequence number and the tail sequence number are updated according to the cached heartbeat packet; If the judgment result indicates that the aggregation window is not greater than the difference, the heartbeat packet with the smallest sequence number among the cached heartbeat packets is removed from the cache; The current heartbeat packet is cached, and the header sequence number and the tail sequence number are updated based on the cached heartbeat packet.

[0012] Secondly, embodiments of this application also provide a heartbeat packet transmission method, applied to a second device in an industrial private network, comprising: The system receives a heartbeat packet to be transmitted from a first device in the industrial private network. The heartbeat packet to be transmitted is a heartbeat packet obtained by encapsulating the cached heartbeat packet of the target industrial device according to an aggregation window when the current heartbeat packet generated by the sending device meets the heartbeat packet caching condition. The aggregation window is used to represent the number of heartbeat packets required to encapsulate the data packet to be transmitted. The data packet to be transmitted is sent to the receiving device, wherein the sending device is the target industrial equipment and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial equipment.

[0013] Optionally, sending the data packet to be transmitted to the receiving device includes: Determine whether the data packet to be transmitted is a composite heartbeat packet; If the data packet to be transmitted is not a composite heartbeat packet, then the data packet to be transmitted is sent to the receiving device; If the data packet to be transmitted is a composite heartbeat packet, the composite heartbeat packet is split into multiple heartbeat packets, and the heartbeat packets with a sequence number greater than the currently sent sequence number are sent to the receiving device. Heartbeat packets with sequence numbers less than the currently sent sequence number are discarded.

[0014] Thirdly, embodiments of this application also provide a communication device, including: a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement the heartbeat packet transmission method described in any of the first aspects above, or the heartbeat packet transmission method described in any of the second aspects above.

[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when read and executed, implements the heartbeat packet transmission method described in any one of the first and second aspects.

[0016] The beneficial effects of this application are: In summary, this application provides a heartbeat packet transmission method, comprising: obtaining a heartbeat packet transmission strategy for a target industrial device, the heartbeat packet transmission strategy including: an aggregation window and a cached heartbeat packet sequence number; wherein, the aggregation window is used to represent the maximum number of encapsulated heartbeat packets; obtaining the current heartbeat packet generated by the sending device; determining whether the heartbeat packet caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat packet sequence number; if the heartbeat packet caching condition is met, caching the current heartbeat packet, and encapsulating the cached heartbeat packet of the target industrial device according to the aggregation window to obtain a heartbeat packet to be transmitted; sending the heartbeat packet to be transmitted to a second device in an industrial private network, so that the second device sends the heartbeat packet to be transmitted to a receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device. When the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the object encapsulated and transmitted is all the cached heartbeat packets. In this way, even if a heartbeat packet is delayed due to the scheduling strategy of the industrial private network, the encapsulated heartbeat packet can still be transmitted to ensure that the receiving device can receive the heartbeat packets in order. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the system architecture on which a heartbeat packet transmission method provided in an embodiment of this application is based; Figure 2 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 1 ; Figure 3 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 2 ; Figure 4 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 3 ; Figure 5 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 4 ; Figure 6 This is a schematic diagram of a heartbeat packet aggregation and transmission provided in an embodiment of this application; Figure 7 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 5 ; Figure 8 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 6 ; Figure 9 A schematic diagram of the structure of a heartbeat packet transmission device provided in this application embodiment. Figure 1 ; Figure 10 A schematic diagram of the structure of a heartbeat packet transmission device provided in this application embodiment. Figure 2 ; Figure 11 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.

[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in, it is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0022] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0024] The following is an explanation of the terms used in the embodiments of this application.

[0025] 5G: 5th Generation Mobile Communication Technology.

[0026] SMF: Session Management Function, responsible for user session management. It is mainly used for session management, UE Internet Protocol (IP) address allocation and management, selection of manageable user plane functions, policy control, or endpoints for charging function interfaces, and downlink data notification. In this application embodiment, it can be used to implement the functions of a session management network element.

[0027] NEF: Network Equipment Functions, is a component of a network device that can be used to provide network services.

[0028] UE: User Equipment, also known as user equipment, terminal, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, wireless communication equipment, user agent, or user device. UE can also be a cellular phone, cordless phone, session initiation protocol (SIP) phone, wireless local loop (WLL) station, personal digital assistant (PDA), handheld device with wireless communication capabilities, computing device or other processing device connected to a wireless modem, vehicle-mounted device, wearable device, terminal equipment in a 5G network, or terminal equipment in a future evolved public land mobile network (PLMN), etc. It can also be an end device, logical entity, smart device, such as a mobile phone, smart terminal, or other terminal equipment; or a server, gateway, base station, controller, or other communication equipment; or an Internet of Things (IoT) device, such as a sensor, electricity meter, water meter, etc. This application's embodiments do not limit this.

[0029] PDU session: Protocol Data Unit session is the process of communication between a user terminal and a data network, which establishes a data transmission channel between the user terminal and the data network.

[0030] UPF: User Plane Function, i.e., data plane gateway. It can be used for packet routing and forwarding, or for quality of service (QoS) processing of user plane data. User data can access the data network (DN) through this network element. In the embodiments of this application, it can be used to implement the functions of a user plane gateway.

[0031] RAN: Radio Access Network, is a part of a mobile communication system. It is the implementation of radio access technology. NG-RAN refers to 5G Line Access Network.

[0032] NG-RAN: Next Generation Radio Access Network.

[0033] AMF: Access and Mobility Management Function, primarily used for mobility management and access management, can be used to implement functions of the Mobility Management Entity (MME) other than session management, such as lawful interception or access authorization (or authentication). In the embodiments of this application, it can be used to implement the functions of the access and mobility management network element.

[0034] NSSF: Network Slice Selection Function, responsible for managing network slices.

[0035] UDM: Unified Data Management, used for handling user identification, access authentication, registration, or mobility management, etc.

[0036] PCF: Policy Control Function, is one of the network functions of the 5G core network. Its main function is to manage network behavior using a unified policy framework and to coordinate with user information in the UDR (Unified Data Repository) to execute relevant policies.

[0037] AF: Application Function, refers to various services at the application layer. These are used for data routing affected by applications, accessing network open function elements, or interacting with policy frameworks for policy control, etc.

[0038] AUSF: Authentication Server Function.

[0039] Figure 1 This is a schematic diagram of the system architecture on which a heartbeat packet transmission method provided in an embodiment of this application is based, such as... Figure 1 As shown, it includes: NSSF entity, NEF entity, PCF entity, UDM entity, AF entity, SMF entity, AMF entity, and AUSF entity connected to the communication bus; the terminal device communicates with the UPF entity through the NG-RAN entity, the terminal device also communicates with the AMF entity, the AMF entity communicates with the NG-RAN entity, and the SMF entity communicates with the UPF entity.

[0040] The UPF entity is also connected to the business server and the network management server, respectively. The network management server is also connected to the NEF entity, and the terminal device is connected to the industrial equipment. One terminal device can connect to at least one industrial device.

[0041] Additionally, the N1 interface serves as the reference point between the terminal equipment and the AMF entity; the N2 interface serves as the reference point between the NG-RAN and the AMF entity, used for sending non-access stratum (NAS) messages; the N3 interface serves as the reference point between the NG-RAN and the UPF entity, used for transmitting user plane data; the N4 interface serves as the reference point between the SMF entity and the UPF entity, used for transmitting information such as tunnel identification information for N3 connections, data buffer indication information, and downlink data notification messages; and the N6 interface serves as the reference point between the UPF entity and the service server.

[0042] It should be understood that the network architecture described above in the embodiments of this application is merely an example illustrating a network architecture from the perspective of a traditional point-to-point architecture and a service-oriented architecture. The network architecture applicable to the embodiments of this application is not limited to this; any network architecture capable of implementing the functions of the above-described network elements is applicable to the embodiments of this application. It should be understood that the above-described network elements can communicate with each other through preset interfaces, which will not be elaborated further here.

[0043] It should also be understood that Figure 1 The NSSF, NEF, PCF, UDM, AF, SMF, AMF, AUSF, NG-RAN, and UPF entities shown can be understood as network elements in the core network used to implement different functions, such as network slices that can be combined as needed. These core network elements can be independent devices or integrated into the same device to implement different functions; this application does not limit this.

[0044] It should be noted that the above Figure 1 The system architecture described in this application embodiment can be referred to as an industrial private network.

[0045] In the following text, for ease of explanation, the entity used to implement UPF will be referred to as UPF, and the NG-RAN entity will be referred to as NG-RAN. Other designations are similar and will not be repeated here. It should be understood that the above naming is only for distinguishing different functions and does not mean that these network elements are independent physical devices. This application does not limit the specific form of the above network elements. For example, they can be integrated into the same physical device or they can be different physical devices. In addition, the above naming is only for distinguishing different functions and should not constitute any limitation on this application. This application does not exclude the possibility of using other names in 5G networks and other future networks. For example, in 6G networks, some or all of the above network elements can use the terminology in 5G, or they may use other names, etc. This is explained uniformly here and will not be repeated below.

[0046] This application provides a heartbeat packet transmission method, applied to a first device in an industrial private network. The following explains the heartbeat packet transmission method provided by this application.

[0047] Figure 2 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method may include: S101. Obtain the heartbeat packet sending strategy of the target industrial equipment.

[0048] The heartbeat packet sending strategy includes: an aggregation window and a cached heartbeat packet sequence number. The aggregation window is used to represent the maximum number of heartbeat packets to be encapsulated.

[0049] In this embodiment, the network administrator enters heartbeat packet information generated by the target industrial device into the network management server. This information is defined as <target industrial device IP, network protocol, characteristic fields>. The network protocol includes both IP and Ethernet protocols. The characteristic fields include either an IP 5-tuple or an Ethernet 3-tuple. The IP 5-tuple contains the destination IP address, source IP address, transport protocol, destination port, and source port. The Ethernet 3-tuple contains the destination MAC address (Media Access Control Address), Ethernet frame type, and source MAC address. Here, "destination" refers to the receiving device, and "source" refers to the sending device.

[0050] In some implementations, the first device establishes a connection with NG-RAN, the network management server sends heartbeat packet information of the target industrial device to the first device, the first device receives the heartbeat packet information from the network management server, and generates a heartbeat packet sending strategy for the target industrial device based on the heartbeat packet information.

[0051] Additionally, the heartbeat packet transmission strategy for the target industrial equipment may also include: the target industrial equipment's IP address. The target industrial equipment's heartbeat packet transmission strategy can be defined as <target industrial equipment IP address, aggregation window, cached heartbeat packet sequence number>. The cached heartbeat packet sequence number can include: a header sequence number and a tail sequence number. The header sequence number refers to the minimum sequence number in the first device's cached heartbeat packets, and the tail sequence number refers to the maximum sequence number in the first device's cached heartbeat packets. The aggregation window refers to the maximum number of heartbeat packets that can be encapsulated into a single data packet for transmission for the target industrial equipment.

[0052] S102. Obtain the current heartbeat packet generated by the sending device.

[0053] S103. Based on the current heartbeat packet sequence number and the cached heartbeat packet sequence number, determine whether the heartbeat packet caching condition is met.

[0054] In some implementations, the transmitting device sends a current data packet to the first device, which can receive the current data packet and detect whether the current data packet generated by the transmitting device is a heartbeat packet based on the heartbeat packet information generated by the target industrial equipment; if the current data packet is a heartbeat packet, it is determined that the current heartbeat packet generated by the transmitting device has been obtained.

[0055] Specifically, after obtaining the current heartbeat packet generated by the sending device, the system determines whether the heartbeat packet caching condition is met based on the sequence number of the current heartbeat packet and the header and tail sequence numbers in the cached heartbeat packet sequence number.

[0056] Additionally, if it is detected that the current data packet is not a heartbeat packet, the first device sends the current data packet to the second device via NG-RAN.

[0057] S104. If the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the cached heartbeat packet of the target industrial device is encapsulated according to the aggregation window to obtain the heartbeat packet to be transmitted.

[0058] The cached heartbeat packets must include at least the current heartbeat packet. Optionally, the cached heartbeat packets may also include previously cached heartbeat packets.

[0059] It should be noted that if the current heartbeat packet does not meet the heartbeat packet caching conditions, the current heartbeat packet will be sent to the second device according to the sequence number of the current heartbeat packet and the sequence number of the cached heartbeat packet, or the second device will discard the heartbeat packet.

[0060] S105. Send the heartbeat packet to be transmitted to the second device in the industrial private network, so that the second device sends the heartbeat packet to be transmitted to the receiving device.

[0061] In this case, the sending device is the target industrial equipment, and the receiving device is the business server; or, the sending device is the business server, and the receiving device is the target industrial equipment.

[0062] In some implementations, if the sending device is the target industrial device and the receiving device is the service server, then the first device is the terminal device and the second device is the UPF. The target industrial device generates a current heartbeat packet, the terminal device sends the heartbeat packet to be transmitted to the UPF in the industrial private network via NG-RAN, and the UPF sends the heartbeat packet to be transmitted to the service server. This achieves the uplink transmission of the heartbeat packet.

[0063] In other implementations, if the sending device is a service server and the receiving device is the target industrial device, then the first device is a UPF (User-Defined Provider), and the second device is a terminal device. The network management server generates the current heartbeat packet, and the UPF sends the heartbeat packet to be transmitted to the terminal device in the industrial private network via NG-RAN. The terminal device then sends the heartbeat packet to be transmitted to the target industrial device. This achieves uplink transmission of the heartbeat packet. This also achieves downlink transmission of the heartbeat packet.

[0064] In summary, this application provides a heartbeat packet transmission method, comprising: obtaining a heartbeat packet transmission strategy for a target industrial device, the heartbeat packet transmission strategy including: an aggregation window and a cached heartbeat packet sequence number; wherein, the aggregation window is used to represent the maximum number of encapsulated heartbeat packets; obtaining the current heartbeat packet generated by the sending device; determining whether the heartbeat packet caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat packet sequence number; if the heartbeat packet caching condition is met, caching the current heartbeat packet, and encapsulating the cached heartbeat packet of the target industrial device according to the aggregation window to obtain a heartbeat packet to be transmitted; sending the heartbeat packet to be transmitted to a second device in an industrial private network, so that the second device sends the heartbeat packet to be transmitted to a receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device. When the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the object encapsulated and transmitted is all the cached heartbeat packets. In this way, even if a heartbeat packet is delayed due to the scheduling strategy of the industrial private network, the encapsulated heartbeat packet can still be transmitted to ensure that the receiving device can receive the heartbeat packets in order.

[0065] Optionally, the cached heartbeat sequence number includes: header sequence number; Figure 3 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 2 ,like Figure 3 As shown, the process in S103 above, which determines whether the heartbeat packet caching condition is met based on the current heartbeat packet sequence number and the cached heartbeat packet sequence number, may include: S201. If the sequence number of the current heartbeat packet is less than the header sequence number, then the heartbeat packet caching condition is not met.

[0066] The method also includes: S202, Send the current heartbeat packet to the second device so that the second device sends the current heartbeat packet to the receiving device.

[0067] The initial value of the header number is a preset value; for example, the preset value can be -1.

[0068] In some implementations, the sending device is the target industrial device, and the receiving device is the service server. In this case, the first device is the UE, and the second device is the UPF. The UE obtains the current heartbeat packet generated by the target industrial device. If the sequence number of the current heartbeat packet is less than the header sequence number, the UE determines that the heartbeat packet caching condition is not met. The UE then sends the current heartbeat packet to the UPF, and the UPF sends the current heartbeat packet to the service server.

[0069] In other implementations, if the sending device is a service server and the receiving device is a target industrial device, then the first device is a UPF and the second device is a UE. The UPF obtains the current heartbeat packet generated by the service server. If the sequence number of the current heartbeat packet is less than the header sequence number, the UPF determines that the heartbeat packet caching condition is not met, and the UPF sends the current heartbeat packet to the UE, which then sends the current heartbeat packet to the target industrial device.

[0070] Optionally, the cached heartbeat sequence number includes: header sequence number; Figure 4 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 3 ,like Figure 4 As shown, the process in S103 above, which determines whether the heartbeat packet caching condition is met based on the sequence number of the first heartbeat packet and the sequence number of the cached heartbeat packet, further includes: S301. If the sequence number of the current heartbeat packet is equal to the header sequence number, then the heartbeat packet caching condition is not met.

[0071] The method also includes: S302, Discard the current heartbeat packet.

[0072] In some implementations, the sending device is the target industrial device, and the receiving device is the service server. In this case, the first device is the UE, and the second device is the UPF. The UE obtains the current heartbeat packet generated by the target industrial device. If the sequence number of the current heartbeat packet is equal to the header sequence number, the UE determines that the heartbeat packet caching condition is not met and discards the current heartbeat packet.

[0073] In other implementations, the sending device is a service server, and the receiving device is a target industrial device. In this case, the first device is a UPF, and the second device is a UE. The UPF obtains the current heartbeat packet generated by the service server. If the sequence number of the current heartbeat packet is equal to the header sequence number, the UPF determines that the heartbeat packet caching condition is not met and discards the current heartbeat packet.

[0074] Optionally, the cached heartbeat sequence number includes: header sequence number; the process in S103 above, which determines whether the heartbeat caching condition is met based on the current heartbeat sequence number and the cached heartbeat sequence number, may include: If the sequence number of the current heartbeat packet is greater than the header sequence number, then the heartbeat packet caching condition is met.

[0075] Optionally, the cached heartbeat sequence number also includes: a tail sequence number; the initial value of the tail sequence number is a preset value, for example, the preset value can be -1.

[0076] Figure 5 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 4 ,like Figure 5 As shown, the process in S104 above, where the heartbeat packet caching condition is met, involves caching the current heartbeat packet and encapsulating the cached heartbeat packet of the target industrial device according to the aggregation window to obtain the heartbeat packet to be transmitted. This process may include: S401. Determine whether the aggregation window is greater than the difference between the tail number and the head number, and obtain the judgment result.

[0077] S402. Based on the judgment result, cache the current heartbeat packet.

[0078] In practical applications, the sending device continuously generates heartbeat packets. If the current heartbeat packet is the first heartbeat packet in the cache, then the cached heartbeat packets only include the current heartbeat packet. If the current heartbeat packet is not the first heartbeat packet in the cache, that is, if other heartbeat packets were cached before the current heartbeat packet, then the cached heartbeat packets include both the current heartbeat packet and the other heartbeat packets.

[0079] In this embodiment of the application, the header sequence number and the tail sequence number are updated every time a heartbeat packet is cached.

[0080] It should be noted that the header sequence number refers to the smallest sequence number among the cached heartbeat packets, and the tail sequence number refers to the largest sequence number among the cached heartbeat packets. By determining whether the aggregation window is greater than the difference between the tail sequence number and the header sequence number, it can be determined whether the number of heartbeat packets in the cached heartbeat packets is less than or equal to the maximum number of encapsulated heartbeat packets.

[0081] Depending on the judgment result, different methods are used to cache the current heartbeat packet.

[0082] S403. Based on the aggregation window, encapsulate all the heartbeat packets in the cached heartbeat packets to obtain the heartbeat packets to be transmitted.

[0083] In some implementations, the current heartbeat packet is cached. If other heartbeat packets are cached before the current heartbeat packet, all cached heartbeat packets include the current heartbeat packet and the other heartbeat packets. Based on the aggregation window, the current heartbeat packet and the other heartbeat packets are encapsulated to obtain the heartbeat packet to be transmitted.

[0084] Figure 6 This is a schematic diagram of a heartbeat packet aggregation and transmission provided in an embodiment of this application, such as... Figure 6 As shown, all heartbeat packets in the cached heartbeat packets include: heartbeat packet with sequence number 1 and heartbeat packet with sequence number 2. By aggregating (encapsulating) the heartbeat packet with sequence number 1 and heartbeat packet with sequence number 2, we can obtain the aggregated heartbeat packet, which is the heartbeat packet to be transmitted. The heartbeat packet to be transmitted includes: heartbeat packet with sequence number 1 and heartbeat packet with sequence number 2.

[0085] In other implementations, the current heartbeat packet is cached. If no other heartbeat packets are cached before the current heartbeat packet, then all cached heartbeat packets include only the current heartbeat packet. The current heartbeat packet is then encapsulated according to the aggregation window to obtain the heartbeat packet to be transmitted.

[0086] Optionally, the process of caching the current heartbeat packet based on the judgment result in S402 above may include: If the judgment result indicates that the aggregation window is greater than the difference, the current heartbeat packet is cached, and the header sequence number and tail sequence number are updated according to the cached heartbeat packet.

[0087] If the judgment result indicates that the aggregation window is greater than the difference, it means that the number of cached heartbeat packets is less than or equal to the maximum number of heartbeat packets that can be encapsulated. The current heartbeat packet can be cached directly. This way, when encapsulating the cached heartbeat packet in the future, it can be ensured that the number of encapsulated heartbeat packets does not exceed the aggregation window.

[0088] If the judgment result indicates that the aggregation window is not greater than the difference, remove the heartbeat packet with the smallest sequence number from the cached heartbeat packets; cache the current heartbeat packet, and update the header sequence number and tail sequence number according to the cached heartbeat packets.

[0089] In this embodiment, if the judgment result indicates that the aggregation window is not greater than the difference, it means that the number of cached heartbeat packets exceeds the maximum number of heartbeat packets that can be encapsulated. If the current heartbeat packet is cached directly, the number of encapsulated heartbeat packets will exceed the aggregation window when the cached heartbeat packets are encapsulated subsequently. Therefore, when the aggregation window is not greater than the difference, the heartbeat packet with the smallest sequence number among the cached heartbeat packets is removed from the cache. Cache the current heartbeat packet then to ensure that the number of encapsulated heartbeat packets does not exceed the aggregation window.

[0090] In addition, timely updates to the head and tail serial numbers can ensure accurate subsequent judgments.

[0091] In this embodiment of the application, the heartbeat packet information of the target industrial equipment sent by the network management server to the first device is explained in detail below.

[0092] In some implementations, if the sending device is a service server, the receiving device is a target industrial device, the first device is a UPF, and the second device is a terminal device, after the UPF and NG-RAN establish a connection, the UPF sends a query request to the network management server to obtain the heartbeat packet information of the target industrial device. In this way, the network management server sends the heartbeat packet information of the target industrial device to the first device.

[0093] In other implementations, if the transmitting device is the target industrial device, the receiving device is a service server, the first device is a terminal device (UE), and the second device is a UPF, after the UE accesses the NG-RAN and establishes a PDU session with the UPF, the UE sends a query request to the network management server to obtain the IP address of the target industrial device deployed in the industrial private network. The network management server returns the IP address of the target industrial device in the industrial private network to the UE.

[0094] The UE, based on the received IP address of the target industrial device, sends an ARP (Address Resolution Protocol) request to the target industrial device via its local network interface, requesting to obtain the MAC address (Media Access Control Address) corresponding to the target industrial device's IP address. If the ARP request sent by the UE contains the IP address of the target industrial device, it can receive an ARP response from the target industrial device. Otherwise, the target industrial device will not return an ARP response. The ARP response from the target industrial device contains its MAC address.

[0095] It should be noted that after the UE receives the ARP response from the industrial device, it reports the information of the target industrial device to the network management server and establishes a local data record, which is expressed as <UE IP, target industrial device IP, target industrial device MAC>. After the network management server receives the reported information of the target industrial device from the UE, it establishes a local data record, which is expressed as <UE IP, target industrial device IP, target industrial device MAC>. After the network management server completes the establishment of the local data record, it sends the heartbeat packet information corresponding to the target industrial device IP in the data record to the UE, that is, the heartbeat packet information of the target industrial device.

[0096] The embodiment of the present application provides a method for transmitting heartbeat packets, which is applied to a second device in an industrial private network. The following explains a method for transmitting heartbeat packets provided by the embodiment of the present application.

[0097] Figure 7 The flow diagram of a method for transmitting heartbeat packets provided by the embodiment of the present application Figure 5 , as Figure 7 shown, the method may include: S501. Receive the heartbeat packet to be transmitted of the target industrial device sent by the first device in the industrial private network.

[0098] Among them, the heartbeat packet to be transmitted is obtained by encapsulating the cached heartbeat packets of the target industrial device according to the aggregation window when the current heartbeat packet generated by the sending device meets the heartbeat packet caching condition; the aggregation window is used to represent the number of heartbeat packets required to encapsulate the packet to be transmitted.

[0099] It should be noted that for the process by which the first device obtains the heartbeat packet to be transmitted of the target industrial device, reference can be made to the relevant content of S101 to S104 above, and the embodiment of the present application does not specifically limit this.

[0100] S502. Send the packet to be transmitted to the receiving device.

[0101] Among them, the sending device is the target industrial device and the receiving device is the service server; or the sending device is the service server and the receiving device is the target industrial device.

[0102] In some embodiments, if the sending device is the target industrial device and the receiving device is the service server, the first device is the terminal device and the second device is the UPF. The target industrial device generates the current heartbeat packet, and the terminal device sends the heartbeat packet to be transmitted to the UPF in the industrial private network through the NG-RAN, and the UPF sends the heartbeat packet to be transmitted to the service server. In this way, the uplink transmission of the heartbeat packet is achieved.

[0103] In other implementations, if the sending device is a service server and the receiving device is the target industrial device, then the first device is a UPF (User-Defined Provider), and the second device is a terminal device. The network management server generates the current heartbeat packet, and the UPF sends the heartbeat packet to be transmitted to the terminal device in the industrial private network via NG-RAN. The terminal device then sends the heartbeat packet to be transmitted to the target industrial device. This achieves uplink transmission of the heartbeat packet. This also achieves downlink transmission of the heartbeat packet.

[0104] In summary, this application provides a heartbeat packet transmission method, comprising: receiving a heartbeat packet to be transmitted from a first device in an industrial private network, wherein the heartbeat packet to be transmitted is a heartbeat packet obtained by encapsulating the cached heartbeat packet of the target industrial device according to an aggregation window when the current heartbeat packet generated by the sending device meets the heartbeat packet caching condition; wherein the aggregation window is used to characterize the number of heartbeat packets required to encapsulate the data packet to be transmitted; and sending the data packet to be transmitted to a receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device. When the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the object of encapsulation and transmission is all cached heartbeat packets. In this way, even if a certain heartbeat packet is delayed due to the scheduling strategy of the industrial private network, the receiving device can still receive the heartbeat packets in order by transmitting the encapsulated heartbeat packet.

[0105] Figure 8 A flowchart illustrating a heartbeat packet transmission method provided in this application embodiment. Figure 6 ,like Figure 8 As shown, the process of sending the data packet to be transmitted to the receiving device in S502 above may include: S601. Determine whether the data packet to be transmitted is a composite heartbeat packet.

[0106] S602. If the data packet to be transmitted is not a composite heartbeat packet, then the data packet to be transmitted is sent to the receiving device.

[0107] If the data packet to be transmitted is not a composite heartbeat packet, it means that the data packet to be transmitted is a single heartbeat packet, and the data packet to be transmitted can be sent directly to the receiving device.

[0108] S603. If the data packet to be transmitted is a composite heartbeat packet, split the composite heartbeat packet into multiple heartbeat packets, and send the heartbeat packets with sequence numbers greater than the currently sent sequence numbers to the receiving device.

[0109] S604. Discard heartbeat packets whose sequence number is less than the currently sent sequence number among multiple heartbeat packets.

[0110] If the data packet to be transmitted is a heartbeat packet, it means that the data packet to be transmitted contains at least two heartbeat packets. The composite heartbeat packet is then split into multiple heartbeat packets.

[0111] It should be noted that in the application scenario of heartbeat packet uplink transmission, the currently sent sequence number is the largest sequence number of the heartbeat packets forwarded by the UPF in the uplink direction. For example, if the UPF forwards two heartbeat packets to the service server with sequence numbers 3 and 4 respectively, then the current sent sequence number of the UPF is 4. In the application scenario of heartbeat packet downlink transmission, the currently sent sequence number is the largest sequence number of the heartbeat packets forwarded by the UE in the downlink direction. For example, if the UE forwards two heartbeat packets to the target industrial equipment with sequence numbers 3 and 4 respectively, then the current sent sequence number of the UE is 4.

[0112] In this embodiment of the application, only heartbeat packets with sequence numbers greater than the currently sent sequence number are sent, and heartbeat packets with sequence numbers less than the currently sent sequence number are discarded, which can avoid the repeated sending of the same heartbeat packet.

[0113] For example, if the cached heartbeat packets include a heartbeat packet with sequence number 1 and a heartbeat packet with sequence number 2, then the first data packet to be transmitted will include a heartbeat packet with sequence number 1 and a heartbeat packet with sequence number 2. The first data packet to be transmitted is then sent to the receiving device. The currently sent sequence number is marked as 2.

[0114] In this configuration, the aggregation window is 4. When a heartbeat packet with sequence number 3 is generated, it can be buffered. The buffered heartbeat packets include those with sequence numbers 1, 2, and 3. Therefore, the second data packet to be transmitted includes those with sequence numbers 1, 2, and 3. The heartbeat packet with sequence number 3 is sent to the receiving device, while the heartbeat packets with sequence numbers 1 and 2 are discarded.

[0115] In summary, this application provides a heartbeat packet transmission method that effectively solves the problem of out-of-order reception of multiple heartbeat packets that may be caused by mismatches in the internal transmission mechanisms of 5G networks (e.g., different scheduling strategies at the RLC or MAC layers). Even if a heartbeat packet (including ordinary heartbeat packets and aggregated heartbeat packets) is delayed due to 5G network scheduling strategies, other aggregated heartbeat packets can be transmitted to ensure that industrial equipment or business servers can receive the heartbeat packet in a virtual manner. Moreover, users can complete the heartbeat packet transmission strategy without complex manual configuration.

[0116] The following describes the heartbeat packet transmission apparatus, communication equipment, and storage medium used to implement the heartbeat packet transmission method provided in this application. For the specific implementation process and technical effects, please refer to the relevant content of the heartbeat packet transmission method above, which will not be repeated below.

[0117] Figure 9 A schematic diagram of the structure of a heartbeat packet transmission device provided in this application embodiment. Figure 1 ,like Figure 9 As shown, the device includes: The acquisition module 101 is used to acquire the heartbeat packet sending strategy of the target industrial equipment. The heartbeat packet sending strategy includes: an aggregation window and a cached heartbeat packet sequence number; wherein, the aggregation window is used to represent the maximum number of encapsulated heartbeat packets; and to acquire the current heartbeat packet generated by the sending device. The determining module 102 is used to determine whether the heartbeat packet caching condition is met based on the sequence number of the current heartbeat packet and the sequence number of the cached heartbeat packet. The encapsulation module 103 is used to cache the current heartbeat packet if the heartbeat packet caching condition is met, and encapsulate the cached heartbeat packet of the target industrial equipment according to the aggregation window to obtain the heartbeat packet to be transmitted. The sending module 104 is used to send the heartbeat packet to be transmitted to a second device in the industrial private network, so that the second device sends the heartbeat packet to be transmitted to a receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device.

[0118] Optionally, the cached heartbeat packet sequence number includes: header sequence number; the determining module 102 is specifically used to determine that the heartbeat packet caching condition is not met if the sequence number of the current heartbeat packet is less than the header sequence number. The sending module 104 is further configured to send the current heartbeat packet to the second device, so that the second device sends the current heartbeat packet to the receiving device.

[0119] Optionally, the cached heartbeat packet sequence number includes: header sequence number; the determining module 102 is specifically used to determine that the heartbeat packet caching condition is not met if the sequence number of the current heartbeat packet is equal to the header sequence number. The device further includes: The discard module is used to discard the current heartbeat packet.

[0120] Optionally, the cached heartbeat packet sequence number includes: header sequence number; the determining module 102 is specifically used to determine that the heartbeat packet caching condition is met if the sequence number of the current heartbeat packet is greater than the header sequence number.

[0121] Optionally, the cached heartbeat packet sequence number further includes: a tail sequence number; the encapsulation module 103 is specifically used to determine whether the aggregation window is greater than the difference between the tail sequence number and the head sequence number, and obtain a determination result; according to the determination result, the current heartbeat packet is cached; according to the aggregation window, all heartbeat packets in the cached heartbeat packets are encapsulated to obtain the heartbeat packet to be transmitted.

[0122] Optionally, the encapsulation module 103 is specifically configured to: if the judgment result indicates that the aggregation window is greater than the difference, cache the current heartbeat packet and update the header sequence number and the tail sequence number according to the cached heartbeat packet; if the judgment result indicates that the aggregation window is not greater than the difference, remove the heartbeat packet with the smallest sequence number from the cached heartbeat packets; cache the current heartbeat packet and update the header sequence number and the tail sequence number according to the cached heartbeat packet.

[0123] Figure 10 A schematic diagram of the structure of a heartbeat packet transmission device provided in this application embodiment. Figure 2 ,like Figure 10 As shown, the device includes: The receiving module 201 is used to receive the heartbeat packet to be transmitted from the target industrial device sent by the first device in the industrial private network. The heartbeat packet to be transmitted is the heartbeat packet obtained by encapsulating the cached heartbeat packet of the target industrial device according to the aggregation window when the current heartbeat packet generated by the sending device meets the heartbeat packet caching condition. The aggregation window is used to represent the number of heartbeat packets required to encapsulate the data packet to be transmitted. The sending module 202 is used to send the data packet to be transmitted to the receiving device, wherein the sending device is the target industrial equipment and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial equipment.

[0124] Optionally, the sending module 202 is specifically used to determine whether the data packet to be transmitted is a composite heartbeat packet; if the data packet to be transmitted is not a composite heartbeat packet, then the data packet to be transmitted is sent to the receiving device; if the data packet to be transmitted is a composite heartbeat packet, the composite heartbeat packet is split into multiple heartbeat packets, and the heartbeat packets with sequence numbers greater than the currently sent sequence number are sent to the receiving device; the heartbeat packets with sequence numbers less than the currently sent sequence number are discarded.

[0125] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0126] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0127] Figure 11 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application, such as... Figure 11 As shown, the communication device includes: processor 301 and memory 302.

[0128] The memory 302 is used to store programs, and the processor 301 calls the programs stored in the memory 302 to execute the above method embodiments. The specific implementation and technical effects are similar, and will not be described in detail here.

[0129] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.

[0130] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0133] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0134] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for transmitting heartbeat packets, characterized in that, The first device used in industrial private networks includes: The heartbeat packet sending strategy of the target industrial equipment is obtained. The heartbeat packet sending strategy includes: an aggregation window and a cached heartbeat packet sequence number; wherein, the aggregation window is used to represent the maximum number of encapsulated heartbeat packets. Get the current heartbeat packet generated by the sending device; Based on the sequence number of the current heartbeat packet and the sequence number of the cached heartbeat packet, determine whether the heartbeat packet caching condition is met; If the heartbeat packet caching condition is met, the current heartbeat packet is cached, and the cached heartbeat packet of the target industrial device is encapsulated according to the aggregation window to obtain the heartbeat packet to be transmitted. The heartbeat packet to be transmitted is sent to a second device in the industrial private network, so that the second device sends the heartbeat packet to the receiving device, wherein the sending device is the target industrial device and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial device.

2. The method according to claim 1, characterized in that, The cached heartbeat sequence number includes: a header sequence number; determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number includes: If the sequence number of the current heartbeat packet is less than the sequence number of the header packet, then it is determined that the heartbeat packet caching condition is not met. The method further includes: The current heartbeat packet is sent to the second device, so that the second device sends the current heartbeat packet to the receiving device.

3. The method according to claim 1, characterized in that, The cached heartbeat sequence number includes: a header sequence number; the step of determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number further includes: If the sequence number of the current heartbeat packet is equal to the sequence number of the header packet, then it is determined that the heartbeat packet caching condition is not met. The method further includes: Discard the current heartbeat packet.

4. The method according to claim 1, characterized in that, The cached heartbeat sequence number includes: a header sequence number; determining whether the heartbeat caching condition is met based on the sequence number of the current heartbeat packet and the cached heartbeat sequence number includes: If the sequence number of the current heartbeat packet is greater than the sequence number of the header packet, then the heartbeat packet caching condition is satisfied.

5. The method according to claim 4, characterized in that, The cached heartbeat sequence number further includes: a tail sequence number; if the heartbeat caching condition is met, the current heartbeat packet is cached, and according to the aggregation window, the cached heartbeat packet of the target industrial equipment is encapsulated to obtain the heartbeat packet to be transmitted, including: Determine whether the aggregation window is greater than the difference between the tail number and the head number to obtain the determination result; Based on the judgment result, the current heartbeat packet is cached; Based on the aggregation window, all heartbeat packets in the cached heartbeat packets are encapsulated to obtain the heartbeat packet to be transmitted.

6. The method according to claim 5, characterized in that, The step of caching the current heartbeat packet based on the judgment result includes: If the judgment result indicates that the aggregation window is greater than the difference, then the current heartbeat packet is cached, and the header sequence number and the tail sequence number are updated according to the cached heartbeat packet; If the judgment result indicates that the aggregation window is not greater than the difference, the heartbeat packet with the smallest sequence number among the cached heartbeat packets is removed from the cache; The current heartbeat packet is cached, and the header sequence number and the tail sequence number are updated based on the cached heartbeat packet.

7. A method for transmitting heartbeat packets, characterized in that, Secondary devices used in industrial private networks include: The system receives a heartbeat packet to be transmitted from a first device in the industrial private network. The heartbeat packet to be transmitted is a heartbeat packet obtained by encapsulating the cached heartbeat packet of the target industrial device according to an aggregation window when the current heartbeat packet generated by the sending device meets the heartbeat packet caching condition. The aggregation window is used to represent the number of heartbeat packets required to encapsulate the data packet to be transmitted. The data packet to be transmitted is sent to the receiving device, wherein the sending device is the target industrial equipment and the receiving device is a service server; or, the sending device is a service server and the receiving device is the target industrial equipment.

8. The method according to claim 7, characterized in that, Sending the data packet to be transmitted to the receiving device includes: Determine whether the data packet to be transmitted is a composite heartbeat packet; If the data packet to be transmitted is not a composite heartbeat packet, then the data packet to be transmitted is sent to the receiving device; If the data packet to be transmitted is a composite heartbeat packet, the composite heartbeat packet is split into multiple heartbeat packets, and the heartbeat packets with a sequence number greater than the currently sent sequence number are sent to the receiving device. Heartbeat packets with sequence numbers less than the currently sent sequence number are discarded.

9. A communication device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor executes the computer program to implement the heartbeat packet transmission method according to any one of claims 1-6, or the heartbeat packet transmission method according to any one of claims 7-8.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when read and executed, implements the heartbeat packet transmission method according to any one of claims 1-8.