Communication method, electronic equipment and medium

By generating verification data and adjusting the transmission state using response signals during I2S communication, the problem of unreliable data transmission in the I2S communication protocol is solved, and highly reliable data transmission is achieved.

CN121750171APending Publication Date: 2026-03-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

The existing communication process based on the I2S communication protocol lacks a mechanism to determine the correctness of data transmission, resulting in low communication reliability.

Method used

During data transmission, the data sending module generates verification data and combines it with the original data to form a data packet. The data receiving module performs verification and generates a response signal. The data transmission module determines the target transmission status based on the response signal, thereby enabling the retransmission, continuation of transmission, or cessation of transmission of the data packet.

Benefits of technology

It improves the reliability of the I2S communication process, ensures the accuracy and efficiency of data transmission, and promptly handles data errors or transmission anomalies through a response signal mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121750171A_ABST
    Figure CN121750171A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method, electronic equipment and a medium, and relates to the technical field of communication, a data transmission module transmits to-be-transmitted data from a data sending module to a data receiving module, and receives a response signal returned by the data receiving module; the data receiving module verifies the to-be-transmitted data through the verification data sent by the data sending module so as to inform the data transmission module whether the current to-be-transmitted data is correct or not through the returned response signal, and the data transmission module executes different target transmission states according to different conditions of the to-be-transmitted data. The data transmission module and the data sending module are helped to determine whether errors and omissions exist in the currently transmitted data or not through data verification operation and response signal configuration, so that the possible problems of error transmission and the like are solved through the corresponding target transmission state, and the reliability of the whole communication process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a communication method, an electronic device and a medium. BACKGROUND

[0002] The collection, processing and transmission of sound data are important components of multimedia technology. Numerous digital audio systems have entered the consumer market, such as digital audio tapes, digital sound processors and other audio devices. For these audio systems or audio devices, a standardized information transmission structure can improve the adaptability of the entire system. The I2S communication protocol based on the I2S bus (Inter-IC Sound, integrated circuit built-in audio bus) architecture has been widely used in various audio systems or audio devices, and the I2S bus is responsible for realizing data transmission between audio devices. However, the communication implemented based on the I2S communication protocol currently lacks a determination mechanism for the correctness of the transmitted data, and when some bits in the transmitted data are missing or incorrect, it cannot be identified, resulting in incorrect transmission and low reliability of the entire communication process.

[0003] Therefore, how to implement an I2S communication process with higher reliability is a problem to be solved by those skilled in the art. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a communication method, an electronic device and a medium, which can solve the problem of unreliable communication implemented based on the I2S communication protocol.

[0005] To solve the above technical problems, the embodiments of the present application provide a communication method applied to a data transmission module; the communication method comprises:

[0006] obtaining transmitted data sent by a data sending module; the transmitted data comprises original data and check data;

[0007] transmitting the transmitted data to a data receiving module;

[0008] receiving a response signal returned by the data receiving module; the response signal is generated according to a check result by the data receiving module based on a check on the received transmitted data;

[0009] determining a target transmission state of the data transmission module based on the response signal, so that the data transmission module continues communication based on the target transmission state.

[0010] Optionally, the data transmission module comprises a storage module; after obtaining the transmitted data sent by the data sending module, the method further comprises:

[0011] copying the transmitted data into the storage module;

[0012] The target transmission state is retransmission of the to-be-transmitted data; and the communication is continued based on the target transmission state, including:

[0013] The to-be-transmitted data is obtained from the storage module, and the step of transmitting the to-be-transmitted data to the data receiving module is re-executed.

[0014] Optionally, the target transmission state of the data transmission module is determined based on the response signal, including:

[0015] It is judged whether the receipt signal returned by the data receiving module is received within a preset time period;

[0016] If the receipt signal is not received within the preset time period, it is determined that the target transmission state of the data transmission module is retransmission of the to-be-transmitted data;

[0017] If the receipt signal is received within the preset time period, it is judged whether the receipt signal is a first receipt; the first receipt is configured to represent that the to-be-transmitted data received by the data receiving module is not verified;

[0018] If the receipt signal is the first receipt, it is determined that the target transmission state of the data transmission module is retransmission of the to-be-transmitted data;

[0019] If the receipt signal is not the first receipt, it is judged whether the receipt signal is a second receipt; the second receipt is configured to represent that the to-be-transmitted data received by the data receiving module is verified and the data receiving module needs to continue to receive data transmission;

[0020] If the receipt signal is the second receipt, it is determined that the target transmission state of the data transmission module is to continue transmission of the next to-be-transmitted data;

[0021] If the receipt signal is not the second receipt, it is determined that the target transmission state of the data transmission module is to stop transmission.

[0022] Optionally, after the receipt signal is not the second receipt, further including:

[0023] It is judged whether the receipt signal is a third receipt; the third receipt is configured to represent that the to-be-transmitted data received by the data receiving module is verified and the data receiving module does not need to continue to receive data transmission;

[0024] If the receipt signal is the third receipt, it is determined that the target transmission state of the data transmission module is to stop transmission.

[0025] To solve the above technical problems, an embodiment of the present application further provides another communication method applied to a data sending module; the communication method includes:

[0026] Obtaining original data to be transmitted;

[0027] generate the check data corresponding to the original data based on the original data;

[0028] combine the original data and the check data into a data packet according to a preset mode to obtain the to-be-transmitted data;

[0029] send the to-be-transmitted data to the data transmission module, so that the data transmission module transmits the to-be-transmitted data to the data receiving module, and continues the communication based on the target transmission state after determining the target transmission state based on the response signal returned by the data receiving module.

[0030] Optionally, the generating of the check data corresponding to the original data based on the original data comprises:

[0031] splitting the original data into a plurality of data units based on a preset data format corresponding to the preset mode;

[0032] For any data unit, the data unit is checked by using a preset check mode to obtain the check data corresponding to the data unit;

[0033] combining the original data and the check data into a data packet according to a preset mode to obtain the to-be-transmitted data, comprising:

[0034] combining the data unit and the check data corresponding to the data unit into a data packet according to a preset mode to obtain the to-be-transmitted data transmitted in units of data packets.

[0035] To solve the above technical problems, the embodiment of the present application further provides another communication method applied to a data receiving module; the communication method comprises:

[0036] receiving the to-be-transmitted data sent by the data transmission module; the to-be-transmitted data is obtained by the data transmission module from the data sending module and transmitted to the data receiving module, and the to-be-transmitted data comprises original data and check data;

[0037] checking the received to-be-transmitted data based on the check data, and generating a corresponding response signal according to the check result;

[0038] sending the response signal to the data transmission module, so that the data transmission module determines the target transmission state, and continues the communication based on the target transmission state.

[0039] Optionally, the to-be-transmitted data is transmitted in units of data packets, and the data packet comprises a data unit corresponding to the original data and check data corresponding to the data unit; the checking of the received to-be-transmitted data based on the check data comprises:

[0040] For any data packet of the to-be-transmitted data, the data unit in the data packet is checked by using a preset check mode to obtain a check result;

[0041] judging whether the check result is consistent with the check data corresponding to the data unit in the data packet;

[0042] If yes, it is determined that the data packet passes the check;

[0043] If all the data packets of the data to be transmitted pass the check, it is determined that the data to be transmitted passes the check.

[0044] To solve the above technical problems, the embodiment of the present application further provides an electronic device, comprising:

[0045] a memory for storing a computer program;

[0046] a processor for executing the computer program to realize the steps of the communication method as described above.

[0047] To solve the above technical problems, the embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to realize the steps of the communication method as described above.

[0048] From the above technical solution, it can be seen that the data transmission module transmits the data to be transmitted from the data sending module to the data receiving module and receives the response signal returned by the data receiving module; the data receiving module checks the data to be transmitted by the check data sent by the data sending module, and informs the data transmission module of the correctness of the current data to be transmitted through the returned response signal; and the data transmission module executes different target transmission states according to different situations of the data to be transmitted. The beneficial effects of the present application are that the operation of data checking and the configuration of the response signal help the data transmission module and the data sending module to determine whether the current data is correct or not, so as to solve the possible error transmission problem through the corresponding target transmission state, and improve the reliability of the whole communication process. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0050] Figure 1 a flowchart of a communication method provided by the embodiment of the present application;

[0051] Figure 2 a flowchart of a data transmission process provided by the embodiment of the present application;

[0052] Figure 3 a working flowchart of a data transmission module provided by the embodiment of the present application;

[0053] Figure 4 Another flowchart of a communication method applied to a data sending module provided by the embodiment of the present application is shown in FIG. 6;

[0054] Figure 5 A working flowchart of a data sending module provided by the embodiment of the present application is shown in FIG. 7;

[0055] Figure 6 Another flowchart of a communication method applied to a data receiving module provided by the embodiment of the present application is shown in FIG. 8;

[0056] Figure 7 A working flowchart of a data receiving module provided by the embodiment of the present application is shown in FIG. 9;

[0057] Figure 8 A structural diagram of an electronic device provided by the embodiment of the present application is shown in FIG. 10. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0059] The terms “include” and “have” and any variations of the terms “include” and “have” in the specification and the above drawings of the present application are intended to cover the non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can include steps or units not listed.

[0060] In order to make the person skilled in the art better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0061] Next, a communication method provided by the embodiment of the present application applied to a data transmission module will be described in detail. Referring to FIG. 5, Figure 1 Figure 1 A flowchart of a communication method provided by the embodiment of the present application is shown in FIG. 5; the communication method includes:

[0062] S11: obtaining the to-be-transmitted data sent by the data sending module; the to-be-transmitted data includes original data and check data;

[0063] ​It is understandable that the data transmission module needs to obtain the to-be-transmitted data currently required to be transmitted from the data sending module. In order to improve the communication reliability, the data sending module will perform a preset check on the original data required to be transmitted in advance, generate check data corresponding to the original data, and transmit the to-be-transmitted data containing the original data and the check data at the same time when transmitting the original data through the data transmission module, so that the data receiving module can obtain the check data corresponding to the original data from the received to-be-transmitted data, and thus calculate and verify the received to-be-transmitted data through the preset check to determine the correctness of the received to-be-transmitted data, thereby realizing the determination mechanism of the correctness of the current transmission data in the communication process.

[0064] It should be noted that the specific implementation form of the to-be-transmitted data can be set according to actual application requirements, and the present application does not make special limitations here. If the communication method is applied in a communication process based on the I2S communication protocol, the to-be-transmitted data needs to be implemented in the transmission format specified by the I2S communication protocol. The to-be-transmitted data is specifically a data packet obtained by combining and packaging the original data and the check data in a preset manner by the data sending module. For one original data, the to-be-transmitted data may contain only one data packet, or may contain multiple data packets. The original data refers to the information body that the data sending module needs to transmit to the data receiving module, and the check data refers to additional information derived from the original data by a specific algorithm corresponding to the preset check, which is used to verify the integrity and correctness of the original data. The specific type and implementation of the check data are not particularly limited herein, and can be implemented by a check bit or the like.

[0065] S12: transmitting the to-be-transmitted data to the data receiving module;

[0066] S13: receiving a response signal returned by the data receiving module; the response signal is generated by the data receiving module according to a check result after checking the received to-be-transmitted data based on the check data;

[0067] It can be understood that after the data transmission module receives the to-be-transmitted data, it can transmit the to-be-transmitted data to the data receiving module through the I2S bus, and wait to receive the response signal returned from the data receiving module. After receiving the to-be-transmitted data, the data receiving module will verify and calculate the original data in the to-be-transmitted data by using a specific algorithm corresponding to the same preset check method as the data sending module, determine whether the to-be-transmitted data can pass the check through the verification and calculation check process, and generate a corresponding response signal according to the check result. The specific type and implementation of the response signal are not particularly limited herein, and can be implemented by a receipt signal or other types of signal.

[0068] S14: determining a target transmission state of the data transmission module based on the response signal, so that the data transmission module continues communication based on the target transmission state.

[0069] It is not difficult to understand that the data transmission module can determine the receiving condition of the data receiving module to the to-be-transmitted data and the checking result according to the specific condition of the response signal, and then determine the target transmission state to be executed subsequently based on this. The response signal specifically includes at least three conditions, the first condition corresponds to transmission exception (for example, transmission timeout), in this case, the data transmission module cannot receive the response signal returned by the data receiving module, at this time, it is indicated that the data receiving module does not normally receive the data, or the transmission of the data / response signal is abnormal, in this case, the to-be-transmitted data needs to be retransmitted in order to complete the normal transmission of the current to-be-transmitted data, that is, the target transmission state is to retransmit the to-be-transmitted data; the second condition corresponds to the checking failure, in this case, the data transmission module receives the first signal returned by the data receiving module, at this time, it is indicated that the data receiving module normally receives the data, but the data does not pass the checking, the to-be-transmitted data has error, at this time, the to-be-transmitted data also needs to be retransmitted in order to complete the normal transmission of the current to-be-transmitted data, that is, the target transmission state is to retransmit the to-be-transmitted data; the third condition corresponds to the checking passing, in this case, the data transmission module receives the second signal returned by the data receiving module, at this time, it is indicated that the data receiving module normally receives the data, and the data successfully passes the checking, the to-be-transmitted data is normally transmitted, at this time, it is indicated that the current to-be-transmitted data has completed the accurate and reliable transmission, and the transmission of the next data can be continued or the transmission is stopped until the communication between the data sending module and the data receiving module is completed.

[0070] It should be noted that this application does not impose any special limitations on the specific implementation method of the target transmission state, which can be determined according to the specific implementation and implementation status of the data transmission module, including but not limited to the three situations mentioned above. This application does not impose any special limitations on the specific types and implementation methods of the data sending module, data transmission module, and data receiving module. The data sending module can directly reuse the processing module in the communication sender, or it can be implemented through independent functional component settings; the data receiving module can directly reuse the processing module in the communication receiver, or it can be implemented through independent functional component settings. The data transmission module needs to include a data transmission channel to be responsible for data transmission. The identification and judgment of response signals by the data transmission module can be implemented in various ways, such as setting a check processor in the data transmission module, etc., which this application does not impose any special limitations on. Data transmission channels can be implemented using various types of signal lines. For example, an I2S channel based on the I2S communication protocol requires the use of signal lines defined by the I2S bus for the transmission of digital audio data. The I2S bus uses a design that separates clock and data signals using independent wires, thus separating the data and clock signals. A standard I2S bus includes three serial signal lines: one TDM (Time Division Multiplexing) data line; one word select line; and one clock line.

[0071] It's easy to understand that the entire communication method requires the cooperation of a data sending module, a data transmission module, and a data receiving module. (See [link to relevant documentation]). Figure 2 As shown, Figure 2 This is a flowchart illustrating a data transmission process according to an embodiment of the present invention. When a communication sender needs to communicate with a communication receiver, the sender first sends communication data to a data sending module. The data sending module processes this raw data (e.g., generates corresponding verification data) to obtain the data to be transmitted, preparing for subsequent data transmission. The data transmission module transmits the data sent by the data sending module. After preparation, the data sending module transmits the data to be transmitted to the data receiving module through the data transmission module. The data receiving module receives the data to be transmitted from the data transmission channel, verifies its correctness, and sends a response signal back to the data transmission module based on the actual reception status of the data to be transmitted. This allows the data transmission module to determine whether to retransmit the data to be transmitted based on the actual reception status of the data receiving module. If the data to be transmitted is accurately and effectively transmitted to the data receiving module, the transmission process of the current data to be transmitted ends, and the transmission of the next data continues until the communication between the sender and receiver is completed, at which point data transmission stops.

[0072] It should be noted that before transmitting data, the data sending module and the data receiving module will pre-agree on the data transmission format and the preset verification method to be used during verification on the data transmission channel. For I2S channels based on the I2S communication protocol, the data transmission format is mainly 8-bit, 16-bit, 24-bit, or 32-bit data packets. Specifically, the data transmission format can be determined according to the sampling frequency and bit width used by the audio codec. This application does not impose any special limitations on the specific implementation of the preset verification method and its corresponding algorithm; various types of verification methods such as parity checking and checksum can be used.

[0073] This application provides a communication method. In the process of data transmission based on a communication architecture consisting of a data sending module, a data transmission module, and a data receiving module, the data sending module processes the raw data and configures verification data for the raw data to be transmitted. By adding the verification data, the data receiving module can determine the correctness of the transmitted data, thereby improving the reliability of the data transmission process and making the I2S bus a reliable transmission protocol, thus realizing a reliable communication method based on the I2S bus. At the same time, the data transmission module is configured with a mechanism to adjust its target transmission state based on response signals, so as to handle data errors or transmission anomalies in a timely manner and improve the processing efficiency when data errors or transmission anomalies occur.

[0074] See Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the workflow of a data transmission module provided in an embodiment of the present invention; as an optional embodiment, the data transmission module includes a storage module; after acquiring the data to be transmitted sent by the data transmission module, it further includes:

[0075] Copy the data to be transferred to the storage module;

[0076] The target transmission state is retransmission of data to be transmitted; communication continues based on the target transmission state, including:

[0077] The process retrieves the data to be transmitted from the storage module and then jumps back to the step of transmitting the data to the data receiving module.

[0078] It can be understood that, in order to facilitate timely solution when data error or transmission anomaly occurs, ensure reliable transmission of data, a storage module is specially configured in the data transmission module, the storage module can copy a data copy to the storage module after obtaining the to-be-transmitted data, once data error or transmission anomaly occurs, the data transmission module determines the target transmission state of the data transmission module based on the response signal to be retransmission of the to-be-transmitted data, the data transmission module can directly call the data copy in the storage module, jump to the step of transmitting the to-be-transmitted data to the data receiving module for retransmission of the to-be-transmitted data until the to-be-transmitted data is normally received by the data receiving module. The specific type and implementation of the storage module are not particularly limited in the present application, and can be implemented by using cache hardware and the like, as long as the to-be-transmitted data sent by the data sending module can be temporarily stored.

[0079] Specifically, by increasing the storage module in the data transmission module, the data transmission module can directly call the copied copy in the storage module to complete the retransmission of the to-be-transmitted data when data error or transmission anomaly occurs, fast retransmission is realized, the to-be-transmitted data does not need to be reacquired from the data sending module, time is saved, the processing efficiency when data error or transmission anomaly occurs is improved, and the communication efficiency is improved.

[0080] As an optional embodiment, determining the target transmission state of the data transmission module based on the response signal comprises:

[0081] determining whether the receipt signal returned by the data receiving module is received within a preset time period;

[0082] if the receipt signal is not received within the preset time period, determining that the target transmission state of the data transmission module is to retransmit the to-be-transmitted data;

[0083] if the receipt signal is received within the preset time period, determining whether the receipt signal is a first receipt; the first receipt is configured to represent that the to-be-transmitted data received by the data receiving module is not verified;

[0084] if the receipt signal is the first receipt, determining that the target transmission state of the data transmission module is to retransmit the to-be-transmitted data;

[0085] if the receipt signal is not the first receipt, determining whether the receipt signal is a second receipt; the second receipt is configured to represent that the to-be-transmitted data received by the data receiving module is verified and the data receiving module needs to continue receiving data transmission;

[0086] if the receipt signal is the second receipt, determining that the target transmission state of the data transmission module is to continue transmission of the next to-be-transmitted data;

[0087] If the response signal is not the second response, it is determined that the target transmission state of the data transmission module is stop transmission.

[0088] It is understandable that the response signal can be implemented in the form of a response signal. Considering different situations of the data receiving module in receiving the data to be transmitted, the embodiment provides three response signals, i.e., a first response, a second response, and a third response. Under normal circumstances, within a preset time period after the data transmission module transmits the data to be transmitted to the data receiving module, the data receiving module returns a response signal to inform the data transmission module of the reception of the data to be transmitted. Therefore, if the data transmission module does not receive the response signal within the preset time period, it is determined that the transmission is timed out, indicating that an abnormal transmission occurs, and the data to be transmitted needs to be retransmitted.

[0089] It is understandable that if the data transmission module can receive the response signal within the preset time period, it needs to further determine the type of the response signal. If the response signal is the first response, it indicates that the data receiving module has received the data to be transmitted, but the data to be transmitted has not passed the verification, i.e., the data is incorrect, and the data to be transmitted needs to be retransmitted. If the response signal is the second response, it indicates that the data receiving module has normally received the data to be transmitted, and the data to be transmitted has successfully passed the verification, i.e., the data has completed normal transmission, and the data receiving module can continue the next data transmission, and the data transmission module can continue the transmission of the next data to be transmitted. If the response signal is neither the first response nor the second response, it indicates that the received response signal is the third response, and although the data receiving module has normally received the data to be transmitted and the data to be transmitted has successfully passed the verification, the data receiving module does not support the next data transmission or the current communication has been completed, and the data transmission module can directly stop the transmission and complete the current communication.

[0090] It should be noted that the specific type and implementation of the first response, the second response, and the third response are not particularly limited in the present application. The second response can be implemented by an ACK (Acknowledge character) response, and the third response can be implemented by an NACK (Negative Acknowledgement character) response. The specific value and determination method of the preset time period are not particularly limited in the present application, and can be implemented by configuring a timer in the data transmission module, and the value can be flexibly set according to the actual situation by manual setting or the like.

[0091] As a specific embodiment, the first response is set as a WRONG response, the second response is set as an ACK response, and the third response is set as an NACK response. The storage module is implemented by a cache. As shown in FIG. 1, the data transmission module 100 includes a data storage module 101, a data receiving module 102, a data transmission module 103, and a response module 104.Figure 3 As shown, Figure 3 The diagram illustrates the workflow of a data transmission module performing a single data transmission. When the data sending module transmits new data to be transmitted via the I2S channel, it first uses a high-speed buffer to cache and back up the data just sent to the I2S channel upon receiving it. Then, it sends the data to be transmitted to the data receiving module via the I2S channel. Simultaneously, once the data to be transmitted (specifically, the first data packet corresponding to the data to be transmitted) is sent to the I2S channel, the data transmission module's timer starts counting. If the data transmission module does not receive an acknowledgment signal after the timer has elapsed for a preset time period t, it is considered a transmission timeout. In this case, the high-speed buffer can be invoked for fast retransmission, the timer is reset, and the process of sending the data to be transmitted and starting the timer again is restarted. If the data transmission module receives an acknowledgment signal within the preset time period t, it will then perform another check to determine if the received acknowledgment signal is a WRONG acknowledgment. A WRONG acknowledgment is issued by the data receiving module after verification and detection of a data transmission error. If it is a WRONG acknowledgment, the high-speed buffer will be invoked for fast retransmission, the timer will be reset, and the process will re-enter the steps of sending the data to be transmitted and starting the timer again. If it is not a WRONG acknowledgment, the acknowledgment signal will be checked again to determine if it is an ACK acknowledgment. An ACK acknowledgment is a transmission control character fed back by the data receiving module to the data sending module after receiving data, indicating that the data has been confirmed to be received without error. This means that the data receiving module has received the data to be transmitted and confirmed that the data is correct, requesting the start of the next data transmission. At this time, the timer will be reset, and the process will begin in the data sending module, which will then transmit a new set of data to be transmitted via the I2S channel. If it is not an ACK, it means that the received receipt signal is a NACK. A NACK is a transmission control character that the data receiving module sends back to the data sending module after receiving data. It indicates that the data has been confirmed to be received without error, but the next data transmission will not be accepted, and the transmission ends. Therefore, the transmission can be stopped directly at this time, and the entire communication process ends.

[0092] Specifically, by setting the first, second, and third receipts, the data transmission module and the data sending module can effectively determine the data receiving module's reception status of the data to be transmitted. This not only determines whether the data receiving module has effectively received the data to be transmitted, but also, through the setting of the first receipt, determines whether the data received by the data receiving module is erroneous. Thus, the communication process based on the I2S bus can achieve a certain degree of verification function, making I2S transmission a reliable transmission method and realizing a reliable communication method based on the I2S protocol.

[0093] As an optional embodiment, if the receipt signal is not a second receipt, the following steps are also included:

[0094] Determine whether the receipt signal is the third receipt; the third receipt is configured to indicate that the data to be transmitted received by the data receiving module has passed the verification and the data receiving module does not need to continue receiving data transmission.

[0095] If the receipt signal is the third receipt, then the target transmission status of the data transmission module is determined to be stopped.

[0096] Understandably, to ensure the accuracy and reliability of subsequent transmission decisions, after confirming that the receipt signal is neither the first nor the second receipt, a further process could be added to determine whether the receipt signal is indeed a third receipt. If the receipt signal is a third receipt, it indicates that the data receiving module itself does not need to continue receiving data transmission and can stop transmission. If the receipt signal is not a third receipt, it indicates that the data receiving module may be malfunctioning. This situation can be communicated to the communication sender by returning an alarm signal to the data sending module, or directly to the communication receiver, so that the communication sender and / or receiver can promptly perform troubleshooting operations.

[0097] Specifically, by further enhancing the judgment process of the third receipt, the accuracy and reliability of the received receipt signal are ensured, avoiding the situation where transmission is accidentally stopped when the receipt signal is incorrect, and ensuring the reliability of the entire communication process.

[0098] See Figure 4 As shown, Figure 4 The present invention provides a flowchart illustrating another communication method applied to a data transmission module according to an embodiment of the invention. To address the aforementioned technical problems, the present invention also provides another communication method applied to a data transmission module, the communication method comprising:

[0099] S21: Obtain the raw data to be transmitted;

[0100] S22: Generate verification data corresponding to the original data based on the original data;

[0101] S23: Combine the original data and the verification data into a data packet according to a preset method to obtain the data to be transmitted;

[0102] S24: Send the data to be transmitted to the data transmission module so that the data transmission module can transmit the data to the data receiving module. After determining the target transmission status based on the response signal returned by the data receiving module, communication continues based on the target transmission status.

[0103] It should be noted that the preset manner adopted by the data sending module when combining to generate the data packet is not particularly limited in the present application, and the data packet form can be determined according to the data transmission format agreed with the data receiving module in advance, and then a corresponding packaging manner is adopted to realize the combination.

[0104] For the description of the features of another communication method provided by the embodiments of the present application, reference can be made to the related description of the foregoing embodiment of the communication method, which will not be repeated here.

[0105] Referring to Figure 5 , the Figure 5 is a working flow diagram of a data sending module provided by the embodiments of the present application; as an optional embodiment, the original data corresponding to the check data is generated based on the original data, which includes:

[0106] The original data is split into a plurality of data units based on the preset data format corresponding to the preset manner;

[0107] For any data unit, the data unit is checked by using the preset check manner to obtain the check data corresponding to the data unit;

[0108] The original data and the check data are combined into a data packet according to the preset manner to obtain the to-be-transmitted data, which includes:

[0109] The data unit and the check data corresponding to the data unit are combined into a data packet according to the preset manner to obtain the to-be-transmitted data transmitted in the unit of data packet.

[0110] It can be understood that the original data sent by the communication sender to the data sending module is generally long data without processing, and in the data transmission process, the data transmission is generally completed in the form of a data packet with a specific length, and considering that the generation of check data also needs to determine the data length so as to add the check data in the data packet, therefore, the data sending module needs to first determine the data size supported by a data packet for transmission according to the data transmission format agreed in advance and the preset check manner, and then split the original data into a plurality of data units according to the data size, the size of the data unit plus the size of the check data corresponding to the data unit is equal to the data size supported by a data packet for transmission. After the data unit is split, the check data corresponding to the data unit is generated according to the agreed preset check manner, and the check data corresponding to the original data in the to-be-transmitted data includes the check data of each data unit corresponding to the original data. Then, according to the agreed data transmission format, the corresponding preset manner is adopted to encapsulate the one-to-one corresponding data unit and check data to obtain the data packet corresponding to the to-be-transmitted data. Finally, all the data packets corresponding to the to-be-transmitted data are transmitted in sequence through the data transmission module according to the order when splitting.

[0111] As a specific embodiment, as shown in Figure 5 The data sending module will first receive information from various communication senders such as upper-layer applications or devices using I2S protocol to transmit data. The information varies in length. After receiving the original data, the data sending module splits the original data in byte units. For example, when audio data is transmitted, the data packet usually uses data sizes corresponding to 8-bit, 16-bit, 24-bit or 32-bit width to implement. Correspondingly, the original data needs to be split into data units of 7-bit (corresponding to 8-bit width), 15-bit (corresponding to 16-bit width), 23-bit (corresponding to 24-bit width) or 31-bit (corresponding to 32-bit width) as a group. These data units are arranged in the order of their positions in the original data, waiting for the next parity bit setting operation. Then the data sending module performs the parity check and data encapsulation operation. For example, for any data unit, based on the 7-bit data in the data unit obtained after splitting, the 1-bit to 7-bit are sequentially subjected to XOR operation from the 1-bit, and finally the parity bit of 0 or 1 is obtained, wherein 0 indicates that there are even number of 1s in the previous 7-bit data unit; and 1 indicates that there are odd number of 1s in the previous 7-bit data unit, thereby realizing the parity check. The parity bit is added to the data packet as the 8th bit of data in the data packet. The previous 7-bit data in the data packet is the corresponding data unit. Based on this, a data unit is restored to an 8-bit (1 byte) data packet, and the 1 byte (byte) is encapsulated to obtain a data packet corresponding to each data unit. A data packet is transmitted on the I2S channel as a transmission unit. The parity check and data encapsulation operation of other data size data packets are similar, and will not be described herein. After the splitting, parity configuration and encapsulation processing procedures, the data sending module can send the processed data to be transmitted to the I2S bus for transmission by the data transmission module.

[0112] Specifically, the data sending module processes the original data through the splitting, parity configuration and encapsulation processing procedures, standardizes the data format of the data packet transmitted by the data transmission module, and ensures the effective transmission of the data to be transmitted on the data transmission channel.

[0113] Referring to Figure 6 As shown in Figure 6 a flowchart of another communication method applied to the data receiving module provided by the embodiment of the application; to solve the above technical problems, the embodiment of the application further provides another communication method applied to the data receiving module, and the communication method comprises:

[0114] S31: receiving the to-be-transmitted data sent by the data transmission module; the to-be-transmitted data is obtained by the data transmission module from the data sending module and transmitted to the data receiving module, and the to-be-transmitted data includes original data and check data;

[0115] S32: checking the received to-be-transmitted data based on the check data, and generating a corresponding response signal according to the check result;

[0116] S33: sending the response signal to the data transmission module, so that the data transmission module determines the target transmission state and continues to communicate based on the target transmission state.

[0117] For the description of the features of another communication method provided by the embodiment of the application, reference can be made to the related description of the two communication method embodiments described above, which will not be repeated here.

[0118] Referring to Figure 7 , the working process of a data receiving module provided by the embodiment of the application is shown. Figure 7 As an optional embodiment, the to-be-transmitted data is transmitted in units of data packets, and the data packet includes a data unit corresponding to the original data and check data corresponding to the data unit; the received to-be-transmitted data is checked based on the check data, including:

[0119] For any data packet of the to-be-transmitted data, the data unit in the data packet is checked by a preset check method to obtain a check result;

[0120] determining whether the check result is consistent with the check data corresponding to the data unit in the data packet;

[0121] If yes, it is determined that the data packet passes the check;

[0122] If all the data packets of the to-be-transmitted data pass the check, it is determined that the to-be-transmitted data passes the check.

[0123] It is understandable that after the data receiving module receives the to-be-transmitted data transmitted in the form of data packets, the to-be-transmitted data is first checked in the form of data packets. If the calculated check result is inconsistent with the check data corresponding to the data unit in the data packet, it means that the data packet has not passed the check. Any data packet that has not passed the check means that the to-be-transmitted data has not passed the check. If the to-be-transmitted data has not passed the check, a first receipt is returned to the data transmission module. If the to-be-transmitted data has passed the check and the data receiving module needs to continue to receive data transmission, a second receipt is returned. If the to-be-transmitted data has passed the check and the data receiving module does not need to continue to receive data transmission, a third receipt is returned. The checking method of the data receiving module is not particularly limited in this application. The data can be checked while being received, and the checking is started after each data packet is received. The data can also be checked after all data packets of the to-be-transmitted data are received.

[0124] As a specific embodiment, accordingly, still taking parity check as an example, as shown in Figure 7 The data receiving module receives the to-be-transmitted data transmitted by the data transmission module from the I2S bus. After receiving the to-be-transmitted data, the to-be-transmitted data is first checked in the form of data packets, that is, in the form of bytes. The first 7 bits of each data packet are sequentially XORed bit by bit. The check result obtained by the operation is compared with the check data of the eighth bit. If the comparison result is consistent, it means that the to-be-transmitted data is accurate. Then the data receiving module determines whether to return the second receipt or the third receipt according to the actual needs of itself, and sends the ACK receipt / NACK receipt to the I2S channel. If the comparison result is inconsistent, it means that there is a bit or several bits error (i.e. data error) in the data transmission process due to channel interference or the like. The data receiving module returns the first receipt and sends the WRONG receipt to the I2S channel.

[0125] On the other hand, after determining that the to-be-transmitted data has passed the check, the data receiving module can formally receive the data. At this time, the eighth bit of each byte needs to be removed, that is, the eighth bit of each data packet is deleted. Then, the data units (multiple groups of 7-bit data) after the check bits are taken out from all data packets corresponding to the data are reassembled into the original data according to the order when the data is split, or the bytes are assembled into 8-bit groups according to the subsequent transmission requirements, to obtain the original data in the form of 1 byte. The reception of the to-be-transmitted data is completed. The received data is transmitted to other I2S device hardware or upper-layer application according to the needs.

[0126] It should be noted that the data receiving module has multiple options for determining whether it needs to continue receiving data transmission, and this application does not impose any specific limitations on this. There are two situations where the data receiving module does not need to continue receiving data transmission: first, all data to be transmitted in this communication has been transmitted, and communication can be stopped; second, the data receiving module itself has an error and does not support receiving the next data from the data transmission module. Therefore, after confirming that the data to be transmitted has passed verification, the data receiving module can first determine whether the length of all received data has reached the pre-agreed data volume for this communication, or determine whether there is an end separator (indicating the end of communication data) in the received data to be transmitted. If the length of all received data has reached the pre-agreed data volume for this communication, or if there is an end separator in the received data to be transmitted, it means that all data to be transmitted in this communication has been transmitted, and the data receiving module will return a third receipt. If the total length of all received data does not reach the pre-agreed amount of data for this communication, or if there is no end separator in the data to be transmitted, the system further determines whether it supports continuing to receive data. This includes, but is not limited to, determining whether its processing register is full, whether its storage module for storing received data is full, and whether there are any equipment fault signals on the receiving end or itself. If the system does not support continuing to receive data, the data receiving module will return a third receipt; if the system supports continuing to receive data, the data receiving module will return a second receipt.

[0127] Specifically, the processing procedure of the data receiving module for the received data to be transmitted needs to correspond to the processing procedure of the data sending module for the original data, so that the data receiving module can effectively restore the original data and ensure accurate communication between the communication sender and the communication receiver.

[0128] See Figure 8 As shown, Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. To solve the above-mentioned technical problems, an embodiment of the present invention also provides an electronic device, comprising:

[0129] Memory 60 is used to store computer program 601;

[0130] Processor 61 is configured to execute computer program 601 to implement the steps of the communication method as described above.

[0131] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.

[0132] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0133] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, is capable of implementing the relevant steps of the communication method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, data in the communication method.

[0134] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.

[0135] Those skilled in the art will understand that Figure 8 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0136] For a description of the features in the electronic device provided in the embodiments of the present invention, please refer to the relevant description of the embodiments of the communication method, which will not be repeated here.

[0137] It can be understood that if the communication method in the above embodiments is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable ROM, a register, a hard disk, a removable magnetic disk, a CD-ROM, a magnetic disk or an optical disk, and various media that can store program codes.

[0138] To solve the above technical problems, the embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the communication method described above are realized.

[0139] For the description of the features of the computer readable storage medium provided by the embodiment of the present application, please refer to the related description of the embodiment of the communication method, which will not be repeated here.

[0140] To solve the above technical problems, the embodiment of the present application further provides a computer program product, which includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the communication method described above are realized.

[0141] For the description of the features of the computer program product provided by the embodiment of the present application, please refer to the related description of the embodiment of the communication method, which will not be repeated here.

[0142] The above describes in detail the communication method, electronic device and medium provided by the embodiment of the present application. The embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the difference from other embodiments. The same or similar parts of each embodiment can be referred to. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the related parts can be referred to the method part.

[0143] Those skilled in the art will further realize that the mere conception of the examples described herein is sufficient to enable practitioners to practice the examples as further described below. Therefore, many modifications and adaptations will be apparent to those skilled in the art (e.g., variations in sizes, dimensions, structures, materials, and / or use of the example's components, changes in the arrangement of components, methods, and / or functions, etc.). For example, the dimensions and / or types of the components can be varied, and the size of the components can be either larger or smaller depending on the intended application or usage. Therefore, the foregoing description is not intended to limit the examples described herein and should not be interpreted in that manner. It will be apparent to those having ordinary skill in the art that numerous changes can be made without departing from the scope of the present disclosure and that the scope of the disclosure is not to be limited to the details of construction and the arrangement of components set forth in the description above and illustrated in the drawings. Warnings or suggestions of patents or patent applications retained by the applicant and referred to in the specification can not be prior art to the claimed application and can be directed to the same technical field or a different technical field.

[0144] The above provides a communication method, an electronic device and a medium. The principles and implementation manners of the present application are described by using specific examples. The above description of the examples is only applicable to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A communication method, characterized in that, Applied to the data transmission module; the communication method includes: The system acquires the data to be transmitted sent by the data sending module; the data to be transmitted includes raw data and verification data. The data to be transmitted is transmitted to the data receiving module; The system receives a response signal returned by the data receiving module; the response signal is generated by the data receiving module after verifying the received data to be transmitted based on the verification data, and then based on the verification result. The target transmission state of the data transmission module is determined based on the response signal, so that the data transmission module can continue communication based on the target transmission state.

2. The communication method according to claim 1, characterized in that, The data transmission module includes a storage module; after acquiring the data to be transmitted sent by the data sending module, it also includes: The data to be transmitted is copied to the storage module; The target transmission state is to retransmit the data to be transmitted; communication continues based on the target transmission state, including: The data to be transmitted is retrieved from the storage module, and the process jumps back to the step of transmitting the data to the data receiving module.

3. The communication method according to claim 1, characterized in that, Determining the target transmission state of the data transmission module based on the response signal includes: Determine whether an acknowledgment signal is received from the data receiving module within a preset time period; If the receipt signal is not received within the preset time period, the target transmission status of the data transmission module is determined to be retransmission of the data to be transmitted. If the receipt signal is received within a preset time period, it is determined whether the receipt signal is the first receipt; the first receipt is configured to indicate that the data to be transmitted received by the data receiving module has failed the verification. If the receipt signal is the first receipt, then the target transmission status of the data transmission module is determined to be retransmission of the data to be transmitted; If the receipt signal is not the first receipt, then it is determined whether the receipt signal is the second receipt; the second receipt is configured to indicate that the data to be transmitted received by the data receiving module has passed the verification and the data receiving module needs to continue receiving data transmission; If the receipt signal is a second receipt, then the target transmission status of the data transmission module is determined to continue transmitting the next data to be transmitted; If the receipt signal is not a second receipt, then the target transmission status of the data transmission module is determined to be stopped transmission.

4. The communication method according to claim 3, characterized in that, If the receipt signal is not a second receipt, it also includes: Determine whether the receipt signal is a third receipt; the third receipt is configured to indicate that the data to be transmitted received by the data receiving module has passed the verification and the data receiving module does not need to continue receiving data transmission. If the receipt signal is the third receipt, then the target transmission status of the data transmission module is determined to be stopped transmission.

5. A communication method, characterized in that, Applied to the data transmission module; the communication method includes: Obtain the raw data that needs to be transmitted; Generate verification data corresponding to the original data based on the original data; The original data and the verification data are combined into a data packet according to a preset method to obtain the data to be transmitted; The data to be transmitted is sent to the data transmission module so that the data transmission module transmits the data to the data receiving module. After determining the target transmission status based on the response signal returned by the data receiving module, communication continues based on the target transmission status.

6. The communication method according to claim 5, characterized in that, Generate verification data corresponding to the original data based on the original data, including: The original data is split into several data units based on the preset data format corresponding to the preset method; For any data unit, a preset verification method is used to verify the data unit in order to obtain the verification data corresponding to the data unit. The original data and the verification data are combined into a data packet according to a preset method to obtain the data to be transmitted, including: The data unit and the corresponding verification data are combined into a data packet according to a preset method to obtain the data to be transmitted in units of the data packet.

7. A communication method, characterized in that, Applied to the data receiving module; the communication method includes: The receiving module receives data to be transmitted from the data transmission module; the data to be transmitted is data obtained by the data transmission module from the data sending module and transmitted to the data receiving module, and the data to be transmitted includes original data and verification data. The received data to be transmitted is verified based on the verification data, and a corresponding response signal is generated based on the verification result. The response signal is sent to the data transmission module so that the data transmission module can determine the target transmission status and continue communication based on the target transmission status.

8. The communication method according to claim 7, characterized in that, The data to be transmitted is transmitted in units of data packets, and each data packet includes a data unit corresponding to the original data and a checksum corresponding to the data unit. Verification of the received data to be transmitted based on the verification data includes: For any data packet to be transmitted, the data units in the data packet are verified using a preset verification method to obtain the verification result; Determine whether the verification result is consistent with the verification data corresponding to the data unit in the data packet; If so, the data packet is determined to have passed the verification. If all the data packets to be transmitted pass the verification, then the data to be transmitted is determined to have passed the verification.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the communication method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the communication method as described in any one of claims 1 to 8.