Message transmission method and device, storage medium and electronic device

Through the hierarchical storage structure and initial historical serial number information, the problem of low reliability and large storage resource occupation caused by messy messages in TSN is solved, and more reliable and efficient message transmission is achieved.

CN120498598APending Publication Date: 2025-08-15SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510819170.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In TSN, the out-of-order phenomenon caused by multi-path transmission leads to low reliability of message transmission, and the storage resources occupies a large amount in the prior art, and there is no effective solution.

Method used

The target sequence number range is divided into multiple hierarchical intervals by using a hierarchical storage structure. The coverage range of transmitted historical messages is recorded through the initial historical sequence number information, and whether the target message is a new message is controlled, and its transmission is controlled.

Benefits of technology

Improve the reliability of message transmission, reduce storage resource usage, and avoid repeated reception or omission of messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498598A_ABST
    Figure CN120498598A_ABST
Patent Text Reader

Abstract

The invention discloses a message transmission method and device, a storage medium and an electronic device, and relates to the technical field of communication, and the message transmission method comprises the steps: obtaining a target message serial number of a target message to be transmitted to a message receiving end at present; positioning a target hierarchical interval to which the target message serial number belongs from the hierarchical storage structure; obtaining initial historical sequence number information corresponding to the target hierarchical interval; and controlling transmission of the target message according to the initial historical sequence number information and the target message sequence number, and by adopting the technical scheme, the problems of relatively low reliability of message transmission, relatively large occupation of storage resources and the like in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message transmission method and device, a storage medium, and an electronic device. Background Art

[0002] In TSN (Time-Sensitive Networking), FRER (Frame Replication and Elimination for Reliability) ensures data integrity in message transmission by replicating streams and adding redundant links. However, when multiple replicated stream messages with the same sequence number arrive at the same node through different network paths, the order in which the replicated stream messages are sent may be different from the order in which they were sent, resulting in message disorder in multi-path transmission.

[0003] In the related art, in the face of the message disorder phenomenon in multi-path transmission, the existing MRA (Match Recovery Algorithm) may repeatedly receive messages with the same seq because it only stores the latest single seq (Sequence), resulting in low reliability of message transmission. For example, a replication flow message with seq=477 arrives after a replication flow message with seq=500, but the MRA still regards the replication flow message with seq=477 as the first appearance and receives it again; and although the VRA (Vector Recovery Algorithm) records multiple received seqs through the historical window, the historical window specification is generally limited, because an excessively large historical window specification requires a large amount of storage resources, which increases storage costs. However, under the limited historical window specification, when the disorder is greater than the historical window specification, the reliability of message transmission cannot be guaranteed.

[0004] In view of the problems in related technologies such as low reliability of message transmission and large occupation of storage resources, no effective solutions have been proposed. Summary of the Invention

[0005] The embodiments of the present application provide a message transmission method and device, a storage medium, and an electronic device to at least solve the problems in the related art, such as low reliability of message transmission and large storage resource occupation.

[0006] According to an embodiment of the present application, a method for transmitting a message is provided, including: obtaining a target message sequence number of a target message currently to be transmitted to a message receiving end, wherein the target message sequence number is used to indicate the order in which the target messages are sent from a message sending end; locating a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing a target sequence number range into a plurality of hierarchical intervals, each of which covers a portion of the sequence number range in the target sequence number range, and the target sequence number range is the maximum range allowed to be covered by the message sequence number of the message sent by the message sending end; obtaining initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate the coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval; and controlling the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

[0007] In an exemplary embodiment, locating the target hierarchical interval to which the target message sequence number belongs from the hierarchical storage structure includes: when the target message sequence number is a 16-bit binary number, truncating the first 8 bits of the target message sequence number to obtain a first truncated sequence number; converting the first truncated sequence number from binary to decimal to obtain a first numerical value; and determining the hierarchical interval of the first numerical value in the hierarchical storage structure as the target hierarchical interval.

[0008] In an exemplary embodiment, obtaining the initial historical sequence number information corresponding to the target hierarchical interval includes: obtaining multiple range parameter pairs recorded in the target hierarchical interval, wherein each range parameter pair includes a pair of start parameter and continuous parameter with a corresponding relationship, and each range parameter pair whose continuous parameter is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair whose continuous parameter is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; and determining multiple range parameter pairs as the initial historical sequence number information.

[0009] In an exemplary embodiment, controlling the transmission of the target message based on the initial historical sequence number information and the target message sequence number includes: detecting whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information; if the target message sequence number falls within the coverage range indicated by the initial historical sequence number information, controlling the target message to be prohibited from being transmitted to the message receiving end; if the target message sequence number does not fall within the coverage range indicated by the initial historical sequence number information, controlling the target message to be transmitted to the message receiving end, and updating the initial historical sequence number information according to the target message sequence number.

[0010] In an exemplary embodiment, the detection of whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information includes: obtaining multiple range parameter pairs included in the initial historical sequence number information, wherein each range parameter pair includes a pair of start parameters and continuous parameters with a corresponding relationship, and each range parameter pair including the continuous parameter that is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate all the historical message sequence numbers that are arranged after the first historical message sequence number in a continuous segment of the historical message sequence numbers. The number of the historical message sequence numbers, each of the range parameter pairs including the continuous parameter being 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; when the target message sequence number is a 16-bit binary number, the last 8 bits of the target message sequence number are truncated to obtain a second truncated sequence number; when the second truncated sequence number is the same as the reference starting parameter included in any reference range parameter pair in the multiple range parameter pairs, or when the second truncated sequence number is greater than the reference starting parameter and less than or equal to the sum of the reference starting parameter and the reference continuous parameter in the reference range parameter pair, it is determined that the target message sequence number falls within the coverage range indicated by the initial historical sequence number information.

[0011] In an exemplary embodiment, updating the initial historical sequence number information according to the target message sequence number includes: when the initial historical sequence number information includes multiple range parameter pairs, obtaining a range minimum value and a range maximum value corresponding to each range parameter pair, and detecting an absolute value of a difference between the target message sequence number and the range minimum value and the range maximum value corresponding to each range parameter pair to obtain a reference difference value, wherein the range minimum value is the start parameter included in each range parameter pair, and the range maximum value is the sum of the start parameter and the continuous parameter included in each range parameter pair; when it is detected that the reference differences are all greater than 1, adding the target range parameter pair corresponding to the target message sequence number to the initial historical sequence number information to obtain reference historical sequence number information, wherein the target start parameter included in the target range parameter pair is the same as the second truncation sequence number, and the target continuous parameter included in the target range parameter pair is 0; when it is detected that the reference difference value equals 1 between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs, adjusting the candidate range parameter pair to obtain the reference historical sequence number information.

[0012] In an exemplary embodiment, when it is detected that there is a reference difference of 1 between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs, adjusting the candidate range parameter pair to obtain the reference historical sequence number information includes: when the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the i-th range maximum value included in the i-th range parameter pair among the N range parameter pairs is equal to 1, adjusting the i-th continuous parameter included in the i-th range parameter pair to The reference historical sequence number information is obtained by adding 1 to the number, wherein N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pair includes the i-th range parameter pair; when the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the j-th range minimum value included in the j-th range parameter pair among the N range parameter pairs is equal to 1, the j-th starting parameter included in the j-th range parameter pair is subtracted by 1, and the j-th range parameter pair included in the j-th range parameter pair is increased. The reference historical sequence number information is obtained by adding 1 to the j-th continuous parameter, wherein N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pair includes the j-th range parameter pair; the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and the k-th range maximum value included in the k-th range parameter pair among the N range parameter pairs, and the reference difference between the t-th range minimum value included in the t-th range parameter pair are both equal to 1. In the case of a k-th continuous parameter included in the k-th range parameter pair, the k-th continuous parameter included in the t-th range parameter pair is changed to the difference between the t-th range maximum value included in the t-th range parameter pair and the k-th range minimum value included in the k-th range parameter pair, and the t-th range parameter pair is deleted from the initial historical sequence number information to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, k is not equal to t, and k and t are both integers greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the k-th range parameter pair and the t-th range parameter pair.

[0013] In an exemplary embodiment, after adjusting the candidate range parameter pair to obtain the reference historical sequence number information, the method further includes one of the following:

[0014] When the coverage range indicated by the reference historical sequence number information is equal to the target sequence number range, clearing the reference historical sequence number information;

[0015] The timing starts after the reference history sequence number information is adjusted, and when the timing duration reaches a preset duration, the reference history sequence number information is cleared.

[0016] According to another embodiment of the present application, a message transmission device is further provided, including: a first acquisition module, configured to acquire a target message sequence number of a target message currently to be transmitted to a message receiving end, wherein the target message sequence number is used to indicate the order in which the target messages are sent from a message sending end; a positioning module, configured to locate a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing a target sequence number range into a plurality of hierarchical intervals, each of which covers a portion of the sequence number range in the target sequence number range, and the target sequence number range is the maximum range allowed to be covered by the message sequence number of the message sent by the message sending end; a second acquisition module, configured to acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate the coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval; and a control module, configured to control the transmission of the target message based on the initial historical sequence number information and the target message sequence number.

[0017] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned message transmission method when running.

[0018] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the message transmission method through the computer program.

[0019] In an embodiment of the present application, a hierarchical storage structure is obtained by dividing the target sequence number range into multiple hierarchical intervals, and the target hierarchical interval to which the target message sequence number belongs is located from the hierarchical storage structure. Since the initial historical sequence number information records the coverage range of the historical message sequence numbers of the historical messages that have completed the transmission between the message sending end and the message receiving end in the target hierarchical interval, that is, the historical message sequence numbers of all historical messages that have completed the transmission are stored in each level, so according to the initial historical sequence number information and the target message sequence number, it is possible to accurately determine whether the target message is a new message or a message that has been received, and then control the transmission of the message, effectively avoiding repeated reception or omission of the message. The above technical solution is adopted to solve the problems of low reliability of message transmission and large storage resource occupation in the related technology, and achieve the technical effect of improving the reliability of message transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] Figure 1 This is a schematic diagram of a hardware environment for a message transmission method according to an embodiment of the present application;

[0023] Figure 2 is a flowchart of a message transmission method according to an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of an optional method of obtaining initial historical sequence number information corresponding to a target hierarchical interval according to an embodiment of the present application;

[0025] Figure 4 is a schematic diagram of an optional method for detecting whether a target message sequence number falls within the coverage range indicated by the initial historical sequence number information according to an embodiment of the present application;

[0026] Figure 5 is a schematic diagram of an optional maximization of a history window specification according to an embodiment of the present application;

[0027] Figure 6 This is a schematic diagram of an optional method of using run-length encoding to store historical message sequence numbers according to an embodiment of the present application;

[0028] Figure 7 is a schematic diagram of an optional hierarchical storage structure according to an embodiment of the present application;

[0029] Figure 8 This is a schematic diagram of an optional method of searching for a target message sequence number in initial historical information according to an embodiment of the present application;

[0030] Figure 9 This is a schematic diagram of an optional method of requiring a new application space to store the target message sequence number according to an embodiment of the present application;

[0031] Figure 10 This is a schematic diagram of an optional method of updating only continuous parameters according to an embodiment of the present application;

[0032] Figure 11is a schematic diagram of an optional need to update the starting parameters and continuous parameters according to an embodiment of the present application;

[0033] Figure 12 is a schematic diagram of optional merging and space release of run-length encoding records according to an embodiment of the present application;

[0034] Figure 13 It is a structural block diagram of a message transmission device according to an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a schematic diagram of a hardware environment for a message transmission method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 Shown are different configurations with more functionality.

[0038] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending message push in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0039] The transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0040] In this embodiment, a message transmission method is provided, which is applied to the above-mentioned computer terminal. Figure 2 is a flow chart of a message transmission method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0041] Step S202: Acquire a target message sequence number of a target message to be transmitted to the message receiving end, wherein the target message sequence number is used to indicate the order in which the target message is sent from the message sending end;

[0042] Step S204: locating a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing the target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being the maximum range allowed to be covered by the message sequence numbers of messages sent by the message sender;

[0043] Step S206: Acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval;

[0044] Step S208: Control the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

[0045] Through the above steps, the target sequence number range is divided into a plurality of hierarchical intervals to obtain a hierarchical storage structure, and the target hierarchical interval to which the target message sequence number belongs is located from the hierarchical storage structure. Since the initial historical sequence number information records the coverage of the historical message sequence numbers of the historical messages that have completed the transmission between the message sending end and the message receiving end in the target hierarchical interval, that is, the historical message sequence numbers of all historical messages that have completed the transmission are stored in each level, so according to the initial historical sequence number information and the target message sequence number, it is possible to accurately determine whether the target message is a new message or a message that has been received, and then control the transmission of the message, effectively avoiding repeated reception or omission of the message. The above technical solution is adopted to solve the problems of low reliability of message transmission and large storage resource occupation in the related technology, and achieve the technical effect of improving the reliability of message transmission.

[0046] In the technical solution provided in the above step S202, the target message sequence number can be used to indicate the order in which the target messages are sent from the message sending end. For example, the target message sequence number seq of target message 1 is 0, indicating that target message 1 is the first batch of messages sent at the message sending end.

[0047] Optionally, in this embodiment, in order to avoid message loss, there can be multiple messages transmitted from the message sending end to the message receiving end in the same batch. These messages transmitted in the same batch have the same message sequence number, and the content carried in the message is also the same, that is, multiple copy messages. These messages are transmitted to the message receiving end through different paths, and the order in which they arrive at the message receiving end may be different. For example, after messages with seq=0, seq=1, seq=2, and seq=3 arrive at the message receiving end, a message with seq=1 arrives at the message receiving end, that is, disorder occurs.

[0048] In the technical solution provided in the above step S204, the target sequence number range is the maximum range allowed by the message sequence numbers of the messages sent by the message sending end. For example, if the maximum range allowed by the message sequence numbers of the messages sent by the message sending end is [0, 65535], then the target sequence number range is [0, 65535].

[0049] Optionally, in this embodiment, the hierarchical storage structure is obtained by dividing the target sequence number range into multiple optional hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range. For example, if the target sequence number range is [0, 65535], the target sequence number range can be divided into 256 hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range [0, 65535], such as Level 0: [0, 255], Level 1: [256, 511] ... Level 254: [65024, 65279], Level 255: [65280, 65535], that is, each hierarchical interval covers 256 message sequence numbers. The target hierarchical interval to which the target message sequence number belongs is located from the hierarchical storage structure. For example, if the target message sequence number is 100, the target hierarchical interval to which the target message sequence number belongs is Level 0.

[0050] In an exemplary embodiment, the target hierarchical interval to which the target message sequence number belongs can be located from the hierarchical storage structure in the following manner, but not limited to: when the target message sequence number is a 16-bit binary number, the first 8 bits of the target message sequence number are truncated to obtain a first truncated sequence number; the first truncated sequence number is converted from binary to decimal to obtain a first numerical value; and the hierarchical interval of the first numerical value in the hierarchical storage structure is determined as the target hierarchical interval.

[0051] Optionally, in this embodiment, taking the target message sequence number 00000010 00001010, corresponding to decimal 522, the target message sequence number range is divided into 256 hierarchical intervals, and each hierarchical interval covers 256 message sequence numbers as an example, the first 8 bits of the target message sequence number: 00000010 are obtained to obtain the first intercepted sequence number, the first intercepted sequence number 00000010 is converted from binary to decimal, and the first value is 2, and the second hierarchical interval in the hierarchical storage structure is determined as the target hierarchical interval, that is, the target hierarchical interval is Level 2, and the partial sequence number range covered is [512,767].

[0052] Optionally, in this embodiment, the target hierarchical interval to which the target message sequence number belongs can also be located from the hierarchical storage structure in the following manner, but not limited to: when the target message sequence number is decimal, obtain the number of message sequence numbers covered by each hierarchical interval in the hierarchical storage structure in the target sequence number range to obtain the number of hierarchical sequence numbers; perform a division operation on the target message sequence number and the number of hierarchical sequence numbers to obtain a target quotient value; when the starting level of the target hierarchical interval is defined as Level 0, perform a rounding-down operation on the target quotient value to obtain a target hierarchical interval; when the starting level of the target hierarchical interval is defined as Level 1, perform a rounding-up operation on the target quotient value to obtain a target hierarchical interval.

[0053] Taking the case where the number of message sequence numbers covered by each level interval in the target sequence number range is 256 and the target message sequence number is 128 as an example, the number of message sequence numbers covered by each level interval in the hierarchical storage structure in the target sequence number range is obtained, and the number of level sequence numbers is 256; the target message sequence number 128 is divided by the number of level sequence numbers 256 to obtain a target quotient value of 0.5. When the first level of the target level interval is Level 0, the target quotient value is rounded down to obtain a target level interval of 0, that is, Level 0. When the first level of the target level interval is Level 1, the target quotient value is rounded up to obtain the target level interval, that is, Level 1.

[0054] It should be noted that the starting level of the hierarchical interval being Level 0 or Level 1 is merely a difference in naming and does not affect the partial sequence number range in the target sequence number range covered by each hierarchical interval. When the starting level of the hierarchical interval is defined as Level 0 or Level 1, the partial sequence number range in the target sequence number range covered by the starting hierarchical interval is the same. For example, the partial sequence number range in the target sequence number range covered by Level 0 or Level 1 is [0,255].

[0055] In the technical solution provided in the above step S206, taking the target hierarchical interval as Level 0, the covered partial sequence number range as [0,255], and the historical message sequence numbers of the historical messages that have been received as seq=0, seq=1, seq=2, seq=3 as an example, the initial historical sequence number information is used to indicate that the coverage range of the historical message sequence numbers of the historical messages that have been transmitted between the message sending end and the message receiving end in the target hierarchical interval can be [0,3].

[0056] In an exemplary embodiment, the initial historical sequence number information corresponding to the target hierarchical interval can be obtained in the following manner, but is not limited to: obtaining multiple range parameter pairs recorded in the target hierarchical interval, wherein each range parameter pair includes a pair of start parameters and continuous parameters with a corresponding relationship, and each range parameter pair whose continuous parameter is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair whose continuous parameter is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; and determining multiple range parameter pairs as the initial historical sequence number information.

[0057] Optionally, in this embodiment, each range parameter pair includes a pair of start parameter and continuous parameter with a corresponding relationship. Run-length encoding can be used to represent the range parameter pair. Run-length encoding has two fields: base and offset. These two fields are used to represent all records in the interval [base, base+offset]. Run-length encoding is suitable for scenarios with a large amount of continuous data. Suppose there is a continuous historical message numbered 0, 1, 2...10. Using run-length encoding, base=0, offset=10, that is, the range parameter pair is [0,1 0], where base is the starting parameter, indicating the position of the first historical message number 0 in a continuous range of historical message numbers 0, 1, 2, ..., 10 within the target hierarchical interval. offset is a continuous parameter, indicating that the number of historical message numbers following the first historical message number 0 in a continuous range of historical message numbers 0, 1, 2, ..., 10 is 10. The continuous parameter offset = 10 is not 0. The range parameter pair [0, 10] indicates that the range of the continuous historical message numbers 0, 1, 2, ..., 10 within the hierarchical interval is [base, base + offset], i.e., [0, 10]. Assume that the range parameter pair is [22, 0] and the continuous parameter offset is 0, indicating the position of a single historical message number 22 within the target hierarchical interval.

[0058] Optionally, in this embodiment, taking the target level interval as Level 0 and the covered partial sequence number range as [0,255] as an example, Figure 3 This is a schematic diagram of an optional method for obtaining initial historical sequence number information corresponding to a target level interval according to an embodiment of the present application. Figure 3As shown, multiple range parameter pairs recorded in the target hierarchical interval Level 0 are obtained, namely [0,16], [30,2] and [200,32], wherein [0,16], [30,2] and [200,32] indicate that the coverage range of the historical message sequence numbers of the historical messages that have completed transmission in the target hierarchical interval Level 0 is [0,16], [30,32] and [200,232], and the range parameter pairs [0,16], [30,2] and [200,32] are determined as the initial historical sequence number information.

[0059] Through the embodiments of the present application, the hierarchical storage structure divides the entire target sequence number range into multiple hierarchical intervals, enabling rapid location of the hierarchical level to which a message belongs based on its sequence number, thereby significantly reducing the scope and time required to traverse historical message records and improving message processing speed. The use of range parameters further optimizes the storage of historical messages. By using a combination of start and continuation parameters to represent the coverage or position of historical message sequence numbers within the target hierarchical interval, storage space is effectively compressed, reducing chip resource consumption.

[0060] In the technical solution provided in the above step S208, controlling the transmission of the target message according to the initial historical sequence number information and the target message sequence number may include controlling the target message to be prohibited from being transmitted to the message receiving end, or controlling the target message to be transmitted to the message receiving end.

[0061] In an exemplary embodiment, the transmission of the target message can be controlled according to the initial historical sequence number information and the target message sequence number in the following manner, but not limited to: detecting whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information; if the target message sequence number falls within the coverage range indicated by the initial historical sequence number information, controlling the target message to be prohibited from being transmitted to the message receiving end; if the target message sequence number does not fall within the coverage range indicated by the initial historical sequence number information, controlling the target message to be transmitted to the message receiving end, and updating the initial historical sequence number information according to the target message sequence number.

[0062] Optionally, in this embodiment, when the target message sequence number falls within the coverage range indicated by the initial historical sequence number information, it indicates that the message receiving end has received the message corresponding to the target message sequence number, and the target message is a duplicate message; when the target message sequence number falls within the coverage range indicated by the initial historical sequence number information, it indicates that the message receiving end has not yet received the message corresponding to the target message sequence number.

[0063] Optionally, in this embodiment, the transmission of the control target message can be performed at the message receiving end, that is, prohibiting the control target message from being transmitted to the message receiving end is equivalent to the message receiving end not receiving the target message, and controlling the target message to be transmitted to the message receiving end is equivalent to the message receiving end receiving the target message.

[0064] In an exemplary embodiment, it is possible but not limited to detect whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information in the following manner: obtain multiple range parameter pairs included in the initial historical sequence number information, wherein each range parameter pair includes a pair of starting parameters and continuous parameters with a corresponding relationship, and each range parameter pair including the continuous parameter that is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the starting parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers. The number of historical message sequence numbers thereafter, each range parameter pair in which the continuous parameter is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; when the target message sequence number is a 16-bit binary number, the last 8 bits of the target message sequence number are truncated to obtain a second truncated sequence number; when the second truncated sequence number is the same as the reference starting parameter included in any reference range parameter pair in the multiple range parameter pairs, or when the second truncated sequence number is greater than the reference starting parameter and less than or equal to the sum of the reference starting parameter and the reference continuous parameter in the reference range parameter pair, it is determined that the target message sequence number falls within the coverage range indicated by the initial historical sequence number information.

[0065] Optionally, in this embodiment, Figure 4 is a schematic diagram of an optional method for detecting whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information according to an embodiment of the present application, such as Figure 4As shown, if the target message sequence number is 00000000 00011110, which corresponds to decimal 30, then the target level interval to which the target message sequence number belongs is Level 0, and the partial sequence number range covered is [0,255]. The multiple range parameter pairs included in the initial historical sequence number information are [0,16], [30,2], and [200,32]. The last 8 bits of the target message sequence number are intercepted, and the second intercepted sequence number is 00011110, which corresponds to decimal 30, which is the same as the reference start parameter 30 included in the reference range parameter pair [30,2]. It is determined that the target message sequence number 00000000 00011110 falls within the coverage range indicated by the initial historical sequence number information; if the target message sequence number is 00000000 The value is 11010011, which corresponds to 211 in decimal. The target level interval of the target message sequence number is Level 0, and the covered sequence number range is [0, 255]. The initial historical sequence number information includes multiple range parameter pairs: [0, 16], [30, 2], and [200, 32]. The last 8 bits of the target message sequence number are truncated, resulting in a second truncated sequence number of 11010011, which corresponds to 211 in decimal. This value is greater than the reference start parameter 200 included in the reference range parameter pair [200, 32] and less than the sum of the reference start parameter 200 and the reference continuous parameter 32 in the reference range parameter pair [200, 32], which is 232. Therefore, the target message sequence number 00000000 00011110 is determined to fall within the coverage range indicated by the initial historical sequence number information.

[0066] In an exemplary embodiment, the initial historical sequence number information may be updated according to the target message sequence number in the following manner, but is not limited to: when the initial historical sequence number information includes multiple range parameter pairs, obtaining a range minimum value and a range maximum value corresponding to each range parameter pair, and detecting an absolute value of a difference between the target message sequence number and the range minimum value and the range maximum value corresponding to each range parameter pair to obtain a reference difference value, wherein the range minimum value is the start parameter included in each range parameter pair, and the range maximum value is the sum of the start parameter and the continuous parameter included in each range parameter pair; when it is detected that the reference difference values are all greater than 1, adding the target range parameter pair corresponding to the target message sequence number to the initial historical sequence number information to obtain reference historical sequence number information, wherein the target start parameter included in the target range parameter pair is the same as the second truncation sequence number, and the target continuous parameter included in the target range parameter pair is 0; when it is detected that the reference difference value equals 1 between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs, adjusting the candidate range parameter pair to obtain the reference historical sequence number information.

[0067] Optionally, in this embodiment, taking the range parameter pair [30, 2] as an example, the minimum range value is the starting parameter 30 included in the range parameter pair, and the maximum range value is the sum of the starting parameter 30 and the continuous parameter 2 included in the range parameter pair [30, 2], that is, the maximum range value is 32.

[0068] Optionally, in this embodiment, it is assumed that the current initial historical sequence number information contains the following three range parameter pairs: [0, 16], [30, 2], and [200, 32], and the target message sequence number is 00000000 11111011, which corresponds to 251 in decimal. First, the target message sequence number 251 is not within the ranges [0,16], [30,32] and [200,232] covered by the range parameter pairs [0,16], [30,2] and [200,32]. That is, it is determined that the target message sequence number 251 does not fall within the coverage range indicated by the initial historical sequence number information. Secondly, for [0,16], the minimum range value is 0, the maximum range value is 16, and the reference difference values are |251-0|=251 and |251-16|=235, both greater than 1; for [30,2], the minimum range value is 30, the maximum range value is 32, the reference difference values are |251-30|=221 and |251-32|=219, also greater than 1. Greater than 1; for [200,32], the minimum range value is 200, the maximum range value is 232, the reference difference values are |251-200|=51, |251-232|=19, and the reference differences are also greater than 1. The target range parameter pair corresponding to the target message sequence number is added to the initial historical sequence number information. The target start parameter included in the target range parameter pair is the same as the second interception sequence number, that is, the target start parameter is 251, and the target continuous parameter included in the target range parameter pair is 0, that is, the target range parameter pair is [251,0]. The reference historical sequence number information includes four range parameter pairs: [0,16], [30,2], [200,32], and [251,0].

[0069] In an exemplary embodiment, the reference historical sequence number information can be obtained by, but is not limited to, adjusting the candidate range parameter pair in the following manner when it is detected that the reference difference between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs is equal to 1: when the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the i-th range maximum value included in the i-th range parameter pair among the N range parameter pairs is equal to 1, adjusting the i-th range parameter included in the i-th range parameter pair to the reference historical sequence number information. The continuous parameter is added by 1 to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pair includes the i-th range parameter pair; when the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the j-th range minimum value included in the j-th range parameter pair among the N range parameter pairs is equal to 1, the j-th starting parameter included in the j-th range parameter pair is subtracted by 1, and the j-th range parameter is added. Add 1 to the j-th continuous parameter included to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pair includes the j-th range parameter pair; the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and the k-th range maximum value included in the k-th range parameter pair among the N range parameter pairs, and the reference difference between the t-th range minimum value included in the t-th range parameter pair are equal. In the case of 1, the kth continuous parameter included in the kth range parameter pair is changed to the difference between the tth range maximum value included in the tth range parameter pair and the kth range minimum value included in the kth range parameter pair, and the tth range parameter pair is deleted from the initial historical sequence number information to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, k is not equal to t, and k and t are both integers greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the kth range parameter pair and the tth range parameter pair.

[0070] Optionally, in this embodiment, taking the target message sequence number 33 as an example, if the initial historical sequence number information includes three range parameter pairs [0,16], [30,2] and [200,32], and it is detected that the reference difference between the target message sequence number 33 and the second range maximum value 32 included in the second range parameter pair [30,2] among the three range parameter pairs is equal to 1, the second continuous parameter 2 included in the second range parameter pair [30,2] is added by 1, that is, the candidate range parameter pair [30,2] is adjusted to [30,3], and the reference historical sequence number information includes the range parameter pairs [0,16], [30,3] and [200,32].

[0071] Optionally, in this embodiment, taking the target message sequence number 29 as an example, the initial historical sequence number information includes three range parameter pairs [0,16], [30,2] and [200,32], and it is detected that the reference difference between the target message sequence number 29 and the second range minimum value 30 included in the second range parameter pair [30,2] of the three range parameter pairs is equal to 1, the second starting parameter 30 included in the second range parameter pair [30,2] is subtracted by 1, and the second continuous parameter 2 included in the second range parameter pair [30,2] is added by 1, that is, the candidate range parameter pair [30,2] is adjusted to [29,3], and the reference historical sequence number information includes the range parameter pairs [0,16], [29,3] and [200,32].

[0072] Optionally, in this embodiment, taking the target message sequence number as 33 as an example, when the initial historical sequence number information includes three range parameter pairs [0, 16], [30, 2], and [34, 60], and it is detected that the reference difference between the target message sequence number 33 and the second range maximum value 32 included in the second range parameter pair [30, 2] of the three range parameter pairs, and the reference difference between the third range minimum value 34 included in the third range parameter pair [34, 60] are both equal to 1, the second range parameter pair [30, 2] is replaced by [34, 60]. The second continuous parameter 2 included is changed to the difference between the third range maximum value 94 included in the third range parameter pair [34,60] and the second range minimum value 30 included in the second range parameter pair [30,2], that is, 64, and the third range parameter pair [34,60] is deleted from the initial historical sequence number information, that is, the candidate range parameter pair [30,2] is adjusted to [30,64], and the range parameter pair [34,60] is deleted, and the reference historical sequence number information includes the range parameter pairs [0,16] and [30,64].

[0073] In an exemplary embodiment, after the candidate range parameter pair is adjusted to obtain the reference historical sequence number information, one of the following methods may be included but is not limited to: when the coverage range indicated by the reference historical sequence number information is equal to the target sequence number range, the reference historical sequence number information is cleared; after the reference historical sequence number information is adjusted, timing is started, and when the timing duration reaches a preset duration, the reference historical sequence number information is cleared.

[0074] Optionally, in this embodiment, the coverage range indicated by the reference historical sequence number information is equivalent to the number of messages currently received, and the target sequence number range is equivalent to the maximum number of messages MaxSeq. When the coverage range indicated by the reference historical sequence number information is equal to the target sequence number range, it means that the number of messages received is equal to MaxSeq, and at this time, all historical run-length coding records are cleared. The next round of message deduplication begins; or, when the first duration (i.e., the timing duration) is greater than the first threshold duration (i.e., the preset duration), all historical sequence number information is cleared and the next round of message transmission begins, wherein the first duration is used to indicate the duration of the target message that is not yet transmitted to the message receiving end, and the first threshold duration is used to indicate the maximum duration of the target message that is not yet transmitted to the message receiving end.

[0075] In order to better understand the transmission process of the above-mentioned message, the transmission process of the above-mentioned message is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0076] Given that existing technologies are unable to accurately deduplicate messages when messages are severely out of order, this application proposes a precise deduplication scheme based on the VRA algorithm, namely the message transmission method in the above embodiment, which can effectively handle the problem of under- or over-receiving messages when messages are out of order, ensuring the reliability of message transmission. Specifically, this scheme may include the following aspects.

[0077] 1. Maximize the historical window size:

[0078] Set the specification of the historical window (equivalent to the target sequence number range) to MaxSeq (Max Sequence, maximum sequence number), that is, the maximum range allowed for the sequence numbers of the messages sent by the message sender. At this time, only the historical window is used, and all Seqs will be recorded. Messages are selected based on the historical window records (equivalent to the initial historical sequence number information). Figure 5 is a schematic diagram of an optional historical window specification maximization according to an embodiment of the present application, such as Figure 5 As shown, the history window can record the historical message sequence numbers of the historical messages that have completed transmission ranging from 0 to MaxSeq-1.

[0079] 2. Stroke length encoding:

[0080] Maximizing the historical window size also increases the chip resources required. Assuming a MaxSeq of 65536, the related art method of using VRA for message transmission requires 65536 bits, or 4KB, of chip resources to store all the historical records of each Sequence. To reduce excessive chip resource usage, this solution uses run-length encoding (equivalent to range parameter pairs) to compress the historical record storage space.

[0081] Run-length encoding has two fields: the starting parameter base and the continuous parameter offset. These two fields are used to represent all records in the interval [base, base+offset] (equivalent to the historical message sequence number). Figure 6 is a schematic diagram of an optional method of using run-length encoding to store historical message sequence numbers according to an embodiment of the present application, such as Figure 6 As shown, if there are records 1, 2, ... 511, 512, 512 bits are needed to store them using bitmap; if run-length encoding is used, base = 1, offset = 511, at least 1 + 9 = 10 bits are needed to represent all the records.

[0082] 3. Historical Record Storage:

[0083] Although packets may not arrive in order, all Seqs are recorded once during a complete round of packet deduplication if there is no packet loss. Historical records can ultimately be optimized to base = 0, offset = 65535 using run-length encoding. If there is packet loss, an additional run-length encoding value can be added to store the record. For example, base = 0, offset = 32767; base = 32769, offset = 32766 indicates that packet seq = 32768 was lost. In this case, representing one set of base and offset may require 16 + 16 = 32 bits of data. When the number of packet losses is less than 65536 / 32 = 2048, the space occupied by run-length encoding to store all historical records (equivalent to historical message sequence numbers) is provided by the full history space bitmap. That is, if the total number of packet losses remains below 2048, the additional storage space added by RLE (Run-Length Encoding) (32 bits for each lost packet) does not exceed the 65536 bits (4KB) required by the bitmap storage method. However, because messages do not necessarily arrive in order, every time an out-of-order message arrives, 32 bits of space must be applied for to store the run-length code value. In cases where the out-of-order situation is more serious, more space will be required for the entire message deduplication process, and when searching for historical records, it may be necessary to traverse all run-length code values to determine whether the target message has been received. The more run-length code values there are, the longer the search time will be required. In order to reduce the storage space used in the message deduplication process and speed up the historical record search, this solution further adopts a layered approach to optimize the storage of historical message sequence numbers. The number of layers (equivalent to the level interval) can be defined by yourself. Figure 7 is a schematic diagram of an optional hierarchical storage structure according to an embodiment of the present application, such as Figure 7As shown, taking the target sequence number range as an example, the 65536 historical record space (equivalent to the storage space corresponding to the target sequence number range) is divided into 256 layers, each layer has 256 records. In the layered manner, the 16-bit Seq can be decomposed into high 8 bits and low 8 bits. The high 8 bits indicate the level, and the low 8 bits are used for run length encoding. The base and offset are used together to represent continuous records within a range. The level interval Level 0 records the range parameter pairs [0,16], [30,2], [200,32], the level interval Level 1 records the range parameter pairs [10,20], [50,0], and the level interval Level 255 records the range parameter pair [15,30]. The coverage range of historical message sequence numbers in the hierarchical interval is [0,16], [30,32], [200,232], [266,286],

[306] , and [65295,65325]. Among them, [266,286] is calculated by [256*1+10,256*1+10+20],

[306] is calculated by [256*1+50], and [65295,65325] is calculated by [256*255+15,256*255+15+30].

[0084] By using a hierarchical storage structure, the run-length code that originally required 32 bits to represent now only requires 16 bits, reducing the storage space consumption during message deduplication. The original search required traversing all run-length codes, but now only needs to traverse the corresponding hierarchical interval, speeding up the search speed.

[0085] 4. Historical record search:

[0086] Using the hierarchical run-length encoding storage method, a Seq needs to first determine the level it belongs to (equivalent to the target level) in the history window, and then traverse all run-length encoding records (equivalent to the initial historical sequence number information). If it is within the range of the run-length encoding records, the search is successful, otherwise the search fails.

[0087] Figure 8 is a schematic diagram of an optional method of searching for a target message sequence number in initial historical information according to an embodiment of the present application, such as Figure 8As shown in the figure, assuming that the target message sequence number Seq to be searched is 270, the corresponding 16-bit binary is 00000001 00001110, the upper 8 bits (equivalent to the first 8 bits) correspond to the decimal value 1, indicating that the target level is level 1, and the lower 8 bits (equivalent to the last eight bits) correspond to the decimal value 14, indicating that the number to be searched in the run-length encoding record in level 1 is 14. The range parameter pairs included in level 1 are [10, 20] and [50, 0]. Because the detection target message sequence number 14 is greater than the minimum value 10 corresponding to the range parameter pair [10, 20] and less than the maximum value 30 corresponding to the range parameter pair [10, 20], it means that 14 is in the initial historical sequence number information and the search is successful.

[0088] 5. Historical record update:

[0089] When the lookup fails, the run-length encoding record needs to be updated. Based on the run-length encoding record and Seq in the current level, the update operation is divided into the following scenarios:

[0090] 1. New application space is required to store records. Figure 9 This is a schematic diagram of an optional embodiment of the present application that requires a new application space to store the target message sequence number, such as Figure 9 As shown in the figure, assuming that the target message sequence number Seq to be searched is 100, the corresponding 16-bit binary is 00000000 01100100, the upper 8 bits are 0, indicating level 0, and the lower 8 bits are 100, indicating that the target message to be searched in the run-length encoding (equivalent to the range parameter pair) record in level 0 is 100. After traversing all run-length encoding records (equivalent to the initial historical information), it is found that 100 is not in the record, and the difference between 100 and the maximum and minimum range values in all current run-length encoding records is greater than 1. In this case, space needs to be allocated to store the record, that is, the target range parameter pair [100,0] corresponding to the target message sequence number 14 is added to the run-length encoding record.

[0091] 2. Only the offset needs to be updated. Figure 10 This is a schematic diagram of an optional embodiment of the present application in which only continuous parameters need to be updated, such as Figure 10As shown in the figure, assume the target message sequence number Seq is 233, and the corresponding 16-bit binary representation is 00000000 11101001. The upper 8 bits are 0, indicating level 0, and the lower 8 bits are 233, indicating that the target message in the run-length coded record at level 0 is 233. After traversing all run-length coded records, it is found that 233 is not found. However, the difference between 233 and the maximum value of 232 in the range of base = 200, offset = 32 in all current run-length coded records is equal to 1. Therefore, only offset = 33 needs to be updated. In other words, the candidate range parameter pair [200, 32] is adjusted to [200, 33].

[0092] 3. The base and offset need to be updated. Figure 11 is a schematic diagram of an optional need to update the starting parameters and continuous parameters according to an embodiment of the present application, such as Figure 11 As shown in the figure, assume that the target message sequence number Seq is 29, and the corresponding 16-bit binary is 00000000 00011101, with the upper 8 bits being 0, indicating level 0, and the lower 8 bits being 29, indicating that the target message in the run-length encoding record at level 0 is 29. After traversing all run-length encoding records, it is found that 29 is not in the record, but the difference between 29 and the minimum value 30 in the range of all current run-length encoding records with base = 30 and offset = 2 is equal to 1. Therefore, the base needs to be updated to 29 and offset = 3, adjusting the candidate range parameter pair [30,2] to [29,3].

[0093] 4: Merging and space release of run-length encoded records. Figure 12 is a schematic diagram of an optional run-length encoding record merging and space release according to an embodiment of the present application, such as Figure 12Assume that the target message sequence number Seq to be searched is 199, and the corresponding 16-bit binary is 0000 0000 1100 0111, with the upper 8 bits being 0, indicating level 0, and the lower 8 bits being 199, indicating that the target message in the run-length coding record at level 0 is 199. After traversing all run-length coding records, it is found that 199 is not in the record, but the difference between it and the range maximum value 198 in all current run-length coding records with base = 30, offset = 168 is equal to 1, and the difference between it and the range minimum value 200 in the run-length coding record with base = 200, offset = 32 is also equal to 1. These two run-length coding records need to be merged, and the space in the run-length coding record with base = 200, offset = 32 needs to be freed up. That is, the candidate range parameter pair [30, 168] is adjusted to [30, 202], and the range parameter pair [200, 32] is deleted.

[0094] 6. Historical record refresh:

[0095] After a round of Seq deduplication, the historical records (equivalent to the initial historical sequence number information) need to be refreshed to the initial state to ensure the normal operation of the next round of deduplication. This solution provides two refresh methods: active refresh and passive refresh.

[0096] Active refresh counts received messages. When the number of received messages reaches MaxSeq, a refresh is performed, clearing all run-length encoding records. This starts the next round of message deduplication.

[0097] In the passive refresh mode, a timer is set. When no message is received within a period of time (equivalent to the first time threshold), that is, the history record window is not updated within this period of time, it will be refreshed.

[0098] Through the message transmission method provided by this solution, when TSN network messages are severely out of order, the VRA historical window specifications are maximized to store all historical Seqs, and the chip resources consumed by expanding the historical window specifications are reduced through a hierarchical storage structure and run-length encoding. This achieves accurate deduplication of messages and ensures the reliability of message transmission.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0100] Figure 13 is a structural block diagram of a message transmission device according to an embodiment of the present application; Figure 13 Shown, including:

[0101] A first acquisition module 1002 is configured to acquire a target message sequence number of a target message currently to be transmitted to a message receiving end, wherein the target message sequence number is used to indicate the order in which the target message is sent from a message sending end;

[0102] a positioning module 1004 configured to locate a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing the target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being the maximum range allowed to be covered by the message sequence numbers of messages sent by the message sender;

[0103] A second acquisition module 1006 is configured to acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval;

[0104] The control module 1008 is configured to control the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

[0105] Through the above embodiment, a hierarchical storage structure is obtained by dividing the target sequence number range into multiple hierarchical intervals, and the target hierarchical interval to which the target message sequence number belongs is located from the hierarchical storage structure. Since the initial historical sequence number information records the coverage of the historical message sequence numbers of the historical messages that have completed the transmission between the message sending end and the message receiving end in the target hierarchical interval, that is, the historical message sequence numbers of all historical messages that have completed the transmission are stored in each level, so according to the initial historical sequence number information and the target message sequence number, it is possible to accurately determine whether the target message is a new message or a message that has been received, and then control the transmission of the message, effectively avoiding repeated reception or omission of the message. The above technical solution is adopted to solve the problems of low reliability of message transmission and large storage resource occupation in the related technology, and achieve the technical effect of improving the reliability of message transmission.

[0106] In an exemplary embodiment, the positioning module includes:

[0107] an interception unit, configured to intercept the first 8 bits of the target message sequence number when the target message sequence number is a 16-bit binary number, to obtain a first interception sequence number;

[0108] a conversion unit, configured to convert the first truncated serial number from binary to decimal to obtain a first value;

[0109] The first determining unit is configured to determine the hierarchical interval of the first value in the hierarchical storage structure as the target hierarchical interval.

[0110] In an exemplary embodiment, the second acquisition module includes:

[0111] an acquisition unit, configured to acquire a plurality of range parameter pairs recorded in the target hierarchical interval, wherein each range parameter pair includes a pair of a start parameter and a continuous parameter having a corresponding relationship, and each range parameter pair including the continuous parameter being not 0 is used to indicate a coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate a position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair including the continuous parameter being 0 is used to indicate a position of a single historical message sequence number in the target hierarchical interval;

[0112] The second determining unit is configured to determine a plurality of the range parameter pairs as the initial historical sequence number information.

[0113] In an exemplary embodiment, the control module includes:

[0114] a detection unit, configured to detect whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information;

[0115] a control unit, configured to control the target message to be prohibited from being transmitted to the message receiving end when the target message sequence number falls within the coverage range indicated by the initial historical sequence number information;

[0116] A processing unit is used to control the transmission of the target message to the message receiving end when the target message sequence number does not fall within the coverage range indicated by the initial historical sequence number information, and to update the initial historical sequence number information according to the target message sequence number.

[0117] In an exemplary embodiment, the detection unit is configured to:

[0118] Obtain multiple range parameter pairs included in the initial historical sequence number information, wherein each range parameter pair includes a pair of start parameter and continuous parameter having a corresponding relationship, each range parameter pair including the continuous parameter that is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair including the continuous parameter that is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval;

[0119] When the target message sequence number is a 16-bit binary number, intercepting the last 8 bits of the target message sequence number to obtain a second intercepted sequence number;

[0120] When the second truncation sequence number is the same as the reference starting parameter included in any one of the multiple range parameter pairs, or when the second truncation sequence number is greater than the reference starting parameter and less than or equal to the sum of the reference starting parameter and the reference continuous parameter in the reference range parameter pair, it is determined that the target message sequence number falls within the coverage range indicated by the initial historical sequence number information.

[0121] In an exemplary embodiment, the processing unit is configured to:

[0122] In a case where the initial historical sequence number information includes a plurality of range parameter pairs, obtaining a range minimum value and a range maximum value corresponding to each range parameter pair, and detecting an absolute value of a difference between the target message sequence number and the range minimum value and the range maximum value corresponding to each range parameter pair to obtain a reference difference value, wherein the range minimum value is the starting parameter included in each range parameter pair, and the range maximum value is the sum of the starting parameter and the continuous parameter included in each range parameter pair;

[0123] When it is detected that the reference difference values are all greater than 1, adding the target range parameter pair corresponding to the target message sequence number to the initial historical sequence number information to obtain reference historical sequence number information, wherein the target start parameter included in the target range parameter pair is the same as the second interception sequence number, and the target continuity parameter included in the target range parameter pair is 0;

[0124] In the case where it is detected that there is a reference difference value equal to 1 between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs, the candidate range parameter pair is adjusted to obtain the reference historical sequence number information.

[0125] In an exemplary embodiment, the processing unit is further configured to:

[0126] The step of adjusting the candidate range parameter pair to obtain the reference historical sequence number information when detecting that the reference difference equals 1 exists between the target message sequence number and a candidate range parameter pair among the plurality of range parameter pairs includes:

[0127] When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the i-th range maximum value included in the i-th range parameter pair among the N range parameter pairs is equal to 1, the reference historical sequence number information is obtained by adding 1 to the i-th continuous parameter included in the i-th range parameter pair, where N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the i-th range parameter pair;

[0128] When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the j-th range minimum value included in the j-th range parameter pair among the N range parameter pairs is equal to 1, subtract 1 from the j-th start parameter included in the j-th range parameter pair, and add 1 to the j-th continuous parameter included in the j-th range parameter pair to obtain the reference historical sequence number information, where N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the j-th range parameter pair;

[0129] When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and the kth range maximum value included in the kth range parameter pair among the N range parameter pairs, and the reference difference between the tth range minimum value included in the tth range parameter pair, are both equal to 1, the kth continuous parameter included in the kth range parameter pair is changed to the difference between the tth range maximum value included in the tth range parameter pair and the kth range minimum value included in the kth range parameter pair, and the tth range parameter pair is deleted from the initial historical sequence number information to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, k is not equal to t, and both k and t are integers greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the kth range parameter pair and the tth range parameter pair.

[0130] In an exemplary embodiment, after adjusting the candidate range parameter pair to obtain the reference history sequence number information, the processing unit is further configured to do one of the following:

[0131] When the coverage range indicated by the reference historical sequence number information is equal to the target sequence number range, clearing the reference historical sequence number information;

[0132] The timing starts after the reference history sequence number information is adjusted, and when the timing duration reaches a preset duration, the reference history sequence number information is cleared.

[0133] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0134] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0135] S302, obtaining a target message sequence number of a target message to be transmitted to the message receiving end, wherein the target message sequence number is used to indicate the order in which the target message is sent from the message sending end;

[0136] S304: Locate a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing the target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being the maximum range allowed to be covered by the message sequence numbers of messages sent by the message sender;

[0137] S306: Acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval;

[0138] S308: Control the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

[0139] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0140] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0141] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0142] S402, obtaining a target message sequence number of a target message to be transmitted to the message receiving end, wherein the target message sequence number is used to indicate the order in which the target message is sent from the message sending end;

[0143] S404: Locate a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing the target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being the maximum range allowed to be covered by the message sequence numbers of messages sent by the message sender;

[0144] S406: Acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval;

[0145] S408: Control the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

[0146] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0147] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0148] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0149] The above is only a preferred embodiment 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 message transmission method, characterized in that: include: Obtaining a target message sequence number of a target message to be currently transmitted to the message receiving end, wherein the target message sequence number is used to indicate a sending order of the target message from the message sending end; Locating a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing a target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being a maximum range allowed to be covered by message sequence numbers of messages sent by the message sender; Acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval; The transmission of the target message is controlled according to the initial historical sequence number information and the target message sequence number.

2. The method according to claim 1, characterized in that The step of locating the target hierarchical interval to which the target message sequence number belongs from the hierarchical storage structure includes: When the target message sequence number is a 16-bit binary number, intercepting the first 8 bits of the target message sequence number to obtain a first intercepted sequence number; Converting the first truncated serial number from binary to decimal to obtain a first value; The hierarchical interval of the first value in the hierarchical storage structure is determined as the target hierarchical interval.

3. The method according to claim 1, characterized in that The obtaining of the initial historical sequence number information corresponding to the target level interval includes: Obtain multiple range parameter pairs recorded in the target hierarchical interval, wherein each range parameter pair includes a pair of start parameter and continuous parameter having a corresponding relationship, and each range parameter pair including the continuous parameter that is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, and the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair including the continuous parameter that is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; A plurality of the range parameter pairs are determined as the initial historical sequence number information.

4. The method according to claim 1, wherein The controlling the transmission of the target message according to the initial historical sequence number information and the target message sequence number includes: Detecting whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information; When the target message sequence number falls within the coverage range indicated by the initial historical sequence number information, controlling the target message to be prohibited from being transmitted to the message receiving end; In a case where the target message sequence number does not fall within the coverage range indicated by the initial historical sequence number information, the target message is controlled to be transmitted to the message receiving end, and the initial historical sequence number information is updated according to the target message sequence number.

5. The method according to claim 4, characterized in that The detecting whether the target message sequence number falls within the coverage range indicated by the initial historical sequence number information includes: Obtain multiple range parameter pairs included in the initial historical sequence number information, wherein each range parameter pair includes a pair of start parameter and continuous parameter having a corresponding relationship, each range parameter pair including the continuous parameter that is not 0 is used to indicate the coverage range of a continuous segment of the historical message sequence numbers in the target hierarchical interval, the start parameter is used to indicate the position of the first historical message sequence number in a continuous segment of the historical message sequence numbers in the target hierarchical interval, the continuous parameter is used to indicate the number of historical message sequence numbers that follow the first historical message sequence number in a continuous segment of the historical message sequence numbers, and each range parameter pair including the continuous parameter that is 0 is used to indicate the position of a single historical message sequence number in the target hierarchical interval; When the target message sequence number is a 16-bit binary number, intercepting the last 8 bits of the target message sequence number to obtain a second intercepted sequence number; When the second truncation sequence number is the same as the reference starting parameter included in any one of the multiple range parameter pairs, or when the second truncation sequence number is greater than the reference starting parameter and less than or equal to the sum of the reference starting parameter and the reference continuous parameter in the reference range parameter pair, it is determined that the target message sequence number falls within the coverage range indicated by the initial historical sequence number information.

6. The method according to claim 5, characterized in that The updating of the initial historical sequence number information according to the target message sequence number includes: In a case where the initial historical sequence number information includes a plurality of range parameter pairs, obtaining a range minimum value and a range maximum value corresponding to each range parameter pair, and detecting an absolute value of a difference between the target message sequence number and the range minimum value and the range maximum value corresponding to each range parameter pair to obtain a reference difference value, wherein the range minimum value is the starting parameter included in each range parameter pair, and the range maximum value is the sum of the starting parameter and the continuous parameter included in each range parameter pair; When it is detected that the reference difference values are all greater than 1, adding the target range parameter pair corresponding to the target message sequence number to the initial historical sequence number information to obtain reference historical sequence number information, wherein the target start parameter included in the target range parameter pair is the same as the second interception sequence number, and the target continuity parameter included in the target range parameter pair is 0; In the case where it is detected that there is a reference difference value equal to 1 between the target message sequence number and a candidate range parameter pair among the multiple range parameter pairs, the candidate range parameter pair is adjusted to obtain the reference historical sequence number information.

7. The method according to claim 6, characterized in that The step of adjusting the candidate range parameter pair to obtain the reference historical sequence number information when detecting that the reference difference equals 1 exists between the target message sequence number and a candidate range parameter pair among the plurality of range parameter pairs includes: When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the i-th range maximum value included in the i-th range parameter pair among the N range parameter pairs is equal to 1, the reference historical sequence number information is obtained by adding 1 to the i-th continuous parameter included in the i-th range parameter pair, where N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the i-th range parameter pair; When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and only the j-th range minimum value included in the j-th range parameter pair among the N range parameter pairs is equal to 1, subtract 1 from the j-th start parameter included in the j-th range parameter pair, and add 1 to the j-th continuous parameter included in the j-th range parameter pair to obtain the reference historical sequence number information, where N is an integer greater than or equal to 1, i is an integer greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the j-th range parameter pair; When the initial historical sequence number information includes N range parameter pairs, and it is detected that the reference difference between the target message sequence number and the kth range maximum value included in the kth range parameter pair among the N range parameter pairs, and the reference difference between the tth range minimum value included in the tth range parameter pair, are both equal to 1, the kth continuous parameter included in the kth range parameter pair is changed to the difference between the tth range maximum value included in the tth range parameter pair and the kth range minimum value included in the kth range parameter pair, and the tth range parameter pair is deleted from the initial historical sequence number information to obtain the reference historical sequence number information, wherein N is an integer greater than or equal to 1, k is not equal to t, and both k and t are integers greater than or equal to 1 and less than or equal to N, and the candidate range parameter pairs include the kth range parameter pair and the tth range parameter pair.

8. The method according to claim 6, characterized in that After adjusting the candidate range parameter pair to obtain the reference historical sequence number information, the method further includes one of the following: When the coverage range indicated by the reference historical sequence number information is equal to the target sequence number range, clearing the reference historical sequence number information; The timing starts after the reference history sequence number information is adjusted, and when the timing duration reaches a preset duration, the reference history sequence number information is cleared.

9. A message transmission device, characterized in that: include: A first acquisition module is used to obtain a target message sequence number of a target message to be transmitted to a message receiving end, wherein the target message sequence number is used to indicate the order in which the target message is sent from a message sending end; a positioning module, configured to locate a target hierarchical interval to which the target message sequence number belongs from a hierarchical storage structure, wherein the hierarchical storage structure is obtained by dividing a target sequence number range into a plurality of hierarchical intervals, each hierarchical interval covering a portion of the target sequence number range, the target sequence number range being the maximum range allowed to be covered by the message sequence numbers of messages sent by the message sender; a second acquisition module, configured to acquire initial historical sequence number information corresponding to the target hierarchical interval, wherein the initial historical sequence number information is used to indicate a coverage range of historical message sequence numbers of historical messages that have completed transmission between the message sending end and the message receiving end in the target hierarchical interval; A control module is used to control the transmission of the target message according to the initial historical sequence number information and the target message sequence number.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 8 when executed.

11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.