Data error correction method and device, computer device and storage medium
By employing a dual-mode communication method in the smart grid system, sequence numbers are set for power data packets and error-correcting data packets are generated, forming two data packet sequences. These sequences are transmitted via power line carrier and wireless communication, respectively, thus solving the problem of data loss in power communication and improving data transmission efficiency and reliability.
Patent Information
- Application Number
- CN202410453230.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-04-16
AI Technical Summary
In smart grid systems, power line carrier communication and wireless communication are susceptible to interference from the distribution network topology and the environment, leading to data loss and affecting data transmission efficiency.
A dual-mode communication method is adopted, which sets the sequence number of power data packets in sequence and generates error correction data packets to form two data packet sequences. These sequences are transmitted separately through power line carrier and wireless communication, and the receiving device can recover the data based on these two sequences.
It improves the reliability and efficiency of data transmission, reduces the probability of data retransmission, and ensures that all power data packets can be recovered in the event of continuous packet loss.
Smart Images

Figure CN118381526B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data communication, and in particular to a data error correction method and device, a computer device and a storage medium. BACKGROUND
[0002] The smart grid has the characteristics of wide application scenarios and various services, and is the development trend of the current power system. With the development of the smart grid system, in addition to the communication between devices based on the power line carrier (PLC), the devices can also communicate in combination with the wireless communication mode.
[0003] However, the power line carrier communication is easily affected by the topology of the power distribution network, the load and the like, and the wireless communication is easily affected by the environment, resulting in the problem of data loss when the power line carrier communication or the wireless communication is used, and the need for repeated packet transmission, which affects the data transmission efficiency. SUMMARY
[0004] Therefore, the present application provides a data error correction method and device, a computer device and a storage medium to solve the problem of low data transmission efficiency of the existing power grid system.
[0005] In a first aspect, the present application provides a data error correction method applied to a source device, comprising:
[0006] determining m*n power data packets to be sent to a destination device; the source device and the destination device are in dual-mode communication, and the dual-mode communication includes power line carrier communication and wireless communication; m and n are both integers greater than or equal to 2;
[0007] setting a corresponding serial number for each power data packet in sequence and forming a first data packet sequence;
[0008] In the first data packet sequence, a corresponding first error correction data packet is generated based on consecutive n power data packets, and the first error correction data packet is inserted into the first data packet sequence;
[0009] reordering the m*n power data packets to form a second data packet sequence;
[0010] In the second data packet sequence, a corresponding second error correction data packet is generated based on consecutive m power data packets, and the second error correction data packet is inserted into the second data packet sequence;
[0011] The power data packets and the first error correction data packet in the first data packet sequence are sent to the destination device in sequence in a first communication mode; the power data packets and the second error correction data packet in the second data packet sequence are sent to the destination device in sequence in a second communication mode;
[0012] The first communication mode is the power line carrier communication and the second communication mode is the wireless communication, or the first communication mode is the wireless communication and the second communication mode is the power line carrier communication.
[0013] In some optional embodiments, the reordering of the mxn power data packets to form a second data packet sequence comprises:
[0014] In the mxn power data packets, every m power data packets are selected, and the selected power data packets are sequentially taken as elements in the second data packet sequence.
[0015] After the selection is completed, the process of selecting every m power data packets is re-executed until all power data packets in the first data packet sequence are traversed, and a second data packet sequence containing mxn power data packets is formed.
[0016] In some optional embodiments, m = n.
[0017] In a second aspect, the present application provides a data error correction method applied to a destination device, which comprises:
[0018] obtaining a first data packet sequence transmitted by a source device in a first communication mode and a second data packet sequence transmitted by the source device in a second communication mode; the source device and the destination device perform dual-mode communication, the dual-mode communication comprises power line carrier communication and wireless communication; and the first communication mode is the power line carrier communication and the second communication mode is the wireless communication, or the first communication mode is the wireless communication and the second communication mode is the power line carrier communication;
[0019] In the case that there is a missing power data packet in the first data packet sequence, determining a first data packet group to which the missing power data packet belongs; the first data packet group comprises other power data packets with serial numbers continuous to the missing power data packet and corresponding first error correction data packets;
[0020] performing data recovery according to the power data packets and the first error correction data packets in the first data packet group to recover the missing power data packet;
[0021] In the case that there are multiple missing data packets in the first data packet group, determining at least part of the missing power data packets in the first data packet group based on the second data packet sequence to recover all the missing power data packets.
[0022] In some optional embodiments, the determining the at least partially lost power data packets in the first data packet sequence based on the second data packet sequence to recover all the lost power data packets comprises:
[0023] determining a to-be-recovered sequence number, the to-be-recovered sequence number being a sequence number of a lost power data packet in the first data packet sequence;
[0024] judging whether the second data packet sequence contains a power data packet with the to-be-recovered sequence number;
[0025] in the case that the second data packet sequence contains a power data packet with the to-be-recovered sequence number, recovering the at least partially lost power data packets in the first data packet sequence based on the power data packet with the to-be-recovered sequence number;
[0026] in the case that the second data packet sequence does not contain a power data packet with the to-be-recovered sequence number, determining a second data packet sequence corresponding to the to-be-recovered sequence number in the second data packet sequence; the second data packet sequence comprises other power data packets with sequence numbers continuous to the to-be-recovered sequence number and corresponding second error correction data packets;
[0027] recovering the power data packet with the to-be-recovered sequence number based on the power data packets and the second error correction data packets in the second data packet sequence.
[0028] In some optional embodiments, the method further comprises:
[0029] in the case that there are also multiple lost data packets in the second data packet sequence, sending a retransmission instruction for retransmitting the lost power data packets in the first data packet sequence to the source device, to instruct the source device to retransmit the lost power data packets in the first data packet sequence to the destination device.
[0030] In a third aspect, the present application provides a data error correction device applied to a source device, the device comprising:
[0031] a determining module configured to determine m×n power data packets to be transmitted to a destination device; the source device and the destination device perform dual-mode communication, the dual-mode communication comprising power line carrier communication and wireless communication; m and n are both integers not less than 2;
[0032] a first sequence module configured to set a corresponding sequence number for each of the power data packets in sequence and form a first data packet sequence; in the first data packet sequence, a corresponding first error correction data packet is generated based on continuous n power data packets, and the first error correction data packet is inserted into the first data packet sequence;
[0033] a second sequence module, configured to reorder the mxn power data packets to form a second data packet sequence, and insert a second error correction data packet into the second data packet sequence based on a continuous m power data packets in the second data packet sequence;
[0034] a sending module, configured to send the power data packets and the first error correction data packets in the first data packet sequence to the target device in a first communication mode, and send the power data packets and the second error correction data packets in the second data packet sequence to the target device in a second communication mode;
[0035] The first communication mode is the power line carrier communication, and the second communication mode is the wireless communication, or the first communication mode is the wireless communication, and the second communication mode is the power line carrier communication.
[0036] In a fourth aspect, the present application provides a data error correction device applied to a target device, which comprises:
[0037] a obtaining module, configured to obtain a first data packet sequence sent by a source device in a first communication mode and a second data packet sequence sent by the source device in a second communication mode, wherein the source device and the target device perform dual-mode communication, the dual-mode communication comprises power line carrier communication and wireless communication, and the first communication mode is the power line carrier communication, and the second communication mode is the wireless communication, or the first communication mode is the wireless communication, and the second communication mode is the power line carrier communication;
[0038] a grouping module, configured to determine a first data packet group to which a lost power data packet belongs in a case that the lost power data packet exists in the first data packet sequence, wherein the first data packet group comprises other power data packets with serial numbers continuous to the lost power data packet and corresponding first error correction data packets;
[0039] a first recovery module, configured to perform data recovery according to the power data packets and the first error correction data packets in the first data packet group to recover the lost power data packet;
[0040] a second recovery module, configured to determine at least part of the lost power data packets in the first data packet group based on the second data packet sequence in a case that multiple lost data packets exist in the first data packet group, to recover all the lost power data packets.
[0041] In a fifth aspect, the present application provides a computer device, comprising a memory and a processor, which are communicatively connected with each other, and the memory stores computer instructions, and the processor executes the computer instructions to perform the data error correction method of the first aspect, the second aspect or any of the corresponding embodiments thereof.
[0042] In a sixth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the data error correction method of the first aspect, the second aspect or any of the corresponding embodiments thereof.
[0043] The technical solution provided by the present application can use different arrangement sequences for multiple power data packets to be transmitted, respectively, form corresponding error correction data packets by grouping, construct two data packet sequences, and transmit the two error correction data packets through power line carrier communication and wireless communication, respectively. This processing manner can make the target device on the receiving side more easily perform data recovery, and in the case of continuous packet loss in the transmission process, there is a greater possibility of data error correction, so that all original power data packets can be recovered, and the situation of retransmitting data packets is avoided as much as possible, thereby improving the transmission efficiency.
[0044] In addition, when the first data packet sequence received by the target device has a packet loss problem, the lost power data packets in the first data packet sequence can be recovered based on the second data packet sequence, thereby improving the possibility of the target device obtaining all power data packets and effectively avoiding data retransmission. In addition, if the second data packet sequence is generated every m power data packets, when the first packet sequence has a continuous packet loss problem, the second data packet sequence is more likely to lose a data packet in a different second data packet group, so that data recovery can be performed based on the second data packet group, and the probability of data retransmission can be further reduced. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the specific embodiments or related art, the following will briefly introduce the drawings needed to be used in the specific embodiments or related art descriptions. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0046] Figure 1 is a flowchart of a data error correction method on the source device side according to an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of a dual-mode communication between a source device and a target device according to an embodiment of the present application;
[0048] Figure 3 This is a schematic diagram illustrating the generation of two data packet sequences according to an embodiment of the present invention;
[0049] Figure 4 This is a flowchart illustrating a data error correction method on the target device side according to an embodiment of the present invention;
[0050] Figure 5 This is a structural block diagram of a data error correction device on the source device side according to an embodiment of the present invention;
[0051] Figure 6 This is a structural block diagram of a data error correction device on the target device side according to an embodiment of the present invention;
[0052] Figure 7 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] In power grid systems, power line carrier communication technology is currently widely used. With the continuous advancement of power grid system construction and the significant increase in the number of smart meters and data acquisition terminals, the communication environment for power line carrier communication has become quite harsh. The widespread application of power electronic devices and frequency converters has also made the electromagnetic environment of the power grid increasingly complex, resulting in unstable carrier communication performance between smart meters and data acquisition terminals.
[0055] Wireless signals are transmitted through the air via electromagnetic waves. Due to the limited signal transmission power and the different heights of the transmitting and receiving ends, the signal is blocked by many obstacles during transmission. This results in significant signal attenuation when penetrating walls and buildings, causing phenomena such as reflection and diffraction, leading to multipath transmission. As a result, the signal energy received by the receiving end will be lost to a certain extent, thus affecting the transmission performance of wireless communication.
[0056] To improve the reliability of data transmission between power equipment, redundancy processing, such as forward error correction (FEC), is typically applied to the data to be transmitted to correct errors and reduce duplicate packet transmission. However, in power communication scenarios, the communication channel changes are relatively slow and continuous, leading to frequent packet loss. This makes traditional data error correction methods ineffective in power communication environments.
[0057] This invention provides a data error correction method that arranges multiple power data packets into two data packet sequences with different orders, performs data error correction, and then sends the two data packet sequences to the destination device via power line carrier communication and wireless communication respectively. This enables the destination device to effectively recover data even in the event of data loss, reduces the probability of data retransmission, and thus improves data transmission efficiency.
[0058] According to an embodiment of the present invention, a data error correction method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0059] This embodiment provides a data error correction method, which can be executed by the source device used to send data packets. Figure 1 This is a flowchart of a data error correction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps.
[0060] Step S101: Determine the m×n power data packets to be sent to the destination device; the source device and the destination device communicate in a dual-mode manner, which includes power line carrier communication and wireless communication; m and n are both integers not less than 2.
[0061] In this embodiment, the source device and the destination device are different devices in the power grid system. The source device is the device that sends power data, and the destination device is the device that receives power data. The source device is capable of dual-mode communication with the destination device, meaning they can communicate using both power line carrier (PLC) and wireless communication. Accordingly, the source device can send power data to the destination device using dual-mode communication.
[0062] Figure 2 This diagram illustrates a scenario of dual-mode communication between a source device and a destination device. For example... Figure 2 As shown, the source device 201 includes a power line carrier communication module 2011 and a wireless communication module 2022. Based on the power line carrier communication module 2011 and the wireless communication module 2022, dual-mode communication can be realized between the source device 201 and the destination device 202.
[0063] In this embodiment, the source device and the destination device transmit data in the form of data packets; that is, the source device sends multiple power data packets to the destination device. Specifically, when the source device sends power data packets to the destination device, it can first determine the number of m×n power data packets to be sent to the destination device, where m and n are both integers not less than 2. Here, m and n can be preset values; for example, if m = 4 and n = 3, then the source device needs to determine 12 power data packets first.
[0064] Step S102: Set the corresponding sequence number for each power data packet in sequence to form the first data packet sequence.
[0065] In this embodiment, the power data packets on the source device side have a certain order, such as the generation order. Based on this order, corresponding sequence numbers can be set for the m×n power data packets sequentially, for example, starting from 1 and setting sequence numbers 1, 2, 3, etc. It can be understood that when the source device transmits another set of m×n power data packets next time, the sequence number of this set of power data packets will start from m×n+1 to ensure the uniqueness of the sequence number.
[0066] By sorting the m×n power data packets according to this sequence number, a sequence containing m×n power data packets can be formed, which is the first data packet sequence. For example, if the subscripts represent the sequence numbers of the power data packets, then the m×n power data packets can be represented as a1, a2, ..., a... m×n The first data packet sequence formed at this time can be represented as {a1, a2, ..., a...} m×n}
[0067] Step S103: In the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence.
[0068] In this embodiment, the power data packets in the first data packet sequence are grouped, that is, every n power data packets are a data packet group, which will be referred to as the first data packet group; for each first data packet group, the error correction data packet of the first data packet group can be determined, that is, the first error correction data packet.
[0069] For example, the first error-correcting data packet can be generated based on a forward error correction algorithm. For instance, if n = 3 and the first data packet group includes power data packets a1, a2, and a3, then the corresponding first error-correcting data packet b1 can be determined by XOR, i.e., b1 = a1⊕a2⊕a3, where ⊕ represents the XOR operator. Other methods can also be used to generate the first error-correcting data packet; this embodiment does not limit this method.
[0070] In this process, for each group of first data packets in the first data packet sequence, a corresponding first error-correcting data packet can be generated. After generating the first error-correcting data packet, it is inserted into the first data packet sequence, and the insertion position of the first error-correcting data packet matches the position of the power data packet that generated it, thereby updating the first data packet sequence. It can be understood that for m×n power data packets, there are m groups of first data packets, meaning a total of m first error-correcting data packets can be determined. Therefore, after inserting the m first error-correcting data packets into the first data packet sequence, the first data packet sequence includes: m×n power data packets and m first error-correcting data packets, that is, a total of m×n+m data packets.
[0071] For example, the first error-correcting data packet can be inserted at the end of the corresponding first data packet group to update the first data packet group; based on all the updated first data packet groups, the first data packet sequence can be finally determined.
[0072] For example, with m=2 and n=3, the initial sequence of the first data packet is {a1,a2,a3,a4,a5,a6}. Furthermore, based on the power data packets a1, a2, and a3, the corresponding first error correction data packet b1 can be determined, and based on the power data packets a4, a5, and a6, the corresponding first error correction data packet b2 can be determined. The first error correction data packets are inserted at the end of their respective first data packet groups, resulting in the final sequence of the first data packets: {a1,a2,a3,b1,a4,a5,a6,b2}.
[0073] Step S104: Reorder the m×n power data packets to form a second data packet sequence.
[0074] In this embodiment, in addition to generating the first data packet sequence, these power data packets are also reordered to form another data packet sequence with a different arrangement order than the first data packet sequence, namely the second data packet sequence. It can be understood that both the first and second data packet sequences include the same m×n power data packets, only their arrangement order is different.
[0075] Step S105: In the second data packet sequence, a corresponding second error correction data packet is generated based on m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence.
[0076] In this embodiment, similar to the method for generating the first error-correcting data packet described above, for the second data packet sequence, every m power data packets form a data packet group, hereinafter referred to as the second data packet group; for each second data packet group, the error-correcting data packet of that second data packet group can be determined, i.e., the second error-correcting data packet. Then, the second error-correcting data packet is inserted into the second data packet sequence, and finally, the second data packet sequence to be sent externally can be determined. The generation and insertion process of the second error-correcting data packet is similar to that of the first error-correcting data packet, and will not be described in detail here.
[0077] It can be understood that for m×n power data packets, there are n second data packet groups, that is, a total of n second error correction data packets can be determined. Therefore, after inserting the n second error correction data packets into the second data packet sequence, the second data packet sequence includes: m×n power data packets and n second error correction data packets, that is, a total of m×n+n data packets.
[0078] In some optional implementations, the above step S104, "reordering the m×n power data packets to form a second data packet sequence," may specifically include steps A1 to A2.
[0079] Step A1: Select power data packets from m×n power data packets at intervals of m, and use the selected power data packets as elements in the second data packet sequence.
[0080] Step A2: After the selection is completed, the process of selecting power data packets every m intervals is repeated until all power data packets in the first data packet sequence are traversed, forming a second data packet sequence containing m×n power data packets.
[0081] In this embodiment, the main function of the second data packet sequence is to help recover some data packets from the first data packet sequence. To better address the problem of continuous packet loss, m is used as the interval parameter when generating the second data packet sequence. That is, every m power data packets, data is selected from m×n power data packets to form a new second data packet sequence. This method of generating the second data packet sequence ensures that each power data packet in the second data packet group corresponds to a different first data packet group, thereby effectively reducing the probability of continuous data loss in the second data packet group when continuous packet loss occurs in the first data packet group.
[0082] For example, m×n power data packets can be represented in rows and columns. Figure 3 As shown, if m = 2 and n = 3, then these 6 power data packets can be represented as follows: d 11 d 12 d 13 d 21 d 22 d23 For the first data packet sequence, the first error correction data packet can be generated by grouping every 3 (n=3) power data packets together; for example... Figure 3 As shown, based on each row of power data packets, corresponding first error correction data packets D1 and D2 can be generated. Similarly, for the second data packet sequence, corresponding second error correction data packets can be generated by grouping every 2 (n=2) power data packets; as shown... Figure 3 As shown, based on the power data packets in each column, corresponding second error correction data packets D3, D4, and D5 can be generated.
[0083] Insert the error correction data packet at the end of the corresponding group, such as... Figure 3 As shown, the final determined first data packet sequence is {d} 11 ,d 12 ,d 13 ,D1,d 21 ,d 22 ,d 23 The second data packet sequence is {d}, D2}. 11 ,d 21 ,D3,d 12 ,d 22 ,D4,d 13 ,d 23 ,D5}.
[0084] Step S106: Using a first communication method, the power data packet and the first error correction data packet in the first data packet sequence are sent to the destination device in sequence; using a second communication method, the power data packet and the second error correction data packet in the second data packet sequence are sent to the destination device in sequence.
[0085] The first communication method is power line carrier communication, and the second communication method is wireless communication; alternatively, the first communication method is wireless communication, and the second communication method is power line carrier communication. Optionally, to ensure consistency between the two communication methods, m = n can be chosen.
[0086] In this embodiment, after determining the first data packet sequence (including m×n power data packets and m first error correction data packets) and the second data packet sequence (including m×n power data packets and n second error correction data packets), different communication methods can be used to send the data packets from the two data packet sequences to the destination device. By sending different data packet sequences to the destination device using two communication methods, the destination device has a higher probability of recovering the original m×n power data packets in the event of continuous packet loss. The principle behind the easier data recovery by the destination device will be explained in detail later.
[0087] For example, data packets in the first data packet sequence can be sent sequentially to the destination device using power line carrier communication, and data packets in the second data packet sequence can be sent sequentially to the destination device using wireless communication; alternatively, data packets in the first data packet sequence can be sent sequentially to the destination device using wireless communication, and data packets in the second data packet sequence can be sent sequentially to the destination device using power line carrier communication. This embodiment does not limit this approach.
[0088] The data error correction method provided in this embodiment adopts different arrangement orders for multiple power data packets to be sent, groups them into corresponding error correction data packets, constructs two data packet sequences, and transmits the two error correction data packets through power line carrier communication and wireless communication respectively. This processing method makes it easier for the receiving device to recover data. In the event of continuous packet loss during transmission, there is also a greater chance of data error correction, thereby recovering all the original power data packets and minimizing the need for retransmission of data packets, thus improving transmission efficiency.
[0089] This embodiment provides another data error correction method, which can be executed by the destination device for receiving data packets. Figure 4 This is a flowchart of a data error correction method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps.
[0090] Step S401: Obtain a first data packet sequence sent by the source device in a first communication mode and a second data packet sequence sent in a second communication mode; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; and the first communication mode is power line carrier communication and the second communication mode is wireless communication, or the first communication mode is wireless communication and the second communication mode is power line carrier communication.
[0091] In this embodiment, as Figure 1 As shown, when data is transmitted between the source device and the destination device, the source device sends a first data packet sequence and a second data packet sequence to the destination device using different communication methods. For example, the process by which the destination device 202 obtains the first data packet sequence and the second data packet sequence can be found in [reference needed]. Figure 2 As shown.
[0092] It is understandable that if the communication link between the source device and the destination device is normal, the destination device can receive the first data packet sequence and the second data packet sequence completely, and data recovery is not required.
[0093] If data packet loss occurs due to an anomaly in the communication link between the source and destination devices, data recovery may be required. Specifically, since the error correction data packets (including the first and second error correction data packets) in the first and second data packet sequences are redundant data packets used for data recovery, if only the error correction data packets are lost, the destination device does not need to perform data recovery. Conversely, if there is a loss of power data packets in the data packet sequence received by the destination device, data recovery is required, as detailed in steps S402 to S403 below.
[0094] Step S402: If there is a lost power data packet in the first data packet sequence, determine the first data packet group to which the lost power data packet belongs; the first data packet group includes other power data packets with the sequence number of the lost power data packet, and the corresponding first error correction data packet.
[0095] In this embodiment, since the power data packets themselves have sequence numbers, the continuity of these sequence numbers can be used to determine whether a power data packet loss has occurred. If some power data packets in the first data packet sequence are lost, other power data packets adjacent to the lost power data packet, as well as the corresponding first error correction data packet, can be identified. This first error correction data packet is formed based on these power data packets (including the lost power data packets). For ease of description, these power data packets and the first error correction data packet are referred to as the first data packet group.
[0096] Step S403: Perform data recovery based on the power data packet and the first error correction data packet in the first data packet group to recover the lost power data packet.
[0097] In this embodiment, since the first error-correcting data packet is generated based on a corresponding error-correction algorithm (e.g., forward error correction algorithm), the lost power data packet can be recovered using the first error-correcting data packet. For example, if the first data packet group originally included power data packets a1, a2, and a3, and the first error-correcting data packet b1, and if power data packet a2 is lost during transmission, power data packet a2 can be recovered based on power data packets a1, a3, and the first error-correcting data packet b1.
[0098] Step S404: In the case that there are multiple lost data packets in the first data packet group, at least some of the lost power data packets in the first data packet group are determined based on the second data packet sequence, so as to recover all lost power data packets.
[0099] In this embodiment, if there are multiple lost data packets in the first data packet group, for example, if the first data packet group includes multiple lost power data packets, or includes lost power data packets and first error correction data packets, data recovery cannot be achieved solely based on the first data packet group. In this case, the target device can perform data recovery based on related data packets in the second data packet sequence to recover all lost power data packets.
[0100] In some optional implementations, the above step S404, "determining at least some of the lost power data packets in the first data packet group based on the second data packet sequence, so as to recover all lost power data packets," may specifically include the following steps B1 to B5.
[0101] Step B1: Determine the sequence number to be recovered. The sequence number to be recovered is the sequence number of the lost power data packet in the first data packet group.
[0102] In this embodiment, since each power data packet has a sequence number, the lost power data packets in the first data packet group also have a corresponding sequence number; for ease of description, this sequence number is referred to as the recovery sequence number. The number of recovery sequence numbers can be one or more, depending on the number of lost power data packets.
[0103] Step B2: Determine whether the second data packet sequence contains a power data packet with a sequence number to be recovered.
[0104] Step B3: If the second data packet sequence contains a power data packet with a sequence number to be recovered, at least some of the lost power data packets in the first data packet group are recovered based on the power data packet with the sequence number to be recovered.
[0105] In this embodiment, if the second data packet sequence contains a power data packet with a sequence number to be recovered, the lost power data packet in the first data packet group can be directly recovered based on the power data packet in the second data packet sequence.
[0106] For example, for Figure 3 The six power data packets shown include power data packet d. 11 d 12 d 13 And the first error correction data packet D1 is a first data packet group; if the first data packet sequence received by the destination device only includes the power data packet d 11 And the first error-correcting data packet D1, i.e., the power data packet d 12 d 13 If the data is lost, data recovery is impossible. If the destination device receives a second data packet sequence containing the power data packet d... 12 d13 Then, data recovery can be performed directly on the first data packet group, thereby recovering the complete first data packet group {d}. 11 ,d 12 ,d 13 ,D1}.
[0107] Step B4: If the second data packet sequence does not contain a power data packet with a sequence number to be recovered, determine the second data packet group corresponding to the sequence number to be recovered in the second data packet sequence; the second data packet group includes other power data packets with sequence numbers consecutive to the power data packet with the sequence number to be recovered, and the corresponding second error correction data packet.
[0108] Step B5: Perform data recovery based on the power data packet and the second error correction data packet in the second data packet group to recover the power data packet with the sequence number to be recovered.
[0109] In this embodiment, if the second data packet sequence does not contain a power data packet with a sequence number to be recovered, the second error correction data packet in the second data packet sequence can be used to recover the required power data packet.
[0110] like Figure 3 As shown, the power data packet d is still lost in the first data packet sequence. 12 d 13 For example; if the power data packet d does not exist in the second data packet sequence. 12 The power data packet d is then transmitted using two communication methods. 12 Data loss occurred in both cases; at this point, it can be determined that in the second data packet sequence, the data packet d is related to the power data packet. 12 The corresponding second data packet group. For example... Figure 3 As shown, the second data packet group is {d} 12 ,d 22 ,D4}(where the power data packet d) 12 (Lost), at this time, the second data packet group can be used as {d 12 ,d 22 The remaining packets in D4} attempt to recover the power packet d. 12 .
[0111] Specifically, if only one data packet is lost in the second data packet group, that is, if the second data packet group includes the power data packet d 22 The second error correction data packet D4 is based on the power data packet d. 22 The power data packet d can be recovered from the second error-corrected data packet D4. 12 For the lost power data packet d 13 A similar processing flow can also be executed, which will not be elaborated here.
[0112] Because continuous packet loss is common in power communication scenarios, multiple data packets may be lost consecutively in the first data packet group. In this embodiment, if a second data packet sequence is generated based on the above steps A1 to A2, such as... Figure 3 As shown, when the first packet sequence experiences continuous packet loss, the second packet sequence is likely to lose only one packet from a different second packet group. This allows for data recovery based on the second packet group, reducing the probability of data retransmission.
[0113] Alternatively, the method may further include step B6.
[0114] Step B6: If multiple lost data packets also exist in the second data packet group, a retransmission instruction is sent to the source device to retransmit the lost power data packets in the first data packet sequence, instructing the source device to retransmit the lost power data packets in the first data packet sequence to the destination device.
[0115] In this embodiment, if there are also multiple lost data packets in the second data packet group, data recovery cannot be achieved based solely on the second data packet sequence. Therefore, a request can be made to retransmit the lost data packets. That is, the source device sends a retransmission instruction to retransmit the lost power data packets in the first data packet sequence. After receiving the retransmission instruction, the source device can retransmit the lost power data packets in the first data packet sequence to the destination device.
[0116] If there are multiple lost data packets in the second data packet group, we can first try to recover some of the lost power data packets in the second data packet group based on the first data packet sequence. If at least some of the lost power data packets in the second data packet group can be recovered based on the first data packet sequence, and the recovered second data packet group has only one lost data packet or no lost data packets, then we can re-recover the first data packet group based on the second data packet group, that is, execute step B5 above again.
[0117] The data error correction method provided in this embodiment can assist in recovering lost power data packets in the first data packet sequence based on the second data packet sequence when the first data packet sequence received by the destination device has packet loss issues. This increases the likelihood that the destination device can obtain all power data packets and effectively avoids data retransmission. Furthermore, if the second data packet sequence is generated every m power data packets, then when the first packet sequence experiences continuous packet loss, the second data packet sequence is likely to have lost only one data packet from a different second data packet group. This allows for data recovery based on the second data packet group, further reducing the probability of data retransmission.
[0118] This embodiment also provides a data error correction device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0119] This embodiment provides a data error correction device, applied to a source device, such as... Figure 5 As shown, it includes:
[0120] The determining module 501 is used to determine the m×n power data packets that need to be sent to the destination device; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; m and n are both integers not less than 2;
[0121] The first sequence module 502 is used to set a corresponding sequence number for each of the power data packets in sequence and form a first data packet sequence; in the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence;
[0122] The second sequence module 503 is used to reorder the m×n power data packets to form a second data packet sequence; in the second data packet sequence, a corresponding second error correction data packet is generated based on the m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence;
[0123] The sending module 504 is configured to send the power data packet and the first error correction data packet in the first data packet sequence to the destination device in sequence using a first communication method; and to send the power data packet and the second error correction data packet in the second data packet sequence to the destination device in sequence using a second communication method.
[0124] Wherein, the first communication method is the power line carrier communication and the second communication method is the wireless communication, or the first communication method is the wireless communication and the second communication method is the power line carrier communication.
[0125] In some optional implementations, the second sequence module 503 reorders the m×n power data packets to form a second data packet sequence, including:
[0126] In the m×n power data packets, a selection is made every m power data packets, and the selected power data packets are used as elements in the second data packet sequence in sequence.
[0127] After the selection is completed, the process of selecting power data packets every m intervals is repeated until all power data packets in the first data packet sequence are traversed, forming a second data packet sequence containing m×n power data packets.
[0128] In some alternative implementations, m = n.
[0129] This embodiment provides another data error correction device, applied to the target device, such as... Figure 6 As shown, it includes:
[0130] The acquisition module 601 is used to acquire a first data packet sequence sent by the source device in a first communication mode and a second data packet sequence sent in a second communication mode; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; and the first communication mode is the power line carrier communication and the second communication mode is the wireless communication, or the first communication mode is the wireless communication and the second communication mode is the power line carrier communication;
[0131] The grouping module 602 is used to determine the first data packet group to which the lost power data packet belongs when there is a lost power data packet in the first data packet sequence; the first data packet group includes other power data packets with the sequence number of the lost power data packet, and the corresponding first error correction data packet;
[0132] The first recovery module 603 is used to perform data recovery based on the power data packet and the first error correction data packet in the first data packet group, so as to recover the lost power data packet;
[0133] The second recovery module 604 is used to determine, based on the second data packet sequence, at least some of the lost power data packets in the first data packet group when there are multiple lost data packets in the first data packet group, so as to recover all lost power data packets.
[0134] In some optional implementations, the second recovery module 604 determines at least partially lost power data packets in the first data packet group based on the second data packet sequence, in order to recover all lost power data packets, including:
[0135] Determine the sequence number to be recovered, where the sequence number to be recovered is the sequence number of the lost power data packet in the first data packet group;
[0136] Determine whether the second data packet sequence contains a power data packet with the sequence number to be recovered;
[0137] If the second data packet sequence contains a power data packet with the number to be recovered, at least some of the lost power data packets in the first data packet group are recovered based on the power data packet with the number to be recovered.
[0138] If the second data packet sequence does not contain a power data packet with the sequence number to be restored, a second data packet group corresponding to the sequence number to be restored is determined in the second data packet sequence; the second data packet group includes other power data packets whose sequence numbers are consecutive to the power data packet with the sequence number to be restored, and corresponding second error correction data packets;
[0139] Data recovery is performed based on the power data packet and the second error correction data packet in the second data packet group to recover the power data packet with the sequence number to be recovered.
[0140] In some alternative implementations, the device further includes a retransmission module for:
[0141] If multiple lost data packets also exist in the second data packet group, a retransmission instruction for retransmitting the lost power data packets in the first data packet sequence is sent to the source device, instructing the source device to retransmit the lost power data packets in the first data packet sequence to the destination device.
[0142] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0143] In this embodiment, the data error correction device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0144] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.
[0145] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0146] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0147] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0148] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0149] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0150] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0151] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A data error correction method, characterized in that, Applied to a source device, the method includes: Determine m×n power data packets to be sent to the destination device; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; m and n are both integers not less than 2; Each of the power data packets is assigned a corresponding sequence number in sequence, forming a first data packet sequence; In the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence; The m×n power data packets are reordered to form a second data packet sequence; In the second data packet sequence, a corresponding second error correction data packet is generated based on m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence; Using a first communication method, the power data packet and the first error correction data packet in the first data packet sequence are sent to the destination device in sequence; using a second communication method, the power data packet and the second error correction data packet in the second data packet sequence are sent to the destination device in sequence. Wherein, the first communication method is the power line carrier communication and the second communication method is the wireless communication, or the first communication method is the wireless communication and the second communication method is the power line carrier communication.
2. The method according to claim 1, characterized in that, The step of reordering the m×n power data packets to form a second data packet sequence includes: In the m×n power data packets, a selection is made every m power data packets, and the selected power data packets are used as elements in the second data packet sequence in sequence. After the selection is completed, the process of selecting power data packets every m intervals is repeated until all power data packets in the first data packet sequence are traversed, forming a second data packet sequence containing m×n power data packets.
3. The method according to claim 2, characterized in that, m=n.
4. A data error correction method, characterized in that, Applied to a target device, the method includes: The source device acquires a first data packet sequence sent in a first communication mode and a second data packet sequence sent in a second communication mode; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; and the first communication mode is the power line carrier communication and the second communication mode is the wireless communication, or the first communication mode is the wireless communication and the second communication mode is the power line carrier communication; If a lost power data packet exists in the first data packet sequence, the first data packet group to which the lost power data packet belongs is determined; the first data packet group includes other power data packets with consecutive sequence numbers of the lost power data packet, and the corresponding first error correction data packet; Data recovery is performed based on the power data packet and the first error correction data packet in the first data packet group to recover the lost power data packet; In the case that there are multiple lost data packets in the first data packet group, at least some of the lost power data packets in the first data packet group are determined based on the second data packet sequence, so as to recover all lost power data packets; The first data packet sequence and the second data packet sequence are generated based on the following method: Assign corresponding sequence numbers to m×n power data packets in order to form the first data packet sequence; m and n are both integers not less than 2; In the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence; The m×n power data packets are reordered to form a second data packet sequence; In the second data packet sequence, a corresponding second error correction data packet is generated based on m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence.
5. The method according to claim 4, characterized in that, The step of determining at least some of the lost power data packets in the first data packet group based on the second data packet sequence, in order to recover all lost power data packets, includes: Determine the sequence number to be recovered, where the sequence number to be recovered is the sequence number of the lost power data packet in the first data packet group; Determine whether the second data packet sequence contains a power data packet with the sequence number to be recovered; If the second data packet sequence contains a power data packet with the number to be recovered, at least some of the lost power data packets in the first data packet group are recovered based on the power data packet with the number to be recovered. If the second data packet sequence does not contain a power data packet with the sequence number to be restored, a second data packet group corresponding to the sequence number to be restored is determined in the second data packet sequence; the second data packet group includes other power data packets whose sequence numbers are consecutive to the power data packet with the sequence number to be restored, and corresponding second error correction data packets; Data recovery is performed based on the power data packet and the second error correction data packet in the second data packet group to recover the power data packet with the sequence number to be recovered.
6. The method according to claim 5, characterized in that, Also includes: If multiple lost data packets also exist in the second data packet group, a retransmission instruction for retransmitting the lost power data packets in the first data packet sequence is sent to the source device, instructing the source device to retransmit the lost power data packets in the first data packet sequence to the destination device.
7. A data error correction device, characterized in that, Applied to a source device, the device includes: A determination module is used to determine the m×n power data packets that need to be sent to the destination device; the source device and the destination device communicate in a dual-mode manner, which includes power line carrier communication and wireless communication; m and n are both integers not less than 2; The first sequence module is used to set a corresponding sequence number for each of the power data packets in sequence and form a first data packet sequence; in the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence; The second sequence module is used to reorder the m×n power data packets to form a second data packet sequence; in the second data packet sequence, a corresponding second error correction data packet is generated based on the m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence; The sending module is configured to send the power data packet and the first error correction data packet in the first data packet sequence to the destination device in sequence using a first communication method; and to send the power data packet and the second error correction data packet in the second data packet sequence to the destination device in sequence using a second communication method. Wherein, the first communication method is the power line carrier communication and the second communication method is the wireless communication, or the first communication method is the wireless communication and the second communication method is the power line carrier communication.
8. A data error correction device, characterized in that, Applied to a target device, the device includes: The acquisition module is used to acquire a first data packet sequence sent by the source device in a first communication mode and a second data packet sequence sent in a second communication mode; the source device and the destination device communicate in a dual-mode manner, the dual-mode communication including power line carrier communication and wireless communication; and the first communication mode is the power line carrier communication and the second communication mode is the wireless communication, or the first communication mode is the wireless communication and the second communication mode is the power line carrier communication; The grouping module is used to determine the first data packet group to which the lost power data packet belongs when there is a lost power data packet in the first data packet sequence; the first data packet group includes other power data packets with the sequence number of the lost power data packet, and the corresponding first error correction data packet; The first recovery module is used to perform data recovery based on the power data packet and the first error correction data packet in the first data packet group, so as to recover the lost power data packet; The second recovery module is used to determine, based on the second data packet sequence, at least some of the lost power data packets in the first data packet group when there are multiple lost data packets in the first data packet group, so as to recover all lost power data packets. The first data packet sequence and the second data packet sequence are generated based on the following method: Assign corresponding sequence numbers to m×n power data packets in order to form the first data packet sequence; m and n are both integers not less than 2; In the first data packet sequence, a corresponding first error correction data packet is generated based on n consecutive power data packets, and the first error correction data packet is inserted into the first data packet sequence; The m×n power data packets are reordered to form a second data packet sequence; In the second data packet sequence, a corresponding second error correction data packet is generated based on m consecutive power data packets, and the second error correction data packet is inserted into the second data packet sequence.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the data error correction method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the data error correction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
High-real-time data transmission method
CN116155450A
Communication method and device, and storage medium
CN117768949A