Transmission method and device, electronic equipment, storage medium and program product
By using UDP protocol, bitmap control and big data fragmentation technology during the transmission process, codes are added to different types of messages and message retransmission is performed, solving the reliability and efficiency of the traditional TCP protocol in weak network environments. problem, enabling efficient file transfer.
Patent Information
- Application Number
- CN202410731881.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-10
AI Technical Summary
Traditional file transfer technology based on the TCP protocol has problems with unstable connections, high latency and data packet loss in weak network environments, resulting in low reliability and low efficiency of file transfer, especially poor performance in large-capacity data transfer.
It uses UDP protocol, bitmap control and big data fragmentation technology to add codes to different types of messages for transmission, and resends them at the receiving end according to lost messages and preset resend strategies to ensure the reliability of transmission. and efficiency.
In weak network environments, it improves the efficiency of file and information transmission, improves user experience, ensures the reliability of message transmission, and is suitable for large-capacity data transmission scenarios.
Smart Images

Figure CN118631397A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent network connection technology, and in particular to a transmission method, device, electronic equipment, storage medium and program product. Background Art
[0002] The File Transfer Protocol (FTP) is a commonly used file transfer technology. Its underlying transmission uses TCP (Transmission Control Protocol) communication. Therefore, the client and server must go through a "three-way handshake" process before establishing a connection to ensure the reliability of the connection. In a weak network environment, traditional TCP-based file transfer technologies (such as FTP) face problems including unstable connections, high latency, and high data packet loss. For example, a weak network environment causes frequent handshakes to establish connections, resulting in latency; weak network packet loss causes repeated data transmission, resulting in bandwidth waste and fluctuations in communication efficiency. These problems seriously affect the reliability and efficiency of file transfers.
[0003] In the related art, the data frame to be sent is usually split into N data, and header information is added before the data to determine the loss of the data frame during the transmission process, and the lost data is requested to be retransmitted based on the header information, thereby ensuring the real-time and reliability of data transmission in a weak network environment.
[0004] However, the packet header information of the above-mentioned technical means is relatively complex, and the packet header information accounts for a large proportion during the transmission process, so the transmission efficiency is relatively low. When there is a need to transmit large amounts of data and fast transmission, it is difficult to meet the expected requirements and needs to be solved urgently. Summary of the invention
[0005] The present invention provides a transmission method, device, electronic device, storage medium and program product to solve the problem that packet header information accounts for a large proportion and the transmission efficiency is relatively low in the related technology. Based on technical means such as UDP (User Datagram Protocol), bitmap control and big data segmentation, the reliability of message transmission can still be guaranteed in a weak network environment, the transmission efficiency of files and information is optimized, and the user experience is improved.
[0006] To achieve the above object, a first embodiment of the present invention provides a transmission method, comprising the following steps:
[0007] Determine the current message to be transmitted;
[0008] Determine a message adding code according to the type of the current message to be transmitted, add the message adding code to the current message to be transmitted, obtain a target transmission message, and send the target transmission message to a receiving end;
[0009] The receiving end receives a confirmation message sent based on the target transmission message, and when there is a lost message in the confirmation message, resends the lost message based on the lost message and a preset message resending strategy until the transmission is completed.
[0010] According to one embodiment of the present invention, after determining the current message to be transmitted, the method further includes:
[0011] Determine whether the current message to be transmitted meets the preset fragmentation processing condition;
[0012] If the current message to be transmitted meets the preset fragment processing condition, preprocessing the current message to be transmitted is performed, and the number of fragments of the current message to be transmitted after preprocessing and the bytes of each fragment are calculated;
[0013] After completing the fragmentation based on the number of fragments and the bytes of each fragment, a fragment sequence number is added to each fragment to obtain a fragment message.
[0014] According to an embodiment of the present invention, the determining whether the current message to be transmitted meets a preset fragmentation processing condition further includes:
[0015] Determine whether the current message to be transmitted is larger than a preset byte;
[0016] If the current message to be transmitted is larger than the preset bytes, it is determined that the current message to be transmitted meets the preset fragmentation processing condition.
[0017] According to an embodiment of the present invention, the determining the message adding code according to the type of the current message to be transmitted includes:
[0018] If the type of the current message to be transmitted is a data message, the message addition code is an SN sequence number;
[0019] If the type of the current message to be transmitted is an information message, the message addition code is the First SN sequence number and the Last SN sequence number;
[0020] If the type of the current message to be transmitted is a confirmation message, the message addition code is a bitmap.
[0021] According to an embodiment of the present invention, the reissuing the lost message based on the lost message and a preset message reissuing strategy includes:
[0022] Calculate the message to be resent according to the lost message;
[0023] Send the message to be resent to the sending end.
[0024] According to the transmission method proposed in the embodiment of the present invention, by determining the message adding code according to the type of the current message to be transmitted, and adding the message adding code to the current message to be transmitted, the processed target transmission message is sent to the receiving end, the received target transmission message is confirmed, and after confirming that the message is lost, it is resent according to the preset message resending strategy until the transmission is completed. Therefore, by adding message adding codes to different types of messages and then transmitting them, the reliability of message transmission is still guaranteed in a weak network environment, the transmission efficiency is optimized, and the user experience is improved.
[0025] To achieve the above object, a second embodiment of the present invention provides a transmission device, comprising:
[0026] A confirmation module is used to determine the current message to be transmitted;
[0027] A sending module, used for determining a message adding code according to the type of the current message to be transmitted, adding the message adding code to the current message to be transmitted, obtaining a target transmission message, and sending the target transmission message to a receiving end;
[0028] The receiving module is used to receive the confirmation message sent by the receiving end based on the target transmission message, and when there is a lost message in the confirmation message, resend it based on the lost message and a preset message resending strategy until the transmission is completed.
[0029] According to an embodiment of the present invention, after determining the current message to be transmitted, the confirmation module further includes:
[0030] A judging unit, used to judge whether the message to be transmitted currently satisfies a preset fragmentation processing condition;
[0031] A preprocessing unit, configured to preprocess the message to be transmitted currently when the message to be transmitted currently satisfies the preset fragmentation processing condition, and calculate the number of fragments of the message to be transmitted currently after preprocessing and the bytes of each fragment;
[0032] The marking unit adds a fragment sequence number to each fragment after completing the fragmentation based on the number of fragments and the bytes of each fragment to obtain a fragment message.
[0033] According to one embodiment of the present invention, the judging unit is further configured to:
[0034] Determine whether the current message to be transmitted is larger than a preset byte;
[0035] If the current message to be transmitted is larger than the preset bytes, it is determined that the current message to be transmitted meets the preset fragmentation processing condition.
[0036] According to an embodiment of the present invention, the sending module is specifically used for:
[0037] If the type of the current message to be transmitted is a data message, the message addition code is an SN sequence number;
[0038] If the type of the current message to be transmitted is an information message, the message addition code is the First SN sequence number and the Last SN sequence number;
[0039] If the type of the current message to be transmitted is a confirmation message, the message addition code is a bitmap.
[0040] According to an embodiment of the present invention, the receiving module is specifically used for:
[0041] Calculate the message to be resent according to the lost message;
[0042] Send the message to be resent to the sending end.
[0043] According to the transmission device proposed in the embodiment of the present invention, by determining the message adding code according to the type of the current message to be transmitted, and adding the message adding code to the current message to be transmitted, the processed target transmission message is sent to the receiving end, the received target transmission message is confirmed, and after confirming that the message is lost, it is resent according to the preset message resending strategy until the transmission is completed. Therefore, by adding message adding codes to different types of messages and then transmitting them, the reliability of message transmission is still guaranteed in a weak network environment, the transmission efficiency is optimized, and the user experience is improved.
[0044] To achieve the above objectives, the third aspect of the present invention proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the transmission method as described in the above embodiments.
[0045] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the transmission method as described in the above embodiments.
[0046] To achieve the above objectives, a fifth aspect of the present invention provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the transmission method as described in the above embodiments.
[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0049] Figure 1 A flowchart of a transmission method provided according to an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the principle of a bitmap calculation method provided according to a specific embodiment of the present invention;
[0051] Figure 3 A schematic diagram of a flow chart of a transmission method provided according to a specific embodiment of the present invention;
[0052] Figure 4 A block diagram of a transmission device according to an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present invention.
[0054] Among them, 10-transmission device; 100-confirmation module, 200-sending module, 300-receiving module; 501-memory, 502-processor, 503-communication interface. DETAILED DESCRIPTION
[0055] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0056] The following describes a transmission method, device, electronic device, storage medium and program product according to an embodiment of the present invention with reference to the accompanying drawings. First, the transmission method according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0057] In view of the problem mentioned in the background technology that the packet header information accounts for a large proportion and the transmission efficiency is relatively low, the present invention provides a transmission method, which determines the message adding code according to the type of the current message to be transmitted, and adds the message adding code to the current message to be transmitted, sends the processed target transmission message to the receiving end, confirms the received target transmission message, and resends it according to the preset message resending strategy after confirming that the message is lost, until the transmission is completed. Therefore, by adding message adding codes to different types of messages and then transmitting them, the reliability of message transmission is still guaranteed in a weak network environment, the transmission efficiency is optimized, and the user experience is improved.
[0058] Figure 1It is a flow chart of a transmission method provided by an embodiment of the present invention.
[0059] like Figure 1 As shown, the transmission method includes the following steps:
[0060] In step S101, the message to be transmitted is determined.
[0061] The current message to be transmitted refers to the data unit waiting to be sent at the current moment.
[0062] Specifically, the embodiment of the present invention can refer to the computer network OSI (Open System Interconnection) model to obtain the data file transferred from the application layer, and use the data file to be sent as the current message to be transmitted.
[0063] In step S102, a message adding code is determined according to the type of the current message to be transmitted, and the message adding code is added to the current message to be transmitted to obtain a target transmission message, and the target transmission message is sent to the receiving end.
[0064] The target transmission message refers to the current message to be transmitted that has been added.
[0065] Specifically, the embodiment of the present invention obtains the target transmission message by adding an additional code to the current message to be transmitted. The message additional code includes the position information of all messages in the data packet, the message sequence number and bitmap at the beginning and end of the data packet. The receiving end will determine the message information lost in the network transmission based on the additional code. After the sending end packages the data, it sends the data packet to the receiving end through the gateway.
[0066] Optionally, in some embodiments, the message addition code is determined according to the type of the current message to be transmitted, including: if the type of the current message to be transmitted is a data message, the message addition code is the SN sequence number; if the type of the current message to be transmitted is an information message, the message addition code is the First SN sequence number and the Last SN sequence number; if the type of the current message to be transmitted is a confirmation message, the message addition code is a bitmap.
[0067] The embodiment of the present invention divides the types of messages to be transmitted into: data messages, information messages and confirmation messages. The data messages are used by both the sender and the receiver to confirm the position of the message in the entire file or information, which is convenient for data reorganization and confirmation of loss; the information message is used to confirm the sequence number of the first message and the last message of the file; the confirmation message is used to control the file or information fragments to mark the lost data packets during the transmission process.
[0068] Specifically, after all the fragments of a file or information are sent, the sender needs to send an information message to notify the receiver that all the fragments have been sent. The receiver needs to start assembling and confirming the fragment data according to this information prompt and request to resend the data in time. All the fragment messages of a file or information are combined together as a data message. After the receiver confirms that all the fragments have been received, it needs to return a confirmation message, which is considered that the file has been transmitted.
[0069] Exemplarily, the embodiment of the present invention adds an SN sequence number to the data message to determine the position of the message in the file. The data structure of the SN sequence number is:
[0070] Sequence Number
[0071] struct SequenceNumber{
[0072] int32_t high;
[0073] uint32_t low;
[0074] }
[0075] The data structure can be concatenated into a 64-bit signed number through a signed 32-bit integer high and an unsigned 32-bit integer low, which is used to mark the order of the data packets.
[0076] In addition, the embodiment of the present invention adds a bitmap to the confirmation message, which is used to control the file and information fragments to mark the lost data packets during the transmission process. The data structure of the bitmap is:
[0077] Bitmap
[0078] struct bitmap{
[0079] SequenceNumber base;
[0080] uint32_t bitmap[8];
[0081] }
[0082] The data structure consists of a 256-bit bitmap consisting of eight 32-bit unsigned numbers, each bit in the bitmap represents the attribute of the position as true or false. According to the sequence number base, the position attribute in the range of [base, base+256) can be represented.
[0083] In step S103, the receiving end receives a confirmation message sent based on the target transmission message, and when there is a lost message in the confirmation message, resends the message based on the lost message and a preset message resending strategy until the transmission is completed.
[0084] Specifically, after receiving the data message corresponding to the target transmission message, the receiving end restores the target transmission message according to the data message, and establishes a bitmap according to the sequence number of the information message, and compares it with the received target transmission message to determine the missing message sequence number in the bitmap. After receiving the confirmation message sent by the receiving end based on the target transmission message, the sending end confirms the lost message according to the confirmation message, and resends it based on the preset message resending strategy until all messages are transmitted and the transmission is completed.
[0085] For example, Figure 2 As shown, Figure 2 This is a schematic diagram of the principle of a bitmap calculation method provided according to a specific embodiment of the present invention, wherein:
[0086] The data message of the target transmission message is SN=1,2,3,4,5,6, then the information message based on the target transmission message is FirstSN=1, LastSN=6, which means that the minimum sequence number of the target transmission message is 1 and the maximum sequence number is 6. In one embodiment of the present invention, the bitmap attribute of the received message is true, and the attribute of the unreceived message is false, then the corresponding receiving bitmap is [1,0,1,1,0,1,0,0], the confirmation message is the opposite bitmap of the receiving bitmap [0,1,0,0,1,0,0,0], and the corresponding missing data message is SN=2,5. After the sending end receives the confirmation message sent by the receiving end, it resends the corresponding message to the receiving end according to the sequence number of the missing data message.
[0087] Optionally, in some embodiments, retransmitting based on the lost message and a preset message retransmitting strategy includes: calculating the message to be retransmitted according to the lost message; and sending the message to be retransmitted to the sending end.
[0088] Specifically, for the sender, the bitmap sequence number with the bitmap attribute set to true in the confirmation message represents the sequence number of the lost message, such as Figure 2 As shown, the bitmap attributes of the bitmap numbers 2 and 5 are true, so the messages to be resent are the messages with SN sequence numbers 2 and 5. Based on the confirmation message, the sender resends the messages to be resent with SN sequence numbers 2 and 5 to the receiver.
[0089] It should be noted that the resending of the message also requires applying for authorization time from the server. The client first sends a connection request to the server. The validity period of the connection for the first application for server authorization is 1 minute. The client needs to apply again within the validity period to extend the authorization time. According to the number of lost data packets marked in the bitmap, the authorization time is:
[0090]
[0091] The maximum authorization time is 3 minutes, and the effective time is still 1 minute if there is no packet loss.
[0092] Optionally, in some embodiments, after determining the current message to be transmitted, it also includes: determining whether the current message to be transmitted meets the preset fragmentation processing conditions; if the current message to be transmitted meets the preset fragmentation processing conditions, preprocessing the current message to be transmitted, and calculating the number of fragments of the current message to be transmitted after preprocessing and the bytes of each fragment; after completing fragmentation based on the number of fragments and the bytes of each fragment, adding a fragment sequence number to each fragment to obtain a fragmented message.
[0093] It is understandable that in order to reduce the impact of data loss during network transmission, large files are usually divided into several small data pieces for transmission.
[0094] Specifically, if the current message to be transmitted meets the preset fragmentation processing condition, the current message to be transmitted is fragmented. After the message to be transmitted is fragmented, the number of fragments and the sequence number of each fragment are calculated, and then the fragment sequence number is increased for each fragment to obtain a fragmented message.
[0095] Exemplarily, the shard data structure of an embodiment of the present invention includes:
[0096]
[0097] Among them, the embodiment of the present invention saves a data of size N as Message, and first binds it to the msg pointer of FragmentEntry when fragmenting, and then calculates the number of fragments and the fragment size total_frag_count and frag_size, and last_sent_num is used to record the last sub-message sequence number sent by the fragment.
[0098] Among them, in some embodiments, determining whether the current message to be transmitted meets the preset fragmentation processing conditions also includes: determining whether the current message to be transmitted is larger than the preset bytes; if the current message to be transmitted is larger than the preset bytes, then determining that the current message to be transmitted meets the preset fragmentation processing conditions.
[0099] The preset bytes may be a number of bytes pre-set by a user, a number of bytes obtained through a limited number of experiments, or a number of bytes obtained through a limited number of computer simulations, and are not specifically limited here.
[0100] It should be noted that the UDP protocol uses data packets as units for data transmission, and the upper limit of the data packet size is 65535 bytes. The size of files and information sent at a time is generally much larger than this length limit, so the files need to be fragmented.
[0101] Specifically, if the bytes of the current message to be transmitted are greater than the preset bytes, it means that the current message to be transmitted meets the preset fragmentation processing conditions, and the current message to be transmitted is fragmented, and the fragment sequence number is increased for each fragment to obtain a fragmented message; if the bytes of the current message to be transmitted are less than or equal to the preset bytes, it means that the current message to be transmitted does not meet the preset fragmentation conditions, and the current message to be transmitted is regarded as a fragment, and the fragment sequence number is increased for the fragment to obtain a fragmented message.
[0102] In addition, based on the above transmission method, the embodiment of the present invention can also add transmission control to transmit file information, display connection establishment, sending progress and other information prompts during file transmission.
[0103] Specifically, the transmission control logic includes:
[0104] (1) The sender reads the file into memory, starts transmission control, establishes a connection, and sends file information.
[0105] (2) After receiving the file information, the receiving end creates a local file based on the information.
[0106] (3) Adding codes to the transmission message to form the target message. If the message is too large, the data is fragmented.
[0107] (4) During the message sending process, the transmission control at both ends displays the sending progress.
[0108] (5) During the sending and receiving process, the message is confirmed according to the preset retransmission strategy and the lost message data is requested to be retransmitted.
[0109] (6) The receiving end gradually appends the file content based on the received message data.
[0110] (7) After receiving all the message data, the receiving end completes the file assembly.
[0111] (8) Both ends use transmission control to show that the file transfer is complete.
[0112] In order to enable those skilled in the art to further understand the transmission method of the embodiment of the present application, it is elaborated in detail below in conjunction with specific embodiments.
[0113] Specifically, Figure 3 As shown, Figure 3 The following is a flow chart of a transmission method according to a specific embodiment of the present application, wherein the flow chart includes:
[0114] First, the sender sends several data messages, and sends an information message to the receiver after all the data messages are sent; after receiving the information message, the receiver starts to calculate the receiving bitmap and confirmation message, and returns the confirmation message to the sender after the calculation is completed; after receiving the confirmation message sent by the receiver, the sender calculates the retransmission message according to the confirmation message, and retransmits the lost message to the receiver, and repeats the process of sending information messages to retransmitting the lost message until the data transmission is completed.
[0115] Therefore, through the specific discussion of the above embodiments, the embodiments of the present application are based on the UDP protocol, and by combining the bitmap control mechanism, the sending and receiving status of each message fragment is recorded, the function of fast retransmission is realized, and the lost message can be quickly located, thereby increasing the reliability of the UDP protocol and effectively reducing the delay and bandwidth waste caused by packet loss.
[0116] According to the transmission method proposed in the embodiment of the present invention, by determining the message adding code according to the type of the current message to be transmitted, and adding the message adding code to the current message to be transmitted, the processed target transmission message is sent to the receiving end, the received target transmission message is confirmed, and after confirming that the message is lost, it is resent according to the preset message resending strategy until the transmission is completed. Therefore, by adding message adding codes to different types of messages and then transmitting them, the reliability of message transmission is still guaranteed in a weak network environment, the transmission efficiency is optimized, and the user experience is improved.
[0117] Next, the transmission device according to the embodiment of the present invention is described with reference to the accompanying drawings.
[0118] Figure 4 It is a block diagram of a transmission device provided according to an embodiment of the present invention.
[0119] As shown in FIG. 4 , the transmission device 10 includes: a confirmation module 100 , a sending module 200 and a receiving module 300 .
[0120] Wherein, the confirmation module 100 is used to determine the current message to be transmitted;
[0121] The sending module 200 is used to determine the message adding code according to the type of the current message to be transmitted, and add the message adding code to the current message to be transmitted to obtain a target transmission message, and send the target transmission message to the receiving end;
[0122] The receiving module 300 is used to receive the confirmation message sent by the receiving end based on the target transmission message, and when there is a lost message in the confirmation message, resend it based on the lost message and a preset message resending strategy until the transmission is completed.
[0123] After determining the current message to be transmitted, the confirmation module 100 further includes: a judgment unit, a preprocessing unit and a marking unit.
[0124] The judging unit is used to judge whether the message to be transmitted currently satisfies the preset fragmentation processing condition;
[0125] A preprocessing unit, used to preprocess the message to be transmitted when the message to be transmitted meets the preset fragmentation processing condition, and calculate the number of fragments of the message to be transmitted after preprocessing and the bytes of each fragment;
[0126] The marking unit, after completing the fragmentation based on the number of fragments and the bytes of each fragment, adds a fragment sequence number to each fragment to obtain a fragment message.
[0127] According to an embodiment of the present invention, the judgment unit is further used to: judge whether the current message to be transmitted is larger than the preset bytes; if the current message to be transmitted is larger than the preset bytes, determine that the current message to be transmitted meets the preset fragmentation processing conditions.
[0128] According to one embodiment of the present invention, the sending module 200 is specifically used for: if the type of the message to be transmitted is a data message, the message adding code is the SN sequence number; if the type of the message to be transmitted is an information message, the message adding code is the First SN sequence number and the Last SN sequence number; if the type of the message to be transmitted is a confirmation message, the message adding code is a bitmap.
[0129] According to an embodiment of the present invention, the receiving module 300 is specifically used to: calculate the message to be resent according to the lost message; and send the message to be resent to the sending end.
[0130] According to the transmission device proposed in the embodiment of the present invention, by determining the message adding code according to the type of the current message to be transmitted, and adding the message adding code to the current message to be transmitted, the processed target transmission message is sent to the receiving end, the received target transmission message is confirmed, and after confirming that the message is lost, it is resent according to the preset message resending strategy until the transmission is completed. Therefore, by adding message adding codes to different types of messages and then transmitting them, the reliability of message transmission is still guaranteed in a weak network environment, the transmission efficiency is optimized, and the user experience is improved.
[0131] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device may include:
[0132] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0133] When the processor 502 executes the program, the transmission method provided in the above embodiment is implemented.
[0134] Furthermore, the electronic device further comprises:
[0135] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0136] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0137] The memory 501 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0138] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0139] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0140] The processor 502 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0141] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above transmission method is implemented.
[0142] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the above transmission method when executed by a processor.
[0143] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0144] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0145] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A transmission method, characterized in that: The following steps are involved: Determine the current message to be transmitted; Determine a message adding code according to the type of the current message to be transmitted, add the message adding code to the current message to be transmitted, obtain a target transmission message, and send the target transmission message to a receiving end; The receiving end receives a confirmation message sent based on the target transmission message, and when there is a lost message in the confirmation message, resends the lost message based on the lost message and a preset message resending strategy until the transmission is completed.
2. The method according to claim 1, characterized in that: After determining the current message to be transmitted, the method further includes: Determine whether the current message to be transmitted meets the preset fragmentation processing condition; If the current message to be transmitted meets the preset fragment processing condition, preprocessing the current message to be transmitted is performed, and the number of fragments of the current message to be transmitted after preprocessing and the bytes of each fragment are calculated; After completing the fragmentation based on the number of fragments and the bytes of each fragment, a fragment sequence number is added to each fragment to obtain a fragment message.
3. The method according to claim 2, characterized in that The determining whether the current message to be transmitted meets the preset fragmentation processing condition also includes: Determine whether the current message to be transmitted is larger than a preset byte; If the current message to be transmitted is larger than the preset bytes, it is determined that the current message to be transmitted meets the preset fragmentation processing condition.
4. The method according to claim 1, characterized in that The determining the message adding code according to the type of the current message to be transmitted includes: If the type of the current message to be transmitted is a data message, the message addition code is an SN sequence number; If the type of the current message to be transmitted is an information message, the message addition code is the First SN sequence number and the Last SN sequence number; If the type of the current message to be transmitted is a confirmation message, the message addition code is a bitmap.
5. The method according to claim 1, characterized in that The reissuing the lost message based on the lost message and a preset message reissuing strategy includes: Calculate the message to be resent according to the lost message; Send the message to be resent to the sending end.
6. A transmission device, characterized in that: include: A confirmation module is used to determine the current message to be transmitted; A sending module, used for determining a message adding code according to the type of the current message to be transmitted, adding the message adding code to the current message to be transmitted, obtaining a target transmission message, and sending the target transmission message to a receiving end; The receiving module is used to receive the confirmation message sent by the receiving end based on the target transmission message, and when there is a lost message in the confirmation message, resend it based on the lost message and a preset message resending strategy until the transmission is completed.
7. The device according to claim 6, characterized in that After determining the current message to be transmitted, the confirmation module is further used to: Determine whether the current message to be transmitted meets the preset fragmentation processing condition; If the current message to be transmitted meets the preset fragment processing condition, preprocessing the current message to be transmitted is performed, and the number of fragments of the current message to be transmitted after preprocessing and the bytes of each fragment are calculated; After completing the fragmentation based on the number of fragments and the bytes of each fragment, a fragment sequence number is added to each fragment to obtain a fragment message.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the transmission method according to any one of claims 1 to 5.
9. A computer storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the transmission method according to any one of claims 1 to 5.
10. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, is used to implement the transmission method according to any one of claims 1 to 5.
