Data communication method and apparatus, and terminal and storage medium

By introducing check bits and multi-channel data merging technology in data communication, the problem of unstable data transmission signals in factory automation production is solved, real-time verification and anti-interference capabilities of data transmission are achieved, and the stability and stability of processing equipment are improved. Security.

WO2024212133A1PCT designated stage expired Publication Date: 2024-10-17HANS LASER TECH IND GRP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/087874
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

In factory automation production, the data transmission of processing equipment is prone to electromagnetic interference or poor contact of transmission lines, resulting in signal instability, affecting processing quality and possibly causing accidents.

Method used

In the data communication method, the sending end sets a check bit adjacent to each data bit, and the receiving end detects each data bit and check bit of each frame of data to determine the validity of the frame data. bits and end bits identify the data frame, and combine multiple channels of data at the receiving end to improve anti-interference capabilities.

Benefits of technology

It achieves real-time verification and anti-interference capabilities of data transmission, avoids processing accidents caused by erroneous data, and improves the stability and safety of processing equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023087874_17102024_PF_FP_ABST
    Figure CN2023087874_17102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a data communication method and apparatus, and a terminal and a storage medium. The data communication method comprises the steps of: a sending end sending one or more data frames to a receiving end, wherein each data frame comprises one or more data bits, and each data bit is set as a first signal value or a second signal value; and setting a check bit at an adjacent bit of each data bit, wherein each check bit is set as a signal value the same as or different from that of a corresponding data bit. In the present invention, by means of setting a check bit at an adjacent bit of each data bit sent by a sending end, a receiving end can conveniently check, in real time, data sent by the sending end, so as to determine whether each data bit is interfered with during transmission, thereby achieving a full-check effect; thus, the receiving end can find an incorrect data instruction in a timely manner and can avoid the execution of same.
Need to check novelty before this filing date? Find Prior Art

Description

Data communication method, device, terminal and storage medium Technical Field

[0001] The present invention relates to the field of data communication technology, and in particular to a data communication method, device, terminal and storage medium. Background Art

[0002] In the factory automation production process, the data transmission of processing equipment is often affected by electromagnetic interference in the working environment or poor contact of the transmission line, resulting in unstable transmission signals or data transmission errors. The processing equipment cannot process according to the correct processing instructions, thereby affecting the processing quality and even causing processing accidents in serious cases.

[0003] Summary of the Invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present application provides a data communication method, device, terminal and storage medium, which can improve the accuracy of data transmission.

[0005] This embodiment adopts the following technical solutions:

[0006] A data communication method, applied to a sending end, comprises the steps of:

[0007] A transmitting end sends one frame or a plurality of consecutive frames of data to a receiving end, each frame of data including a plurality of data bits, each data bit being set to a first signal value or a second signal value;

[0008] A check bit is set at a position adjacent to each data bit, and each check bit is set to a signal value that is the same as or different from the corresponding data bit.

[0009] A data communication method, applied to a receiving end, comprises the steps of:

[0010] The receiving end receives one or more frames of data sent by the sending end and detects the signal value of each data bit and the adjacent check bit of each frame of data:

[0011] When each check bit is preset to a signal value different from its corresponding data bit, if the receiving end detects that all data bits in a frame of data have different signal values ​​from their adjacent check bits, the frame data is judged to be valid; otherwise, the frame data is judged to be invalid.

[0012] Furthermore, in the data communication method, a check bit is set at a position before or after each data bit, and a signal value of the check bit is different from a signal value of the corresponding data bit.

[0013] Furthermore, in the data communication method, each frame of data also includes a start bit, and the number of the start bits is one or more, which are sequentially set at the front end of all data bits and all check bits.

[0014] Furthermore, in the data communication method, each frame of data also includes an end bit, and the number of the end bits is three or more, which are sequentially arranged at the end of all data bits and all check bits, and the signal value of each end bit is the same.

[0015] Furthermore, the data communication method further includes the steps of:

[0016] The receiving end counts whether the number of consecutive invalid data frames exceeds a preset value;

[0017] If it does not exceed, the current invalid data frame will be ignored and the next frame of data will be received;

[0018] If exceeded, an alarm will be issued.

[0019] Furthermore, the data communication method further includes the steps of:

[0020] Two or more data paths with the same content are sent from the transmitting end to the receiving end, and each path of data includes one or more frames of data.

[0021] Furthermore, the data communication method further includes the steps of:

[0022] The receiving end receives two or more data paths with the same content sent by the transmitting end, each path of data including one frame or multiple frames of continuous data;

[0023] Determine whether each frame of data in each channel is valid:

[0024] All data paths are merged into one path, and each frame of data after the merger is selected from a valid frame of data in any path of data with a corresponding position.

[0025] Furthermore, the data communication method further includes the steps of:

[0026] The receiving end receives two or more data paths with the same content sent by the transmitting end, each path of data including one frame or multiple frames of continuous data;

[0027] Merge all the data into one data path;

[0028] When the signal values ​​of the data bits at the same position in different data paths are the same, the same signal value is directly used as the signal value of the merged data bit;

[0029] When the signal values ​​of the data bits at the same position in different paths of data are different, the signal value with the largest number is directly used as the signal value of the merged data bit.

[0030] A data communication device, comprising:

[0031] Transmitting module: used to send one or more frames of data, each frame of data includes multiple data bits;

[0032] Setting module: used to set each data bit to the first signal value or the second signal value, and set a check bit at the adjacent position of each data bit, and each check bit is set to the same or different signal value as the corresponding data bit.

[0033] A data communication device, comprising:

[0034] Receiving module: used to receive one or more frames of data, each frame of data includes multiple data bits;

[0035] Detection module: used to detect the signal value of each data bit and the adjacent check bit of each frame of data;

[0036] The judgment module is used to judge that when each check bit is preset to a signal value different from its corresponding data bit, if the detection module detects that all data bits in a frame of data have different signal values ​​from the check bits adjacent to them, then the frame data is judged to be valid; otherwise, the frame data is judged to be invalid.

[0037] A terminal includes a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the above data communication methods when executing the computer program.

[0038] A computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are configured to execute any one of the above data communication methods.

[0039] Compared with the existing technology, the data communication method, device, terminal and storage medium provided by the present application can facilitate the receiving end to perform real-time verification of the data sent by the sending end by setting a check bit in the adjacent bits of each data bit sent by the sending end, and determine whether each bit of data is interfered with during transmission, thereby achieving a full verification effect, so that the receiving end can promptly discover and avoid executing erroneous data instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] FIG1 is a flow chart of the data communication method provided in the present application applied to the sending end.

[0041] FIG2 is a flow chart of the data communication method provided in the present application applied to the receiving end.

[0042] FIG3 is a framework diagram of a specific embodiment of the data communication method provided in this application.

[0043] FIG. 4 is a flow chart of steps S600B2 - S900B2 in the data communication method shown in FIG. 2 .

[0044] FIG5 is a hardware circuit diagram of the existing XY2-100 digital protocol.

[0045] FIG6 is a framework diagram of the existing XY2-100 digital protocol.

[0046] FIG7 is a structural block diagram of the data communication device (transmitting end) provided in this application.

[0047] FIG8 is a structural block diagram of the data communication device (receiving end) provided by this application.

[0048] FIG9 is a structural block diagram of the terminal provided in this application. DETAILED DESCRIPTION

[0049] To make the objectives, technical solutions, and effects of this application more clear and explicit, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Without further description, the elements, structures, and features of one embodiment may also be beneficially combined with other embodiments.

[0050] Referring to FIG1 , the present application discloses a data communication method, which is applied to a data transmitting end and includes the following steps:

[0051] S100A, a transmitting end sends one or more consecutive frames of data to a receiving end, each frame of data including multiple data bits, each data bit being set to a first signal value or a second signal value;

[0052] S200A: Set a check bit at a position adjacent to each data bit, and set each check bit to a signal value that is the same as or different from the corresponding data bit.

[0053] In processing equipment, the sending end is typically a control unit, and the receiving end is typically an execution unit. The control unit transmits data containing control instructions via a signal transmission line to the execution unit, which then executes the corresponding processing action. For example, an industrial computer sends a control instruction signal to a laser processing head, causing it to process a workpiece along a preset trajectory.

[0054] Each frame of data is a protocol data unit in the data transmission process defined in this application, including a start part, a data part and an end part. The start part and the end part contain necessary control information, and the data part consists of multiple consecutive data bits.

[0055] A bit is the smallest unit of data storage, representing two distinct states: 0 and 1, representing a low level and a high level, respectively. By adjusting the number of bits and the combination of 0s and 1s in each frame, each frame can express the desired information, such as control instructions for a machining process.

[0056] During the data transmission process of the processing equipment, electromagnetic interference or poor contact of the transmission line may occur, resulting in unstable transmission signals or data transmission errors. At this time, the processing equipment cannot perform processing according to the correct processing instructions, thus affecting the processing quality.

[0057] The present application sets a check bit at the adjacent bit (previous bit or next bit) of each valid data bit, and can check each valid data bit during the data communication process to achieve a full data verification effect, thereby avoiding data transmission errors.

[0058] Referring to FIG. 2 , the present application discloses a data communication method, which is applied to a data receiving end and includes the following steps:

[0059] S100B, the receiving end receives one frame or multiple frames of data sent by the transmitting end, and detects the signal value of each data bit and the adjacent check bit of each frame of data:

[0060] S200B. When each check bit is preset to a signal value different from its corresponding data bit, if the receiving end detects that all data bits in a frame of data have different signal values ​​from their adjacent check bits, the frame of data is judged to be valid; otherwise, the frame of data is judged to be invalid.

[0061] For example, the check bit can be set after the corresponding data bit. When a data bit is originally set to the first signal value, the corresponding check bit is set to the second signal value, representing 01. If all data bits in a frame of data have different signal values ​​from the adjacent check bits, it proves that all data bits have not been interfered with, that is, the frame of data is valid.

[0062] If, during data transmission, a data bit is disturbed and becomes a second signal value, the signal values ​​of the data bit and the check bit change from being different to being the same, representing 11. Upon detecting this, the receiving end determines that the data bit is incorrect. Since this data bit is incorrect, the information required to be expressed in the corresponding frame of data is also incorrect, and the data frame is therefore considered invalid.

[0063] The above data communication method can be applied to various fields, especially automatic processing fields that require real-time control, such as laser processing and CNC processing.

[0064] In a specific embodiment, a laser marking system is used as an example. It primarily consists of an industrial computer, a galvanometer head, a marking control card, and a pulsed laser. During marking, the X, Y, and Z axes are calibrated in the marking software on the industrial computer. The industrial computer then sends control commands via the marking control card to control the galvanometer head, moving the laser beam across the object being marked, thereby achieving a two-dimensional or three-dimensional marking effect.

[0065] When the galvanometer square head receives a faulty signal, the laser's position on the object being marked along the X, Y, and Z axes will deviate, affecting the marking effect and even rendering the marked material scrapped, resulting in serious losses. For example, if a laser marking system is used to weld the metal seams on a lithium battery casing, and the galvanometer square head receives an erroneous signal and becomes stuck in place, the laser beam will continue to emit light at the same position at the seam, easily burning through the battery casing and causing a fire or explosion.

[0066] By monitoring the signal value of each data bit and the signal value of the adjacent check bit sent by the marking control card in real time through the galvanometer square head, the galvanometer square head can judge in real time whether each bit of the processing instruction is interfered with during transmission, achieving the effect of full verification, timely discovering and avoiding the execution of erroneous instructions, thereby avoiding affecting the processing quality and causing safety problems.

[0067] Data is sent from the transmitter to the receiver via wired and wireless transmission. Wired transmission includes differential transmission, fiber optic transmission, and single-ended transmission. Wireless transmission includes LAN transmission, 5G transmission, and Bluetooth transmission. When each check bit is set to a signal value different from the corresponding data bit, DC balance can be achieved, further enhancing the line's anti-interference ability.

[0068] Of course, each check bit can also be set to the same signal value as the corresponding data bit according to actual needs. In this case, if all data bits in a frame of data are detected as the same signal value as the adjacent check bits, the frame of data is judged to be valid; otherwise, the frame of data is judged to be invalid.

[0069] In some embodiments, each frame of data further includes at least one start bit. The number of start bits is one or more, and the start bits are sequentially arranged at the front end of all data bits and all check bits.

[0070] Each frame of data also includes an end bit. When the number of check bits is 1 and the signal value of the check bit is different from the signal value of the corresponding data bit, the number of end bits can be set to three or more, and set in sequence at the end of all data bits and all check bits, and the signal value of each end bit is the same.

[0071] The data communication method in this application uses asynchronous communication. The start and end bits are used to identify the beginning and end of each frame of data. Unlike synchronous communication protocols, this method does not require a high-quality clock signal and coordinated timing in the line. As long as the receiving end receives the start and end bits, the data bits in between can be assumed to be useful data.

[0072] During the transmission of each frame of data, the transmitter first sends the start bit data to the receiver. The start bit can be a logic 0 (low level) that lasts for one bit time, so that the data line is in a logic 0 low level state, prompting the receiver that data transmission is about to begin; then the data bits and check bits are sent. According to the number of data bits and the combination of 0 and 1, the information to be transmitted can be expressed; finally, the stop bit data is sent to mark the end of the current frame of data transmission. At this time, the stop bit can make the data line in a logic 1 high level state.

[0073] Because the signal value of each data bit and the corresponding check bit are different, under normal circumstances, the data portion can only have a maximum of two consecutive data bits with the same signal value, such as 10011001..., 01100110... In this case, the stop bits are set to at least three, such as 111, 1111, etc. This allows the consecutive stop bits to be clearly distinguished from the data bits, making them easier for the receiver to identify.

[0074] Specifically, referring to Figure 3, in an embodiment of a data communication method applied to a laser marking system, each data frame in each data channel consists of 125 bits, including two start bits (01) and three end bits (111). The intermediate 120 bits are divided into three groups, each containing 20 data bits, representing the position data of the X, Y, and Z galvanometers. Each data bit is followed by a check bit, the inverse of the data bit, which can be used to verify data bit accuracy and to provide DC balancing on the transmission line.

[0075] In some embodiments, when the data communication method is applied to a data receiving end, the method further includes the steps of:

[0076] S300B: The receiving end counts whether the number of consecutive invalid data frames exceeds a preset value;

[0077] S400B, if not, ignore all invalid data frames and continue to receive the next frame of data;

[0078] S500B, if exceeded, alarm.

[0079] The receiving end can monitor in real time whether each frame of data sent by the sending end is interfered with during transmission, and set a specific value in advance, namely the preset value. During the data transmission process, it records whether the number of consecutive invalid data frames exceeds the preset value. If it exceeds, an alarm will be issued to notify the operator.

[0080] By increasing the range of the preset value, the continuity of data transmission can be improved and frequent alarms can be avoided; by reducing the range of the preset value, the accuracy of data transmission can be improved.

[0081] Taking the laser marking system as an example, due to the inertia of the galvanometer square head, when the galvanometer square head receives a frame of invalid data, even if the control instructions expressed by the frame data are not executed, it will not significantly affect the movement of the galvanometer square head and the processing quality.

[0082] Therefore, under the premise that the number of consecutive invalid data frames does not reach the preset value, the galvanometer square head can ignore the current invalid data frame and continue to receive the next data frame, avoiding frequent errors of the galvanometer square head and improving processing efficiency.

[0083] In some embodiments, please continue to refer to FIG. 1 , the data communication method applied to the data sending end further includes the steps of:

[0084] S300A: The transmitting end sends two or more data paths with the same content to the receiving end, where each path of data includes one or more frames of data.

[0085] The transmitter sends multiple channels of identical data simultaneously. Even if there is interference during the data transmission process, as long as any channel of data transmission is normal, the receiver can receive the correct data.

[0086] In some embodiments, please continue to refer to FIG. 2 , the data communication method applied to the data receiving end further includes the steps of:

[0087] S600B1. The receiving end receives two or more data channels with the same content from the transmitting end, each channel of data including one frame or multiple frames of continuous data.

[0088] S700B2, determine whether each frame of data in each channel is valid:

[0089] S800B2. Merge all data streams into one data stream, and select a valid data stream corresponding to a position in any data stream for each frame of the merged data.

[0090] The receiving end receives multiple channels of identical data simultaneously. Even if there is interference during the data transmission process, as long as any channel of data transmission is normal, the receiving end can receive the correct data.

[0091] Alternatively, referring to FIG4 , the data communication method applied to the data receiving end further includes the steps of:

[0092] S600B2. The receiving end receives two or more data paths with the same content from the transmitting end, each path of data including one frame or multiple frames of continuous data.

[0093] S700B2, merge all data into one data channel;

[0094] S800B2. When the signal values ​​of the data bits at the same position in different data paths are the same, the same signal value is directly used as the signal value of the merged data bit;

[0095] S900B2. When the signal values ​​of the data bits at the same position in different data paths are different, the signal value with the largest number is directly used as the signal value of the merged data bit.

[0096] That is, a voting scheme is used for multiple data channels. The signal value of each data bit in the final merged data is the signal value with the larger number of data channels. For example, if the galvanometer head receives three data channels sent by the industrial computer at the same time, and one of the channels has a current data bit of 0 and the other two have a current data bit of 1, the merged data will use the current data bit of 1. The receiving end assumes that the sending end sent a high-level data bit.

[0097] In a specific embodiment, when the data communication method adopted in the present application is applied in the field of laser processing, traditional communication modes can be directly reused, such as the hardware circuits of communication protocols such as the XY2-100 digital communication protocol and the SL2-100 digital communication protocol.

[0098] Refer to Figures 5 and 6. The XY2-100 digital protocol is a common synchronous transmission protocol in the laser processing field. On the rising edge of the synchronization signal (sync), the first data bit is transmitted, and then the 19 data bits are held high. The position data (DATA) is written on the rising edge of the clock signal (Clock), and the data is sampled by the galvanometer head on the falling edge. XCH, YCH, and ZCH represent the X-, Y-, and Z-axis galvanometer position data, respectively, and STATUS is the galvanometer feedback signal. Each frame of DATA contains 20 data bits. The first three data bits (C2-C0) are control bits, the next 16 data bits (D15-D0) are position data in shifted format, and the last data bit (P) is the even parity bit.

[0099] Based on the XY2-100 digital protocol hardware circuit, the data communication method disclosed in this application can be directly adopted. Use a differential chip (for example, model AM26LV32) to remove the SYNC / Clock / XCH / YCH / ZCH signals used in synchronous communication, and use these five signals as signal transmission for each data in this application. When the industrial computer transmits all five signals to the galvanometer square head through the control card at the same time, theoretically, the five signals received by the galvanometer square head are the same. If one or more signals are interfered with, as long as one signal transmission is normal, the galvanometer square head can receive the control card signal normally.

[0100] In the 5-channel signal transmission scheme, a voting module can be set before the receiving end of the galvanometer square head, and a voting scheme is adopted: among the 5 received signals, as long as 3 or more signals are high or low, the galvanometer square head believes that the marking control card has transmitted a high-level signal or a low-level signal.

[0101] Therefore, the present application provides a communication method that can be used as a communication protocol with stronger anti-interference capabilities implemented on the hardware facilities of traditional communication protocols. At the same time, it does not require a high-quality clock signal and coordinated timing in the line. As long as the receiving end receives the start bit and the end bit, the data bits in the middle can be defaulted to useful data. And because each bit of data is followed by a check bit, the receiving end can realize the function of detecting and checking each bit of data sent by the control card in real time. At the same time, this opposite data bit can also be used to achieve DC balance on the transmission line, further enhancing the anti-interference capability of signal transmission.

[0102] Referring to FIG. 7 , the present application further provides a data communication device (transmitter), comprising:

[0103] Transmitting module A1: used to send one or more frames of data, each frame of data includes multiple data bits;

[0104] Setting module A2: used to set each data bit to the first signal value or the second signal value, and set a check bit at the adjacent position of each data bit, and each check bit is set to the same or different signal value as the corresponding data bit.

[0105] Among them, the sending module A1 and the setting module A2 are applied to the control unit, such as the marking control card in the laser marking system. The marking control card is provided with corresponding control circuits or chips to realize the functions of the sending module A1 and the setting module A2.

[0106] Each frame of data sent by the sending module A1 also includes at least one start bit. The number of start bits is one or more, and they are sequentially set at the front end of all data bits and all check bits.

[0107] At the same time, each frame of data also includes an end bit. When the number of check bits is 1 and the signal value of the check bit is different from the signal value of the corresponding data bit, the number of end bits can be set to three or more, and set in sequence at the end of all data bits and all check bits, and the signal value of each end bit is the same.

[0108] In some embodiments, the sending module A1 in the data communication device (sending end) is further configured to send two or more data paths with the same content, each path of data including one or more frames of data.

[0109] The sending module A1 sends multiple channels of identical data simultaneously. Even if there is interference during the data transmission process, as long as any channel of data transmission is normal, the receiving end can receive the correct data.

[0110] Referring to FIG8 , the present application further provides a data communication device (receiving end), comprising:

[0111] Receiving module B1: used to receive one or more frames of data, each frame of data includes multiple data bits;

[0112] Detection module B2: used to detect the signal value of each data bit and the adjacent check bit of each frame of data;

[0113] The judgment module B3 is used to judge that when each check bit is preset to a signal value different from its corresponding data bit, if the detection module detects that all data bits in a frame of data have different signal values ​​from the check bits adjacent to them, then the frame data is judged to be valid; otherwise, the frame data is judged to be invalid.

[0114] Among them, the receiving module B1, the detection module B2 and the judgment module B3 are applied to the execution unit, such as the galvanometer square head in the laser marking system. The galvanometer square head is equipped with a corresponding control circuit or chip to realize the functions of the receiving module B1, the detection module B2 and the judgment module B3.

[0115] In some embodiments, the data communication device (receiving end) further includes:

[0116] Statistics module B4: used to count the number of consecutive invalid data frames;

[0117] Alarm module B5: used to alarm errors.

[0118] If the judgment module B3 determines that the number of consecutive invalid data frames counted by the statistical module B4 does not exceed the preset value, the receiving module B1 ignores the current invalid data frame and continues to receive the next frame of data; if the judgment module B3 determines that the number of consecutive invalid data frames counted by the statistical module B4 exceeds the preset value, an alarm is issued through the alarm module B5.

[0119] In some embodiments, the receiving module B1 in the data communication device (receiving end) is further configured to receive two or more data paths with the same content sent by the transmitting end, where each path of data includes one frame or multiple consecutive frames of data.

[0120] At the same time, the data communication device (receiving end) also includes:

[0121] Merging module B6: merges all data paths into one data path.

[0122] First, the judging module B3 judges whether each frame of data in each data path is valid, and then the merging module B6 merges all data paths into one data path, and each merged frame of data selects a valid frame of data with a corresponding position in any data path.

[0123] Alternatively, in some embodiments,

[0124] When the signal values ​​of the data bits at the same position in different data paths are the same, the merging module B6 directly uses the same signal value as the signal value of the merged data bit;

[0125] When the signal values ​​of the data bits at the same position in different paths of data are different, the merging module B6 directly adopts the signal value with the largest number as the signal value of the merged data bit.

[0126] The present application also provides a non-transitory computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the data communication method in the above embodiment.

[0127] Referring to Figure 9 , the present application also provides a data terminal comprising: at least one central processing unit (CPU) C1 (Figure 9 uses a single CPU C1 as an example); memory C2; a transmission line and a communications interface. The CPU C1, memory C2, and communications interface can communicate with each other via the transmission line; the communications interface can transmit information; the CPU C1 can call logic instructions in the memory C2 and utilize the data communication method described in the above embodiments.

[0128] The central processing unit C1 can be a central processing unit (CPU), and the processor C1 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0129] In addition, the logic instructions in the memory C2 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent workpiece.

[0130] Memory C2, as a computer-readable storage medium, can be configured to store software programs or computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present application. CPU C1 executes the software programs, instructions, or modules stored in memory C2 to perform functional applications and data processing, thereby implementing the methods in the embodiments described above.

[0131] Memory C2 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data generated based on the use of the terminal device. Memory C2 may also include high-speed random access memory and non-volatile memory.

[0132] All or part of the steps of the above embodiments can be completed by hardware, or can be completed by a program to instruct the relevant hardware. The program can be stored in a computer-readable storage medium. The storage medium can be a non-transitory storage medium, including a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc., and can also be a transient storage medium.

[0133] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and application concept of this application, and all these changes or substitutions should fall within the scope of protection of the claims attached to this application.

Claims

1. A data communication method, applied to a sending end, characterized in that: Includes steps: A transmitting end sends one frame or a plurality of consecutive frames of data to a receiving end, each frame of data includes a plurality of data bits, and each data bit is set to a first signal value or a second signal value; A check bit is set at a position adjacent to each data bit, and each check bit is set to a signal value that is the same as or different from the corresponding data bit.

2. A data communication method, applied to a receiving end, characterized in that: Includes steps: The receiving end receives one frame or multiple frames of data sent by the sending end, and detects the signal value of each data bit and the adjacent check bit of each frame of data: When each check bit is preset to a signal value different from its corresponding data bit, if the receiving end detects that all data bits in a frame of data have different signal values ​​from the adjacent check bits, the frame of data is judged to be valid, otherwise the frame of data is judged to be invalid.

3. The data communication method according to claim 1 or 2, characterized in that: A check bit is set at a position before or after each data bit, and the signal value of the check bit is different from the signal value of the corresponding data bit.

4. The data communication method according to claim 1 or 2, characterized in that: Each frame of data also includes a start bit, the number of which is one or more, and which is sequentially arranged at the front end of all data bits and all check bits.

5. The data communication method according to claim 3, characterized in that: Each frame of data also includes an end bit, the number of which is three or more, which are sequentially arranged at the rear ends of all data bits and all check bits, and the signal value of each end bit is the same.

6. The data communication method according to claim 2, characterized in that: Also includes the steps: The receiving end counts whether the number of consecutive invalid data frames exceeds a preset value; If not, the current invalid data frame will be ignored and the next frame of data will continue to be received; If exceeded, an alarm will be sounded.

7. The data communication method according to claim 1, characterized in that: Also includes the steps: Two or more data paths with the same content are sent from the transmitting end to the receiving end, and each path of data includes one or more frames of data.

8. The data communication method according to claim 2, characterized in that: Also includes the steps: The receiving end receives two or more data with the same content sent by the transmitting end, each of which includes one frame or multiple frames of continuous data; Determine whether each frame of data in each data channel is valid: All data paths are merged into one data path, and each frame of data after the merger is selected from a valid frame of data in any data path with a corresponding position.

9. The data communication method according to claim 2, characterized in that: Also includes the steps: The receiving end receives two or more data with the same content sent by the transmitting end, each of which includes one frame or multiple frames of continuous data; Merge all the data into one data path; When the signal values ​​of the data bits at the same position in different data paths are the same, the same signal value is directly used as the signal value of the merged data bit; When the signal values ​​of the data bits at the same position in different paths of data are different, the signal value with the largest number is directly used as the signal value of the merged data bit.

10. A data communication device, characterized in that: include: Transmitting module: used to send one or more frames of data, each frame of data includes multiple data bits; Setting module: used to set each data bit to the first signal value or the second signal value, and set a check bit at the adjacent position of each data bit, and each check bit is set to a signal value that is the same as or different from the corresponding data bit.

11. [Corrected 18.05.2023 in accordance with Rule 26] A data communication device, characterized in that include: Receiving module: used to receive one or more frames of data, each frame of data includes multiple data bits; Detection module: used to detect the signal value of each data bit and the adjacent check bit of each frame of data; The judgment module is used for judging that when each check bit is preset to a signal value different from its corresponding data bit, if the detection module detects that all data bits in a frame of data have different signal values ​​from the check bits adjacent to them, the frame of data is judged to be valid, otherwise the frame of data is judged to be invalid.

12. A terminal, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the data communication method according to any one of claims 1 to 9 when executing the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are configured to execute the data communication method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Double-bit-check coding and decoding method

    CN103107864A

  • Data transmission method and device, electronic equipment and machine readable storage medium

    CN112822226A

  • Data communication method and device, terminal and storage medium

    CN115459881A

  • Method and apparatus for error detection and correction

    US10725841B1