An android-based messaging method, system and medium

By integrating NanoHTTPD and MQTT protocols into the Android system, and combining them with voice and natural language processing, the message sending and receiving functions of the Android system were realized, solving the problem that existing technologies cannot receive and send messages simultaneously, and improving the data interaction capabilities of smart devices.

CN117201473BActive Publication Date: 2026-02-13SHANDONG NEW GENERATION INFORMATION IND TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311153742.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-08
Publication Date
2026-02-13
Estimated Expiration
2043-09-08

AI Technical Summary

Technical Problem

Existing Android system applications cannot act as both message receivers and message senders simultaneously, thus failing to meet the data interaction needs between smart devices such as smart guide robots and x86 system boxes.

Method used

By integrating NanoHTTPD into the Android system to build a micro server, using the MQTT protocol for message passing, and combining speech processing and natural language processing modules, the message sending and receiving functions are realized. The front-end page interacts with the Android message receiving module through the HTTP interface, the speech processing module performs audio recognition and synthesis, and the natural language processing module generates answers.

Benefits of technology

It enables the Android system to both receive and send messages, increasing the functionality and scalability of applications, supporting multiple message types, providing a flexible user experience, and is suitable for smart devices such as smart guide robots and hospital self-service terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117201473B_ABST
    Figure CN117201473B_ABST
Patent Text Reader

Abstract

The application discloses an Android-based message transmission method and system and a medium, relates to the field of Android systems, and can serve as a bridge for message transmission and has the functions of message receiving and message sending. The Android client is endowed with the function of a server, can deploy an Http service and define an Http interface like the server, and can accept and process an Http request. Based on the function, components such as a front-end page which cannot directly communicate with the Android end can directly perform message transmission through the mode of sending an Http request, and the diversity and expansibility of the functions of the Android application are increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Android system, in particular to a message transmission method and system based on Android and a medium. BACKGROUND

[0002] With the popularity of Android smart hardware, there are many interactive needs based on Android system, such as the smart guide robot involved in the present application, which needs the voice processing assembly of the Android system, and data interaction with the service assembly and front-end page application on the x86 system box. The functions realized by the Android system application are usually used as a client to access the server to obtain data for page display and interaction, which cannot meet the needs of the Android system as both a message receiver and a message sender. SUMMARY

[0003] In order to overcome the above technical deficiencies, the present application provides a message transmission method and system based on Android which provides a convenient and efficient message exchange method and a medium.

[0004] The technical solution adopted by the present application to overcome the technical problems is:

[0005] A message transmission method based on Android, comprising:

[0006] The front-end page transmits the message to the Android message receiving module by calling the agreed Http interface;

[0007] After the Android message receiving module receives the message transmitted by the front-end page, the message is parsed to determine whether to start the voice processing module;

[0008] After the voice processing module is opened, the audio stream is collected in real time, the audio stream is subjected to voice recognition, the recognized text is transmitted to the server natural language processing module, the server natural language processing module intelligently generates an answer according to the text and synchronously transmits the audio stream to the voice processing module, the voice processing module plays the audio stream after synthesizing the audio and sends the text to the message sending module;

[0009] The message sending module publishes the message to the specified Topic after receiving the text;

[0010] The front-end display module receives the message published by the message sending module by subscribing to the specified Topic, obtains the text content after parsing the message entity, and displays the text content on the page.

[0011] Further, after the user triggers the button directly through the front-end page, the front-end page transmits the message to the Android message receiving module by calling the agreed Http interface.

[0012] Further, the front-end page transmits the wake-up message or the sleep message to the Android message receiving module by calling the agreed Http interface.

[0013] Further, the method for the Android message receiving module to analyze the message is: if the message is a wake-up message, the switch of the voice processing module is opened, if the message is a sleep message, the switch of the voice processing module is closed, and the ongoing voice processing logic is ended.

[0014] Further, the message sending module publishes the message to the specified Topic through MQTT after receiving the text.

[0015] Further, the message entity published by the message sending module to the specified Topic carries the received text content after receiving the text.

[0016] An Android-based message transceiving system, comprising:

[0017] A message receiving module, which sets up a micro server by integrating NanoHTTPD, and an external device transmits data to the message receiving module by calling the defined Http interface;

[0018] A message sending module, which publishes messages to a specified Topic through the MQTT protocol, and an external device receives the published messages by subscribing to the Topic;

[0019] A voice processing module, which comprises audio acquisition, voice device, and audio output functions realized based on the Android system, receives messages from the message receiving module, transmits messages to the message sending module, and interacts with the server-side natural language processing module;

[0020] A natural language processing module, which serves as a server-side module, comprises semantic understanding, answer generation, and speech synthesis functions, and interacts with the natural language processing module;

[0021] A front-end display module, which serves as a front-end display page, interacts with the Android-side message receiving module and the message sending module, and is touched by the user, sends messages to the Android side after responding to the user's intention, and receives the processed messages from the Android side, and displays the content to the user.

[0022] A non-volatile computer storage medium stores computer executable instructions arranged to:

[0023] The front-end page transmits messages to the Android message receiving module by calling the agreed Http interface.

[0024] After the Android message receiving module receives the message transmitted by the front-end page, the message is parsed to determine whether to start the voice processing module.

[0025] After the voice processing module is opened, audio streams are collected in real time, voice recognition is performed on the audio streams, the recognized text is transmitted to the server natural language processing module, the server natural language processing module intelligently generates answers and audio streams and synchronously transmits them to the voice processing module, the voice processing module plays the synthesized audio and sends the text to the message sending module.

[0026] The message sending module publishes messages to a specified Topic after receiving the text.

[0027] The front-end display module receives the messages published by the message sending module by subscribing to the specified Topic, obtains the text content after parsing the message entity, and displays the text content on the page.

[0028] The Android can serve as a bridge for message transmission and has the functions of message receiving and message sending. The Android client is endowed with the function of the server, can deploy Http services, define Http interfaces, accept and process Http requests, and based on this function, components such as the front-end page that cannot directly communicate with the Android end can directly transmit messages by sending Http requests, thereby increasing the diversity and expandability of the functions of the Android application. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 The system structure diagram of the present application. DETAILED DESCRIPTION

[0030] The present application will be further described below. Figure 1 The present application will be further described below.

[0031] A message transceiving method based on Android, comprising:

[0032] The front-end page transmits messages to the Android message receiving module by calling the agreed Http interface.

[0033] After the Android message receiving module receives the message transmitted by the front-end page, the message is parsed to determine whether to start the voice processing module.

[0034] After the voice processing module is opened, the audio stream is collected in real time, voice recognition is performed on the audio stream, the recognized text is transmitted to the server natural language processing module, the server natural language processing module intelligently generates an answer according to the text and synchronously transmits the audio stream to the voice processing module, and the voice processing module plays the audio stream after synthesizing the audio stream and sends the text to the message sending module.

[0035] After the message sending module receives the text, the message sending module publishes a message to a specified Topic.

[0036] The front-end display module receives the message published by the message sending module by subscribing to a specified Topic, obtains the text content after analyzing the message entity, and displays the text content on a page.

[0037] The message sending and receiving are realized through an Android mobile phone application, a variety of message types are supported, and more flexible and rich user experiences are provided. The Android end can be used as a server to deploy an Http service, and external data can be transmitted to the Android end in the form of calling an Http interface. Meanwhile, the Android end can also send data to the outside (for example, in the form of an MQTT published message). The application scenarios of the application include intelligent tour guide robots, hospital self-service terminal integrated machines and the like.

[0038] In one embodiment of the application, after a user directly triggers a button through a front-end page, the front-end page transmits a message to the Android message receiving module by calling a predetermined Http interface.

[0039] In one embodiment of the application, the front-end page transmits a wake-up message or a sleep message to the Android message receiving module by calling a predetermined Http interface.

[0040] In one embodiment of the application, the method for the Android message receiving module to analyze the message is as follows: if the message is a wake-up message, the switch of the voice processing module is opened; if the message is a sleep message, the switch of the voice processing module is closed, and the voice processing logic being performed is ended.

[0041] In one embodiment of the application, after the message sending module receives the text, the message sending module publishes a message to a specified Topic through MQTT.

[0042] In one embodiment of the application, the message entity published by the message sending module to the specified Topic carries the received text content.

[0043] The application also relates to an android-based message transmission system, which comprises the following modules:

[0044] The message receiving module is built by integrating a micro server of NanoHTTPD, and data is transmitted between the message receiving module and external equipment by calling a defined Http interface.

[0045] The message sending module publishes messages to a specified Topic by using an MQTT protocol, and external equipment receives the published messages by subscribing to the Topic.

[0046] The voice processing module comprises audio acquisition, voice equipment and audio output functions based on an Android system, receives messages from the message receiving module, transmits the messages to the message sending module and interacts with the server-side natural language processing module.

[0047] The natural language processing module is a server-side module, and comprises semantic understanding, answer generation and voice synthesis functions.

[0048] The front-end display module is a front-end display page, interacts with the Android-side message receiving module and the message sending module, is touched by a user, sends messages to the Android side after responding to the user's intention, receives the processed messages from the Android side and displays the content to the user.

[0049] The application also relates to a non-volatile computer storage medium which stores computer executable instructions.

[0050] The front-end page transmits messages to the Android message receiving module by calling a defined Http interface.

[0051] The Android message receiving module receives the message passed by the front-end page, parses the message, and determines whether to start the voice processing module;

[0052] After the voice processing module is started, audio streams are collected in real time, voice recognition is performed on the audio streams, the recognized text is passed to the server-side natural language processing module, the server-side natural language processing module intelligently generates an answer based on the text and synchronously passes the audio stream to the voice processing module, the voice processing module plays the audio stream after synthesizing the audio and sends the text to the message sending module;

[0053] The message sending module receives the text and publishes a message to a specified Topic;

[0054] The front-end display module subscribes to the specified Topic, receives the message published by the message sending module, obtains the text content after parsing the message entity, and displays the text content on the page.

[0055] Finally, it should be noted that: the above only for the preferred embodiments of the present application, and not for limiting the present application, although the foregoing embodiments of the present application are described in detail, for those skilled in the art, it still can be modified, or part of the technical features of the equivalent replacement. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application, should be included in the protection scope of the present application.

Claims

1. A message sending and receiving method based on Android, characterized in that, include: The front-end page sends messages to the message receiving module on the Android side by calling a pre-defined HTTP interface; After receiving a message from the front-end page, the Android message receiving module on the Android side parses the message and determines whether to enable the voice processing module on the Android side. Once the voice processing module on the Android side is turned on, it collects audio streams in real time, performs speech recognition on the audio streams, and passes the recognized text to the server-side natural language processing module. The server-side natural language processing module intelligently generates answers and audio streams based on the text and then synchronously passes them to the voice processing module on the Android side. The voice processing module on the Android side synthesizes the audio streams into audio, plays it, and sends the text to the message sending module on the Android side. After receiving the text, the message sending module on the Android side publishes the message to the specified Topic. The front-end display module subscribes to a specified Topic, receives messages published by the message sending module on the Android side, parses the message entity to obtain the text content, and then displays the text content on the page.

2. The message sending and receiving method based on Android according to claim 1, characterized in that: After a user triggers a button directly through the front-end page, the front-end page sends the message to the Android message receiving module by calling the agreed-upon HTTP interface.

3. The message sending and receiving method based on Android according to claim 1, characterized in that: The front-end page passes wake-up or sleep messages to the Android message receiving module by calling a pre-defined HTTP interface.

4. The message sending and receiving method based on Android according to claim 3, characterized in that, The Android message receiving module parses messages as follows: if the message is a wake-up message, the voice processing module is turned on; if the message is a sleep message, the voice processing module is turned off, and the ongoing voice processing logic ends.

5. The message sending and receiving method based on Android according to claim 1, characterized in that: After receiving the text, the message sending module publishes the message to the specified Topic via MQTT.

6. The message sending and receiving method based on Android according to claim 1, characterized in that: After receiving the text, the message sending module sends the received text content to the message entity published to the specified Topic.

7. A non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows: The front-end page sends messages to the message receiving module on the Android side by calling a pre-defined HTTP interface; After the message receiving module on the Android side receives the message sent by the front-end page, it parses the message and determines whether to enable the voice processing module on the Android side. Once the voice processing module on the Android side is turned on, it collects audio streams in real time, performs speech recognition on the audio streams, and passes the recognized text to the server-side natural language processing module. The server-side natural language processing module intelligently generates answers and audio streams based on the text and then synchronously passes them to the voice processing module on the Android side. The voice processing module on the Android side synthesizes the audio streams into audio, plays it, and sends the text to the message sending module on the Android side. After receiving the text, the message sending module on the Android side publishes the message to the specified Topic. The front-end display module subscribes to a specified Topic, receives messages published by the message sending module on the Android side, parses the message entity to obtain the text content, and then displays the text content on the page.

Citation Information

Patent Citations

  • System supporting speech recognition and search and image recognition

    CN111708534A

  • Network request method and device, computer equipment and storage medium

    CN112822020A