Communication method and device and electronic equipment
By uniformly responding multiple data packets as a data group, the problem of low data transmission efficiency in multi-chip communication is solved, and the effect of reducing the number of responses and improving the transmission efficiency is achieved.
Patent Information
- Application Number
- CN202411344817.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, when multi-chip communication, the data transmission efficiency is low, especially when the number of data packets is large, because each data packet is sent, it is particularly obvious.
By using n data packets as a data group, all data packets in a data group are received and unified responses are completed, reducing the number of responses and improving data transmission efficiency.
It reduces the number of responses during packet transmission, reduces the time required for response, and improves data transmission efficiency.
Smart Images

Figure CN119210659A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method, device and electronic equipment. Background Art
[0002] In order to meet the needs of various differentiated performance enhancements, other external chips besides the main processor will be added to electronic devices to handle special services. For example, dedicated chips such as camera image processing and display screen processing. In order to enable the main processor and these chips to interact and control data normally, a corresponding communication protocol needs to be formulated to ensure stable data transmission when multiple chips communicate on the hardware interface.
[0003] To ensure the reliability of key data transmission, the sender must confirm the data transmission each time it sends a data packet. When the response to the current data packet is received, the next data packet will be sent. This method requires receiving the response packet before sending the next data packet. When the number of data packets is large, it is easy to cause low data transmission efficiency. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a communication method, device and electronic device, which are conducive to improving the efficiency of data transmission.
[0005] In a first aspect, an embodiment of the present application provides a communication method, which is applied to a receiving end, and the method includes:
[0006] Receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0007] When the data number of the first data packet is equal to x+n, a first response packet is sent to the transmitting end, wherein the first response packet is a response packet for the n data packets.
[0008] In a second aspect, an embodiment of the present application provides a communication method, which is applied to a sending end, and the method includes:
[0009] Sending a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0010] When the data number of the first data packet is equal to x+n and the first response packet is received, a data packet in a third data group is sent to the sending end, wherein the third data group is a data group to be sent in the next round of the first data group.
[0011] In a third aspect, an embodiment of the present application provides a communication device, applied to a receiving end, the device comprising:
[0012] A first receiving module, configured to receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0013] The first sending module is used to send a first response packet to the sending end when the data number of the first data packet is equal to x+n, wherein the first response packet is a response packet of the n data packets.
[0014] In a fourth aspect, an embodiment of the present application provides a communication device, applied to a transmitting end, the device comprising:
[0015] A second sending module, used for sending a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0016] The second sending module is also used to send data packets in a third data group to the sending end when the data number of the first data packet is equal to x+n and a first response packet is received, wherein the third data group is the next round of data group to be sent of the first data group.
[0017] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0018] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0019] In the seventh aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method described in the first aspect or the second aspect.
[0020] In an eighth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the method described in the first aspect or the second aspect.
[0021] In the embodiment of the present application, n data packets are treated as a data group, and after completing the reception of n data packets in a data group, the n data packets are uniformly responded to, that is, only one response is required for the transmission of n data packets. In this way, compared with the related art that requires n responses for n data packets, it is beneficial to reduce the number of responses in the process of data packet transmission, thereby reducing the time required for the response, and further helping to improve the efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is one of the flow charts of a communication method provided in an embodiment of the present application;
[0023] Figure 2 is a schematic diagram of the encapsulation structure of a data packet in an embodiment of the present application;
[0024] Figure 3 This is a second flow chart of a communication method provided in an embodiment of the present application;
[0025] Figure 4 It is a flowchart of a process of checking a received data packet by a receiving end in an embodiment of the present application;
[0026] Figure 5 This is a third flow chart of a communication method provided in an embodiment of the present application;
[0027] Figure 6This is a fourth flow chart of a communication method provided in an embodiment of the present application;
[0028] Figure 7 This is a fifth flow chart of a communication method provided in an embodiment of the present application;
[0029] Figure 8 This is one of the structural schematic diagrams of a communication device provided in an embodiment of the present application;
[0030] Fig. 9 This is a second structural diagram of a communication device provided in an embodiment of the present application;
[0031] Fig.10 is a schematic diagram of the structure of an electronic device provided by some embodiments of the present application;
[0032] Fig.11 One of the hardware structure diagrams of the electronic device provided in some embodiments of the present application;
[0033] Fig.12 The second schematic diagram of the hardware structure of the electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0035] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0036] In the following, in conjunction with the accompanying drawings, a communication method, device and electronic device provided in an embodiment of the present application are described in detail through specific embodiments and their application scenarios.
[0037] See also Figure 1 , Figure 1 A flow chart of a communication method provided in an embodiment of the present application is provided. The communication method is applied to a receiving end, and the communication method comprises the following steps:
[0038] Step 101, receiving a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0039] Step 102: When the data number of the first data packet is equal to x+n, a first response packet is sent to the transmitting end, wherein the first response packet is a response packet for the n data packets.
[0040] The above-mentioned transmitting end and receiving end may refer to the transmitting end and receiving end in various data packet transmission scenarios. In some embodiments of the present application, the transmitting end and receiving end may be two different chips in the same electronic device. For example, one of the transmitting end and the receiving end is a main processor and the other is an external chip. The external chip may be various external chips in the electronic device, specifically various external image processing chips.
[0041] The n data packets mentioned above can be data packets in various data transmission scenarios. Figure 2 , is the encapsulation structure of the data packet in some embodiments of the present application, wherein the data packet may include a frame identifier, a sending identifier, a receiving identifier, a data type, a data number, a data length, a multi-frame response, a frame header check, a data segment and a frame tail check, and the sending identifier and the receiving identifier are used to confirm the source address of unicast (point-to-point) data and the destination address of the data when multiple devices interact, and can also be used for the transmission of broadcast (one-to-many) data, that is, the sending identifier is used to characterize the source address of the data, and the receiving identifier is used to characterize the destination address of the data. The data type is used to characterize that the data packet is a data packet or a response packet. The data number is used to characterize the number of the data packet in the data group to which it belongs. The data length identifier is used to characterize the length of the valid data segment and is used to confirm the frame tail position. The multi-frame response is used to indicate how many specific frames are divided into a group of unified responses. In the embodiment of the present application, the value of the multi-frame response is n, so that the receiving end can determine the specific value of n according to the received data packet.
[0042] The above x may be a value determined according to a rule agreed upon in advance between the sending end and the receiving end. For example, the x may be: the data number of the data packet with the largest data number among the data groups sent by the sending end and received by the receiving end in the previous round. When the first data group is the data group sent by the receiving end to the sending end in the first round, the value of x may be 1 by default. For another example, the value of x may be recorded in the header of the above data packet, specifically, the value of x may be recorded in a multi-frame response, or a field including the value of x may be added to the header of the data packet.
[0043] It should be noted that the data number of the first data packet in the above-mentioned first data group is x+1, that is, the data number of the data packet with the smallest data number in the first data group is x+1, wherein the first data packet in the first data group is also the first data packet sent by the sending end in the process of sending the data packets in the first data group to the receiving end.
[0044] The n data packets mentioned above may be n data packets whose data numbers are continuously incremented by 1, for example, the data numbers of the n data packets may be x+1 to x+n in sequence. In other embodiments of the present application, when there are k data packets with abnormal transmission in the data group sent in the previous round of the first data group, the n data packets may also include the k data packets with abnormal transmission, and another nk data packets whose data numbers are continuously incremented by 1, and the data numbers of the k data packets with abnormal transmission are all smaller than the data numbers of the other nk data packets in the first data group.
[0045] The data number is used to indicate the sending order of the corresponding data packet in the data group to which it belongs, which specifically means that the sending end can send the n data packets in the order of the data numbers in the first data group from small to large. Since the data packet with the largest data number among the n data packets is numbered x+n, the data packet with data number x+n in the first data group is the last data packet sent in the first data group.
[0046] It is understandable that in the embodiment of the present application, the receiving end may uniformly respond to the n data packets after completing the reception of the n data packets in a data group. For example, see Figure 3 , is a schematic diagram of the process of a sending end sending a data packet to a receiving end in an embodiment of the present application.
[0047] Specifically, after receiving each data packet, the receiving end may first parse the data packet to obtain the data number of the received data packet. For example, after receiving the first data packet, the receiving end may parse the first data packet to obtain the data number of the received first data packet, and when the data number of the first data packet is equal to x+n, it is determined that the n data packets in the first data group have been received. At this time, the receiving end may send a first response packet to the sending end to respond to the reception status of the n data packets.
[0048] Among them, the above-mentioned first response packet can indicate whether the n data packets in the first data group are sent normally. It can be understood that when the receiving end successfully receives the n data packets in the first data group, it can be determined that the n data packets in the first data group are sent normally. When the receiving end does not successfully receive the n data packets in the first data group, it can be determined that the n data packets in the first data group are sent abnormally, and the first response packet can include the data number of the data packet with abnormal sending among the n data packets in the first data group, so that the sending end can resend the data packet with abnormal sending in the previous round during the sending process of the next round of data groups.
[0049] See also Figure 4 , is a flow chart of the process of parsing a received data packet when the receiving end receives a data packet in some embodiments of the present application, and the process specifically includes the following steps:
[0050] When the receiving end receives the data packet, it starts to match the frame header identifier agreed upon with the sending end byte by byte until the frame identifier is found.
[0051] After finding the frame identifier, follow Figure 2 The format of the frame header check field is determined, and the frame header data check value is calculated according to the specified algorithm such as the CRC8 algorithm, and compared with the received frame header check field.
[0052] If the frame header check is inconsistent, return to step "The receiving end receives the data packet" to continue receiving new data. If it is consistent, pass Figure 2 The format determines the offset of the frame end check field.
[0053] The frame tail data check value is calculated according to the specified algorithm, such as the CRC32 algorithm, and compared with the received frame tail check field. If they are inconsistent, return to step "the receiving end receives the data packet" to continue receiving new data. If they are consistent, return the data segment content as the parsed valid data.
[0054] In addition, in some embodiments of the present application, when the data packet with data number x+n is sent abnormally, it may result in the inability to generate the "data packet with data number x+n" received and sent. In this case, a timeout period can be set in advance. When the "data packet with data number (x+n-1)" is received, and after the timeout period, if the "data packet with data number x+n" is not received, it is determined that the "data packet with data number x+n" is sent abnormally. At this time, the data numbers of the "data packet with data number x+n" and other data packets with abnormal sending in the first data group can be added to the first response packet, and the first response packet is sent to the sending end.
[0055] In this implementation, n data packets are treated as a data group, and after completing the reception of n data packets in a data group, the n data packets are responded to uniformly, that is, only one response is required for the transmission of n data packets. In this way, compared with the related art that requires n responses for n data packets, this is beneficial to reduce the number of responses in the process of data packet transmission, thereby reducing the time required for the response, and further beneficial to improving the efficiency of data transmission.
[0056] Optionally, when the data number of the first data packet is equal to x+n, before sending the first response packet to the sending end, the method further includes:
[0057] Acquire m data numbers, wherein the m data numbers include: data numbers of data packets included in the first data group received by the receiving end, and m is an integer less than or equal to n;
[0058] The first response packet is generated based on the m data numbers, wherein the first response packet is used to indicate whether the n data packets in the first data group are sent normally.
[0059] Specifically, since the receiving end may receive all the data packets of the first data group, or may receive only some of the data packets in the first data group due to various anomalies in the data transmission process, the number of all data packets in the first data group received by the receiving end may be defined as m. In the case where the receiving end receives all the data packets of the first data group, m is equal to n. In the case where the receiving end receives only some of the data packets in the first data group, m is less than n. The m data numbers are the data numbers of the m data packets in the first data group received by the receiving end, and the m data numbers correspond one-to-one to the m data packets in the first data group.
[0060] In some embodiments of the present application, when the receiving end knows in advance which data packets with data numbers should be included in the first data group, it can determine which data packets are successfully received and which data packets are not successfully received through the m data numbers and the data numbers of the data packets that should be included in the first data group. And the data numbers of the data packets that are not successfully received can be written into the first response packet, so that after receiving the first response packet, the sending end can resend the data packets that are not successfully received by the receiving end during the next data group transmission process.
[0061] In other embodiments of the present application, when the receiving end cannot know in advance which data packets should be included in the first data group, the data numbers of the successfully received data packets can be written into the first response packet, so that the sending end can determine which data packets the receiving end failed to successfully receive after receiving the first response packet, and resend the data packets that the receiving end failed to successfully receive during the sending of the next data group.
[0062] In this implementation, since it is possible to determine which data packets are successfully received and which are not received based on the m data numbers, the m data numbers can be used to generate a first response packet to characterize whether the n data packets in the first data group are sent normally, thereby realizing the generation process of the first response packet.
[0063] Optionally, generating the first response packet based on the m data numbers includes:
[0064] In the case where m is equal to n and the m data numbers are m data numbers that are continuously incremented by 1, the first response packet is generated, wherein the first response packet indicates that the n data packets in the first data group are sent normally; or,
[0065] In the case where m is equal to n, and the m data numbers are m data numbers that are non-continuously incremented by 1, the first response packet is generated based on the m data numbers and the second abnormal data number included in the second response packet, wherein the second response packet is a response packet for the second data group, the second abnormal data number is the data number of the abnormal data packet in the second data group, and the second data group is the data group received in the previous round of the first data group; or
[0066] When m is smaller than n, the first response packet is generated, wherein the first response packet includes the data number of the abnormally sent data packet among the n data packets.
[0067] The m data numbers being m data numbers that are continuously incremented by 1 may specifically mean that, based on the data number of the last data packet of the data group sent in the previous round, the m data numbers are m data numbers that are continuously incremented by 1. For example, in some embodiments of the present application, if the data number of the last data packet in the previous round of data groups is x, then the data numbers of the n data packets in the first data group are sequentially: x+1 to x+n.
[0068] The second response packet is used to indicate whether the data packets in the second data group are sent normally. It is understandable that the second response packet is a response packet sent by the receiving end to the sending end after receiving the data packets in the second data group.
[0069] Accordingly, the m data numbers being m non-continuous data numbers that increase by 1 may mean: based on the data number of the last data packet of the data group sent in the previous round, the m data numbers are m non-continuous data numbers that increase by 1. For example, in some embodiments of the present application, if the data number of the last data packet in the previous round of data groups is x, if the m data numbers are n-1 data numbers from x+2 to x+n that increase by 1 in sequence, since x+2 is not continuous with x, the m data numbers are determined to be m non-continuous data numbers that increase by 1. Accordingly, when the m data numbers lack any one of the numbers between x+1 and x+n, the m data numbers will also be discontinuous. In this case, the m data numbers are determined to be m non-continuous data numbers that increase by 1.
[0070] In some embodiments of the present application, when there is no abnormal data packet in the previous round of data groups of the first data group, the n data packets in the first data group can be n data packets whose data numbers are continuously incremented by 1, and the data numbers of the n data packets are: x+1 to x+n. Therefore, when the m is equal to the n, and the m data numbers are m data numbers that are continuously incremented by 1, it can be determined that all the n data packets are sent normally. At this time, the first response packet can indicate that the n data packets are sent normally. For example, the first response packet can include the following text "sending normally" or "no abnormality" and other response content.
[0071] Accordingly, when m is equal to n, and the m data numbers are m non-continuous data numbers that increase by 1, at this time, it may be due to the repeated reception of some data packets and the unsuccessful reception of some data packets, resulting in discontinuous data numbers. For example, when the first data group includes 5 data packets, and the data numbers of the 5 data packets are 1, 2, 3, 4, and 5 respectively, if the m data numbers are: 1, 1, 3, 4, and 5, at this time, the data packet with data number 1 is repeatedly received twice, and the data packet with data number 2 is not successfully received, resulting in the m data numbers being m non-continuous data numbers that increase by 1.
[0072] In addition, when the m is equal to the n, and the m data numbers are m data numbers that non-continuously increase by 1, it may also be because the data numbers of the data packets in the first data group are themselves discontinuous. For example, the first data group includes data packets that failed to be received in the previous round of data groups. In this case, the data numbers of the data packets in the previous round of data groups will be discontinuous with the data numbers of the newly added data packets in this round. Therefore, the second abnormal data number included in the second response packet can be further obtained, and the first response packet can be generated based on the m data numbers and the second abnormal data number included in the second response packet.
[0073] Since the number of data packets included in the first data group is n, when m is less than n, it indicates that the receiving end has only received some of the data packets in the first data group, that is, some of the data packets have failed to be received. In this case, the receiving end can first determine the n data numbers of the n data packets in the first data group, and then compare the m data numbers with the determined n data numbers, and can determine the other data numbers among the n data numbers except the m data numbers as the data numbers of the data packets with abnormal transmission.
[0074] The receiving end determining the n data numbers of the n data packets in the first data group may include the following steps:
[0075] When the second response packet does not include the second abnormal data number and the data packet with the largest data number in the second data group is numbered x, the n data numbers of the n data packets in the first data group are sequentially: x+1 to x+n.
[0076] When the second response packet includes s second abnormal data numbers, and the data number of the data packet with the largest data number in the second data group is x, the n data numbers of the n data packets in the first data group include: s second abnormal data numbers, and (ns) data numbers that are continuously incremented by 1, and the (ns) data numbers that are continuously incremented by 1 are respectively: (x+1) to (x+ns).
[0077] In this implementation, since the data numbers of the data packets in the first data group are usually data numbers that continuously increase by 1, the continuity of the data numbers of all received data packets and whether the number of all received data packets is n are judged to determine whether the n data packets are successfully sent.
[0078] Optionally, the generating the first response packet based on the m data numbers and the second abnormal data number included in the second response packet includes:
[0079] Obtaining a third abnormal data number among the m data numbers, wherein the third abnormal data number is a data number of a data packet in the first data group that sends an abnormality;
[0080] In the case where the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, the first response packet is generated, wherein the first response packet is used to indicate that the n data packets are sent normally; or, in the case where there is at least one third abnormal data number that is a data number other than the second abnormal data number included in the second response packet, the first response packet is generated, wherein the first response packet includes the data numbers of the data packets with other sending abnormalities among the m data numbers except the second abnormal data number.
[0081] Among them, the above-mentioned second response packet may include the data numbers of all data packets sending exceptions in the second data group, that is, when the second response packet includes the second exception data number, the second response packet may include at least one second exception data number.
[0082] The third abnormal data number may include: a data number that is discontinuous with other data numbers among the m data numbers except the third abnormal data number. For example, when the m data numbers are 3, 5, 6, 7, 8, and 9, data number "3" is the third abnormal data number. In addition, the third abnormal data number may also include: a data number of a data packet that was not successfully received. For example, when the m data numbers are 5, 5, 6, 8, and 9, if the n data numbers corresponding to the n data packets are 5, 6, 7, 8, and 9, it can be determined that the receiving end did not successfully receive the data packet with data number "7". Therefore, data number "7" is the third abnormal data number.
[0083] Specifically, when the first data number among the m data numbers is discontinuous with other data numbers among the m data numbers, if the first data number is less than x+1, it can be determined that the first data number may be the data number of the abnormal data packet sent in the previous round. In order to further determine whether the first data number is the data number of the abnormal data packet sent in the previous round, the first data number can be determined as the third abnormal data number.
[0084] Correspondingly, when the second data number among the m data numbers is discontinuous with other data numbers among the m data numbers, if the second data number is greater than or equal to x+1, it can be determined that the second data number is the data number of the data packet sent normally in this round. At this time, the second data number will not be regarded as the third abnormal data number. Since the second data number is discontinuous with other data numbers among the m data numbers, the missing data number that causes the second data number to be discontinuous with other data numbers among the m data numbers can be determined as the third abnormal data number.
[0085] For example, when m is equal to n, when the data number of the last data packet of the data group sent in the previous round is 4, and the m data numbers are: 3, 5, 5, 7, 8, 9 in sequence, if the second abnormal data number is 3, at this time, it can be determined that data numbers 3 and 5 are discontinuous with other data numbers, and data number 3 is less than "data number 4 of the last data packet of the data group sent in the previous round", so data number 3 can be determined as the third abnormal data number. Correspondingly, since data number 5 is greater than "data number 4 of the last data packet of the data group sent in the previous round", the reason for the discontinuity of data number 5 is the lack of "data number 6", so data number 6 can be determined as the third abnormal data number. In this case, the determined third abnormal data number includes: data number 3 and data number 6. Since the second abnormal data number is 3, the third abnormal data number 6 is the other data number other than the second abnormal data number included in the second response packet, so the third abnormal data number 6 can be determined as the data number of other abnormal data packets sent except the second abnormal data number. And add data number 6 to the first response packet.
[0086] For another example, when m is equal to n, when the data number of the last data packet of the data group sent in the previous round is 4, and the m data numbers are 3, 5, 6, 7, 8, and 9 respectively, if the second abnormal data number is 3, since the third abnormal data number is equal to the second abnormal data number at this time, the first response packet can be generated, wherein the first response packet is used to indicate that the n data packets are sent normally.
[0087] Since the first data group includes the abnormal data packet sent in the previous round, the data numbers of the data packets in the first data group may be discontinuous. Therefore, if it is determined that the reason for the m data numbers to be m non-continuous data numbers increasing by 1 is because the m data numbers include the second abnormal data number, it can be determined that the n data packets are sent normally, otherwise, it is determined that the n data packets are sent abnormally. Based on this, it can be set:
[0088] In the case where the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, the first response packet is generated, wherein the first response packet is used to indicate that the n data packets are sent normally; or
[0089] When there is at least one third abnormal data number among the third abnormal data numbers that is a data number other than the second abnormal data number included in the second response packet, the first response packet is generated, wherein the first response packet includes the data numbers of other data packets sending abnormalities among the m data numbers except the second abnormal data number.
[0090] The third abnormal data numbers mentioned above are all the second abnormal data numbers included in the second response packet, which may mean that all the third abnormal data numbers among the m data numbers are the second abnormal data numbers included in the second response packet.
[0091] In other embodiments of the present application, it is also possible to determine that "the first response packet includes the data numbers of other abnormally sent data packets except the second abnormal data number in the m data numbers" by comparing the m data numbers with the n data numbers corresponding to the above-mentioned n data packets. Specifically, the data number of the abnormally sent data packet can be determined by the following method:
[0092] The receiving end can first determine the n data numbers of the n data packets in the first data group, and then compare the above m data numbers with the determined n data numbers, and can determine the other data numbers among the n data numbers except the m data numbers as the data numbers of the data packets sending the exception.
[0093] The receiving end determining the n data numbers of the n data packets in the first data group may include the following steps:
[0094] When the second response packet does not include the second abnormal data number and the data packet with the largest data number in the second data group is numbered x, the n data numbers of the n data packets in the first data group are sequentially: x+1 to x+n.
[0095] When the second response packet includes the s second abnormal data numbers and the data number of the data packet with the largest data number in the second data group is x, the n data numbers of the n data packets in the first data group include: s second abnormal data numbers, and (ns) data numbers that are continuously incremented by 1, and the (ns) data numbers that are continuously incremented by 1 are respectively: (x+1) to (x+ns).
[0096] The following further explains the process of generating the first response packet with some specific embodiments:
[0097] In some embodiments of the present application, when m is equal to n, when the data number of the last data packet of the data group sent in the previous round is 4, and the m data numbers are: 3, 5, 5, 7, 8, 9, since the value of n is 6, according to the above method, it can be determined that the n data numbers of the n data packets in the first data group include: 3, 5, 6, 7, 8, 9. At this time, "m data numbers are: 3, 5, 5, 7, 8, 9", and by comparing "n data numbers" with "m data numbers", it can be known that "m data numbers" lack a data packet with data number "6", so the first response packet can include data number "6".
[0098] In this implementation, by obtaining the third abnormal data number among the m data numbers and determining whether the third abnormal data number is the second abnormal data number included in the second response packet, it is possible to determine whether the data numbering is discontinuous due to the fact that the first data group includes an abnormal data packet sent in the previous round. If it is determined that the data numbering is discontinuous due to the fact that the first data group includes an abnormal data packet sent in the previous round, it is determined that the n data packets are sent normally. This is beneficial to improving the accuracy of abnormality judgment.
[0099] See also Figure 5 , is a flow chart of a communication method provided in an embodiment of the present application, the method is applied to a receiving end, and the method comprises the following steps:
[0100] Receive data packets;
[0101] Determine whether the received packet number is x+n, that is, determine whether the data number of the currently received data packet is x+n, wherein the data number of the data packet with the largest data number among the n data packets is x+n; if not, continue to receive the next data packet.
[0102] If the received packet number is x+n, the data packet numbers are sorted, that is, the data numbers of all the data packets currently received in the first data group are sorted.
[0103] If the data packet number is continuously increased by +1, a normal response is sent, that is, the first response packet indicating that the n data packets are sent normally is sent.
[0104] If the data packet number is not continuously incremented by +1, it is determined whether the abnormal number is a retransmitted packet, that is, it is determined whether the third abnormal data number is equal to the second abnormal data number. If so, a normal response is sent.
[0105] If the exception number is not a retransmission packet, an exception response packet is sent and the exception packet number is filled in, that is, the third exception data number is filled in the first response packet.
[0106] Enter the next round of receiving process.
[0107] See also Figure 6 , Figure 6 A flow chart of a communication method provided in an embodiment of the present application is provided. The communication method is applied to a sending end, and the method comprises the following steps:
[0108] Step 601: Send a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packets in the data group to which it belongs, x is an integer greater than or equal to 0, and n is an integer greater than 1;
[0109] Step 602: When the data number of the first data packet is equal to x+n and the first response packet is received, send the data packet in the third data group to the sending end, wherein the third data group is the data group to be sent in the next round of the first data group.
[0110] It is understandable that, when the data number of the first data packet is equal to x+n and the first response packet is not received, sending the data packets in the third data group to the sending end is suspended until the first response packet is received.
[0111] When the data number of the first data packet is equal to x+n, it can be determined that the sending of all data packets in the first data group has been completed.
[0112] In the case where the data number of the first data packet is less than x+n, the next data packet may continue to be sent to the receiving end until the sending of the data packet with the data number x+n is completed.
[0113] This embodiment is a sending end embodiment corresponding to the above embodiment. Its specific implementation process corresponds to the above embodiment and has corresponding beneficial effects. To avoid repetition, it will not be described again here.
[0114] Optionally, when the data number of the first data packet is equal to x+n and a first response packet is received, before sending a data packet in a next data group to the transmitting end, the method further includes:
[0115] In the case where the first response packet includes k fourth abnormal data numbers, the third data group is generated, wherein the third data group includes: k data packets corresponding to the k fourth abnormal data numbers, and nk data packets whose data numbers are successively increased by 1, wherein the data number of the data packet with the smallest data number among the nk data packets is (x+n+1), wherein k is an integer greater than or equal to 0, and the fourth abnormal data number is used to characterize that the sending of the data packet with the fourth abnormal data number among the n data packets in the first data group is abnormal.
[0116] The above-mentioned nk data packets may refer to: based on x+n, the data numbers of nk data packets are continuously increased by 1, that is, the data numbers of the nk data packets can be expressed as: (x+n+1) to (x+2n-k). Among them, x+n is the data number of the last data packet sent in the first data group.
[0117] Among them, the above-mentioned k can be equal to 0 or greater than 0. For example, when the first response packet does not include a data packet sending an exception, the first response packet includes 0 fourth abnormal data numbers. At this time, the k is equal to 0, and the data numbers of the nk data packets can be expressed as: x+n+1 to x+2n.
[0118] For another example, when the first response packet includes two data packets with sending exceptions, the first response packet includes two fourth abnormal data numbers. Assuming that the data numbers of the two abnormal data packets are (x+n-5) and (x+n-2), respectively, at this time, k is equal to 2, and the data numbers of the nk data packets can be expressed as: (x+n-5), (x+n-2), and (x+n+1) to (x+2n-2).
[0119] In this implementation, the data packets with abnormal transmission in the first data group are added to the next data group for retransmission, thereby facilitating ensuring the integrity of data packet transmission.
[0120] See also Figure 7 , is a flow chart of a communication method provided in an embodiment of the present application, the communication method is applied to a sending end, and the method comprises the following steps:
[0121] Send data packets;
[0122] Whether the amount of data sent is equal to the number of multi-frame responses n, if not, continue to send the next data packet;
[0123] If the amount of data sent is equal to the number of multi-frame responses n, then the response packet is received;
[0124] Determine whether there is a data packet number that is not received normally in the response, that is, determine whether there is a data number of a data packet that is not received normally in the response packet; if not, enter the next round of sending process.
[0125] If there is a data packet number that was not received normally in the response, the data packet with the corresponding number will be placed in the next round of sending queue, and then enter the next round of sending process.
[0126] The communication method provided in the embodiment of the present application can be specifically applied to the use scenario of multi-chip communication within a mobile phone. The embodiment of the present application formulates a communication protocol for transmission across different hardware interfaces and designs an efficiency improvement scheme based on reliable data transmission, which has at least the following beneficial effects:
[0127] The communication protocol supports transmission interfaces with and without hardware frame synchronization signals.
[0128] Reduce the reliable data transmission time from n*(t_data+t_ack) to n*t_data+t_ack, improve the data transmission efficiency of application chips and other external chips in actual use scenarios, and reduce access delay. Wherein, t_data is the time required to send a data packet, and t_ack is the time required to send a response packet.
[0129] It should be noted that the above communication method can not only be used for communication between chips, but also as a protocol encapsulation for data interaction between different modules within a system on chip (SOC), and as a transmission protocol for data sharing, forwarding, and routing.
[0130] The communication method provided in the embodiment of the present application can be executed by a communication device. In the embodiment of the present application, the communication device provided in the embodiment of the present application is described by taking the communication device executing the communication method as an example.
[0131] See also Figure 8 , Figure 8 A schematic diagram of the structure of a communication device 800 provided in an embodiment of the present application, wherein the communication device 800 is applied to a receiving end, and the device includes:
[0132] A first receiving module 801 is configured to receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0133] The first sending module 802 is used to send a first response packet to the sending end when the data number of the first data packet is equal to x+n, wherein the first response packet is a response packet of the n data packets.
[0134] Optionally, the device further comprises:
[0135] an acquisition module, configured to acquire m data numbers, wherein the m data numbers include: data numbers of data packets included in the first data group received by the receiving end, and m is an integer less than or equal to n;
[0136] The first generating module is used to generate the first response packet based on the m data numbers, wherein the first response packet is used to indicate whether the n data packets in the first data group are sent normally.
[0137] Optionally, the first generating module is specifically configured to generate the first response packet when m is equal to n and the m data numbers are m data numbers that are continuously incremented by 1, wherein the first response packet indicates that the n data packets are sent normally; or
[0138] The first generating module is further specifically used to generate the first response packet based on the m data numbers and the second abnormal data number included in the second response packet when m is equal to n and the m data numbers are m data numbers that are non-continuously incremented by 1, wherein the second response packet is a response packet for the second data group, the second abnormal data number is the data number of the abnormally sent data packet in the second data group, and the second data group is the data group received in the previous round of the first data group; or,
[0139] The first generating module is further specifically used to generate the first response packet when m is smaller than n, wherein the first response packet includes the data number of the abnormally sent data packet among the n data packets.
[0140] Optionally, the first generating module includes:
[0141] An acquisition submodule, used for acquiring a third abnormal data number among the m data numbers, wherein the third abnormal data number is a data number of a data packet sending an abnormality in the first data group;
[0142] A generating submodule is used to generate the first response packet when the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, wherein the first response packet is used to indicate that the n data packets in the first data group are sent normally; or, in the case where there is at least one third abnormal data number that is a data number other than the second abnormal data number included in the second response packet, generate the first response packet, wherein the first response packet includes the data numbers of the data packets with other sending abnormalities among the m data numbers except the second abnormal data number.
[0143] In this implementation, n data packets are treated as a data group, and after completing the reception of n data packets in a data group, the n data packets are responded to uniformly, that is, only one response is required for the transmission of n data packets. In this way, compared with the related art that requires n responses for n data packets, this is beneficial to reduce the number of responses in the process of data packet transmission, thereby reducing the time required for the response, and further beneficial to improving the efficiency of data transmission.
[0144] The communication device 800 in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0145] The communication device 800 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0146] The communication device 800 provided in the embodiment of the present application can realize Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0147] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a communication device 900 provided in an embodiment of the present application, wherein the communication device is applied to a transmitting end, and the device includes:
[0148] A second sending module 901 is used to send a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0149] The second sending module 901 is also used to send data packets in a third data group to the sending end when the data number of the first data packet is equal to x+n and a first response packet is received, wherein the third data group is a data group to be sent in the next round of the first data group.
[0150] Optionally, the device further comprises:
[0151] A second generating module is used to generate the third data group when the first response packet includes k fourth abnormal data numbers, wherein the third data group includes: k data packets corresponding to the k fourth abnormal data numbers, and nk data packets whose data numbers are successively increased by 1, wherein the data number of the data packet with the smallest data number among the nk data packets is x+n+1, wherein k is an integer greater than or equal to 0, and the fourth abnormal data number is used to characterize that the data packet with the fourth abnormal data number among the n data packets in the first data group is sent abnormally.
[0152] In this implementation, n data packets are treated as a data group, and after completing the reception of n data packets in a data group, the n data packets are responded to uniformly, that is, only one response is required for the transmission of n data packets. In this way, compared with the related art that requires n responses for n data packets, this is beneficial to reduce the number of responses in the process of data packet transmission, thereby reducing the time required for the response, and further beneficial to improving the efficiency of data transmission.
[0153] The communication device 900 in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0154] The communication device 900 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0155] The communication device 900 provided in the embodiment of the present application can realize Figure 6 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0156] Alternatively, if Fig.10 As shown, an embodiment of the present application also provides an electronic device 1000, including a processor 1001, a memory 1002, and a program or instruction stored in the memory 1002 and executable on the processor 1001. When the program or instruction is executed by the processor 1001, each process of the above-mentioned communication method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0157] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0158] Fig.11 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0159] The electronic device 1100 includes but is not limited to: a radio frequency unit 1101, a network module 1102, an audio output unit 1103, an input unit 1104, a sensor 1105, a display unit 1106, a user input unit 1107, an interface unit 1108, a memory 1109, and a processor 1110 and other components.
[0160] The radio frequency unit 1101 is configured to receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0161] The radio frequency unit 1101 is further configured to send a first response packet to the transmitting end when the data number of the first data packet is equal to x+n, wherein the first response packet is a response packet for the n data packets.
[0162] Optionally, the processor 1110 is configured to obtain m data numbers, wherein the m data numbers include: data numbers of data packets included in the first data group received by the receiving end, and m is an integer less than or equal to n;
[0163] The processor 1110 is further configured to generate the first response packet based on the m data numbers, wherein the first response packet is used to indicate whether the n data packets in the first data group are sent normally.
[0164] Optionally, the processor 1110 is configured to generate the first response packet when m is equal to n and the m data numbers are m data numbers that are continuously incremented by 1, wherein the first response packet indicates that the n data packets in the first data group are sent normally; or
[0165] The processor 1110 is used to generate the first response packet based on the m data numbers and the second abnormal data number included in the second response packet when m is equal to n and the m data numbers are m data numbers that are non-continuously incremented by 1, wherein the second response packet is a response packet for the second data group, the second abnormal data number is the data number of the data packet that sends the abnormality in the second data group, and the second data group is the data group received in the previous round of the first data group; or
[0166] The processor 1110 is configured to generate the first response packet when m is smaller than n, wherein the first response packet includes a data number of a data packet that has been sent abnormally among the n data packets.
[0167] Optionally, the processor 1110 is configured to obtain a third abnormal data number among the m data numbers, wherein the third abnormal data number is a data number of a data packet sending an abnormality in the first data group;
[0168] The processor 1110 is used to generate the first response packet when the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, wherein the first response packet is used to indicate that the n data packets in the first data group are sent normally; or, when there is at least one third abnormal data number that is a data number other than the second abnormal data number included in the second response packet, generate the first response packet, wherein the first response packet includes the data numbers of the data packets with other sending abnormalities among the m data numbers except the second abnormal data number.
[0169] Those skilled in the art will appreciate that the electronic device 1100 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.11 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0170] It should be understood that in the embodiment of the present application, the input unit 1104 may include a graphics processor (Graphics Processing Unit, GPU) 11041 and a microphone 11042, and the graphics processor 11041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1106 may include a display panel 11061, and the display panel 11061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1107 includes a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include two parts: a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0171] The memory 1109 can be used to store software programs and various data. The memory 1109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1109 may include a volatile memory or a non-volatile memory, or the memory 1109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0172] The processor 1110 may include one or more processing units; optionally, the processor 1110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1110.
[0173] Fig.12 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0174] The electronic device 1200 includes but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 1205, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, and a processor 1210 and other components.
[0175] The radio frequency unit 1201 is used to send a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which it belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1;
[0176] The radio frequency unit 1201 is further used to send a data packet in a third data group to the transmitting end when the data number of the first data packet is equal to x+n and a first response packet is received, wherein the third data group is a data group to be sent in the next round of the first data group.
[0177] Optionally, the processor 1210 is used to generate the third data group when the first response packet includes k fourth abnormal data numbers, wherein the third data group includes: k data packets corresponding to the k fourth abnormal data numbers, and nk data packets whose data numbers are continuously increased by 1, and the data number of the data packet with the smallest data number among the nk data packets is x+n+1, wherein k is an integer greater than or equal to 0, and the fourth abnormal data number is used to characterize that the data packet with the data number of the fourth abnormal data number among the n data packets in the first data group is abnormally sent.
[0178] Those skilled in the art will appreciate that the electronic device 1200 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1210 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.12 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0179] It should be understood that in the embodiment of the present application, the input unit 1204 may include a graphics processor (Graphics Processing Unit, GPU) 12041 and a microphone 12042, and the graphics processor 12041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1206 may include a display panel 12061, and the display panel 12061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1207 includes a touch panel 12071 and other input devices 12072. The touch panel 12071 is also called a touch screen. The touch panel 12071 may include two parts: a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0180] The memory 1209 can be used to store software programs and various data. The memory 1209 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1209 may include a volatile memory or a non-volatile memory, or the memory 1209 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1209 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0181] The processor 1210 may include one or more processing units; optionally, the processor 1210 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1210.
[0182] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned communication method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0183] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0184] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned communication method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0185] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0186] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0188] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A communication method, applied to a receiving end, characterized in that: The method comprises: Receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1; When the data number of the first data packet is equal to x+n, a first response packet is sent to the transmitting end, wherein the first response packet is a response packet for the n data packets.
2. The method according to claim 1, characterized in that In the case where the data number of the first data packet is equal to x+n, before sending the first response packet to the transmitting end, the method further includes: Acquire m data numbers, wherein the m data numbers include: data numbers of data packets included in the first data group received by the receiving end, and m is an integer less than or equal to n; The first response packet is generated based on the m data numbers, wherein the first response packet is used to indicate whether the n data packets in the first data group are sent normally.
3. The method according to claim 2, characterized in that The generating the first response packet based on the m data numbers includes: In the case where m is equal to n and the m data numbers are m data numbers that are continuously incremented by 1, the first response packet is generated, wherein the first response packet indicates that the n data packets in the first data group are sent normally; or In the case where m is equal to n, and the m data numbers are m data numbers that are non-continuously incremented by 1, the first response packet is generated based on the m data numbers and the second abnormal data number included in the second response packet, wherein the second response packet is a response packet for the second data group, the second abnormal data number is the data number of the abnormal data packet in the second data group, and the second data group is the data group received in the previous round of the first data group; or When m is smaller than n, the first response packet is generated, wherein the first response packet includes the data number of the abnormally sent data packet among the n data packets.
4. The method according to claim 3, characterized in that The generating the first response packet based on the m data numbers and the second abnormal data number included in the second response packet comprises: Obtaining a third abnormal data number among the m data numbers, wherein the third abnormal data number is a data number of a data packet in the first data group that sends an abnormality; In the case where the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, the first response packet is generated, wherein the first response packet is used to indicate that the n data packets in the first data group are sent normally; or, in the case where there is at least one third abnormal data number that is a data number other than the second abnormal data number included in the second response packet, the first response packet is generated, wherein the first response packet includes the data numbers of the data packets with other sending abnormalities among the m data numbers except the second abnormal data number.
5. A communication method, applied to a sending end, characterized in that: The method comprises: Sending a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate the sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1; When the data number of the first data packet is equal to x+n and the first response packet is received, a data packet in a third data group is sent to the sending end, wherein the third data group is the data group to be sent in the next round of the first data group.
6. The method according to claim 5, characterized in that In the case where the data number of the first data packet is equal to x+n and the first response packet is received, before sending the data packet in the next data group to the transmitting end, the method further includes: In the case where the first response packet includes k fourth abnormal data numbers, the third data group is generated, wherein the third data group includes: k data packets corresponding to the k fourth abnormal data numbers, and nk data packets whose data numbers are successively increased by 1, wherein the data number of the data packet with the smallest data number among the nk data packets is x+n+1, wherein k is an integer greater than or equal to 0, and the fourth abnormal data number is used to characterize that the sending of the data packet with the fourth abnormal data number among the n data packets in the first data group is abnormal.
7. A communication device, applied to a receiving end, characterized in that: The device comprises: A first receiving module, configured to receive a first data packet sent by a transmitting end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packet in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1; The first sending module is used to send a first response packet to the sending end when the data number of the first data packet is equal to x+n, wherein the first response packet is a response packet of the n data packets.
8. The device according to claim 7, characterized in that The device also includes: an acquisition module, configured to acquire m data numbers, wherein the m data numbers include: data numbers of data packets included in the first data group received by the receiving end, and m is an integer less than or equal to n; The first generating module is used to generate the first response packet based on the m data numbers, wherein the first response packet is used to indicate whether the n data packets in the first data group are sent normally.
9. The device according to claim 8, characterized in that The first generating module is specifically configured to generate the first response packet when m is equal to n and the m data numbers are m data numbers that are continuously incremented by 1, wherein the first response packet indicates that the n data packets are sent normally; or The first generating module is further specifically used to generate the first response packet based on the m data numbers and the second abnormal data number included in the second response packet when m is equal to n and the m data numbers are m data numbers that are non-continuously incremented by 1, wherein the second response packet is a response packet for the second data group, the second abnormal data number is the data number of the abnormally sent data packet in the second data group, and the second data group is the data group received in the previous round of the first data group; or, The first generating module is further specifically used to generate the first response packet when m is smaller than n, wherein the first response packet includes the data number of the abnormally sent data packet among the n data packets.
10. The device according to claim 9, characterized in that The first generating module comprises: An acquisition submodule, used for acquiring a third abnormal data number among the m data numbers, wherein the third abnormal data number is a data number of a data packet sending an abnormality in the first data group; A generating submodule is used to generate the first response packet when the third abnormal data numbers are all the second abnormal data numbers included in the second response packet, wherein the first response packet is used to indicate that the n data packets in the first data group are sent normally; or, in the case where there is at least one third abnormal data number that is a data number other than the second abnormal data number included in the second response packet, generate the first response packet, wherein the first response packet includes the data numbers of the data packets with other sending abnormalities among the m data numbers except the second abnormal data number.
11. A communication device, applied to a transmitting end, characterized in that: The device comprises: A second sending module, used for sending a first data packet to a receiving end, wherein the first data packet includes a data number of the first data packet in a first data group to which the first data packet belongs, the first data group includes n data packets, and the data number of the data packet with the largest data number among the n data packets is x+n, the data number is used to indicate a sending order of the corresponding data packets in the data group to which it belongs, the x is an integer greater than or equal to 0, and the n is an integer greater than 1; The second sending module is also used to send data packets in a third data group to the sending end when the data number of the first data packet is equal to x+n and the first response packet is received, wherein the third data group is the data group to be sent in the next round of the first data group.
12. The device according to claim 11, characterized in that The device also includes: A second generating module is used to generate the third data group when the first response packet includes k fourth abnormal data numbers, wherein the third data group includes: k data packets corresponding to the k fourth abnormal data numbers, and nk data packets whose data numbers are successively increased by 1, wherein the data number of the data packet with the smallest data number among the nk data packets is x+n+1, wherein k is an integer greater than or equal to 0, and the fourth abnormal data number is used to characterize that the data packet with the fourth abnormal data number among the n data packets in the first data group is sent abnormally.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the communication method according to any one of claims 1 to 6 are implemented.
