A data transmission method and device, electronic equipment and storage medium
By constructing a set of notification frames and data frames, the data transmission problem between electric vehicles and charging piles was solved, achieving orderly and complete data transmission, avoiding data loss and duplicate transmission, and ensuring the reliability of data transmission.
Patent Information
- Application Number
- CN202310812935.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-07-04
AI Technical Summary
In existing technologies, data transmission between electric vehicles and charging stations is prone to problems such as data loss, data misalignment, and duplicate data transmission, leading to inconvenience in data transmission management.
By constructing a set of notification frames and data frames, and utilizing the notification identifier bit, total number of frames sent, and total number of bits sent in the notification frame, the data sender and receiver synchronize the transmission of the data frame set, ensuring that the data receiver can construct an acknowledgment frame and verify data integrity.
It enables orderly data transmission between electric vehicles and charging stations, avoiding data loss, data misalignment, and data duplication, thus ensuring the integrity and efficiency of data transmission.
Smart Images

Figure CN116614207B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data transmission, and in particular to a data transmission method and device, electronic equipment and storage medium. BACKGROUND
[0002] Data transmission between an electric vehicle and a charging pile is the basis for ensuring the orderly execution of the charging process. Therefore, accurate transmission of charging data between an electric vehicle and a charging pile is an important guarantee for charging safety.
[0003] Charging data transmitted between a vehicle and a charging pile usually has the characteristic of a large amount of data, which exceeds the single-frame carrying capacity of the communication protocol, i.e., the data length exceeds the number of data bits possessed by a single frame. Therefore, a piece of charging data often needs to be transmitted by multiple data frames. In the prior art, charging data is usually directly stored in each data frame to complete data transmission.
[0004] However, such a data transmission method often causes phenomena such as data loss, data misplacement and repeated transmission of data. The data sender cannot confirm whether the data receiver has received complete data, and the data receiver cannot confirm whether the data sender has completely sent the data, which is not conducive to the management of data transmission. SUMMARY
[0005] The present application provides a data transmission method, device, electronic equipment and storage medium to solve the problem of unordered transmission of charging data.
[0006] According to an aspect of the present application, a data transmission method is provided, applied to a data sender, comprising:
[0007] constructing a notification frame and a data frame set according to target data to be transmitted and a single-frame bit threshold; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit;
[0008] sending the notification frame to a data receiver to enable the data receiver to construct a response frame based on the notification frame; the response frame comprises a response identification bit, a starting frame bit to be received and a total frame number bit to be received;
[0009] sending the data frame set to the data receiver according to the response frame sent by the data receiver.
[0010] According to an aspect of the present application, a data transmission method is provided, applied to a data receiver, comprising:
[0011] In response to obtaining the notification frame sent by the data sender, a response frame is constructed according to the notification frame; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the response frame comprises a response identification bit, a starting frame to be received bit and a total frame number to be received bit;
[0012] The response frame is sent to the data sender, so that the data sender sends a data frame set based on the response frame; wherein the data frame set comprises at least one data frame; the data frame comprises a frame serial number bit and a transmission data bit;
[0013] According to the data frame set sent by the data sender, the matching target data is obtained.
[0014] According to an aspect of the present application, a data transmission device is provided, which is applied to a data sender and comprises:
[0015] A frame construction execution module is configured to construct a notification frame and a data frame set according to target data to be transmitted and a single frame bit threshold; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the data frame set comprises at least one data frame; the data frame comprises a frame serial number bit and a transmission data bit;
[0016] A notification frame sending module is configured to send the notification frame to a data receiver, so that the data receiver constructs a response frame based on the notification frame; the response frame comprises a response identification bit, a starting frame to be received bit and a total frame number to be received bit;
[0017] A data frame sending module is configured to send the data frame set to the data receiver according to the response frame sent by the data receiver.
[0018] According to an aspect of the present application, a data transmission device is provided, which is applied to a data receiver and comprises:
[0019] A response frame construction module is configured to, in response to obtaining the notification frame sent by the data sender, construct a response frame according to the notification frame; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the response frame comprises a response identification bit, a starting frame to be received bit and a total frame number to be received bit;
[0020] A response frame sending module is configured to send the response frame to the data sender, so that the data sender sends a data frame set based on the response frame; wherein the data frame set comprises at least one data frame; the data frame comprises a frame serial number bit and a transmission data bit;
[0021] A target data obtaining module is configured to obtain matching target data according to the data frame set sent by the data sender.
[0022] According to another aspect of the present application, there is provided an electronic device comprising:
[0023] at least one processor; and
[0024] a memory communicatively connected to the at least one processor; wherein
[0025] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the data transmission method according to the first embodiment of the present application, or to perform the data transmission method according to the second embodiment of the present application.
[0026] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for enabling a processor to implement the data transmission method according to the first embodiment of the present application, or to implement the data transmission method according to the second embodiment of the present application, when the processor executes the computer instructions.
[0027] The technical solution of the embodiments of the present application, after the data sender constructs the notification frame and the data frame set according to the target data to be transmitted and the single frame bit threshold, the data sender transmits the notification frame to the data receiver, and transmits the data frame set to the data receiver according to the response frame sent by the data receiver based on the notification frame, so as to realize the ordered transmission of the target data, avoid the occurrence of data loss, data misplacement and data repeated transmission, and at the same time, the notification frame reflects the specific composition structure of the data frame set, so as to facilitate the data receiver to verify the transmission integrity of the target data based on the notification frame.
[0028] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0030] Figure 1 is a flowchart of a data transmission method according to the first embodiment of the present application;
[0031] Figure 2 is a flowchart of another data transmission method according to the second embodiment of the present application;
[0032] Figure 3 is a structural schematic diagram of a data transmission device according to Embodiment Three of the present application;
[0033] Figure 4 is a structural schematic diagram of another data transmission device according to Embodiment Four of the present application
[0034] Figure 5 is a structural schematic diagram of an electronic device implementing a data transmission method according to the present application. DETAILED DESCRIPTION
[0035] In order to make the technical personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of protection of the present 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 do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0037] Embodiment One
[0038] Figure 1 A flowchart of a data transmission method according to Embodiment One of the present application is provided, the present embodiment can be applied to the ordered transmission of target data by constructing a notification frame and a data frame set. The method can be executed by a data transmission device, which can be realized in the form of hardware and / or software. The data transmission device is configured in a data transmission system, which is configured in an electronic device, typically in a vehicle terminal device or a charging pile, which serves as a data sender. As shown in the figure, the method comprises: Figure 1
[0039] S101, constructing a notification frame and a data frame set according to target data to be transmitted and a single frame bit threshold; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit.
[0040] The single frame bit threshold is the maximum number of bits that a communication frame can carry data, which reflects the amount of data that a communication frame can carry; different communication protocols can correspond to different single frame bit thresholds, and the data sender acquires a matched single frame bit threshold according to the current communication protocol type when detecting target data to be transmitted.
[0041] Generally, vehicles and charging piles can support multiple types of communication protocols, for example, CAN (Controller Area Network) communication protocol and Ethernet communication protocol; the data sender can construct a notification frame and a data frame based on a default communication protocol, or select a matched communication protocol according to the data amount of target data to be transmitted; wherein when the data amount of target data is large, i.e. greater than a first preset threshold, a communication protocol with a large single frame data threshold can be selected as the current communication protocol; when the data amount of target data is small, i.e. less than or equal to the first preset threshold, a communication protocol with a small single frame data threshold can be selected as the current communication protocol; in addition, the data sender can also select a communication protocol with good communication quality as the current communication protocol according to historical data transmission records, so as to avoid communication abnormal phenomenon in the data transmission process and ensure effective transmission of target data.
[0042] The notification frame is used to represent the data structure of target data to be transmitted; each target data to be transmitted corresponds to one and only one notification frame; wherein the notification identification bit is the identity of the notification frame, and the number of the notification frame can be set to decimal value 0 to distinguish the notification frame from the numbers of the data frames; the total frame number bit represents the total number of data frames corresponding to the target data, i.e. how many data frames are needed to complete the transmission of the target data; according to the ratio of the data length of the target data to the transmission data bit in the data frame, the total number of data frames can be determined; the total bit number bit represents the total number of bits corresponding to the target data, i.e. how many bits are needed to complete the transmission of the target data.
[0043] Taking a single frame bit threshold corresponding to a current communication protocol as an example, as shown in Table 1, the notification identification bit can be composed of 8 bits, if the number of the notification frame is 0, the notification identification bit is "00000000"; the total frame number bit can also be composed of 8 bits, if the number of the data frame corresponding to the target data is 8, the total frame number bit is "00001000"; the total bit number bit can be composed of 16 bits; at this time, there are 32 bits of idle bits left in the notification frame, that is, there are 32 idle bits.
[0044] Table 1 structure of the notification frame
[0045] Number of place holders 8 8 16 32 Notification frame Notification identification bit Total number of frames transmitted bit Total number of bits transmitted bit Idle bit
[0046] The data frame is used to carry the target data to be transmitted; wherein, the frame sequence number bit represents the number of the data frame, the number of the data frame starts from 1, and the numbers of the data frames under each target data are sequentially increased; the transmission data bit is used to record the actual information of the target data to be transmitted, that is, the target data itself is sequentially stored in the transmission data bit of each data frame. Similarly, taking a single frame bit threshold corresponding to a current communication protocol as an example, as shown in Table 2, the frame sequence number bit can be composed of 8 bits; the transmission data bit can be composed of 56 bits.
[0047] Table 2 structure of the data frame
[0048] Number of place holders 8 56 Data frame Frame sequence number bit Transmitted data bit
[0049] Optionally, in the embodiment of the application, the notification frame further comprises a bit number identification bit; the notification frame and the data frame set are constructed according to the target data to be transmitted and the single frame bit threshold, specifically comprising: the number of data frames is obtained according to the target data to be transmitted and the single frame bit threshold, and the bit number of the frame sequence number bit and the value of the bit number identification bit are configured according to the number of the data frames.
[0050] Specifically, taking the above technical solution as an example, the length of the frame sequence number bit of the data frame is fixed at 8 bits, but actually when the number of the data frames is small, only a small number of bits can represent the numbers of all the data frames, and there can be redundant bits in the 8 bits of the frame sequence number bit; for example, if the target data needs to occupy 22 bytes, that is, 176 bits; as described in the above technical solution, if the frame sequence number bit is 8 bits, four data frames are needed to complete the transmission of the target data; if the number of the data frames is four, the number of the data frames can be represented by the binary number "100", that is, the maximum number of the data frames can be represented by three bits at this time, and the transmission data bit of a corresponding data frame can be 61 bits; as described above, the target data is 176 bits, and three data frames can provide 183 transmission data bits, so three data frames can meet the transmission requirements of the target data.
[0051] Meanwhile, in order to ensure that the data receiver can know the specific bit number of the frame sequence number in the target data transmission, a bit number identification bit can be added in the notification frame, which indicates the bit number of the frame sequence number bit in the data frame. As shown in Table 3, the bit number identification bit can be composed of 8 bits. For example, if the bit number of the frame sequence number bit is 3 bits, the corresponding bit number identification bit is configured as "00000011". Thus, the data receiver can determine the specific bit number of the frame sequence number bit in the data frame according to the bit number identification bit in the notification frame, and further determine the specific bit number of the transmission data bit. Thus, the bit number of the frame sequence number bit and the value of the bit number identification bit are configured according to the data frame number, which reduces the construction number of the data frame and improves the transmission efficiency of the target data.
[0052] Table 3 Structure of the notification frame
[0053]
[0054] Optionally, in the embodiment of the present application, the notification frame further comprises a data identification bit. The construction of the notification frame and the data frame set according to the target data to be transmitted and the single frame bit number threshold value further comprises: obtaining the data frame number according to the target data to be transmitted and the single frame bit number threshold value, and constructing the data frame set according to the data frame number; obtaining the effective transmission data bit of the target data frame with the largest frame sequence number in the data frame set; if it is determined that the number of the effective transmission data bit is less than or equal to the number of the idle bit in the notification frame, storing the data in the effective transmission data bit into the idle bit in the notification frame, configuring a value matching the number of the effective transmission data bit in the data identification bit, and deleting the target data frame in the data frame set.
[0055] Specifically, the effective transmission data bit is a bit in the transmission data bit that actually stores the target data. After the target data is stored into the transmission data bit of each data frame in sequence to construct the data frame set, the transmission data bit of the target data frame with the largest frame sequence number can be fully occupied or only partially occupied, that is, the last data frame only needs to use a small number of transmission data bits to record the remaining data in the target data. Meanwhile, there are multiple bits in the notification frame that are not used, that is, idle bits in an idle state.
[0056] If the number of the effective transmission data bit of the target data frame is less than or equal to the number of the idle bit in the notification frame, the target data recorded in the target data frame can be stored in the idle bit in the notification frame, and the target data frame can be deleted in the data frame set. In this way, part of the data in the target data to be transmitted is recorded in the notification frame, the number of the data frame in the data frame set is reduced, the utilization rate of the notification frame is improved, and the transmission efficiency of the target data is improved.
[0057] Meanwhile, in order to ensure that the data receiver can know whether the target data is recorded in the notification frame in the target data transmission, a data identification bit can be added in the notification frame, which indicates whether the target data is recorded in the notification frame; as shown in Table 4, the data identification bit can occupy 1 bit, if the value of the data identification bit is 1, it indicates that part of the target data is recorded in the idle bit of the notification frame, that is, the idle bit has been switched from the idle state to the data filling state; if the value of the data identification bit is 0, it indicates that the target data is not recorded in the idle bit of the notification frame. In particular, if the number of the valid transmission data bits of the target data frame is greater than the number of the idle bits of the notification frame, the target data frame remains unchanged, the value of the data identification bit can be set to 0, and the idle bit in the notification frame continues to remain in the idle state.
[0058] Table 4 structure of the notification frame
[0059]
[0060] S102, sending the notification frame to the data receiver, so that the data receiver constructs a response frame based on the notification frame; wherein the response frame includes a response identification bit, a to-be-received starting frame bit and a to-be-received total frame number bit.
[0061] After the data sender sends the notification frame to the data receiver, the data receiver can determine the identity of the notification frame according to the notification identification bit in the notification frame; then continue to extract the total number of sending frames and the total number of bits of the notification frame; the response identification bit is the identity of the response frame, which can be set to a large value, for example, “11111111”, to distinguish the response identification from the notification identification and the frame sequence number; the to-be-received starting frame bit indicates the starting number of the data frame to be received by the data receiver, obviously, the data receiver waits for the next data frame whose number is 1 after obtaining the notification frame; the to-be-received total frame number bit indicates the total number of the data frame to be received by the data receiver, which can be obtained according to the total number of sending frames extracted from the notification frame and the to-be-received starting frame bit, obviously, if the to-be-received starting frame bit is 1, then the to-be-received total frame number bit is equal to the total number of sending frames. The structure of the response frame can be as shown in Table 5.
[0062] Table 5 structure of the response frame
[0063]
[0064] S103, sending the data frame set to the data receiver according to the response frame sent by the data receiver.
[0065] The data sender, after obtaining the response frame, indicates that the data transmission link between the data sender and the data receiver has been established, and extracts the relevant information in the response frame. When the to-be-received start frame bit in the response frame is 1 and the to-be-received total frame number bit is consistent with the total frame number bit in the notification frame, it indicates that the relevant information of the data frame to be obtained by the data receiver is correct. At this time, each data frame in the data frame set is sequentially sent to the data receiver.
[0066] The data receiver, after obtaining each data frame, combines the data in the transmission data bit in each data frame according to the number of each data frame to obtain the complete target data. At the same time, as described in the above technical solution, if part of the target data is stored in the notification frame, the data receiver, after sequentially combining the data in the transmission data bit of each data frame, places the part of the target data recorded in the notification frame after the combined data, thereby obtaining the complete target data.
[0067] Optionally, in the embodiment of the application, the data frame set is sent to the data receiver according to the response frame sent by the data receiver, including at least one of the following: if the response frame sent by the data receiver is not obtained within a first preset time, the notification frame is repeatedly sent to the data receiver until the number of repeated sending of the notification frame reaches a first preset number, and an end frame is sent to the data receiver; if the data frame set is not sent completely within a second preset time, an end frame is sent to the data receiver; if the completion frame sent by the data receiver is not received within a third preset time, the target data frame with the largest frame sequence number in the data frame set is repeatedly sent to the data receiver until the number of repeated sending of the target data frame reaches a second preset number, and an end frame is sent to the data receiver.
[0068] Specifically, after the data sender sends the notification frame, if the response frame fed back by the data receiver is not received within the first preset time, data loss may occur. At this time, the notification frame is sent to the data receiver again to avoid the phenomenon that the target data cannot be completely transmitted due to accidental data loss. At the same time, when the number of repeated sending of the notification frame reaches the first preset number, an end frame is sent to the data receiver to stop the transmission of the current target data and avoid the unlimited retransmission of the notification frame when the data receiver appears communication abnormity. The structure of the end frame can be as shown in Table 6. The end frame includes an end identification bit and an idle bit. The end identification can be set to a large value, for example, “01111111”, to distinguish the end identification from the notification identification and the frame sequence number.
[0069] Table 6 Structure of end frame
[0070] Number of place holders 8 56 End frame End identification bit Idle bit
[0071] Similarly, after the data sender sends the notification frame, if the data frameset is not sent completely within the second preset time, it may be that transmission delay occurs between the data sender and the data receiver, or the data receiver has communication abnormality, or the data volume of the target data itself is too large, at this time, the end frame is also sent to the data receiver to stop the transmission of the current target data, so as to avoid that the communication link is occupied by the current target data for a long time, and other data cannot be transmitted in time.
[0072] In addition, the completion frame is the reception completion information fed back by the data receiver when confirming that all the data frames of the current target data have been acquired completely, and the completion frame can be as shown in Table 7. The completion frame can include a completion identification bit, a received frame number bit and a received bit number bit. The completion identification bit is the identity of the completion frame, and the completion identification can be set to a large value, for example, “00111111”, so as to distinguish the completion identification from other identification information. The received frame number bit is the total frame number received by the data receiver, and the received bit number bit is the total bit number received by the data receiver.
[0073] Table 7 Structure of completion frame
[0074] Number of place holders 8 8 16 32 Acknowledgement frame Completion identification bit Number of completion frames received bit Number of completion bits received bit Idle bit
[0075] After the data sender sends the data frameset to the data receiver, if the end frame sent by the data receiver is not received within the third preset time, the data sender repeatedly sends the target data frame with the largest frame sequence number in the data frameset to the data receiver, until the number of repeated sending of the target data frame reaches the second preset number, and then the end frame is sent to the data receiver to stop the transmission of the current target data, so as to avoid that the communication link is occupied by the current target data for a long time, and other data cannot be transmitted in time.
[0076] The technical scheme of the embodiment of the application is that, after the data sender constructs the notification frame and the data frameset according to the target data to be transmitted and the single-frame bit threshold value, the data sender sends the notification frame to the data receiver, and sends the data frameset to the data receiver according to the response frame sent by the data receiver based on the notification frame, so as to realize the ordered transmission of the target data, avoid the occurrence of data loss, data misplacement and data repeated transmission, and at the same time, the notification frame reflects the specific composition structure of the data frameset, so as to facilitate the data receiver to verify the transmission integrity of the target data based on the notification frame.
[0077] Embodiment two
[0078] Figure 2A flowchart of a data transmission method provided for the second embodiment of the present application. The embodiment can be applied to realize the ordered transmission of target data by constructing a notification frame and a data frame set. The method can be executed by a data transmission device, which can be realized in the form of hardware and / or software. The data transmission device is configured in a data transmission system, which is configured in an electronic device. Typically, the data transmission device can be configured in a vehicle terminal device or a charging pile, which serves as a data receiving party. As shown in FIG. 20, the method comprises the following steps. Figure 2
[0079] S201, in response to obtaining a notification frame sent by a data sender, constructing a response frame according to the notification frame; wherein the notification frame comprises a notification identification bit, a total frame number bit and a total bit number bit; the response frame comprises a response identification bit, a starting frame bit to be received and a total frame number bit to be received.
[0080] S202, sending the response frame to the data sender, so that the data sender sends a data frame set based on the response frame; wherein the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit.
[0081] S203, obtaining matching target data according to the data frame set sent by the data sender.
[0082] Optionally, in the embodiment of the present application, the step of obtaining matching target data according to the data frame set sent by the data sender specifically comprises at least one of the following: if it is determined that the current data frame is not a target data frame in the data frame set, and a specified data frame sent by the data sender is not obtained within a fourth preset time, a matching current response frame is sent to the data sender, until the number of repeated sending of the current response frame reaches a third preset number, an end frame is sent to the data sender; wherein the target data frame is a data frame with the largest frame sequence number in the data frame set; the specified data frame is a next data frame connected with the frame sequence number of the current data frame; if a complete data frame set is not received within a fifth preset time, an end frame is sent to the data sender.
[0083] Specifically, after the data receiver obtains a data frame, if the data frame is not the data frame with the largest frame sequence number in the data frame set, it indicates that there are other data frames to be received after the data frame, if other data frames with incorrect frame sequence numbers are obtained or no data frame is obtained within a long time after the current data frame, i.e., within the fourth preset time, a matching response frame, i.e., a current response frame, needs to be sent to the data sender to guide the data sender to send a complete and ordered data frame set in time; wherein the values of the to-be-received starting frame bit and the to-be-received total frame number bit in the current response frame can be obtained according to the frame sequence number of the next data frame connected with the frame sequence number of the current data frame; and when the number of repeated sending of the current response frame reaches the third preset number, an end frame is sent to the data sender.
[0084] Meanwhile, the data receiver starts timing from receiving the notification frame sent by the data sender, and if the complete data frame set is not received within the fifth preset time, it is possible that transmission delay occurs between the data sender and the data receiver, or the data sender has communication abnormality, or the data volume of the target data is too large, at this time, an end frame is sent to the data sender to stop the transmission of the current target data, so as to avoid that the communication link is occupied by the current target data for a long time, thereby causing other data to be unable to be transmitted in time.
[0085] The technical scheme of the embodiment of the application, after the data receiver constructs a response frame according to the notification frame sent by the data sender, the response frame is sent to the data sender, and then the matching target data is obtained according to the data frame set sent by the data sender, so that the ordered transmission of the target data is realized, and the phenomena of data loss, data misplacement and data repeated transmission are avoided, and meanwhile, the notification frame reflects the specific composition structure of the data frame set, and the data receiver effectively verifies the transmission integrity of the target data based on the notification frame.
[0086] Embodiment three
[0087] Figure 3 is a structural block diagram of a data transmission device provided by the embodiment three of the application, and the device specifically comprises:
[0088] The frame construction execution module 301 is configured to construct a notification frame and a data frame set according to the target data to be transmitted and a single frame bit threshold value; wherein the notification frame comprises a notification identification bit, a sending total frame number bit and a sending total bit number bit; the data frame set comprises at least one data frame; and the data frame comprises a frame sequence number bit and a transmission data bit;
[0089] The notification frame sending module 302 is configured to send the notification frame to the data receiver, so that the data receiver constructs a response frame based on the notification frame; and the response frame comprises a response identification bit, a to-be-received starting frame bit and a to-be-received total frame number bit;
[0090] The data frame sending module 303 is configured to send the data frame set to the data receiver according to the response frame sent by the data receiver.
[0091] The technical scheme of the embodiment of the application, after the data sender constructs the notification frame and the data frame set according to the target data to be transmitted and the single frame bit threshold value, the data sender sends the notification frame to the data receiver, and sends the data frame set to the data receiver according to the response frame sent by the data receiver based on the notification frame, so that the ordered transmission of the target data is realized, and the phenomena of data loss, data misplacement and data repeated transmission are avoided, and meanwhile, the notification frame reflects the specific composition structure of the data frame set, so that the data receiver can verify the transmission integrity of the target data based on the notification frame.
[0092] Optionally, the notification frame further comprises a bit number identification bit.
[0093] The frame construction execution module 301 is specifically configured to acquire the data frame number according to the target data to be transmitted and the single frame bit threshold value, and configure the bit number of the frame sequence number bit and the value of the bit number identification bit according to the data frame number.
[0094] Optionally, the notification frame further comprises a data identification bit.
[0095] The frame construction execution module 301 is specifically further configured to acquire the data frame number according to the target data to be transmitted and the single frame bit threshold value, and construct the data frame set according to the data frame number; acquire the effective transmission data bit of the target data frame with the largest frame sequence number in the data frame set; if it is determined that the number of the effective transmission data bit is less than or equal to the number of the idle bit in the notification frame, store the data in the effective transmission data bit into the idle bit in the notification frame, configure the value matching the number of the effective transmission data bit in the data identification bit, and delete the target data frame in the data frame set.
[0096] Optionally, the data frame sending module 303 is specifically configured to at least one of the following:
[0097] If the response frame sent by the data receiver is not acquired within the first preset time, the notification frame is repeatedly sent to the data receiver until the number of repeated sending of the notification frame reaches the first preset number, and then an end frame is sent to the data receiver;
[0098] If the data frame set is not sent completely within the second preset time, an end frame is sent to the data receiver;
[0099] If the completion frame sent by the data receiver is not received within the third preset time, repeatedly sending the target data frame with the largest frame sequence number in the data frame set to the data receiver until the number of repeated sending of the target data frame reaches the second preset number, and sending an end frame to the data receiver.
[0100] The device can perform the data transmission method provided by any embodiment of the application, has the corresponding function modules and beneficial effects of performing the method. Technical details not described in detail in the embodiment can be referred to the data transmission method provided by embodiment one of the application.
[0101] Embodiment four
[0102] Figure 4 is a structural block diagram of a data transmission device provided by embodiment four of the application, and the device specifically includes:
[0103] The response frame construction module 401 is configured to construct a response frame according to a notification frame in response to obtaining the notification frame sent by the data sender, wherein the notification frame includes a notification identification bit, a total frame number bit and a total bit number bit; and the response frame includes a response identification bit, a to-be-received starting frame bit and a to-be-received total frame number bit.
[0104] The response frame sending module 402 is configured to send the response frame to the data sender, so that the data sender sends a data frame set based on the response frame, wherein the data frame set includes at least one data frame; and the data frame includes a frame sequence number bit and a transmission data bit.
[0105] The target data acquisition module 403 is configured to acquire matched target data according to the data frame set sent by the data sender.
[0106] The technical scheme of the embodiment of the application, after the data receiver constructs a response frame according to a notification frame sent by the data sender, the data receiver sends the response frame to the data sender, and then acquires matched target data according to a data frame set sent by the data sender, so that the ordered transmission of the target data is realized, and the phenomena of data loss, data misplacement and data repeated transmission are avoided. Meanwhile, the notification frame reflects the specific composition structure of the data frame set, and the data receiver effectively verifies the transmission integrity of the target data based on the notification frame.
[0107] Optionally, the target data acquisition module 403 is specifically configured to perform at least one of the following:
[0108] If it is determined that the current data frame is not the target data frame in the data frame set, and the specified data frame sent by the data sender is not acquired within a fourth preset time, a matching current response frame is sent to the data sender, and when the number of repeated sending of the current response frame reaches a third preset number of times, an end frame is sent to the data sender; wherein the target data frame is the data frame with the largest frame sequence number in the data frame set; and the specified data frame is the next data frame connected with the frame sequence number of the current data frame.
[0109] If the complete data frame set is not received within a fifth preset time, an end frame is sent to the data sender.
[0110] The above device can perform the data transmission method provided by any embodiment of the application, has the corresponding function modules and beneficial effects of performing the method. Technical details not described in detail in the embodiment can be referred to the data transmission method provided by embodiment two of the application.
[0111] Embodiment five
[0112] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the applications described and / or claimed in this document.
[0113] As shown in Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0114] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0115] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the data transmission method.
[0116] In some embodiments, the data transmission method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto the heterogeneous hardware accelerator via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the processor, one or more steps of the data transmission method described above can be performed. Alternatively, in other embodiments, the processor can be configured, by any appropriate means (e.g., by means of firmware), to perform the data transmission method.
[0117] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0118] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, or entirely on a remote machine or server.
[0119] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal form, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] To provide for interaction with a user, the systems and techniques described here can be implemented on a heterogeneous hardware accelerator having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the heterogeneous hardware accelerator. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0121] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0122] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0123] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the technical solutions of the present disclosure are achieved, and the present disclosure is not limited herein.
[0124] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data transmission method applied to a data sender, characterized in that, The method comprises the following steps: According to the target data to be transmitted and the single frame bit threshold, a notification frame and a data frame set are constructed; wherein, the notification frame comprises data identification bits, notification identification bits, total frame number bits and total bit number bits; the data frame set comprises at least one data frame; the data frame comprises frame sequence number bits and transmission data bits; the data identification bits are used to indicate whether the target data to be transmitted is recorded in the notification frame; According to the target data to be transmitted and the single frame bit threshold, the data frame number is obtained, and the data frame set is constructed according to the data frame number; the effective transmission data bits of the target data frame with the largest frame sequence number in the data frame set are obtained; if it is determined that the number of the effective transmission data bits is less than or equal to the number of idle bits in the notification frame, the data in the effective transmission data bits is stored in the idle bits of the notification frame, a value matching the number of the effective transmission data bits is configured in the data identification bits, and the target data frame in the data frame set is deleted; The notification frame is sent to a data receiver, so that the data receiver constructs a response frame based on the notification frame; the response frame comprises response identification bits, a starting frame to be received bit and a total frame number to be received bit; According to the response frame sent by the data receiver, the data frame set is sent to the data receiver.
2. The method of claim 1, wherein, The notification frame further comprises bit number identification bits; wherein, the bit number identification bits indicate the bit number of the frame sequence number bits in the data frame; According to the target data to be transmitted and the single frame bit threshold, the data frame number is obtained, and the data frame set is constructed according to the data frame number; the effective transmission data bits of the target data frame with the largest frame sequence number in the data frame set are obtained; if it is determined that the number of the effective transmission data bits is less than or equal to the number of idle bits in the notification frame, the data in the effective transmission data bits is stored in the idle bits of the notification frame, a value matching the number of the effective transmission data bits is configured in the data identification bits, and the target data frame in the data frame set is deleted; The notification frame is sent to a data receiver, so that the data receiver constructs a response frame based on the notification frame; the response frame comprises response identification bits, a starting frame to be received bit and a total frame number to be received bit; 3. The method of claim 1, wherein, According to the response frame sent by the data receiver, the data frame set is sent to the data receiver. The notification frame further comprises bit number identification bits; wherein, the bit number identification bits indicate the bit number of the frame sequence number bits in the data frame; The method comprises the following steps: In response to obtaining the notification frame sent by the data sender, a response frame is constructed according to the notification frame; wherein, the notification frame comprises data identification bits, notification identification bits, total frame number bits and total bit number bits; the response frame comprises response identification bits, a starting frame to be received bit and a total frame number to be received bit; the data identification bits are used to indicate whether the target data to be transmitted is recorded in the notification frame; 4. A data transmission method applied to a data receiving side, characterized in that, sending the response frame to the data sender, so that the data sender sends a data frame set based on the response frame; wherein the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit; if the number of valid transmission data bits of a target data frame with the largest frame sequence number in the data frame set is less than or equal to the number of idle bits in the notification frame, the data in the valid transmission data bits is included in the idle bits of the notification frame, and a value matching the number of the valid transmission data bits is configured in the data identification bit, and the target data frame is not included in the data frame set; acquiring the matching target data according to the data frame set sent by the data sender.
5. The method of claim 4, wherein, The acquiring the matching target data according to the data frame set sent by the data sender specifically comprises at least one of the following: if it is determined that the current data frame is not the target data frame in the data frame set, and the specified data frame sent by the data sender is not acquired within a fourth preset time, a matching current response frame is sent to the data sender until the number of repeated sending of the current response frame reaches a third preset number, and then an end frame is sent to the data sender; wherein the target data frame is the data frame with the largest frame sequence number in the data frame set; the specified data frame is the next data frame connected with the frame sequence number of the current data frame; if the complete data frame set is not received within a fifth preset time, an end frame is sent to the data sender.
6. A data transmission apparatus applied to a data sender, comprising: It comprises: a frame construction execution module, configured to construct a notification frame and a data frame set according to target data to be transmitted and a single frame bit threshold; wherein the notification frame comprises a data identification bit, a notification identification bit, a total frame number bit and a total bit number bit; the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit; the data identification bit is used to indicate whether the target data to be transmitted is recorded in the notification frame; The frame construction execution module is specifically configured to construct a notification frame and a data frame set according to target data to be transmitted and a single frame bit threshold, and specifically further comprises: acquiring the number of data frames according to the target data to be transmitted and the single frame bit threshold, and constructing a data frame set according to the number of data frames; acquiring the valid transmission data bits of a target data frame with the largest frame sequence number in the data frame set; if it is determined that the number of the valid transmission data bits is less than or equal to the number of idle bits in the notification frame, the data in the valid transmission data bits is stored in the idle bits of the notification frame, a value matching the number of the valid transmission data bits is configured in the data identification bit, and the target data frame in the data frame set is deleted; a notification frame sending module, configured to send the notification frame to a data receiver, so that the data receiver constructs a response frame based on the notification frame; the response frame comprises a response identification bit, a start frame bit to be received and a total frame number bit to be received; a data frame sending module, configured to send the data frame set to the data receiver according to the response frame sent by the data receiver.
7. A data transmission apparatus applied to a data receiving side, characterized in that, It comprises: The response frame construction module is configured to, in response to obtaining the notification frame sent by the data sender, construct a response frame according to the notification frame; wherein the notification frame comprises a data identification bit, a notification identification bit, a total frame number bit and a total bit number bit; the response frame comprises a response identification bit, a start frame bit to be received and a total frame number bit to be received; the data identification bit is used to indicate whether the target data to be transmitted is recorded in the notification frame; The response frame sending module is configured to send the response frame to the data sender, so that the data sender sends a data frame set based on the response frame; wherein the data frame set comprises at least one data frame; the data frame comprises a frame sequence number bit and a transmission data bit; if the number of valid transmission data bits of a target data frame with the largest frame sequence number in the data frame set is less than or equal to the number of idle bits in the notification frame, the data in the valid transmission data bits is included in the idle bits of the notification frame, and a value matched with the number of valid transmission data bits is configured in the data identification bit, and the target data frame is not included in the data frame set; The target data obtaining module is configured to obtain matched target data according to the data frame set sent by the data sender.
8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data transmission method in any one of claims 1-3, or execute the data transmission method in claim 4 or 5.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to implement the data transmission method in any one of claims 1-3, or implement the data transmission method in claim 4 or 5 when executed.
Citation Information
Patent Citations
Sliding window based half-duplex communication method and system
CN104113403A