Cloud loudspeaker system based on OpenCPU technology and control method thereof
Through the integration of communication and audio processing functions of OpenCPU modules, the cloud speaker system architecture is simplified, and the existing cloud speaker system's response delay and high hardware complexity are solved, and a high integration and low-cost audio broadcasting solution is realized.
Patent Information
- Application Number
- CN202510463277.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
AI Technical Summary
The existing cloud speaker system has a complex architecture, large response time delay, complex hardware design, low integration, high cost, and difficult to meet scenarios with high real-time requirements.
The OpenCPU module integrates the communication protocol stack and audio playback control program, directly receives and processes cloud audio broadcasting instructions, integrates audio decoding and power amplifier units, eliminates multi-level communication between the MCU and the module, uses a Class D power amplifier chip and non-volatile memory, and supports remote upgrades and local broadcasting.
Significantly reduces system communication latency, improves response speed and integration, reduces hardware costs, and is suitable for audio broadcasting scenarios with high real-time and miniaturization requirements.
Smart Images

Figure CN120378805A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things terminal devices, and particularly to a cloud speaker system based on OpenCPU technology and a control method for a cloud speaker system based on OpenCPU technology. Background Art
[0002] With the rapid development of Internet of Things technology, various intelligent terminal devices are widely used in fields such as payment, logistics, and security. Among them, audio broadcast terminal devices represented by "cloud speakers" are widely used in scenarios such as code scanning payment broadcast and voice prompts, and need to have characteristics such as networking ability, strong real-time performance, and accurate broadcast.
[0003] Existing cloud speaker systems usually adopt the traditional architecture of "MCU + communication module + speaker power amplifier". In this architecture, the MCU serves as the main controller, responsible for parsing cloud data, generating control instructions, and managing the audio playback process; the communication module is only used for data exchange with the cloud server; the speaker power amplifier circuit is used to complete the output of audio signals. Although this solution has a certain degree of feasibility, the following main problems exist in actual applications:
[0004] The system architecture is complex and the response delay is large. Since the audio broadcast process needs to go through multiple levels of transmission of "cloud - communication module - MCU - module - playback", after the communication module receives the data, it needs to be transmitted to the MCU for instruction parsing and authentication, and then the MCU feeds back to the module for audio processing and playback, resulting in a slow system response speed, and it is very easy to have problems such as delayed broadcast and missed broadcast, and it is difficult to meet scenarios with high real-time requirements such as payment.
[0005] Secondly, the hardware design is complex, the integration level is low, and the cost is relatively high. The traditional solution requires two sets of control logics of an independent MCU and a module, with a large number of hardware interfaces and complex wiring, which is not conducive to miniaturization design; at the same time, due to the large number of components, the overall machine cost and failure rate increase, and the maintenance difficulty is large, which limits the popularization and application of the system in scenarios with low cost and high deployment density.
[0006] Therefore, how to simplify the architecture design of the cloud speaker system, reduce communication latency and hardware complexity has become an urgent technical problem in this field. Summary of the Invention
[0007] The purpose of the embodiments of the present invention is to provide a cloud speaker system based on OpenCPU technology and its control method, so as to at least solve the problems of complex system architecture and large communication response latency existing in the existing cloud speaker system.
[0008] To achieve the above object, a cloud speaker system based on OpenCPU technology is provided in the first aspect of the present invention. The system includes: an OpenCPU module for connecting to a cloud server and receiving audio broadcast control instructions; an audio decoding unit connected to the OpenCPU module for decoding the received audio data; an audio power amplifier unit connected to the audio decoding unit for amplifying and outputting the decoded audio signal; and a speaker unit for playing the amplified audio content.
[0009] Optionally, the OpenCPU module integrates a communication protocol stack and an audio playback control program; the communication protocol stack is used to support TCP / IP network communication; the playback control program is used to respond to cloud broadcast instructions, retrieve corresponding audio resources, and control the audio decoding unit to play.
[0010] Optionally, a bidirectional connection is established between the OpenCPU module and the cloud server through the Cat.1 communication protocol; the OpenCPU module has a heartbeat detection mechanism and an abnormal reconnection mechanism to perform connection recovery and re-receive instructions when communication is abnormal.
[0011] Optionally, the audio decoding unit integrates an audio format parsing module; the audio format parsing module is used to decode data in WAV, MP3, and / or AAC audio formats and output it to the power amplifier unit; the decoding unit communicates with the OpenCPU module through an I2S or SPI bus.
[0012] Optionally, the audio power amplifier unit includes a class D power amplifier chip; the input end of the class D power amplifier chip is connected to the audio decoding unit; the output end of the class D power amplifier chip is electrically connected to the speaker; the audio power amplifier unit is configured with an overheat protection module, a short-circuit protection module, and a volume automatic adjustment module.
[0013] Optionally, the OpenCPU module is provided with a non-volatile memory; the non-volatile memory is used to store a preset audio template, and the audio template contains preset broadcast voice content for providing offline broadcast when the network is interrupted.
[0014] Optionally, the OpenCPU module is configured with a remote configuration interface for remotely upgrading and configuring the control program of the OpenCPU module through OTA based on the remote configuration interface.
[0015] The second aspect of the present invention provides a control method for a cloud speaker system based on OpenCPU technology. The method is applied to the above-mentioned cloud speaker system based on OpenCPU technology, and the method includes: receiving a broadcast instruction sent by a cloud server, where the broadcast instruction is generated based on payment result information received by the cloud server from a trading platform; wherein, the cloud server sends the broadcast instruction to the OpenCPU module in the cloud speaker device through a Cat.1 communication network; parsing the broadcast instruction based on the OpenCPU module and calling a local control program to synthesize or call preset audio data; sending the audio data to an audio decoding and power amplification unit and completing the broadcast through a speaker.
[0016] Optionally, the method further includes: if a power failure or communication interruption occurs during the broadcast, writing the current state to a local cache based on the OpenCPU module, and resuming the unbroadcast task according to the cache content after recovery.
[0017] On the other hand, the present invention provides a computer-readable storage medium, on which instructions are stored, and when the instructions run on a computer, the computer is caused to execute the above-mentioned control method for a cloud speaker system based on OpenCPU technology.
[0018] Through the above technical solution, the solution of the present invention uses an OpenCPU module with communication and local control capabilities to replace the separated MCU and communication modules in the traditional system, realizing the direct reception and processing of cloud instructions. The audio decoding, power amplification, and broadcast processes are efficiently completed under the control of the module, eliminating multi-level transfer and redundant interface design, and significantly reducing the system communication delay and hardware complexity. The system has a simple structure and high integration, can effectively improve the response speed, reduce the terminal cost, and is particularly suitable for audio broadcast scenarios with high requirements for real-time performance and miniaturization.
[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent specific embodiments section. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification, and are used together with the following specific embodiments to explain the embodiments of the present invention, but do not constitute a limitation to the embodiments of the present invention. In the drawings:
[0021] Figure 1 is a system structure diagram of a cloud speaker system based on OpenCPU technology provided by an embodiment of the present invention;
[0022] Figure 2 is a step flow diagram of a control method for a cloud speaker system based on OpenCPU technology provided by an embodiment of the present invention. Detailed Embodiments
[0023] The following will describe in detail the specific embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not intended to limit the present invention.
[0024] Figure 1 is the system structure diagram of the cloud speaker system based on OpenCPU technology provided by an embodiment of the present invention. As Figure 1 shown, an embodiment of the present invention provides a cloud speaker system based on OpenCPU technology, and the system includes: an OpenCPU module for connecting to a cloud server and receiving audio broadcast control instructions; an audio decoding unit connected to the OpenCPU module for decoding the received audio data; an audio power amplifier unit connected to the audio decoding unit for amplifying and outputting the decoded audio signal; and a speaker unit for playing the amplified audio content.
[0025] In an embodiment of the present invention, the OpenCPU module, as the core control component of the system, has dual functions of communication and processing. It is not only used to connect to the cloud server through the Cat.1 cellular network, but also used to receive and parse the audio broadcast control instructions from the server. The module is built with a control program that can directly recognize the control commands sent by the cloud, retrieve local or cloud audio data, and realize the integrated operation of instruction parsing and audio processing, eliminating the dependence on an independent MCU in the traditional system.
[0026] The audio decoding unit is connected to the OpenCPU module and is responsible for parsing and decoding the format of the digital audio data output by the module, supporting multiple audio coding standards such as WAV, MP3, etc., to ensure the clarity and compatibility of voice broadcasts. The decoded analog audio signal will be transmitted to the audio power amplifier unit. The audio power amplifier unit is used to amplify the power of the audio signal and provide sufficient driving ability to drive the speaker to sound. Finally, the speaker unit plays the processed audio signal to provide clear and accurate voice prompts to the user.
[0027] By integrating communication, control, and audio processing functions into the OpenCPU module, this system eliminates the multi-level communication mechanism between the MCU and the module in the traditional system, greatly simplifies the hardware structure, and improves the overall integration. Its technical effects are reflected in: significantly reducing the audio broadcast response delay, improving the real-time performance and accuracy of the broadcast; at the same time, reducing the hardware cost and wiring complexity, contributing to the miniaturization and low-power design of terminal devices, and being applicable to various intelligent terminal scenarios with high requirements for broadcast speed and system integration.
[0028] Based on the solution of the present invention, by integrating communication, control, and audio processing functions into the OpenCPU module, the multi-level communication mechanism between the MCU and the module in the traditional system is eliminated, the hardware structure is greatly simplified, and the overall integration level is improved. Its technical effects are reflected in: significantly reducing the audio broadcast response delay, improving the real-time performance and accuracy of the broadcast; at the same time, reducing the hardware cost and wiring complexity, contributing to the miniaturization and low-power design of the terminal device, and being applicable to various intelligent terminal scenarios with high requirements for broadcast speed and system integration level.
[0029] Preferably, the OpenCPU module integrates a communication protocol stack and an audio playback control program; the communication protocol stack is used to support TCP / IP network communication; the playback control program is used to respond to cloud broadcast instructions, retrieve corresponding audio resources, and control the audio decoding unit to play.
[0030] In the embodiment of the present invention, the OpenCPU module is the core component of the system. It internally integrates a complete communication protocol stack and an audio playback control program, has an independent operating ability, and can complete multiple functions such as data communication, instruction processing, and audio broadcast control without an external MCU. Among them, the communication protocol stack supports the standard TCP / IP network communication protocol and can establish a stable two-way data connection with the cloud server through 4G Cat.1 cellular communication, ensuring that the system has good communication capabilities and anti-interference performance in the wide area network environment. The cloud server can send control instructions such as payment broadcast instructions and notification instructions to the module through this communication link.
[0031] After receiving the cloud control instruction, the audio playback control program running in the OpenCPU module will immediately parse the instruction content and retrieve the audio resources stored locally or download the required audio files remotely according to the preset logic. The control program can intelligently judge fields such as transaction amount and payment method, and select and splice or call the matching audio segments to generate the corresponding broadcast content. Subsequently, the control program transmits the audio data to the audio decoding unit to drive the execution of the subsequent audio playback process.
[0032] Based on the solution of the present invention, by integrating the communication and control functions inside the module, the intermediate link of traditional MCU control is eliminated, significantly reducing the system response delay; the module has high programmability and remote upgrade ability, facilitating system function expansion and customized development; this structure simplifies the overall hardware design, improves the system integration level and stability, and provides reliable support for low-cost and high-efficiency intelligent broadcast terminals.
[0033] Preferably, a two-way connection is established between the OpenCPU module and the cloud server through the Cat.1 communication protocol; the OpenCPU module is equipped with a heartbeat detection mechanism and an abnormal reconnection mechanism to perform connection recovery and receive instructions again when a communication anomaly occurs.
[0034] In an embodiment of the present invention, a stable two-way data connection is established between the OpenCPU module and the cloud server through the Cat.1 communication protocol. This protocol is based on a 4G cellular network, has a high data transmission rate and good coverage, and is particularly suitable for Internet of Things terminal devices that require low latency and wide-area deployment. Through this connection, the OpenCPU module can receive audio broadcast instructions from the cloud in real time and feedback information such as device status and broadcast results to the server, realizing closed-loop control and dynamic management of information.
[0035] To improve the stability of the communication link and the reliability of the system, a heartbeat detection mechanism and an abnormal reconnection mechanism are integrated inside the OpenCPU module. The heartbeat detection mechanism means that during the process of maintaining a connection with the cloud server, the module periodically sends small data packets (i.e., "heartbeat packets") to the server to detect whether the communication link is in an effective state; once a connection anomaly is detected or no response from the server is received for a long time, the module will immediately activate the abnormal reconnection mechanism, and quickly complete communication recovery by disconnecting and re-establishing the network connection, and re-request unprocessed broadcast instructions from the cloud to ensure that the system can respond in a timely manner.
[0036] Based on the solution of the present invention, it is ensured that the cloud speaker system can still maintain high reliability and continuous service capabilities in a complex and dynamic network environment, preventing missed broadcasts and misbroadcasts caused by network fluctuations; the heartbeat detection and automatic reconnection mechanism reduces the need for manual intervention and improves the autonomous operation ability of the device; this mechanism supports large-scale deployment and remote management, laying a foundation for building a stable and highly available Internet of Things audio broadcast system, and is particularly suitable for application scenarios with high requirements for communication stability such as payment broadcasts and public voice prompts.
[0037] Preferably, the audio decoding unit integrates an audio format parsing module; the audio format parsing module is used to decode data in WAV, MP3, and / or AAC audio formats and output it to the power amplifier unit; communication between the decoding unit and the OpenCPU module is through an I2S or SPI bus.
[0038] In the embodiment of the present invention, the audio decoding unit is a key component in the system for realizing the audio playback function, and an audio format parsing module is integrated inside it, which is used to perform decoding processing on the received digital audio data. This parsing module supports a variety of mainstream audio coding formats including WAV, MP3, and AAC, and can automatically identify and execute corresponding decoding algorithms according to the coding type of the input audio data, so as to output an analog audio signal that can be amplified by the power amplifier unit. This multi-format compatibility ability provides good flexibility for the system to adapt to audio files from different sources and with different compression ratios, and effectively improves the adaptability of the device to various application scenarios.
[0039] The audio decoding unit communicates with the OpenCPU module through the I2S (Inter-IC Sound) or SPI (Serial Peripheral Interface) bus. The I2S bus is a standard interface specifically for digital audio transmission, which can achieve high-fidelity and low-distortion audio data interaction, and is especially suitable for terminal devices with high requirements for sound quality; while the SPI interface has the characteristics of fast transmission speed and flexible protocol, and can be used to process audio stream tasks with strong controllability. According to different application requirements, the system can flexibly select the communication method to achieve efficient and stable transmission during the decoding process.
[0040] Based on the solution of the present invention, through the integrated multi-format parsing ability, the device can directly process various encoded audio data from the cloud or local, improving system compatibility and resource reuse efficiency; adopting the digital bus communication method reduces the noise interference in the analog transmission process and ensures the sound quality stability; the independent modular design of the decoding function reduces the processing burden of the OpenCPU module, making the overall operation of the system more efficient, and is especially suitable for scenarios such as payment announcements and voice prompts that require clear audio output.
[0041] Preferably, the audio power amplifier unit includes a class-D power amplifier chip; the input end of the class-D power amplifier chip is connected to the audio decoding unit; the output end of the class-D power amplifier chip is electrically connected to the speaker; the audio power amplifier unit is configured with an overheat protection module, a short-circuit protection module, and a volume automatic adjustment module.
[0042] In the embodiment of the present invention, the audio power amplifier unit is a key module in the system for driving a speaker to play audio, and a Class-D power amplifier chip is integrated inside. Compared with traditional Class-A or Class-AB amplifiers, the Class-D power amplifier chip uses pulse-width modulation (PWM) to amplify the audio signal, and has the advantages of high efficiency, low power consumption, small size, etc., and is particularly suitable for the applications of embedded and portable audio systems. The input end of the Class-D power amplifier chip is connected to the audio decoding unit, and is used to receive the decoded audio signal and convert it into a power signal capable of driving the speaker unit; its output end is electrically connected to the speaker to realize the actual playback of the audio content.
[0043] To ensure the stability of the audio playback process and the safe operation of the system, the audio power amplifier unit is also configured with multiple functional protection modules. Among them, the overheat protection module is used to monitor the chip temperature in real time, and automatically reduces the output power or disconnects the output when the temperature exceeds the set threshold to prevent the chip from being damaged due to overheating; the short-circuit protection module is used to detect whether there is abnormal current at the speaker output end, and immediately closes the output channel once a short-circuit phenomenon is found to prevent the circuit from burning or potential fire hazards; the volume automatic adjustment module is used to automatically adjust the volume according to the ambient noise or the type of the broadcast content, so as to achieve a better auditory experience and energy consumption control.
[0044] Based on the solution of the present invention, the power conversion efficiency is improved by the Class-D power amplifier technology, the energy consumption of the device is reduced, and it is particularly suitable for the cloud speaker device that runs for a long time; the multiple safety protection mechanisms improve the stability and service life of the system, reduce the failure rate and maintenance cost; the volume automatic adjustment function enhances the intelligent performance of the device, ensures that the audio content can be clearly played at a suitable loudness in different environments, and improves the user experience.
[0045] Preferably, the OpenCPU module is provided with a non-volatile memory; the non-volatile memory is used to store preset audio templates, and the audio templates include preset broadcast voice content and are used to provide offline broadcast when the network is interrupted.
[0046] In the embodiment of the present invention, the OpenCPU module is provided with a non-volatile memory, and this memory has the characteristic of non-loss of data when the power is off, and usually adopts forms such as Flash, EEPROM or eMMC, etc., and has the advantages of long data storage time, fast read and write speed, low power consumption, etc. In this system, the non-volatile memory is used to store multiple preset audio templates, and these audio templates are usually compressed or format-converted audio files, and the content includes common broadcast statements such as "Payment successful", "XX yuan has been credited", "Please scan the code again", etc. The audio templates can be stored classified by different payment methods, broadcast languages or tones, and are automatically loaded or called as needed by the OpenCPU module when the system starts.
[0047] This design is particularly suitable for usage scenarios where the network environment is unstable or there is a temporary network disconnection. When the OpenCPU module detects a communication interruption with the cloud server, the system can still call the audio templates in the non-volatile memory according to local events or cached control logic to achieve normal broadcasting in the offline state. For example, in the case where the payment has been completed but the cloud response has not been returned in a timely manner, the device can directly call the local template to complete the voice prompt, ensuring that users can obtain feedback information in a timely manner and avoiding interruption of the transaction experience.
[0048] Based on the solution of the present invention, on the one hand, the offline broadcasting ability is achieved by presetting audio templates, improving the reliability and continuous service ability of the system; on the other hand, the module itself can complete template calling and audio control without the assistance of an external processor, reducing the overall hardware complexity and operating load. In addition, this structure can also dynamically replace or expand audio templates through a remote update mechanism to meet the application requirements of multiple languages and multiple scenarios, enhancing the flexibility and scalability of the system.
[0049] Preferably, the OpenCPU module is configured with a remote configuration interface for remotely upgrading and configuring the control program of the OpenCPU module via OTA based on the remote configuration interface.
[0050] In the embodiment of the present invention, the OpenCPU module is configured with a remote configuration interface, which is used to remotely upgrade and configure the internal control program of the module, specifically implemented through OTA (Over-the-Air) technology. OTA is a wireless remote maintenance technology that allows developers or platform administrators to send new control programs, patch packages, or configuration instructions to terminal devices through a cloud server. The remote configuration interface is usually built based on standard communication protocols (such as MQTT, HTTP, or TLS, etc.), can maintain a stable connection with the cloud platform, and automatically download update content when the device is idle or within a specified time window.
[0051] In the system of the present invention, this remote configuration interface can be used for multiple purposes: one is to remotely push the new firmware of the control program to repair vulnerabilities in the existing program or enhance functional modules, such as adding new audio broadcast formats, optimizing broadcast logic, etc.; the second is to achieve dynamic parameter configuration, such as modifying the default volume value, adjusting the broadcast language, switching the server address, etc.; the third is to uniformly distribute customized configurations such as device numbers and operation policies in a batch deployment scenario to improve the deployment efficiency. The upgrade process has mechanisms such as breakpoint resumption, data integrity verification, and version rollback to ensure the safety and stability of the update process and not affect the normal operation of the device.
[0052] Based on the solution of the present invention, the remote maintainability of the system is realized, avoiding the cumbersome process of manual disassembly and upgrade in the traditional method, and greatly reducing the operation and maintenance costs; it supports dynamic adjustment and customization, enhancing the flexible adaptation ability of the device and the market response speed; through unified management and distribution of control logic in the cloud, the version consistency and data security of the system are enhanced, which is particularly suitable for Internet of Things cloud speaker devices that require large-scale remote deployment and long-term operation and maintenance.
[0053] Preferably, the system further includes an environmental sensing module and a local event triggering module, realizing the local automatic broadcast function under specific environmental conditions.
[0054] Among them, the environmental sensing module includes a temperature sensor, a light sensor, an infrared sensor, or a microphone array, etc., for sensing the physical environment parameters around the terminal. For example, in the scenarios of smart stores or community announcements, the system can judge whether it is working hours according to the environmental light change, or automatically broadcast greetings or prompts such as "Welcome" or "Please pay attention to safety" after detecting the approach of people through infrared sensing, without relying on cloud instructions, enhancing the autonomous response ability of the system.
[0055] At the same time, the local event triggering module can be connected to external devices or systems, such as receiving external trigger signals from access control systems, barcode scanning devices, buttons, etc. through GPIO ports, Bluetooth, or short-range RF modules. When an event is detected, the system can immediately execute the broadcast task by calling the local audio template. For example, when the user presses a button, voice prompts such as "The service has been called, please wait a moment" can be triggered, which is applicable to places such as hospitals and queuing systems. Such functions show advantages especially when the network is interrupted or the communication is poor, ensuring that the system still has the ability to operate independently and provide information feedback.
[0056] In addition, to enhance the application flexibility of the system, the audio template in this embodiment not only supports the call of static voice segments, but also can call the local lightweight TTS (Text-to-Speech) module through the OpenCPU module for dynamic broadcast. In this way, the user can send template statements and variable placeholders through the cloud, such as "Your express delivery will arrive in {minutes} minutes". After receiving the statements, the module replaces the parameters and synthesizes the complete voice, further improving the personalization and real-time nature of the broadcast content.
[0057] By introducing the environmental perception and local response mechanism, the system has higher adaptability and intelligence level, and is particularly suitable for use in scenarios where network stability cannot be ensured or offline operation is required.
[0058] Figure 2 It is the flowchart of the control method of the cloud speaker system based on the OpenCPU technology provided by an embodiment of the present invention. As Figure 2As shown in the figure, an embodiment of the present invention provides a control method for a cloud speaker system based on OpenCPU technology, and the method includes:
[0059] Step S10: Receive a broadcast instruction sent by a cloud server, where the broadcast instruction is generated based on payment result information received by the cloud server from a trading platform.
[0060] Specifically, after a user completes payment by scanning a code on a terminal or using other payment methods, the trading platform synchronizes relevant payment success information (including payment amount, payment method, transaction time, merchant number, etc.) to the cloud server. The cloud server parses and formats this information, and generates a structured broadcast instruction according to a preset broadcast rule. The broadcast instruction may include information for indicating audio template selection, speech synthesis parameters, sentence combination order, etc.
[0061] This broadcast instruction is sent to the OpenCPU module in the cloud speaker device through a Cat.1 communication network. As a type of 4G cellular communication standard, Cat.1 has a low communication latency while ensuring wide coverage, and can achieve high-real-time data transmission. After receiving the broadcast instruction, the OpenCPU module can directly execute the broadcast logic without additional transfer or waiting for other controllers to parse, call the corresponding audio template or generate broadcast voice content through the TTS speech synthesis module, and control the audio decoding and power amplifier unit to complete audio playback.
[0062] Based on the solution of the present invention, by converting cloud payment data into broadcast instructions in real time and pushing them using a Cat.1 low-latency network, the intermediate links of data transmission and processing are effectively reduced, rapid broadcast feedback of collection information is realized, and the user payment experience is enhanced; the OpenCPU module directly parses and executes the instructions, eliminating the traditional MCU control steps, improving the system integration and response speed; the flexibility of the instruction structure enables adjustment of the broadcast strategy according to different business requirements in the later stage, enhancing the configurability and expandability of the system, and being applicable to various payment scenarios such as shopping malls, restaurants, and unmanned retail.
[0063] Step S20: Based on the OpenCPU module, parse the broadcast instruction and call the local control program to synthesize or call preset audio data.
[0064] Specifically, after the OpenCPU module receives the structured broadcast instruction from the cloud server, it first parses the fields in the instruction, such as transaction amount, payment method, collection time, and other information. Subsequently, the module determines whether to call the local preset audio template or start the built-in control program for speech synthesis based on the parsing results. For common broadcast content, such as "Received 10 yuan", the system can directly match and call the local audio template to complete the rapid broadcast; for dynamic combined content or personalized broadcast requirements, the text information can be input into the local TTS (Text-to-Speech) module through the control program for speech synthesis.
[0065] Based on the solution of the present invention, firstly, the module locally processes the instruction and independently generates the audio data, reducing the number of interactions between the cloud and the terminal, and improving the response speed and broadcast real-time performance of the system; secondly, it supports flexible switching between two modes of template call and dynamic synthesis, not only improving the diversity and adaptability of the broadcast content, but also reducing the storage pressure and transmission burden, especially suitable for use in environments with network fluctuations or limited bandwidth. This solution significantly enhances the self-processing ability of the system and the intelligence level of voice broadcast.
[0066] Step S30: Send the audio data to the audio decoding and power amplification unit and complete the broadcast through the speaker.
[0067] Specifically, after the OpenCPU module calls the local audio template or completes the speech synthesis, the generated digital audio data is sent to the audio decoding unit in the form of digital interfaces such as I2S or SPI. The audio decoding unit parses and restores the audio data into an analog audio signal according to the encoding format of the audio data (such as MP3, WAV, etc.), and then transfers the analog signal to the audio power amplification unit for signal amplification. The audio power amplification unit uses a high-efficiency Class-D amplifier chip, which can amplify the decoded audio signal to a level sufficient to drive the speaker to sound, and finally broadcasts clear and stable voice content through the speaker to complete the entire broadcast process.
[0068] Based on the solution of the present invention, through the efficient cooperation between the module and the audio processing module, lossless transmission and rapid processing of audio data are achieved, ensuring the quality and real-time performance of voice broadcast; the audio link structure is clear and the modules are independent, which is conducive to the modular design of the system, facilitating maintenance and upgrade, and at the same time reducing the risk of system paralysis caused by single-point failures. The overall solution improves the broadcast accuracy and the user's auditory experience, and is especially suitable for intelligent terminal application scenarios with high requirements for broadcast clarity and response speed, such as mobile payment, unmanned retail, voice prompt devices, etc.
[0069] Preferably, the method further includes: if a power failure or communication interruption occurs during the broadcast, writing the current state into the local cache based on the OpenCPU module, and resuming the unbroadcast tasks according to the cache content after recovery.
[0070] In an embodiment of the present invention, if a power failure or communication interruption occurs during the broadcast, the system can timely write the current task state, audio playback progress, or information of the queue to be broadcast into the local cache area through the exception handling mechanism built in the OpenCPU module. This cache is usually stored in the non-volatile memory integrated in the module to ensure that data will not be lost in case of a power interruption or network failure. When the system is powered on again or communication is restored, the OpenCPU module will automatically detect the previous running state and read the unfinished broadcast tasks or interruption positions from the local cache, so as to achieve resume playback from breakpoint. The system can decide whether to start a complete broadcast again, continue playing from the interruption point, or skip duplicate tasks according to the cache content, ensuring the integrity and accuracy of the broadcast logic.
[0071] Through the resume playback from breakpoint function, it is avoided that important broadcast information is omitted or repeated due to unexpected events, and the reliable operation ability of the device in an uncertain environment is improved. In addition, this solution also reduces the frequency of manual intervention and improves the intelligence and self-repair ability of the system, and is particularly suitable for being deployed in public payment environments, unattended terminals, or scenarios with frequent network fluctuations to ensure service continuity and user experience.
[0072] An embodiment of the present invention also provides a computer-readable storage medium, on which instructions are stored, and when running on a computer, the instructions cause the computer to execute the control method of the cloud speaker system based on the OpenCPU technology as described above.
[0073] Those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to cause a single-chip microcomputer, a chip, or a processor to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0074] The optional embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. In addition, it should be noted that, in the above specific embodiments, the various specific technical features described can be combined in any appropriate manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not separately describe various possible combination methods.
[0075] In addition, any combination can be made between various different embodiments of the present invention as long as it does not violate the idea of the embodiments of the present invention, and it should also be regarded as the content disclosed by the embodiments of the present invention.
Claims
1. A cloud speaker system based on OpenCPU technology, characterized in that, The system includes: An OpenCPU module, which is used to connect to a cloud server and receive audio broadcast control instructions; An audio decoding unit, connected to the OpenCPU module, which is used to decode the received audio data; An audio power amplifier unit, connected to the audio decoding unit, which is used to amplify and output the decoded audio signal; A speaker unit, which is used to play the amplified audio content.
2. The system according to claim 1, wherein The OpenCPU module integrates a communication protocol stack and an audio playback control program; The communication protocol stack is used to support TCP / IP network communication; The playback control program is used to respond to cloud broadcast instructions, retrieve corresponding audio resources, and control the audio decoding unit to play.
3. The system according to claim 1, characterized in that A two-way connection is established between the OpenCPU module and the cloud server through the Cat.1 communication protocol; The OpenCPU module has a heartbeat detection mechanism and an abnormal reconnection mechanism, so that when a communication anomaly occurs, connection recovery is executed and instructions are received again.
4. The system according to claim 1, wherein The audio decoding unit integrates an audio format parsing module; The audio format parsing module is used to decode data in WAV, MP3, and / or AAC audio formats and output it to the power amplifier unit; Communication between the decoding unit and the OpenCPU module is through the I2S or SPI bus.
5. The system according to claim 1, wherein The audio power amplifier unit includes a Class-D power amplifier chip; The input end of the Class-D power amplifier chip is connected to the audio decoding unit; The output end of the Class-D power amplifier chip is electrically connected to the speaker; The audio power amplifier unit is configured with an overheat protection module, a short-circuit protection module, and a volume automatic adjustment module.
6. The system according to claim 1, characterized in that, The OpenCPU module is provided with a non-volatile memory; The non-volatile memory is used to store preset audio templates, and the audio templates contain preset broadcast voice content, which is used to provide offline broadcasts when the network is interrupted.
7. The system according to claim 1, wherein The OpenCPU module is configured with a remote configuration interface, which is used to remotely upgrade and configure the control program of the OpenCPU module through OTA based on the remote configuration interface.
8. A control method for a cloud speaker system based on OpenCPU technology, characterized in that, The method is applied to the cloud speaker system based on OpenCPU technology described in any one of claims 1-7. The method includes: Receiving a broadcast instruction sent by a cloud server, where the broadcast instruction is generated based on payment result information received by the cloud server from a trading platform; where The cloud server sends the broadcast instruction to the OpenCPU module in the cloud speaker device through the Cat.1 communication network; Based on the OpenCPU module, parsing the broadcast instruction and calling the local control program to synthesize or call preset audio data; Sending the audio data to the audio decoding and power amplifier unit and completing the broadcast through the speaker.
9. The method according to claim 8, characterized in that, The method further includes: If power is cut off or communication is interrupted during the broadcast, based on the OpenCPU module, writing the current state into the local cache, and resuming the unbroadcast task according to the cache content after recovery.
10. A computer-readable storage medium, characterized in that, Instructions are stored on this computer-readable storage medium, and when running on a computer, they cause the computer to execute the control method of the cloud speaker system based on OpenCPU technology described in any one of claims 8 and 9.