Audio data and IO signal multiplexing transmission method, system, device and storage medium
By embedding IO signal status information in the audio transmission link, the problem of low efficiency of audio transmission and control signals is solved, synchronous multiplexing transmission is achieved, system complexity and resource usage are reduced, and real-time response capability and integration efficiency are improved.
Patent Information
- Application Number
- CN202510992474.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-18
AI Technical Summary
In the existing technology, the transmission efficiency of audio and control signals is low, especially in multi-node control networks, where it is difficult to ensure real-time and synchronization, which increases the difficulty of system debugging and maintenance. In resource-constrained or cost-sensitive situations, configuring a separate control processor for each node will increase system cost and complexity.
A multiplexing transmission method of audio data and IO signals is adopted. By embedding IO signal status information in the audio transmission link and utilizing the fixed sampling timing of audio frames, synchronous multiplexing transmission is achieved, including the combined packaging, transmission and parsing of audio data and IO signals, avoiding independent control protocols and additional communication channels.
It significantly reduces system design complexity and communication resource usage, improves real-time response capabilities and integration efficiency, is suitable for cost-sensitive embedded systems and conference terminals, and achieves time synchronization and efficient control of IO signals.
Smart Images

Figure CN120498585B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio data transmission, and in particular to a method, system, device and storage medium for multiplexing and transmitting audio data and IO signals. Background Art
[0002] In the field of audio transmission and control systems, particularly in conferencing systems, embedded audio terminals, and industrial audio control equipment, it is often necessary to simultaneously transmit audio signals while also providing remote device control and status feedback. In such systems, control signals typically include simple I / O operations such as keystrokes, indicator light switches, relay drive signals, and serial port communications. To achieve these functions, existing solutions often deploy independent control signal links alongside audio links.
[0003] Currently, mainstream control signal transmission methods are mostly based on traditional master-slave communication protocols, which require complex processes such as command encapsulation, handshake confirmation, and response timeout processing. This necessitates that slave devices be equipped with independent communication processors to support the protocol stack. Furthermore, the real-time and synchronization of control signals is difficult to guarantee, especially in multi-node networks. State inconsistencies can easily occur between nodes, increasing the difficulty of system debugging and maintenance.
[0004] In resource-constrained or cost-sensitive scenarios, such as processor-less conference units and simple audio amplification equipment, configuring a separate control processor for each node significantly increases system cost and complexity. Furthermore, traditional control protocols suffer from low transmission efficiency. When the transmission frequency is far lower than the audio frame rate, this leads to low bandwidth utilization and wasteful transmission of redundant control information. Summary of the Invention
[0005] The purpose of the embodiments of the present application is to propose a method, system, device and storage medium for multiplexing and transmitting audio data and IO signals to solve the technical problem of low transmission efficiency of traditional control protocols.
[0006] In order to solve the above technical problems, the embodiment of the present application provides a method for multiplexing and transmitting audio data and IO signals, which adopts the following technical solutions:
[0007] A method for multiplexing and transmitting audio data and IO signals, comprising the following steps:
[0008] The sending end collects audio data at a fixed sampling frequency and obtains multiple IO signal states at the same time;
[0009] Combining and packaging the audio data and the IO signal status data to form composite frame data;
[0010] Sending the composite frame data to a receiving end via an audio transmission link;
[0011] The receiving end receives and parses the composite frame data, and separates the audio data and IO signal status therefrom;
[0012] A corresponding control operation is performed or a control output is generated at the receiving end according to the IO signal state.
[0013] In a possible implementation, in the step of combining and packaging the audio data and the IO signal status data to form composite frame data, the composite frame data includes a predefined frame header, a fixed bit width field for carrying the IO signal, and a field for carrying the audio data, wherein the total length of the IO signal field and the audio data field is fixed to 32 bits, the IO signal field is the upper 8 bits, and the audio data field is the lower 24 bits.
[0014] In a possible implementation manner, after the receiving end receives and parses the composite frame data to separate the audio data and the IO signal status, the step further includes:
[0015] According to the preset IO mapping table, each bit in the IO signal field in the IO mapping table is mapped to the corresponding physical IO pin state or virtual IO logical bit state, and the switch, signal sending or status update operation of the corresponding peripheral device at the receiving end is controlled according to the state.
[0016] In a possible implementation, the step of combining and packaging the audio data and the IO signal status data includes:
[0017] The sending end compares the IO signal status collected in the current frame with the IO signal status sent in the previous frame bit by bit;
[0018] If none of the bits have changed, the compression flag is set to the first state, and only the compressed frame containing the audio data and the flag is sent;
[0019] If at least one bit changes, the compression flag is set to the second state, and the indices and new values of all the changed bits are appended to the frame data to form an extended frame;
[0020] The compressed frame or the extended frame is sent to the receiving end as a part of the composite frame data.
[0021] In a possible implementation, the step of performing a corresponding control operation or generating a control output at the receiving end according to the IO signal state specifically includes:
[0022] After receiving the composite frame data, the receiving end detects whether it contains the behavior script control flag;
[0023] If a script flag is detected, the script information is extracted from the frame data, wherein the script information includes a target IO number, an action sequence, and an execution time parameter;
[0024] Writing the script into a local script register of the receiving end;
[0025] The receiving end will execute the corresponding IO state switching instructions on time according to the action sequence defined in the script register in the subsequent time until the script is executed or overwritten by the main control.
[0026] In a possible implementation, the step of sending the composite frame data to the receiving end through the audio link includes:
[0027] The sender appends a node ID mask field to the frame data to identify the target node group to which the frame applies;
[0028] After receiving the frame data, the receiving end reads the node ID mask field and determines whether it matches according to its own pre-configured hash index table;
[0029] If there is a match, the IO control bit field related to this node in the frame is extracted and subsequent parsing is continued;
[0030] If there is no match, the IO control bit portion of the frame is ignored and only the audio data is processed.
[0031] In a possible implementation manner, the composite frame data further includes a time synchronization flag, and the control operation steps of the time synchronization flag include:
[0032] The sender sets the synchronization flag of one frame to active state in every N-frame period and the other frames to off state;
[0033] After detecting the synchronization frame, the receiving end refreshes the internal IO control execution time reference point;
[0034] Each receiving node uniformly starts script execution, IO state switching or serial port data resampling operations based on the synchronization point to achieve control timing consistency among multiple nodes.
[0035] In order to solve the above technical problems, the embodiment of the present application further provides an audio data and IO signal multiplexing transmission system, which adopts the following technical solution:
[0036] An audio data and IO signal multiplexing transmission system, comprising:
[0037] Acquisition module: The sending end collects audio data at a fixed sampling frequency and obtains multiple IO signal states at the same time;
[0038] A packaging module combines and packages the audio data and the IO signal status data to form composite frame data;
[0039] A sending module, which sends the composite frame data to a receiving end via an audio transmission link;
[0040] The parsing module receives and parses the composite frame data at the receiving end, and separates the audio data and IO signal status therefrom;
[0041] An execution module executes a corresponding control operation or generates a control output at a receiving end according to the IO signal state.
[0042] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0043] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the audio data and IO signal multiplexing transmission method described above are implemented.
[0044] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0045] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the above-mentioned method for multiplexing and transmitting audio data and IO signals.
[0046] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0047] The audio data and IO signal multiplexing transmission method disclosed in the present application realizes the synchronous multiplexing transmission of audio data and control signals by embedding IO signal status information during the audio data transmission process, without the need to use independent control protocols or additional communication channels, significantly reducing the system design complexity and communication resource occupancy; at the same time, by utilizing the fixed sampling timing of the audio frame, the IO signal has natural time synchronization, which is suitable for cost-sensitive application scenarios with limited control complexity such as embedded systems and conference terminals, greatly improving the system's real-time response capability and integration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 is a flowchart of an embodiment of a method for multiplexing and transmitting audio data and IO signals according to the present application;
[0050] Figure 2 1 is a structural diagram of an embodiment of a system for multiplexing and transmitting audio data and IO signals according to the present application;
[0051] Figure 3 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0053] refer to Figure 1 , shows a flow chart of an embodiment of a method for multiplexing and transmitting audio data and IO signals according to the present application. The method for multiplexing and transmitting audio data and IO signals comprises the following steps:
[0054] In step S101 , the transmitting end collects audio data at a fixed sampling frequency and simultaneously obtains multiple IO signal states.
[0055] In this embodiment, the electronic device on which the audio data and IO signal multiplexing transmission method is running can send or receive data via a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultrawideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0056] In this embodiment, the transmitting end samples the audio signal in real time at a fixed sampling frequency, which is typically 48 kHz or other frame rates that comply with audio industry standards. While sampling the audio, the transmitting end synchronously reads the level status of multiple IO signals. These IO signals can come from local physical IO pin inputs, such as key signals, sensor trigger signals, or control signals written from a processor (such as an MCU, DSP, or FPGA) through an interface such as SPI or UART. The reading method can use parallel GPIO sampling or serial register reading to ensure that a complete IO status can be obtained at each audio sampling point.
[0057] Step S102: Combining and packaging the audio data and the IO signal status data to form composite frame data.
[0058] In this embodiment, the audio data and the collected IO signal status data are combined and packaged to form composite frame data in a unified format. In a specific implementation, the composite frame can adopt a fixed-length format. For example, 24-bit audio data and 8-bit IO status data are combined into a 32-bit composite frame. Each bit corresponds to a clear function, where the upper 8 bits are used to carry the IO status and the lower 24 bits are used to carry the audio sample value. The bit order can be based on the system convention. Each bit of the IO status data corresponds one-to-one to the actual IO channel, such as bit 0 corresponds to IO0, bit 1 corresponds to IO1, and so on, to ensure that the original IO status can be accurately restored at the receiving end. At the same time, the frame data can also include predefined auxiliary fields such as frame header, synchronization bit, check bit, etc. to improve frame identification and data integrity.
[0059] Step S103: Send the composite frame data to a receiving end via an audio transmission link.
[0060] In this embodiment, the composite frame data is sent from the transmitting end to the receiving end in real time via an audio transmission link. The audio transmission link can be an I2S serial audio interface, a TDM bus, or an Ethernet-based audio transmission channel (such as RTP encapsulation, UDP audio broadcast, etc.). The link is required to support fixed frame rate and constant delay transmission to ensure timing consistency of IO control. In practical applications, the link not only completes high-speed transmission of audio samples, but also implicitly carries control information without the need for additional signaling channels, thereby greatly simplifying hardware design and protocol stack processing.
[0061] Step S104 : The receiving end receives and parses the composite frame data, and separates the audio data and IO signal status therefrom.
[0062] In this embodiment, after receiving the composite frame data, the receiving end unpacks the data frame according to the protocol rules consistent with the sending end, extracting the audio part and the IO status part. The unpacking operation can be completed through register separation or frame parsing logic in the receiving module. The extracted audio data will enter the subsequent audio playback link, and the IO status data will be parsed into a single binary control bit and mapped to the local control interface, for example, by setting the IO output pin level of the receiving device, simulating the driving of LEDs, controlling relays, and feeding back to the upper-level application logic. In addition, the receiving end can also use the IO status for further data-driven decision-making to achieve local mapping of the main control logic.
[0063] Step S105 : executing a corresponding control operation or generating a control output at the receiving end according to the IO signal state.
[0064] In this embodiment, the receiving end performs specific control operations or generates corresponding control outputs based on the parsed IO signal status. The control operation can be to directly change the output level of the IO pin to control external hardware, or to trigger further program logic based on the status, such as state machine switching, indicator light flashing, pronunciation prompts, information forwarding, etc. The system can also define certain IO bits for special communication purposes such as UART and PWM according to usage requirements, thereby realizing more complex control behaviors through the ordinary audio link. This makes the entire system have high real-time performance, high flexibility and high integration on the basis of unchanged hardware interface, greatly reducing the design complexity and cost of terminal equipment.
[0065] This application embeds IO signal status information during the audio data transmission process to achieve synchronous multiplexing transmission of audio data and control signals, without the need for independent control protocols or additional communication channels, significantly reducing the system design complexity and communication resource usage; at the same time, the fixed sampling timing of the audio frame is used to give the IO signal natural time synchronization, which is suitable for cost-sensitive application scenarios with limited control complexity such as embedded systems and conference terminals, greatly improving the system's real-time response capability and integration efficiency.
[0066] In some optional implementations of this embodiment, in the above-mentioned step of combining and packaging the audio data and IO signal status data to form composite frame data, the composite frame data includes a predefined frame header, a fixed bit width field for carrying the IO signal, and a field for carrying the audio data, wherein the total length of the IO signal field and the audio data field is fixed to 32 bits, the IO signal field is the upper 8 bits, and the audio data field is the lower 24 bits.
[0067] In this embodiment, the composite frame data consists of three functional areas: one is a predefined frame header used for frame synchronization identification, the second is a fixed bit width field carrying IO signals, and the third is a field carrying audio data. The three parts are spliced in a fixed order to form a complete data frame. The predefined frame header is used by the receiver to locate the start of the data frame and identify the protocol. It can be set to a specific byte sequence (such as 0xAA or a frame sequence number) to facilitate frame synchronization detection. The IO signal field is the upper 8 bits, located in the upper byte position (bits 31 and 24) of the 32-bit composite frame, and is used to carry the status information of eight digital IO signals. Each bit represents the status of an IO channel, for example, bit 0 represents the status of IO0, bit 1 represents the status of IO1, and so on. The sender can obtain and update this 8-bit field in real time by reading GPIO registers or internal variables, or write specific values to the controller to achieve control transparent transmission. The audio data field is the lower 24 bits, located in the bits 23 and 0 interval of the composite frame, and is used to carry the 24-bit audio sample data commonly used in the standard I2S interface. This data can come directly from the audio sampling module (such as the ADC, CODEC) or the digital audio buffer. This fixed 32-bit data frame format has significant system adaptability and processing simplicity. On the one hand, it facilitates the use of standard data bus widths for fast packing and unpacking operations in processors such as FPGAs, DSPs, or MCUs, eliminating the need for complex dynamic frame length parsing. On the other hand, the fixed IO field length also ensures a stable mapping relationship between control signal bits and hardware IO ports, making it particularly suitable for audio control systems with simple control relationships but high real-time requirements, such as pushbutton switches, indicator lights, and microphone power control in conference units. Furthermore, this frame structure offers excellent scalability. Without changing the total length, the frame header can be functionally expanded, such as by adding control flags, synchronization markers, compression bit identifiers, and other information, thereby providing frame-level support for subsequent functions such as compression encoding, adaptive transmission, and behavioral scripts. Therefore, the use of the aforementioned fixed-length 32-bit frame structure maintains the real-time nature of audio transmission while achieving stable multiplexing of IO signals.
[0068] This application establishes a data frame model with a clear structure and efficient processing by designing the composite frame data into a 32-bit fixed format, dedicating the upper 8 bits to the IO signal field and the lower 24 bits to the audio data field. This not only simplifies the operational logic of the sender and receiver during the packaging and unpacking process, but also adapts to the data bus width of mainstream processors, thereby improving processing efficiency and code maintainability.
[0069] In some optional implementations of this embodiment, after the receiving end receives and parses the composite frame data to separate the audio data and the IO signal status, the step further includes:
[0070] According to the preset IO mapping table, each bit in the IO signal field in the IO mapping table is mapped to the corresponding physical IO pin state or virtual IO logical bit state, and the switch, signal sending or status update operation of the corresponding peripheral device at the receiving end is controlled according to the state.
[0071] In this embodiment, to implement efficient and flexible IO control logic, the receiving end internally presets an IO mapping table. This mapping table can take the form of a lookup table, configuration register, or fixed logic rules. Its purpose is to define the correspondence between the 8-bit IO signal field (i.e., 8 control bits) in the composite frame and the actual controllable objects of the local device. Each IO signal field can represent an independent control signal, for example, a "1" bit indicates "turn on the LED light" and a "0" bit indicates "turn off." It can also indicate input status for reverse transmission to the system master control. During implementation, the receiver parses the 8-bit IO field in the composite frame bit by bit according to the preset IO mapping table, and performs mapping actions for each bit: If the bit is mapped to a local physical IO pin (such as GPIO0 to GPIO7), the output level of the corresponding pin is directly set according to its high or low level state, realizing direct control of the external circuits or devices of the receiver, such as lighting the talk indicator, switching phantom power, and driving the buzzer. If the bit is mapped to a virtual IO logic bit, its state is written to the flag register, state machine trigger, or logical operation module in the local control logic module to drive more complex logical behaviors, such as selecting different audio channels, switching the receiving mode, and enabling the serial port response mechanism.
[0072] In a specific application, for example, a processor-less conference unit in a conference system can map bit 0 to "microphone power control" and bit 1 to "speak button light" on the receiver side. When bit 0 is 1 in the composite frame sent by the host computer via the audio link, the receiver immediately outputs a high-level signal to power the microphone; when bit 1 is 1, the button light illuminates. This mapping process is highly flexible, allowing users to preset mappings through initial configuration, firmware writing, or fixed wiring. It can also be used to implement differentiated control based on on-site device functions. This enables accurate decoding and immediate response to control information under low-resource conditions, avoiding the tedious processes of protocol identification, command unpacking, and logic scheduling required in traditional I / O control. This significantly simplifies receiver design and improves response speed and system reliability.
[0073] This application maps each bit in the IO signal field to the physical IO pin or virtual logic bit of the receiving end, and controls the peripheral action or updates the status register based on this mapping relationship, thereby realizing the fast mapping and direct execution of the control signal from the sending end to the receiving end. Compared with the cumbersome process of parsing commands, parsing parameters, and calling control logic in traditional control protocols, a minimalist control execution chain is constructed at the receiving end, significantly reducing hardware resource consumption.
[0074] In some optional implementations of this embodiment, the step of combining and packaging the audio data and the IO signal status data includes:
[0075] The sending end compares the IO signal status collected in the current frame with the IO signal status sent in the previous frame bit by bit;
[0076] If none of the bits have changed, the compression flag is set to the first state, and only the compressed frame containing the audio data and the flag is sent;
[0077] If at least one bit changes, the compression flag is set to the second state, and the indices and new values of all the changed bits are appended to the frame data to form an extended frame;
[0078] The compressed frame or the extended frame is sent to the receiving end as a part of the composite frame data.
[0079] In this embodiment, before generating each frame of composite data, the transmitter compares the 8-bit IO signal state acquired in the current frame with the 8-bit IO signal state transmitted in the previous frame, bit by bit, to determine whether any bits have changed. If all bits remain unchanged, indicating that the IO state does not need to be updated in the current frame, the transmitter sets the compression flag to a first state (e.g., to 0). This flag, which can be located in the frame header or control field, notifies the receiver that the frame does not contain a new IO state field, retaining only the complete audio data field and the compression flag. This creates a compressed frame and avoids repeated transmission of redundant IO fields. If at least one IO signal state changes (e.g., from 0 to 1 or from 1 to 0), the transmitter sets the compression flag to a second state (e.g., to 1) and enters extended packetization mode. In this mode, in addition to the audio data field and the flag, a change description field is also added. This field contains the index positions and new values of all changed bits. For example, it can be encoded in the form of "index-value" pairs, such as "[bit2:1][bit5:0]" indicating that bit 2 changes to 1 and bit 5 changes to 0. The frame constructed in this way is called an extended frame. After receiving this frame, the receiver can identify the frame type based on the flag bit and extract the changed IO bits and their status in the extended field, thereby realizing on-demand updates to the receiver's IO status. This compression and expansion mechanism can be flexibly adapted to different control scenarios. For example, in a conference system, the IO may only change when the user presses a key, and the IO remains stable in most other frames. This mechanism can significantly reduce the bandwidth occupied by the IO field during transmission, avoiding the repeated transmission of control information in the link, thereby freeing up more transmission space for audio data or other control information, and improving the overall utilization efficiency of the link. In addition, this method has a clear structure and consumes very little computing resources. It is suitable for implementation in low-cost embedded platforms (such as FPGAs and MCUs). It is an efficient data optimization strategy for embedded audio control environments.
[0080] This application introduces an adaptive compression mechanism based on inter-frame differences to detect bit-by-bit changes in the IO field, and transmits the corresponding bit and its new value only when a change occurs, effectively avoiding the repeated transmission of redundant control information. When most control signals remain stable, the frame data length can be greatly reduced, thereby reducing bandwidth pressure and improving link utilization.
[0081] In some optional implementations of this embodiment, the step of performing a corresponding control operation or generating a control output at the receiving end according to the IO signal state specifically includes:
[0082] After receiving the composite frame data, the receiving end detects whether it contains the behavior script control flag;
[0083] If a script flag is detected, the script information is extracted from the frame data, wherein the script information includes a target IO number, an action sequence, and an execution time parameter;
[0084] Writing the script into a local script register of the receiving end;
[0085] The receiving end will execute the corresponding IO state switching instructions on time according to the action sequence defined in the script register in the subsequent time until the script is executed or overwritten by the main control.
[0086] In this embodiment, upon receiving each composite frame, the receiving end, in addition to routinely parsing the audio data and IO signal fields, also checks the frame data for a specific behavioral script control flag. This flag indicates whether the current frame carries script information. This flag can be embedded in the frame header, control field, or additional frame area, and the format is customizable. For example, a single-bit flag set to "1" indicates that the frame is a script frame. If the script control flag is detected as active, the receiving end then extracts the script information field from the frame. The script information should include at least three key elements: the target IO number (identifying the IO channel controlled by the script, such as IO2, IO4, etc.), the action sequence (e.g., a series of high-low level switching instructions, such as "high-low-high"), and the execution time parameters (e.g., the duration of each action or the total execution cycle, such as "200ms-100ms-200ms"). These contents can be packaged in a predetermined format, such as "[IO3][1-0-1][200-100-200]." The receiving end writes the parsed script information into a local script register, which can be a structured table in RAM, a configuration segment in hardware timer control logic, or an action buffer on an embedded processor. The script register supports storage of multiple instructions and can be configured with overwrite permissions and clear trigger conditions. During subsequent execution, the receiving end will periodically execute I / O state switching operations according to the action sequence and timing parameters set in the script register. This allows the receiving end to locally implement control actions such as "intermittently lighting an indicator light," "controlling relays on and off at a fixed rhythm," or "presetting the PWM duty cycle" without requiring the master control to send further control commands. This execution process can be accomplished through internal timer scheduling, state machine-driven, or interrupt service routines. If the master control sends a new script or control command before a script has completed execution, the receiving end will, based on its configured policy, either abort the current script and overwrite it with the new one, or cache the new script in a queue until the previous one completes.
[0087] This application introduces a behavior script control mechanism into the frame data, so that the receiving end can independently execute the preset IO state switching sequence according to the issued control script, thereby realizing offline execution and timing control of the control logic.
[0088] In some optional implementations of this embodiment, the step of sending the composite frame data to the receiving end through the audio link includes:
[0089] The sender appends a node ID mask field to the frame data to identify the target node group to which the frame applies;
[0090] After receiving the frame data, the receiving end reads the node ID mask field and determines whether it matches according to its own pre-configured hash index table;
[0091] If there is a match, the IO control bit field related to this node in the frame is extracted and subsequent parsing is continued;
[0092] If there is no match, the IO control bit portion of the frame is ignored and only the audio data is processed.
[0093] In this embodiment, when constructing composite frame data at the transmitting end, in addition to the original frame header, IO signal field, and audio data field, a node ID mask field is further embedded in the frame data. This field is used to identify the set of receiving target nodes to which the current frame applies. The node ID mask can take the form of a fixed-length bitmap (e.g., 1 or 2 bytes), with each bit corresponding to the unique identifier of a receiving node in the system. A value of "1" indicates that the frame is applicable to that node, while a value of "0" indicates that it is invalid. For example, if there are eight receiving nodes in the system, an 8-bit mask of "00100100" indicates that the frame is only sent to nodes with IDs 2 and 5.
[0094] When each receiving node is initialized, it will preset its unique node ID in the system and store a hash index table or ID matching table. This table is used to parse and judge the bitmap information in the mask field when receiving frame data. Specifically, when the receiving end receives a composite frame containing a node ID mask, it first extracts the field and matches it with the local node ID. If the judgment result is "match", that is, the corresponding position in the mask is "1", it indicates that the frame contains the control information of this node. The receiving end then extracts and parses the corresponding IO control bit field in the frame and performs subsequent IO mapping and control operations; conversely, if the judgment result is "mismatch", the receiving end ignores the IO control bit field in the frame and only retains and processes the audio data part, ensuring that non-target nodes in the system do not respond to irrelevant control information, thereby preventing misoperation.
[0095] This application implements selective broadcast distribution of control information in a multi-node system by adding a node ID mask field to a composite frame and using a local hash index table at the receiving end for identification. It supports multiple control modes: unicast, multicast, or broadcast, avoiding miscontrol of irrelevant nodes and reducing the resource waste of repeatedly sending data frames, thereby improving system communication efficiency and the flexibility of distributed control.
[0096] In some optional implementations of this embodiment, the composite frame data further includes a time synchronization flag, and the control operation steps of the time synchronization flag include:
[0097] The sender sets the synchronization flag of one frame to active state in every N-frame period and the other frames to off state;
[0098] After detecting the synchronization frame, the receiving end refreshes the internal IO control execution time reference point;
[0099] Each receiving node uniformly starts script execution, IO state switching or serial port data resampling operations based on the synchronization point to achieve control timing consistency among multiple nodes.
[0100] In this embodiment, when the transmitting end generates composite frame data, the system periodically sets the time synchronization flag in a frame to an active state (e.g., a flag value of 1) according to a set frame period N (e.g., every 32 frames, 64 frames, or a custom period), indicating that the frame is a synchronized frame. In the remaining asynchronous frames, the flag is set to an inactive state (e.g., a flag value of 0), indicating that they are regular frames. This flag can be embedded in a specific bit in the frame header field or control field and transmitted along with the frame via the audio link to the receiving end.
[0101] When parsing the received composite frame data, the receiver identifies the state of the synchronization flag. If it detects that the current frame is a synchronization frame, it immediately uses the current reception time as the new internal control execution time reference point, updating the starting reference time of the local timer, task scheduler, or script execution engine. Refreshing this synchronization point does not interrupt the currently loaded control logic, but ensures that all receiving nodes initiate the next control operation at the same synchronization point.
[0102] After the synchronization point is refreshed, each receiving node in the system can synchronously initiate the following operations based on this unified time base: for example, the IO behavior sequence preset in the script register is executed, ensuring that behaviors with obvious time-aware characteristics, such as LED flashing and relay cycle operation, are consistently initiated across all nodes; or IO state switching is triggered to achieve synchronous driving of multiple ports; or serial port input data is rebuffered and resampled to avoid data alignment errors caused by inconsistent starting points. Such operations are particularly critical in scenarios such as conferencing systems, stage lighting control, distributed sound systems, and industrial synchronization triggering.
[0103] This application achieves synchronized initiation and rhythm alignment of control actions in a multi-node system by introducing a time synchronization flag into the composite frame and uniformly refreshing the execution time base at the receiving end. Without requiring additional synchronization lines or clock calibration signals, the application leverages existing audio links to achieve lightweight, high-precision synchronization flag transmission, ensuring that actions such as script execution, I / O switching, and serial port transparent transmission maintain time consistency across multiple nodes, significantly enhancing the system's collaborative control capabilities.
[0104] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware using computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0105] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0106] Further references Figure 2 , as a response to the above Figure 1 The present application provides an embodiment of a system for multiplexing and transmitting audio data and IO signals. Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices.
[0107] like Figure 2 As shown, the audio data and IO signal multiplexing transmission system 200 described in this embodiment includes: an acquisition module 201, a packaging module 202, a sending module 203, a parsing module 204 and an execution module 205. Among them:
[0108] Acquisition module 201, the sending end collects audio data according to a fixed sampling frequency and obtains multiple IO signal states at the same time;
[0109] The packing module 202 combines and packs the audio data and the IO signal status data to form composite frame data;
[0110] The sending module 203 sends the composite frame data to the receiving end via the audio transmission link;
[0111] The parsing module 204 receives and parses the composite frame data at the receiving end, and separates the audio data and the IO signal status therefrom;
[0112] The execution module 205 executes a corresponding control operation or generates a control output at the receiving end according to the IO signal state.
[0113] The audio data and IO signal multiplexing transmission system provided in the embodiment of the present invention can implement all the processes of the audio data and IO signal multiplexing transmission method of the above embodiment. The functions of each module in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by the audio data and IO signal multiplexing transmission method of the above embodiment, and will not be repeated here.
[0114] To solve the above technical problems, the present application also provides a computer device. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.
[0115] The computer device 3 includes a memory 31, a processor 32, and a network interface 33 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 3 with components 31-33, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0116] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.
[0117] The memory 31 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as the hard disk or internal memory of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 31 may also include both the internal storage unit of the computer device 3 and its external storage device. In this embodiment, the memory 31 is generally used to store the operating system and various application software installed on the computer device 3, such as computer-readable instructions for the multiplexing transmission method of audio data and IO signals. In addition, the memory 31 can also be used to temporarily store various types of data that have been output or are to be output.
[0118] In some embodiments, the processor 32 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 32 is typically used to control the overall operation of the computer device 3. In this embodiment, the processor 32 is used to execute computer-readable instructions stored in the memory 31 or process data, such as computer-readable instructions for executing the method for multiplexing and transmitting audio data and IO signals.
[0119] The network interface 33 may include a wireless network interface or a wired network interface. The network interface 33 is generally used to establish a communication connection between the computer device 3 and other electronic devices.
[0120] The computer device provided in this application realizes the synchronous multiplexing transmission of audio data and control signals by embedding IO signal status information during the audio data transmission process, without the need for independent control protocols or additional communication channels, significantly reducing the system design complexity and communication resource occupancy; at the same time, by utilizing the fixed sampling timing of the audio frame, the IO signal has natural time synchronization, which is suitable for application scenarios such as embedded systems and conference terminals that are cost-sensitive and have limited control complexity, greatly improving the system's real-time response capability and integration efficiency.
[0121] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the audio data and IO signal multiplexing transmission method as described above.
[0122] The computer-readable storage medium provided in this application realizes the synchronous multiplexing transmission of audio data and control signals by embedding IO signal status information during the audio data transmission process, without the need for independent control protocols or additional communication channels, significantly reducing the system design complexity and communication resource occupancy; at the same time, by utilizing the fixed sampling timing of the audio frame, the IO signal has natural time synchronization, which is suitable for cost-sensitive application scenarios with limited control complexity such as embedded systems and conference terminals, greatly improving the system's real-time response capability and integration efficiency.
[0123] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.
[0124] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for multiplexing and transmitting audio data and IO signals, characterized in that: The steps include: The sending end collects audio data at a fixed sampling frequency and obtains multiple IO signal states at the same time; Combining and packaging the audio data and the IO signal status data to form composite frame data, the composite frame data including a predefined frame header, a fixed bit width field for carrying the IO signal, and a field for carrying the audio data, wherein the total length of the IO signal field and the audio data field is fixed to 32 bits, the IO signal field is the upper 8 bits, and the audio data field is the lower 24 bits; Sending the composite frame data to a receiving end via an audio transmission link; The receiving end receives and parses the composite frame data, and separates the audio data and IO signal status therefrom; A corresponding control operation is performed or a control output is generated at the receiving end according to the IO signal state.
2. The audio data and IO signal multiplexing transmission method according to claim 1, characterized in that: After the receiving end receives and analyzes the composite frame data and separates the audio data and the IO signal status therefrom, the method further includes: According to the preset IO mapping table, each bit in the IO signal field in the IO mapping table is mapped to the corresponding physical IO pin state or virtual IO logical bit state, and the switch, signal sending or status update operation of the corresponding peripheral device at the receiving end is controlled according to the state.
3. The audio data and IO signal multiplexing transmission method according to claim 1, characterized in that: The step of combining and packaging the audio data and the IO signal status data comprises: The sending end compares the IO signal status collected in the current frame with the IO signal status sent in the previous frame bit by bit; If none of the bits have changed, the compression flag is set to the first state, and only the compressed frame containing the audio data and the flag is sent; If at least one bit changes, the compression flag is set to the second state, and the indices and new values of all the changed bits are appended to the frame data to form an extended frame; The compressed frame or the extended frame is sent to the receiving end as a part of the composite frame data.
4. The audio data and IO signal multiplexing transmission method according to claim 1, characterized in that: The step of executing a corresponding control operation or generating a control output at the receiving end according to the IO signal state specifically includes: After receiving the composite frame data, the receiving end detects whether it contains the behavior script control flag; If the script control flag is detected, the script information is extracted from the frame data, wherein the script information includes the target IO number, the action sequence and the execution time parameter; Writing the script information into a local script register of the receiving end; The receiving end will execute the corresponding IO state switching instructions on time according to the action sequence defined in the script register in the subsequent time until the script information is executed or overwritten by the main control.
5. The audio data and IO signal multiplexing transmission method according to claim 1, characterized in that: The step of sending the composite frame data to the receiving end via the audio link comprises: The sender appends a node ID mask field to the frame data to identify the target node group to which the frame applies; After receiving the frame data, the receiving end reads the node ID mask field and determines whether it matches according to its own pre-configured hash index table; If there is a match, the IO control bit field related to this node in the frame is extracted and subsequent parsing is continued; If there is no match, the IO control bit portion of the frame is ignored and only the audio data is processed.
6. The audio data and IO signal multiplexing transmission method according to claim 1, characterized in that: The composite frame data also includes a time synchronization flag, and the control operation steps of the time synchronization flag include: The sender sets the synchronization flag of one frame to active state in every N-frame period and the other frames to off state; After detecting the synchronization frame, the receiving end refreshes the internal IO control execution time reference point; Each receiving node uniformly starts script execution, IO state switching or serial port data resampling operation based on the time reference point to achieve control timing consistency among multiple nodes.
7. An audio data and IO signal multiplexing transmission system, characterized in that: include: Acquisition module: The sending end collects audio data at a fixed sampling frequency and obtains multiple IO signal states at the same time; a packing module, combining and packing the audio data and the IO signal status data to form composite frame data, wherein the composite frame data includes a predefined frame header, a fixed-bit-width field for carrying the IO signal, and a field for carrying the audio data, wherein the total length of the IO signal field and the audio data field is fixed to 32 bits, the IO signal field is the upper 8 bits, and the audio data field is the lower 24 bits; A sending module, which sends the composite frame data to a receiving end via an audio transmission link; The parsing module receives and parses the composite frame data at the receiving end, and separates the audio data and IO signal status therefrom; An execution module executes a corresponding control operation or generates a control output at a receiving end according to the IO signal state.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the audio data and IO signal multiplexing transmission method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the audio data and IO signal multiplexing transmission method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Multiplex method of channel in digital audio broadcasting
CN103036664A
Fire-fighting information transmission system, method and device
CN111431562A