A data conversion method, system and vehicle
By using the A-PHY link in the car audio data network to package and unpack I2S data, the problem of limited transmission distance of the traditional I2S protocol is solved, efficient and flexible audio data transmission is achieved, and the vehicle audio data is improved. Network performance.
Patent Information
- Application Number
- CN202411547000.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-11-01
AI Technical Summary
With the deepening of the degree of electronicization of automobiles, the in-car audio data network architecture is complex, and the number of speakers and microphones increases, resulting in the extended signal transmission distance between the main control unit and the terminal device. The transmission distance of the traditional I2S protocol is limited, making it difficult to meet high-quality signals. Transmission requirements.
Through the first conversion unit, the I2S data group is packetized into A-PHY data packets and transmitted to the second conversion unit through the A-PHY link for unpacking processing, so as to realize the efficient conversion and transmission of I2S data in the A-PHY network. Simplify the circuit of the on-board audio data network.
It improves the flexibility and signal transmission distance of the vehicle audio data network, reduces line complexity, enhances resistance to electromagnetic interference, and meets the data transmission needs of long-distance and high-bandwidth.
Smart Images

Figure CN119052186B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data conversion method, system and vehicle. Background Art
[0002] As the degree of automotive electronics deepens, the in-vehicle audio data network architecture becomes increasingly complex, and the number of speakers and microphones increases sharply and is widely distributed, which greatly extends the signal transmission distance between the main control unit and the terminal device. Therefore, it is urgent to simplify the audio data network to improve the flexibility of the in-vehicle audio data network. Summary of the invention
[0003] The purpose of the present invention is to provide a data conversion method, system and vehicle, which realize efficient conversion and transmission of I2S data in an A-PHY network through a first conversion unit, a second conversion unit and an A-PHY link, thereby simplifying the data transmission line of the vehicle audio data network to improve the flexibility of the vehicle audio data network.
[0004] In a first aspect, the present invention provides a data conversion method, comprising:
[0005] The target I2S data sent by the I2S master device is packaged and processed by the first conversion unit to obtain an A-PHY data packet; wherein the target I2S data is audio data in units of target frames;
[0006] An A-PHY link established based on a first A-PHY interface and a second A-PHY interface; wherein the first A-PHY interface is connected to a first conversion unit; and the second A-PHY interface is connected to a second conversion unit;
[0007] transmitting the A-PHY data packet from the first conversion unit to the second conversion unit via the A-PHY link;
[0008] The A-PHY data packet is unpacked by the second conversion unit to obtain target I2S data.
[0009] In some embodiments, the data conversion method further includes: in response to a configuration instruction of the control unit, the central processing unit performs initialization configuration to obtain configuration information; based on the configuration information, the target I2S data is acquired so that the I2S master device transmits the target I2S data to the first conversion unit.
[0010] In some embodiments, the target I2S data sent by the I2S master device is packaged by a first conversion unit to obtain an A-PHY data packet, including: extracting and analyzing the target I2S data by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol; embedding the target embedded field in the payload of the A-PHY protocol to obtain an A-PHY data packet.
[0011] In some embodiments, the target embedded field includes: a frame data field; wherein, the target I2S data is extracted and analyzed by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol, including: when the first conversion unit detects that the frame data field does not meet character alignment, the preset value is filled into the end of the audio data to obtain a frame data field that meets character alignment.
[0012] In some embodiments, the target embedded field further includes: a data description field; wherein the data description field includes: a configuration field, a protocol flag field, a channel flag field, and a resolution field.
[0013] In some embodiments, the target embedded field also includes: a count field and a check field; wherein, before the A-PHY data packet is unpacked and processed by the second conversion unit, the second conversion unit extracts and analyzes the A-PHY data packet to obtain the target embedded field; based on the data description field, frame data field, count field and check field in the target embedded field, the A-PHY data packet is checked to determine the target processing mechanism according to the check result.
[0014] In some embodiments, the data conversion method further includes: if the A-PHY link does not receive the N+1th A-PHY data packet within a preset time after receiving the Nth A-PHY data packet, and the A-PHY link buffer underflows, retaining the N-1th A-PHY data packet or the Nth A-PHY data packet; and
[0015] If, after receiving the Mth A-PHY data packet, the A-PHY link receives multiple data packets exceeding the A-PHY link buffer size within a preset time and the A-PHY link buffer overflows, the M-1th A-PHY data packet or the Mth A-PHY data packet is retained.
[0016] In some embodiments, the data conversion method further includes: sending the target I2S data to an I2S slave device to enable playback of audio data in the target I2S data.
[0017] In a second aspect, the present invention provides a data conversion system, comprising:
[0018] I2S master device, used to send target I2S data to I2S slave device;
[0019] An I2S slave device is used to receive target I2S data sent by an I2S master device to play audio data in the target I2S data;
[0020] A first conversion unit, used for packetizing the target I2S data to obtain an A-PHY data packet;
[0021] A second conversion unit is used to unpack the A-PHY data packet to obtain target I2S data;
[0022] The A-PHY network is used to transmit the A-PHY data packet from the first conversion unit to the second conversion unit; the A-PHY network is composed of multiple A-PHY links.
[0023] In a third aspect, the present invention provides a vehicle having the data conversion system in the second aspect.
[0024] The beneficial effect of the solution provided by the embodiment of the present disclosure is that efficient conversion and transmission of I2S data in the A-PHY network is achieved through the first conversion unit, the second conversion unit and the A-PHY link, thereby simplifying the data transmission line of the vehicle audio data network to improve the flexibility of the vehicle audio data network. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A simplified wiring diagram of a car audio system is provided for the prior art;
[0026] Figure 2 A flow chart of a data conversion method provided by an embodiment of the present invention;
[0027] Figure 3 A schematic diagram of the process of package assembly and unpacking provided by an embodiment of the present invention;
[0028] Figure 4 A schematic diagram of a framework for multiple rounds of data conversion provided by an embodiment of the present invention;
[0029] Figure 5 A schematic diagram of a signal band in a standard I2S format provided by an embodiment of the present invention;
[0030] Figure 6 A schematic diagram of a signal band in a TDM format provided by an embodiment of the present invention;
[0031] Figure 7 A schematic diagram of data conversion from an I2S master device to an I2S slave device provided by an embodiment of the present invention;
[0032] Figure 8 A schematic diagram of a data conversion system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0034] In the field of modern automobile design, the bulky cables of audio systems have become a problem that cannot be ignored. The reason for the above problem is that traditional analog audio lines have strict requirements for high-quality signal transmission, so bulky shielded cables have to be used. With the deepening of automobile electronics, the architecture of in-vehicle audio networks has become increasingly complex, and the number of speakers and microphones has increased sharply and is widely distributed, which greatly extends the signal transmission distance between the main control unit and the terminal equipment. Therefore, it is urgent to simplify the audio data network.
[0035] In the related technology, the integrated circuit built-in audio bus (Inter-IC Sound, I2S) is specially designed to solve the seamless transmission of audio data between integrated circuits. This protocol defines the transmission format, timing arrangement and necessary control signals of audio data. It is widely used in the acquisition and output of audio signals and the communication between analog-to-digital converters (ADC) and main control chips, setting a benchmark for the digital audio field. However, the transmission distance of the I2S protocol is relatively short, usually between tens of centimeters and several meters, and is not suitable for long-distance transmission. The reason is that the I2S protocol does not adopt a differential transmission mechanism, so it has weak resistance to electromagnetic interference, which may cause the signal to degrade when transmitted over a long distance. In addition, the transmission distance of I2S is also affected by factors such as wire quality, wire impedance, and wiring method. Obviously, in the face of the increasing demand for data transmission rate and reliability of automotive electronic systems, the traditional I2S interface has gradually shown its limitations.
[0036] Among related technologies, the Automotive Serial Interface -Physical Layer (A-PHY) is designed to provide a reliable and efficient data transmission solution, especially for high-bandwidth application scenarios such as cameras, radars, lidars, and displays in cars. The core design concept of A-PHY is to achieve low latency and high bandwidth characteristics of data transmission while ensuring excellent durability and long-term stability of the interface.
[0037] Figure 1 A simplified wiring diagram of a car audio system of the prior art is shown. Figure 1 As shown in Figure 1, the Automotive Audio Bus (A2B) supports serial topology, greatly reduces the weight of the wiring harness by using unshielded twisted pair (UTP), and supports speeds of up to 50 megabits per second (Million bits persecond, Mbps). Although A2B can reduce wiring costs, the initial equipment investment and development costs may be relatively high, especially for automakers who need to upgrade existing production lines. In addition, A2B technology is provided by specific suppliers and is highly dependent on a single supplier.
[0038] In order to at least partially solve one or more of the above problems and other potential problems, the present disclosure proposes a data conversion method, which includes: using a first conversion unit to package the target I2S data sent by the I2S master device to obtain an A-PHY data packet; based on the A-PHY link established by the first A-PHY interface of the first conversion unit and the second A-PHY interface of the second conversion unit, the A-PHY data packet is transmitted to the second conversion unit; and the A-PHY data packet is unpacked by the second conversion unit to obtain the target I2S data. In this way, the efficient conversion and transmission of I2S data in the A-PHY network is realized through the first conversion unit, the second conversion unit and the A-PHY link, which helps to improve the flexibility of the vehicle audio data network.
[0039] Figure 2 is a flow chart of a data conversion method according to an embodiment of the present disclosure, such as Figure 2 As shown, the method comprises at least the following steps:
[0040] S201: Packetizing the target I2S data sent by the I2S master device through a first conversion unit to obtain an A-PHY data packet; wherein the target I2S data is audio data in units of target frames;
[0041] S202: An A-PHY link is established based on a first A-PHY interface and a second A-PHY interface; wherein the first A-PHY interface is connected to a first conversion unit; and the second A-PHY interface is connected to a second conversion unit;
[0042] S203: Transmitting the A-PHY data packet from the first conversion unit to the second conversion unit via the A-PHY link;
[0043] S204: unpacking the A-PHY data packet through the second conversion unit to obtain target I2S data.
[0044] In some embodiments, the first conversion unit (i.e., I2S to A-PHY converter, I2S To A-PHY Converter) is used to convert the target I2S data into an A-PHY data packet. Specifically, the first conversion unit can receive the target I2S data sent by the I2S master device; perform packet processing on the target I2S data to obtain an A-PHY data packet. The first conversion unit is connected to the first A-PHY interface. The first conversion unit can achieve flexible system configuration and control through standardized interfaces (such as Advanced Microcontroller Bus Architecture (AMBA), Inter-Integrated Circuit (I2C), Serial Peripheral Interface (SPI)).
[0045] In some embodiments, the second conversion unit (i.e., A-PHY to I2S converter, A-PHY To I2S Converter) is used to convert the A-PHY data packet into target I2S data. Specifically, the second conversion unit unpacks the A-PHY data packet to obtain the target I2S data; and sends the target I2S data to the I2S slave device corresponding to the I2S master device. The second conversion unit is connected to the second A-PHY interface. The second conversion unit can achieve flexible system configuration and control through standardized interfaces (such as AMBA, I2C, SPI).
[0046] In some embodiments, the I2S master device (I2S Master) is the main control device of the audio network system. Specifically, the I2S is used to generate a serial clock (SCK) signal, a frame clock (WS) and a serial data (SD) signal. Among them, the SCK signal is used to synchronize the transmission of data to ensure that the data flows at the same rate and timing during the transmission process. The WS signal is used to identify the start and end of the audio data frame, as well as the switching of the left and right channels; generally, when the WS signal is 0, it indicates that the data of the left channel is being transmitted; when the WS signal is 1, it indicates that the data of the right channel is being transmitted. The SD signal is used to transmit audio data from the sending end (such as the I2S master device) to the receiving end (such as an I2S slave device, a speaker, etc.). The I2S master device is usually connected to multiple I2S slave devices to achieve bidirectional transmission of audio data through the I2S bus. The I2S master device can send audio data to the I2S slave device, and can also receive audio data sent by the I2S slave device, thereby realizing communication and collaborative work between audio devices.
[0047] In some embodiments, the target I2S data is audio data in target frames sent by the I2S host. The target frame is used to represent a basic unit of a short segment of audio data; a target frame includes: a preset number of audio samples and necessary metadata for describing and processing these samples. This helps to ensure the synchronization and consistency of the audio data. The amount of audio data contained in the target frame can be set according to demand and design.
[0048] In some embodiments, the A-PHY data packet refers to a data unit of an A-PHY packet structure (A-PHY Packet Structure, A-Packet) transmitted under the A-PHY protocol. An A-PHY data packet is generally composed of multiple fields. Specifically, the A-PHY data packet may be composed of a data description field, a frame data field, a count field, and a check field. The above fields define specific formats and uses in the A-PHY protocol to ensure correct transmission and processing of data.
[0049] In some embodiments, the first A-PHY interface is an A-PHY interface connected to the first conversion unit. The second A-PHY interface is an A-PHY interface connected to the second conversion unit. The A-PHY interface is a high-speed serializer-deserializer (SerDes) physical layer interface designed specifically for automotive applications. The A-PHY interface benefits from the open architecture principle behind it, ensuring the wide acceptance of the standard and the support of multiple suppliers, thereby effectively avoiding the risk of over-reliance on a single supplier and providing more flexible and reliable technical options for automakers. The A-PHY Programming Interface (APPI) is a key interface defined in the A-PHY protocol. The APPI interface is located at a specific level of the A-PHY protocol stack and is generally used to connect the A-PHY data link layer (DLL) with each native protocol adaptation layer. The main function of the APPI interface is to define a standardized way that enables A-PHY to flexibly support a variety of different native protocols and transmit and convert data through the A-Packet structure.
[0050] In some embodiments, the A-PHY link is used to transmit an A-PHY data packet from the first converter to the second conversion unit. The A-PHY link refers to a data transmission link constructed based on the MIPI A-PHY standard. Specifically, the A-PHY link has the characteristics of long communication distance (up to 15 meters), high bandwidth (maximum transmission rate up to 32 Gigabits persecond (Gbps)), low latency, strong noise resistance and high reliability. In addition, A-PHY also supports a variety of cable types and protocols, providing good compatibility and flexibility.
[0051] Figure 3 The schematic diagram of the process of package assembly and unpacking is shown as follows: Figure 3As shown, the packet processing process includes: the I2S master device transmits the target I2S data to the first conversion unit through the SCK signal, the WS signal and the SD signal; the first conversion unit converts the target I2S data into an A-PHY data packet. An A-PHY link is established based on the first A-PHY interface and the second A-PHY interface; wherein the first A-PHY interface is connected to the first conversion unit; the second A-PHY interface is connected to the second conversion unit; the A-PHY data packet is transmitted from the first conversion unit to the second conversion unit through the A-PHY link; wherein the first conversion unit is connected to the first A-PHY interface through the APPI interface; the second conversion unit is connected to the second A-PHY interface through the APPI interface. The unpacking process includes: the second conversion unit unpacks the A-PHY data packet to obtain the target I2S data. The second conversion unit sends the target I2S data to the I2S slave device; when the I2S slave device successfully receives the target I2S data, it sends an SD signal to the I2S master device.
[0052] Figure 4 A schematic diagram of the framework of multiple rounds of data conversion is shown, such as Figure 4As shown, the control unit controls the central processing unit (CPU) to perform initialization configuration, obtains configuration information 1 and configuration information 2; sends configuration information 1 to I2S master device 1; and sends configuration information 2 to I2S master device 2. The I2S master device 1 obtains the target I2S data-A according to the configuration information 1; transmits the target I2S data-A to the first conversion unit 1; the first conversion unit 1 performs packet processing on the target I2S data-A to obtain an A-PHY data packet-A; the first conversion unit 1 transmits the A-PHY data packet-A to the second conversion unit 1 and the second conversion unit 2 respectively through the A-PHY network; the second conversion unit 1 unpacks the A-PHY data packet-A1 to obtain the target I2S data-A; the second conversion unit 2 unpacks the A-PHY data packet-A2 to obtain the target I2S data-A; the second conversion unit 1 sends the target I2S data-A to the I2S slave device array 1; the second conversion unit 2 sends the target I2S data-A to the I2S slave device array 2. The I2S master device 2 obtains the target I2S data-B according to the configuration information 2; transmits the target I2S data-B to the first conversion unit 2; the first conversion unit 2 performs packet processing on the target I2S data-B to obtain an A-PHY data packet-B; the first conversion unit 2 transmits the A-PHY data packet-B to the second conversion unit 2 and the second conversion unit 3 respectively through the A-PHY network; the second conversion unit 2 unpacks the A-PHY data packet-B3 to obtain the target I2S data-B; the second conversion unit 3 unpacks the A-PHY data packet-B4 to obtain the target I2S data-B; the second conversion unit 2 sends the target I2S data-B to the I2S slave device array 2; the second conversion unit 3 sends the target I2S data-B to the I2S slave device array 3.
[0053] The solution of the embodiment of the present disclosure is to package the target I2S data sent by the I2S master device through the first conversion unit to obtain an A-PHY data packet; an A-PHY link is established based on the first A-PHY interface and the second A-PHY interface; wherein the first A-PHY interface is connected to the first conversion unit; the second A-PHY interface is connected to the second conversion unit; the A-PHY data packet is transmitted from the first conversion unit to the second conversion unit through the A-PHY link; and the A-PHY data packet is unpacked by the second conversion unit to obtain the target I2S data. In this way, the efficient conversion and transmission of I2S data in the A-PHY network is realized through the first conversion unit, the second conversion unit and the A-PHY link, which helps to improve the flexibility of the vehicle audio data network.
[0054] In the embodiment of the present disclosure, the data conversion method also includes: in response to the configuration instruction of the control unit, the central processing unit executes initialization configuration to obtain configuration information; based on the configuration information, the target I2S data is obtained so that the I2S master device transmits the target I2S data to the first conversion unit.
[0055] Here, in the audio network system, the interface from the CPU to other components can be set according to requirements and design to control reading and writing. For example, the CPU and the first conversion unit can be an AMBA interface in the on-chip network or a control interface (such as I2C, SPI) of the off-chip network.
[0056] In some embodiments, the control unit refers to a running component that controls the audio network system. Specifically, the control unit controls the CPU to perform initialization configuration and obtain configuration instructions. The configuration instructions may include: configuration information, master control device information, etc. The master control device information may include: master control device identification information, master control device status information. The above is only an exemplary description and is not intended to limit all possible contents of the configuration information, but it is not exhaustive here.
[0057] In some embodiments, the configuration information may include: a routing address of I2S data, a format of I2S data, a transmission rate of I2S data, and an error response mechanism. The acquisition of target I2S data based on the configuration information may include: acquiring I2S data based on the routing address of I2S data; generating target I2S data in the format of I2S data based on I2S data; and the master device sending the target I2S data according to the transmission rate of I2S data. Among them, the format of I2S data may include: standard I2S format, left-justified format, right-justified format, time division multiplexing (TDM) format, and pulse code modulation (PCM) format.
[0058] In this way, by controlling the CPU to perform initialization configuration through the control unit of the audio network system, the I2S master device can be guaranteed to transmit data according to preset parameters and formats, thereby reducing errors and distortions during data transmission and improving the accuracy and reliability of data transmission.
[0059] In an embodiment of the present disclosure, the target I2S data sent by the I2S master control device is packaged by the first conversion unit to obtain an A-PHY data packet, including: extracting and analyzing the target I2S data by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol; embedding the target embedded field in the payload of the A-PHY protocol to obtain an A-PHY data packet.
[0060] In some embodiments, the target embedded field may include: a data description field, a frame data field, a count field, and a check field. The target embedded field is used to be embedded in a payload of the A-PHY protocol.
[0061] Specifically, the payload of the A-PHY protocol refers to the actual information part carried in the data frame. The data in the payload is the core data that needs to be transmitted and processed. In the A-PHY protocol, the payload is carefully designed and optimized to ensure efficient and reliable transmission of data. The payload uses advanced modulation and coding technology and error detection mechanism to maintain stable communication performance in complex automotive environments.
[0062] In this way, the target embedded field is obtained from the target I2S data through the first conversion unit, and the target embedded field is embedded in the payload of the A-PHY protocol, so that the I2S data can be seamlessly integrated into the A-PHY network for data transmission and conversion, thereby simplifying the design and implementation of the audio network system.
[0063] In an embodiment of the present disclosure, the target embedded field includes: a frame data field; wherein, the target I2S data is extracted and analyzed by a first conversion unit to obtain a target embedded field that complies with the A-PHY protocol, including: when the first conversion unit detects that the frame data field does not meet character alignment, a preset value is filled into the end of the audio data to obtain a frame data field that meets character alignment.
[0064] In some embodiments, the frame data field is used to carry a structural unit of audio data that has been specifically formatted and aligned. In an audio network system, audio data is usually transmitted and processed in the form of a frame. Each frame contains a certain number of audio samples, which together constitute a complete segment of the audio signal. Since the audio data received by the I2S interface may have different sampling resolutions and numbers of channels, the target I2S data needs to be aligned before filling the Frame data field. This means that the data length of each audio sample needs to be an integer multiple of bytes to ensure the correctness and transmission efficiency of the data. Specifically, the filling rules for the alignment process may include:
[0065] 1. First come first filled: Audio data is filled into the Frame data field in the order in which it is received. This ensures the real-time and continuity of the data, which is helpful for subsequent processing and playback.
[0066] 2. Padding for non-byte aligned depth: When the sampling resolution is not byte aligned (for example, 16-bit, 24-bit, etc.), the end of the data needs to be padded with 0 to pad to Byte. This ensures that the data length of each audio sample is consistent, which is convenient for subsequent storage and transmission.
[0067] In some embodiments, when the I2S interface includes multiple channels (such as dual channels of stereo), the data sequence is sorted according to the channel sequence. Exemplarily, in a stereo system, the data of the left channel is first filled into the Frame data field, and after the data of the left channel is filled into the Frame data field, the data of the right channel is filled into the Frame data field. This helps the subsequent processing and playback, so that the data of the left and right channels can correctly correspond and synchronize when the terminal device plays.
[0068] Figure 5 shows a schematic diagram of the signal band of the standard I2S format, such as Figure 5 As shown in the figure, in the standard I2S format, when the WS signal is low, it represents the left channel, and when the WS signal is high, it represents the right channel. The alignment mode (i.e., audio mode) of the Most Significant Bit Left Justified (MSB) and the Least Significant Bit Right Justified Audio Mode (LSB) are filled in the data description field; the first conversion unit performs packetization after receiving the target I2S data of the left and right channels; when the target I2S data in the channel is not Byte-aligned, 0 is added to the end to make up a Byte; here, the target I2S data of the left channel takes precedence over the target I2S data of the right channel.
[0069] Figure 6 A schematic diagram of the signal band in TDM format is shown, Figure 6 As shown in the figure, in TDM mode, the pulse of the WS signal represents the interval of a Frame. In audio mode, fill in the data description field; the first conversion unit assembles the data after receiving the target I2S data of all channels; if the target I2S data in the channel is not byte-aligned, 0 is added to the end to make up a Byte; here, the order of the A-PHY data packets is sorted according to the order of the received channels.
[0070] In this way, when the first conversion unit detects that the frame data field does not meet the character alignment, the preset value is filled into the end of the audio data to obtain a frame data field that meets the character alignment. This can ensure that each frame of audio data meets the length requirement of the target frame, avoid transmission errors or data loss due to insufficient data length, and help improve the reliability and accuracy of data transmission.
[0071] In the disclosed embodiment, the target embedded field further includes: a data description field; wherein the data description field includes: a configuration field, a protocol flag field, a channel flag field and a resolution field.
[0072] In some embodiments, the data description field is used to describe the properties, format and configuration of the audio data. The data description field includes: a configuration field, a protocol flag field, a channel flag field and a resolution field. The configuration field is used to determine whether there is a count field and a check field in the A-PHY data packet obtained after the target I2S data is packaged. The protocol flag field is used to mark the I2S data format in the target I2S data. The channel flag field is used for the valid channel of the target I2S data. The resolution field is used to indicate the sampling resolution of the target I2S data.
[0073] In this way, the configuration field, protocol flag field, channel flag field and resolution field loaded in the data description field provide a detailed description and configuration information of the audio data, which can provide data support for data transmission and conversion, and help improve the accuracy of data transmission.
[0074] In the disclosed embodiment, the target embedded field also includes: a count field and a check field; wherein, before the A-PHY data packet is unpacked and processed by the second conversion unit, the second conversion unit extracts and analyzes the A-PHY data packet to obtain the target embedded field; the A-PHY data packet is checked based on the data description field, frame data field, count field and check field in the target embedded field to determine the target processing mechanism according to the check result.
[0075] In some embodiments, the count field is usually an increasing value used to identify the order of each A-PHY data packet. When the A-PHY link sends each A-PHY data packet, the value of the count field is increased by 1 to ensure that each A-PHY data packet has a unique identifier. In the direction of data transmission by the second conversion unit (A-PHY To I2S Converter), the second conversion unit can determine whether there is a packet loss by checking the count field value of the continuously received A-PHY data packets. If the second conversion unit finds that the count field value of a certain A-PHY data packet is discontinuous with the count field value of the previous A-PHY data packet (that is, there is a jump), it can be considered that a packet loss has occurred during the transmission process. Specifically, the second conversion unit maintains an expected count field value (usually the count field value of the last received A-PHY data packet plus 1). If the count field value of the received A-PHY data packet matches the expected count field value, the second conversion unit considers the A-PHY data packet to be valid and passes it to the subsequent processing module. If the count field value of the received A-PHY data packet does not match the expected count field value, the second conversion unit considers that packet loss has occurred and may trigger a corresponding error handling mechanism (such as requesting retransmission, recording an error log, etc.).
[0076] In some embodiments, the check field (Cyclic Redundancy Check, CRC) is the most commonly used error checking code in the field of data communication. The CRC check is calculated based on the data description character, the count field, and the frame data field to obtain the check result: the calculation process may include:
[0077] S01: Shift the information code (i.e., original data, which may include data descriptor field, count field, frame data field, etc.) left by R bits, which is equivalent to multiplying the corresponding information polynomial C(x) by x to the power of R. In this way, R bits will be vacated on the right side of C(x), which is the position of the check code.
[0078] S02: Use the generating polynomial (binary number) to perform modulo 2 division (i.e., XOR operation) on the information code to obtain an R-bit remainder.
[0079] S03: Put the remainder into the position vacated after the information code is shifted left to obtain a complete CRC code.
[0080] During the data transmission process, the sender (first conversion unit) will calculate the CRC code according to the above method and attach it to the original data before sending it together. After receiving the data, the receiver (second conversion unit) will use the same generating polynomial to perform modulo 2 division on the received data. If the remainder is 0, it means that the data transmission is correct; otherwise, it means that the data transmission is wrong.
[0081] In some embodiments, the verification result includes: correct data transmission (0) and data transmission error (not 0). The target processing mechanism may include: a first processing mechanism and a second processing mechanism. The first processing mechanism includes: sending the target I2S data to the I2S slave device normally; the second processing mechanism may include: sending the target I2S data with a transmission error to the I2S slave device, sending all 0 data to the I2S slave device, sending the previous frame of data to the I2S slave device, and not sending data to the I2S slave device. Determining the target processing mechanism according to the verification result includes: if the verification result is that the data transmission is correct, then sending the target I2S data to the I2S slave device normally; if the verification result is that the data transmission is wrong, then confirming the processing mechanism from the second processing mechanism according to the configuration information obtained by the CPU initialization configuration.
[0082] In this way, by checking the A-PHY data packets before unpacking them, A-PHY data packets with transmission errors can be pre-screened before unpacking, and the erroneous A-PHY data packets can be processed in time, which helps to reduce the waste of processing resources and thus improve the efficiency of data transmission.
[0083] In an embodiment of the present disclosure, the data conversion method further includes: if the A-PHY link does not receive the N+1th A-PHY data packet within a preset time after receiving the Nth A-PHY data packet, and the A-PHY link buffer underflows, retaining the N-1th A-PHY data packet or the Nth A-PHY data packet.
[0084] In some embodiments, if the preset time is t3, after the A-PHY link is created, at time t1, the A-PHY link normally receives the first A-PHY data packet; the first A-PHY data packet is stored in the link cache and the cache status is updated; if the second A-PHY data packet is successfully received before t2, the subsequent A-PHY data packets continue to be received; if the third A-PHY data packet is not received within t3, or the A-PHY link cache underflows (i.e., the number of A-PHY data packets stored in the cache is insufficient to meet the data transmission requirements), it is determined according to the target strategy whether to retain the first A-PHY data packet or the second A-PHY data packet. The target strategy may include multiple factors, such as the importance, timestamp, priority, etc. of the A-PHY data packet. Exemplarily, if the first A-PHY data packet contains critical information (such as an emergency control instruction), the first A-PHY data packet is selected to be retained; if the second A-PHY data packet is more relevant to subsequent operations (such as a continuous data stream), the second A-PHY data packet is selected to be retained. The cache status of the A-PHY link is updated based on the A-PHY data packets selected for retention. When the cache underflows and data transmission is suspended, the cache occupancy and underflow status need to be updated. After the update, the A-PHY link continues to receive and process subsequent A-PHY data packets. If necessary, error recovery or data retransmission can be performed based on the retained A-PHY data packets.
[0085] In this way, by making a reasonable data packet retention strategy for the cache underflow situation, the amount of data in the cache can be dynamically adjusted, which helps to improve the overall performance and response speed of the A-PHY link.
[0086] In the disclosed embodiment, the data conversion method further includes: if after the A-PHY link receives the Mth A-PHY data packet, the A-PHY link receives multiple data packets exceeding the A-PHY link cache size within a preset time, and the A-PHY link cache overflows, then retaining the M-1th A-PHY data packet or the Mth A-PHY data packet.
[0087] In some embodiments, if the preset time is t3', after the A-PHY link is created, at time t1', the A-PHY link normally receives the first A-PHY data packet; the first A-PHY data packet is stored in the link cache, and the cache status is updated; if the A-PHY link is blocked, after recovery, when the A-PHY link receives multiple A-PHY data packets exceeding the A-PHY link cache size within t3', the remaining space of the A-PHY link cache is checked; if the A-PHY link cache overflows (i.e., the remaining space is insufficient to store the next A-PHY data packet), the A-PHY link retains the first A-PHY data packet or the second A-PHY data packet according to the target strategy; the target strategy may include multiple factors, such as the importance, timestamp, priority, etc. of the A-PHY data packet. Exemplarily, if the first A-PHY data packet contains critical information (such as an emergency control instruction), the first A-PHY data packet is selected to be retained; if the second A-PHY data packet is more relevant to subsequent operations (such as a continuous data stream), the second A-PHY data packet is selected to be retained. Based on the A-PHY data packet selected to be retained, the cache state of the A-PHY link is updated. If necessary, A-PHY data packets that are no longer needed in the cache can be discarded to make room for storing new A-PHY data packets. Ensure the consistency and integrity of the cache to avoid data conflicts or corruption. After retaining the A-PHY data packet and updating the cache state, the A-PHY link continues to receive and process subsequent A-PHY data packets. If necessary, operations such as error recovery or data retransmission can be performed based on the retained A-PHY data packet.
[0088] In this way, by making reasonable data packet retention strategies for different cache overflow situations, the cache space can be used more effectively, and cache waste and overflow can be avoided, which helps to improve the overall performance and response speed of the A-PHY link.
[0089] In the disclosed embodiment, the data conversion method further includes: sending the target I2S data to the I2S slave device to achieve playback of audio data in the target I2S data.
[0090] In some embodiments, the I2S slave device refers to a device in an audio network system that does not provide SCK signals and WS signals, and relies on these signals provided by the master device for synchronization and data transmission. The I2S slave device is connected to a terminal device (such as a speaker); after the I2S slave device sends an SD signal to the I2S master device, the target I2S data is formatted to obtain audio data in a preset format; the audio data in the preset format is sent to the terminal device; and the terminal device plays the audio data. Here, the audio data in the preset format is set according to the type of the terminal device.
[0091] Figure 7 FIG. 4 shows a schematic diagram of data conversion from an I2S master device to an I2S slave device. Figure 7 As shown, the I2S master device transmits the target I2S data in units of target frames to the first conversion unit through the valid channels (channel 0 to channel N) provided by the configuration information; the first conversion unit performs packetization processing on the target I2S data to obtain an A-PHY data packet; the A-PHY data packet is transmitted to the second conversion unit through an A-PHY link established by a first A-PHY interface connected to the first conversion unit and a second A-PHY interface connected to the second conversion unit; the second conversion unit performs unpacking processing on the A-PHY data packet to obtain the target I2S data; the second conversion unit transmits the target I2S data to the I2S slave device through the valid channels (channel 0 to channel N) provided by the configuration information; the I2S slave device receives the target I2S data in units of target frames.
[0092] In this way, the I2S data is transmitted from the I2S master device to the terminal device through the first conversion unit, the second conversion unit and the A-PHY link, which greatly reduces the signal transmission distance between the master device and the terminal device.
[0093] Figure 8 is a schematic diagram of a data conversion system according to an embodiment of the present disclosure. Figure 8 As shown, the system at least includes:
[0094] I2S master device, used to send target I2S data to I2S slave device;
[0095] An I2S slave device is used to receive target I2S data sent by an I2S master device to play audio data in the target I2S data;
[0096] A first conversion unit, used for packetizing the target I2S data to obtain an A-PHY data packet;
[0097] A second conversion unit is used to unpack the A-PHY data packet to obtain target I2S data;
[0098] The A-PHY network is used to transmit the A-PHY data packet from the first conversion unit to the second conversion unit; the A-PHY network is composed of multiple A-PHY links.
[0099] The data conversion system further includes: a control unit, which is used to control the I2S master device to send target I2S data to the I2S slave device.
[0100] In this way, efficient conversion and transmission of a large amount of I2S data in the A-PHY network is achieved through the first conversion unit, the second conversion unit and the A-PHY network, which helps to improve the flexibility of the vehicle audio data network and thus improve the efficiency of data transmission.
[0101] According to an embodiment of the present disclosure, the present disclosure also provides a vehicle having the data conversion system as described above.
[0102] In some embodiments, the type of the vehicle includes but is not limited to an autonomous driving vehicle and a new energy vehicle.
[0103] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A data conversion method, characterized in that: The method comprises: The target I2S data sent by the I2S master device is packaged and processed by the first conversion unit to obtain an A-PHY data packet; wherein the target I2S data is audio data in units of target frames; An A-PHY link established based on a first A-PHY interface and a second A-PHY interface; wherein the first A-PHY interface is connected to the first conversion unit; and the second A-PHY interface is connected to the second conversion unit; transmitting the A-PHY data packet from the first conversion unit to the second conversion unit via the A-PHY link; Unpacking the A-PHY data packet by the second conversion unit to obtain the target I2S data; The step of packaging the target I2S data sent by the I2S master device through the first conversion unit to obtain an A-PHY data packet includes: Extracting and analyzing the target I2S data by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol; The target embedding field is embedded in the payload of the A-PHY protocol to obtain the A-PHY data packet.
2. The method according to claim 1, characterized in that The method further comprises: In response to the configuration instruction of the control unit, the central processing unit performs initialization configuration to obtain configuration information; The target I2S data is acquired based on the configuration information, so that the target I2S data is transmitted to the first conversion unit by the I2S master device.
3. The method according to claim 2, characterized in that The target embedded field includes: a frame data field; wherein the target I2S data is extracted and analyzed by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol, including: When the first conversion unit detects that the frame data field does not meet the character alignment requirement, a preset value is filled into the tail of the audio data to obtain a frame data field that meets the character alignment requirement.
4. The method according to claim 3, characterized in that The target embedded field also includes: a data description field; wherein the data description field includes: a configuration field, a protocol flag field, a channel flag field and a resolution field.
5. The method according to claim 4, characterized in that The target embedded field also includes: a count field and a check field; wherein, before the A-PHY data packet is unpacked by the second conversion unit, the second conversion unit extracts and analyzes the A-PHY data packet to obtain the target embedded field; based on the data description field, the frame data field, the count field and the check field in the target embedded field, the A-PHY data packet is checked to determine the target processing mechanism according to the check result.
6. The method according to claim 1, characterized in that The method further comprises: If the A-PHY link does not receive the N+1th A-PHY data packet within a preset time after receiving the Nth A-PHY data packet and the A-PHY link buffer underflows, retaining the N-1th A-PHY data packet or the Nth A-PHY data packet; and If, after receiving the Mth A-PHY data packet, the A-PHY link receives multiple data packets exceeding the A-PHY link cache size within a preset time and the A-PHY link cache overflows, the M-1th A-PHY data packet or the Mth A-PHY data packet is retained.
7. The method according to claim 1, characterized in that The method further comprises: The target I2S data is sent to the I2S slave device to play the audio data in the target I2S data.
8. A data conversion system, characterized in that: The system comprises: I2S master device, used to send target I2S data to I2S slave device; The I2S slave device is used to receive the target I2S data sent by the I2S master device to play the audio data in the target I2S data; A first conversion unit, used for packetizing the target I2S data to obtain an A-PHY data packet; A second conversion unit, configured to unpack the A-PHY data packet to obtain the target I2S data; An A-PHY network, configured to transmit the A-PHY data packet from the first conversion unit to the second conversion unit; the A-PHY network comprising a plurality of A-PHY links; The step of packaging the target I2S data to obtain an A-PHY data packet includes: Extracting and analyzing the target I2S data by the first conversion unit to obtain a target embedded field that complies with the A-PHY protocol; The target embedding field is embedded in the payload of the A-PHY protocol to obtain the A-PHY data packet.
9. A vehicle, characterized in that: The vehicle has a data conversion system as claimed in claim 8.
