CN111031063B - Data transmission method and device based on family education machine - Google Patents

Data transmission method and device based on family education machine Download PDF

Info

Publication number
CN111031063B
CN111031063B CN201911350636.8A CN201911350636A CN111031063B CN 111031063 B CN111031063 B CN 111031063B CN 201911350636 A CN201911350636 A CN 201911350636A CN 111031063 B CN111031063 B CN 111031063B
Authority
CN
China
Prior art keywords
identification information
server
target server
family education
education machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201911350636.8A
Other languages
Chinese (zh)
Other versions
CN111031063A (en
Inventor
汤灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN201911350636.8A priority Critical patent/CN111031063B/en
Publication of CN111031063A publication Critical patent/CN111031063A/en
Application granted granted Critical
Publication of CN111031063B publication Critical patent/CN111031063B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/28Constructional details of speech recognition systems
    • G10L15/30Distributed recognition, e.g. in client-server systems, for mobile phones or network applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application is suitable for the technical field of computers, and provides a data transmission method and equipment based on a family education machine, which comprises the following steps: acquiring voice information to be recognized sent by a family education machine; forwarding the voice information to be recognized to a target server based on the identification information of the target server; and when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine. In the mode, the proxy server performs data transmission through the WebSocket connection established between the proxy server and the family education machine, performs data forwarding through the Transmission Control Protocol (TCP) connection established between the proxy server and the target server, and finally sends the identification information corresponding to the voice information to be identified to the family education machine. The communication is carried out through the TCP connection, so that the proxy server can return data without frequently establishing a connection request target server, the data transmission speed is improved, and the timeliness of the data is ensured.

Description

Data transmission method and device based on family education machine
Technical Field
The application belongs to the technical field of computers, and particularly relates to a data transmission method and device based on a family education machine.
Background
The terminal is necessarily in data communication with the back-end server during operation. In order to simplify the data interaction between the terminal and the server and ensure that the server can also actively push data to the terminal, a proxy server is arranged between the terminal and the server.
However, the conventional proxy server needs to frequently establish a connection request server to return data, which results in slow data transmission speed and failure to ensure timeliness of data.
Disclosure of Invention
In view of this, embodiments of the present application provide a data transmission method and device based on a family education machine, so as to solve the problem that a traditional proxy server needs to frequently establish a connection request server to return data, which results in a slow data transmission speed and cannot ensure timeliness of the data.
The first aspect of the embodiments of the present application provides a data transmission method based on a family education machine, including:
acquiring voice information to be recognized sent by a family education machine;
forwarding the voice information to be recognized to a target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine; the identification information is information obtained by identifying the voice information to be identified by the target server.
Further, in order to guarantee the timeliness of data transmission and accelerate the speed of data transmission, the method further comprises the following steps:
and when a WebSocket connection establishing request sent by the family education machine is acquired, establishing WebSocket connection with the family education machine.
Sending a request for establishing a first TCP connection to the target server based on the identification information of the target server; the establish first TCP connection request is used to establish a TCP connection between the proxy server and the target server.
Further, in order to guarantee the accuracy of the identification information returned to the family education machine, the application further comprises:
receiving the identification information returned by the target server, and detecting whether the identification information contains messy codes;
when the identification information is detected not to contain the messy codes, marking the identification information as correct;
when the identification information is detected to contain messy codes, the identification information is marked as an error.
Further, in order to guarantee the accuracy of the identification information returned to the family education machine, the application further comprises: and generating an identification failure notice and sending the identification failure notice to the family education machine.
Further, in order to return correct identification information to the family education machine in time, this application still includes: when the identification information is not received within a preset time length, sending the voice information to be identified to a standby server;
and when detecting that the identification information returned by the standby server is correct, sending the identification information returned by the standby server to the family education machine.
Further, in order to guarantee the timeliness of data transmission and accelerate the speed of data transmission, the method further comprises the following steps:
sending a request for establishing a second TCP connection to the standby server based on the identification information of the standby server; the establish second TCP connection request is used to establish a TCP connection between the proxy server and the standby server.
A second aspect of an embodiment of the present invention provides a data transmission device based on a family education machine, including:
the acquisition unit is used for acquiring the voice information to be recognized sent by the family education machine;
the forwarding unit is used for forwarding the voice information to be recognized to the target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
the sending unit is used for sending the identification information to the family education machine when the fact that the identification information returned by the target server is correct is detected; the identification information is information obtained by identifying the voice information to be identified by the target server.
Further, the apparatus further comprises:
the detection unit is used for receiving the identification information returned by the target server and detecting whether the identification information contains messy codes or not;
the first marking unit is used for marking the identification information as correct when the identification information is detected not to contain the messy codes;
and the second marking unit is used for marking the identification information as an error when the identification information is detected to contain a messy code.
Further, the apparatus further comprises:
and the generating unit is used for generating a recognition failure notice and sending the recognition failure notice to the family education machine.
Further, the apparatus further comprises:
the first information sending unit is used for sending the voice information to be recognized to the standby server when the recognition information is not received within a preset time length;
and the second information sending unit is used for sending the identification information returned by the standby server to the family education machine when the fact that the identification information returned by the standby server is correct is detected.
Further, the apparatus further comprises:
and the establishing unit is used for establishing the WebSocket connection with the family education machine when the WebSocket connection establishing request sent by the family education machine is obtained.
Further, the apparatus further comprises:
a first request sending unit, configured to send a request for establishing a first TCP connection to the target server based on the identification information of the target server; the establish first TCP connection request is used to establish a TCP connection between the proxy server and the target server.
Further, the apparatus further comprises:
a second request sending unit, configured to send a request for establishing a second TCP connection to the standby server based on the identification information of the standby server; the establish second TCP connection request is used to establish a TCP connection between the proxy server and the standby server.
A third aspect of the embodiments of the present invention provides another family education machine-based data transmission device, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program that supports a terminal to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the following steps:
acquiring voice information to be recognized sent by a family education machine;
forwarding the voice information to be recognized to a target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine; the identification information is information obtained by identifying the voice information to be identified by the target server.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
acquiring voice information to be recognized sent by a family education machine;
forwarding the voice information to be recognized to a target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine; the identification information is information obtained by identifying the voice information to be identified by the target server.
The data transmission method and device based on the family education machine have the following beneficial effects that:
according to the embodiment of the application, the voice information to be recognized, which is sent by the family education machine, is obtained; forwarding the voice information to be recognized to a target server based on the identification information of the target server; and when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine. In the mode, the proxy server performs data transmission through the WebSocket connection established between the proxy server and the family education machine, performs data forwarding through the Transmission Control Protocol (TCP) connection established between the proxy server and the target server, and finally sends the identification information corresponding to the voice information to be identified to the family education machine. The proxy server can return data without frequently establishing a connection request target server by communicating through the TCP connection, so that the data transmission speed is improved, and the timeliness of the data is ensured; and because the target server is not required to be frequently established for connection request, resources are saved, and the data transmission speed is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic view of an application scenario of a data transmission method based on a family education machine provided by the present application;
FIG. 2 is a flowchart illustrating an implementation of a data transmission method based on a family education machine according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a data transmission method based on a family education machine according to another embodiment of the present application;
FIG. 4 is a flowchart illustrating an implementation of a data transmission method based on a family education machine according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a data transmission device based on a family education machine according to an embodiment of the present application;
fig. 6 is a schematic diagram of a data transmission device based on a family education machine according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a data transmission method based on a family education machine according to an embodiment of the present invention. In the application scenario diagram shown in fig. 1, a WebSocket connection is established between the family education machine and the proxy server, that is, the family education machine and the proxy server can communicate through the WebSocket connection; a transmission control protocol TCP connection is established between the proxy server and the target server, i.e. the proxy server and the target server can communicate through the transmission control protocol TCP connection. In one implementation mode, the family education machine sends the voice information to be recognized to the proxy server through the WebSocket connection; the proxy server forwards the received voice information to be recognized to a target server through a Transmission Control Protocol (TCP) connection; the target server identifies the voice information to be identified and sends the identified information to the proxy server through a Transmission Control Protocol (TCP) connection; and when detecting that the identification information returned by the target server is correct, the proxy server sends the identification information to the family education machine through the WebSocket connection. The traditional proxy server is mainly applied to terminals such as mobile phones and computers, HTTP connection is established between the traditional proxy server and a target server, when the traditional proxy server is used for transmitting data, the proxy server needs to frequently establish connection to request the target server to return the data, so that the data transmission speed is low, and the timeliness of the data cannot be guaranteed. In this embodiment, data interaction is performed between the proxy server and the home teaching machine and between the proxy server and the target server, and data transmission is performed between the proxy server and the target server through TCP connection, so that the proxy server can realize data interaction between the home teaching machine and the target server only by establishing TCP connection once, thereby accelerating data transmission speed, ensuring data timeliness, and saving resources.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data transmission method based on a family education machine according to an embodiment of the present invention. In this embodiment, the main execution body of the data transmission method based on the family education machine is the data transmission device based on the family education machine, including but not limited to a proxy server. The family education machine-based data transmission method as shown in fig. 2 may include:
s101: and acquiring the voice information to be recognized sent by the family education machine.
The family education machine is a learning-assisting tool and is used for guiding a user to learn. For example, the user may have an intelligent voice conversation with the home tutor, the home tutor may also mimic the user speaking, and so on. The family education machine can acquire the voice sent by the user through a built-in sound pickup device (such as a microphone, a sound card and the like) and mark the voice as voice information to be recognized; the family education machine sends the voice information to be recognized to the proxy server through WebSocket connection, and the proxy server receives the voice information to be recognized sent by the family education machine through WebSocket connection.
S102: forwarding the voice information to be recognized to a target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; and a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server.
And the proxy server forwards the voice information to be recognized to the target server based on the identification information of the target server. Specifically, the proxy server establishes a WebSocket connection with the family education machine in advance; a transmission control protocol, TCP, connection is established between the proxy server and the target server. When only one target server is available, the proxy server forwards the voice information to be recognized to the target server through the Transmission Control Protocol (TCP) connection; when a plurality of target servers are available, the proxy server forwards the voice information to be recognized to the corresponding target server through the TCP connection according to the identification information of the target servers; and the target server receives the voice information to be recognized forwarded by the proxy server through the Transmission Control Protocol (TCP) connection.
S103: when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine; the identification information is information obtained by identifying the voice information to be identified by the target server.
And when detecting that the identification information returned by the target server through the transmission control protocol TCP connection is correct, the proxy server sends the identification information to the family education machine through the WebSocket connection. The recognition information is information obtained by the target server recognizing the voice information to be recognized, and can also be regarded as a recognition result. Specifically, the target server is used for providing services for the family education machine, and when receiving the voice information to be recognized, the target server recognizes the voice information to be recognized to obtain corresponding recognition information. Different voice information to be recognized corresponds to different recognition results, namely different voice information to be recognized corresponds to different recognition information; for example, a user wants to perform an intelligent voice conversation with a home teaching machine, at this time, the voice information to be recognized, which is forwarded to the proxy server by the home teaching machine, may be a sentence representing a question, after the proxy server forwards the voice information to be recognized to the target server, the target server recognizes the information, obtains an answer corresponding to the information, marks the answer as recognition information, and returns the answer to the proxy server; the proxy server detects whether the identification information contains a messy code, marks the identification information as correct when the messy code is not detected, and sends the identification information to the family education machine through WebSocket connection; the family education machine outputs the identification information by voice, or may display the identification information in a display interface in a text manner, but is not limited thereto.
If the user wants the home teaching machine to perform voice imitation, a corresponding voice imitation function can be selected from the home teaching machine, at the moment, the voice information to be recognized forwarded to the proxy server by the home teaching machine can be the voice to be imitated, after the voice information to be recognized is forwarded to the target server by the proxy server, the target server recognizes the information and obtains the voice corresponding to the information, the voice is returned to the proxy server, the proxy server sends the voice to the home teaching machine through WebSocket connection, and the home teaching machine performs voice output.
If the user wants the home teaching machine to perform language translation, a corresponding language translation function can be selected from the home teaching machine, at the moment, the voice information to be recognized, which is forwarded to the proxy server by the home teaching machine, can be the voice which is desired to be translated, after the voice information to be recognized is forwarded to the target server by the proxy server, the target server recognizes the information, obtains translation information corresponding to the information, and returns the translation information to the proxy server; when the proxy server detects that the translation information is correct, the translation information is sent to the family education machine through WebSocket connection; the family education machine outputs the translation information through voice, and can also display the translation information in a display interface in a character mode and the like. The description is given for illustrative purposes only and is not intended to be limiting.
According to the embodiment of the application, the voice information to be recognized, which is sent by the family education machine, is obtained; forwarding the voice information to be recognized to a target server based on the identification information of the target server; and when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine. In the mode, the proxy server performs data transmission through the WebSocket connection established between the proxy server and the family education machine, performs data forwarding through the Transmission Control Protocol (TCP) connection established between the proxy server and the target server, and finally sends the identification information corresponding to the voice information to be identified to the family education machine. The proxy server can return data without frequently establishing a connection request target server by communicating through the TCP connection, so that the data transmission speed is improved, and the timeliness of the data is ensured; and because the target server is not required to be frequently established for connection request, resources are saved, and the data transmission speed is further improved.
Referring to fig. 3, fig. 3 is a schematic flow chart of a data transmission method based on a family education machine according to another embodiment of the present invention. In this embodiment, the main execution body of the data transmission method based on the family education machine is the data transmission device based on the family education machine, including but not limited to a proxy server.
The differences between the present embodiment and the previous embodiment are S201-S202, S205-S206, and S208-S209, where S203-S204, and S207 in the present embodiment are completely the same as S101-S102, and S103 in the previous embodiment, and reference is specifically made to the description of S101-S102, and S103 in the previous embodiment, which is not repeated herein.
Further, in order to ensure timeliness of data transmission and speed up data transmission, S201 to S202 may be further included before S203 to S204, specifically as follows:
s201: and when a WebSocket connection establishing request sent by the family education machine is acquired, establishing WebSocket connection with the family education machine.
The family education machine sends a WebSocket connection establishing request to the proxy server, the proxy server establishes WebSocket connection between the proxy server and the family education machine when receiving the WebSocket connection establishing request sent by the family education machine, and the family education machine and the proxy server can communicate based on the WebSocket connection. Further, when there are a plurality of different home teaching machines, the home teaching machine carries identification information of the home teaching machine when sending a request for establishing the WebSocket connection to the proxy server, and the proxy server can establish the WebSocket connection between the proxy server and each home teaching machine according to the identification information of each home teaching machine.
S202: sending a request for establishing a first TCP connection to the target server based on the identification information of the target server; the establish first TCP connection request is used to establish a TCP connection between the proxy server and the target server.
When only one target server is available, the proxy server sends a request for establishing the first TCP connection to the target server, and when the target server receives the request for establishing the first TCP connection from the proxy server, the TCP connection between the proxy server and the target server is established. When a plurality of target servers exist, the proxy server sends a first TCP connection establishment request to the target servers according to the identification information of the target servers, and each target server establishes TCP connection between the proxy server and the target servers when receiving the first TCP connection establishment request of the proxy server. Further, the TCP connection between the proxy server and the target server may be established, or the TCP connection between the proxy server and the target server may be established when the proxy server receives a request for establishing the first TCP connection sent by the target server.
Further, in order to ensure the accuracy of the identification information returned to the family education machine, S204 may further include S205-S207, or S205, S208-S209, as follows:
s205: and receiving the identification information returned by the target server, and detecting whether the identification information contains messy codes.
The target server returns the identification information to the proxy server through the Transmission Control Protocol (TCP) connection, and the proxy server receives the identification information returned by the target server; the proxy server detects whether the identification information contains the messy codes or not, and when the identification information does not contain the messy codes, the identification information is considered to be correct, namely the identification information has no problem, and the identification information can be forwarded to the family education machine. When the messy codes are detected to be contained in the identification information, the identification information is considered to be incorrect, namely the identification information has a problem, and the identification information cannot be returned to the family education machine.
S206: and when the identification information is detected not to contain the messy codes, marking the identification information as correct.
The proxy server detects whether the identification information contains the messy codes or not, and when the identification information does not contain the messy codes, the identification information is considered to be correct, namely the identification information has no problem. At this time, the identification information may be marked to be correct, which means that the proxy server may forward the identification information to the family education machine through the WebSocket connection.
S208: when the identification information is detected to contain messy codes, the identification information is marked as an error.
The proxy server detects whether the identification information contains a messy code, and when the identification information contains the messy code, the identification information is considered to be incorrect, namely the identification information has a problem. At this time, the identification information may be marked as an error, meaning that the proxy server may not directly forward the identification information to the family education machine.
S209: and generating an identification failure notice and sending the identification failure notice to the family education machine.
When the identification information is marked as an error, the proxy server may generate an identification failure notification indicating that the target server has failed to recognize the speech information to be recognized this time. The proxy server sends the recognition failure notification to the family education machine, when the family education machine obtains the recognition failure notification, the recognition failure notification is displayed on a display interface or voice prompt is carried out, and the user can know that the current voice recognition fails and then take measures in time. Further, the proxy server may also send an identification failure notification to the target server, which performs re-identification and sends a new identification result to the proxy server.
According to the embodiment of the application, the voice information to be recognized, which is sent by the family education machine, is obtained; forwarding the voice information to be recognized to a target server based on the identification information of the target server; and when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine. In the mode, the proxy server performs data transmission through the WebSocket connection established between the proxy server and the family education machine, performs data forwarding through the Transmission Control Protocol (TCP) connection established between the proxy server and the target server, and finally sends the identification information corresponding to the voice information to be identified to the family education machine. The proxy server can return data without frequently establishing a connection request target server by communicating through the TCP connection, so that the data transmission speed is improved, and the timeliness of the data is ensured; and because the target server is not required to be frequently established for connection request, resources are saved, and the data transmission speed is further improved. Furthermore, the proxy server can detect the identification information returned by the target server and return the correct identification information to the family education machine, so that the data transmission efficiency and the data transmission quality are effectively improved; further, when the proxy server detects that the identification information is wrong, the proxy server generates an identification failure notification to remind the user, so that the user experience is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of a data transmission method based on a family education machine according to another embodiment of the present invention. In this embodiment, the main execution body of the data transmission method based on the family education machine is the data transmission device based on the family education machine, including but not limited to a proxy server.
The difference between the present embodiment and the embodiment corresponding to fig. 1 is S303-S304, where S301-S302 in the present embodiment are completely the same as S101-S102 in the previous embodiment, and reference is specifically made to the related description of S101-S102 in the previous embodiment, which is not repeated herein.
Further, in order to timely return correct identification information to the family education machine, S302 may further include S303-S304, which are as follows:
s303: and when the identification information is not received within the preset time length, sending the voice information to be identified to a standby server.
The standby server may be enabled when the target server fails or when requests received by the target server are not over-processed, as may be provided by the target server. Wherein the proxy server and the standby server have previously established a TCP connection. Specifically, when the proxy server does not receive the identification information sent by the target server within the preset time length, the target server is considered to be temporarily incapable of providing the service normally, and in order to return the correct identification information to the family education machine in time, the user experience is not influenced; at this time, the proxy server transmits the voice information to be recognized to the standby server through the TCP connection.
S304: and when detecting that the identification information returned by the standby server is correct, sending the identification information returned by the standby server to the family education machine.
And when detecting that the identification information returned by the standby server through the transmission control protocol TCP connection is correct, the proxy server sends the identification information returned by the standby server to the family education machine through the WebSocket connection. Specifically, when receiving the voice information to be recognized, the standby server recognizes the voice information to be recognized, and obtains corresponding recognition information. Different voice information to be recognized corresponds to different recognition results, namely different voice information to be recognized corresponds to different recognition information, and the standby server sends the recognition information to the proxy server through TCP connection. And when detecting that the identification information is correct, the proxy server forwards the identification information to the family education machine. The specific implementation process is similar to the process of processing the voice information to be recognized by the target server, and is not described herein again.
Further, in order to ensure timeliness of data transmission and speed up data transmission, S301 may further include: sending a request for establishing a second TCP connection to the standby server based on the identification information of the standby server; the establish second TCP connection request is used to establish a TCP connection between the proxy server and the standby server.
When only one standby server is provided, the proxy server sends a request for establishing the second TCP connection to the standby server, and the standby server establishes the TCP connection between the proxy server and the standby server when receiving the request for establishing the second TCP connection from the proxy server. When a plurality of standby servers exist, the proxy server sends a request for establishing a second TCP connection to the standby servers according to the identification information of the standby servers, and each standby server establishes the TCP connection between the proxy server and the standby server when receiving the request for establishing the second TCP connection of the proxy server. Further, the TCP connection between the proxy server and the standby server may be established, or the TCP connection between the proxy server and the standby server may be established when the proxy server receives a request for establishing the second TCP connection sent by the standby server.
According to the embodiment of the application, the voice information to be recognized, which is sent by the family education machine, is obtained; forwarding the voice information to be recognized to a target server based on the identification information of the target server; and when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine. In the mode, the proxy server performs data transmission through the WebSocket connection established between the proxy server and the family education machine, performs data forwarding through the Transmission Control Protocol (TCP) connection established between the proxy server and the target server, and finally sends the identification information corresponding to the voice information to be identified to the family education machine. The proxy server can return data without frequently establishing a connection request target server by communicating through the TCP connection, so that the data transmission speed is improved, and the timeliness of the data is ensured; and because the target server is not required to be frequently established for connection request, resources are saved, and the data transmission speed is further improved. Further, when the identification information returned by the target server is not received within the preset time, in order to timely return correct identification information to the family education machine, user experience is not affected, the voice information to be recognized can be sent to the standby server, and therefore the fact that the identification information is timely returned to the family education machine is guaranteed.
Referring to fig. 5, fig. 5 is a schematic diagram of a data transmission device based on a family education machine according to an embodiment of the present application. The device comprises units for performing the steps in the embodiments corresponding to fig. 2, 3, 4. Please refer to the related descriptions in the embodiments corresponding to fig. 2, fig. 3, and fig. 4. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 5, it includes:
an obtaining unit 410, configured to obtain to-be-recognized voice information sent by a family education machine;
a forwarding unit 420, configured to forward the to-be-recognized voice information to a target server based on identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
a sending unit 430, configured to send the identification information to the family education machine when it is detected that the identification information returned by the target server is correct; the identification information is information obtained by identifying the voice information to be identified by the target server.
Further, the apparatus further comprises:
the detection unit is used for receiving the identification information returned by the target server and detecting whether the identification information contains messy codes or not;
the first marking unit is used for marking the identification information as correct when the identification information is detected not to contain the messy codes;
and the second marking unit is used for marking the identification information as an error when the identification information is detected to contain a messy code.
Further, the apparatus further comprises:
and the generating unit is used for generating a recognition failure notice and sending the recognition failure notice to the family education machine.
Further, the apparatus further comprises:
the first information sending unit is used for sending the voice information to be recognized to the standby server when the recognition information is not received within a preset time length;
and the second information sending unit is used for sending the identification information returned by the standby server to the family education machine when the fact that the identification information returned by the standby server is correct is detected.
Further, the apparatus further comprises:
and the establishing unit is used for establishing the WebSocket connection with the family education machine when the WebSocket connection establishing request sent by the family education machine is obtained.
Further, the apparatus further comprises:
a first request sending unit, configured to send a request for establishing a first TCP connection to the target server based on the identification information of the target server; the establish first TCP connection request is used to establish a TCP connection between the proxy server and the target server.
Further, the apparatus further comprises:
a second request sending unit, configured to send a request for establishing a second TCP connection to the standby server based on the identification information of the standby server; the establish second TCP connection request is used to establish a TCP connection between the proxy server and the standby server.
Referring to fig. 6, fig. 6 is a schematic diagram of a data transmission device based on a family education machine according to another embodiment of the present application. As shown in fig. 6, the apparatus 5 of this embodiment includes: a processor 50, a memory 51, and computer readable instructions 52 stored in said memory 51 and executable on said processor 50. The processor 50, when executing the computer readable instructions 52, implements the steps in the various embodiments of the family education machine-based data transmission method described above, such as S101 to S103 shown in fig. 1. Alternatively, the processor 50, when executing the computer readable instructions 52, implements the functions of the units in the above embodiments, such as the units 410 to 430 shown in fig. 5.
Illustratively, the computer readable instructions 52 may be divided into one or more units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more elements may be a series of computer readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer readable instructions 52 in the device 5. For example, the computer readable instructions 52 may be obtained by an acquisition unit, a forwarding unit, and a sending unit, each of which functions as described above.
The apparatus may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is merely an example of a device 5 and does not constitute a limitation of device 5 and may include more or fewer components than shown, or some components in combination, or different components, e.g., the device may also include input output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the device 5, such as a hard disk or a memory of the device 5. The memory 51 may also be an external storage device of the device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the device 5. The memory 51 is used to store the computer readable instructions and other programs and data required by the device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not cause the essential features of the corresponding technical solutions to depart from the spirit scope of the technical solutions of the embodiments of the present application, and are intended to be included within the scope of the present application.

Claims (10)

1. A data transmission method based on a family education machine is applied to a proxy server and comprises the following steps:
acquiring voice information to be recognized sent by a family education machine;
forwarding the voice information to be recognized to a target server based on the identification information of the target server; the agent server is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the proxy server and the target server;
when detecting that the identification information returned by the target server is correct, sending the identification information to the family education machine; the identification information is obtained by identifying the voice information to be identified by the target server;
and when the target server fails or the request received by the target server is not processed excessively, starting a standby server, and establishing a TCP connection between the proxy server and the standby server in advance.
2. The data transmission method according to claim 1, wherein after forwarding the voice information to be recognized to the target server based on the identification information of the target server, the method further comprises:
receiving the identification information returned by the target server, and detecting whether the identification information contains messy codes;
when the identification information is detected not to contain the messy codes, marking the identification information as correct;
when the identification information is detected to contain messy codes, the identification information is marked as an error.
3. The data transmission method according to claim 2, wherein the marking the identification information as an error when detecting that the identification information includes a scrambling code further comprises:
and generating an identification failure notice and sending the identification failure notice to the family education machine.
4. The data transmission method according to claim 1, wherein after forwarding the voice information to be recognized to the target server based on the identification information of the target server, the method further comprises:
when the identification information is not received within a preset time length, sending the voice information to be identified to a standby server;
and when detecting that the identification information returned by the standby server is correct, sending the identification information returned by the standby server to the family education machine.
5. The data transmission method according to any one of claims 1 to 4, wherein before acquiring the voice information to be recognized sent by the family education machine, the method further comprises:
and when a WebSocket connection establishing request sent by the family education machine is acquired, establishing WebSocket connection with the family education machine.
6. The data transmission method according to any one of claims 1 to 4, wherein before acquiring the voice information to be recognized sent by the family education machine, the method further comprises:
sending a request for establishing a first TCP connection to the target server based on the identification information of the target server; the establish first TCP connection request is used to establish a TCP connection between the proxy server and the target server.
7. The data transmission method of claim 4, wherein before the obtaining the voice information to be recognized sent by the family education machine, the method further comprises:
sending a request for establishing a second TCP connection to the standby server based on the identification information of the standby server; the establish second TCP connection request is used to establish a TCP connection between the proxy server and the standby server.
8. A data transmission device based on a family education machine, comprising:
the acquisition unit is used for acquiring the voice information to be recognized sent by the family education machine;
the forwarding unit is used for forwarding the voice information to be recognized to the target server based on the identification information of the target server; the data transmission equipment is connected with the family education machine through a WebSocket connection; a Transmission Control Protocol (TCP) connection is established between the data transmission equipment and the target server;
the sending unit is used for sending the identification information to the family education machine when the fact that the identification information returned by the target server is correct is detected; the identification information is obtained by identifying the voice information to be identified by the target server;
and when the target server fails or the request received by the target server is not processed excessively, starting a standby server, and establishing a TCP connection between the data transmission equipment and the standby server in advance.
9. A family education machine-based data transmission device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, wherein the processor when executing the computer readable instructions implements the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN201911350636.8A 2019-12-24 2019-12-24 Data transmission method and device based on family education machine Expired - Fee Related CN111031063B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911350636.8A CN111031063B (en) 2019-12-24 2019-12-24 Data transmission method and device based on family education machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911350636.8A CN111031063B (en) 2019-12-24 2019-12-24 Data transmission method and device based on family education machine

Publications (2)

Publication Number Publication Date
CN111031063A CN111031063A (en) 2020-04-17
CN111031063B true CN111031063B (en) 2022-03-22

Family

ID=70214177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911350636.8A Expired - Fee Related CN111031063B (en) 2019-12-24 2019-12-24 Data transmission method and device based on family education machine

Country Status (1)

Country Link
CN (1) CN111031063B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111816190A (en) * 2020-07-08 2020-10-23 苏州思必驰信息科技有限公司 Voice interaction method and device for upper computer and lower computer
CN114884745B (en) * 2022-06-10 2023-08-01 安徽中电光达通信技术有限公司 Information security protection method and system for data center

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980419A (en) * 2014-09-11 2015-10-14 腾讯科技(深圳)有限公司 Agent communication method and device
CN107862021A (en) * 2017-10-31 2018-03-30 广东小天才科技有限公司 A kind of learning method and system based on intelligent microphone apparatus
CN107979592A (en) * 2013-09-30 2018-05-01 腾讯科技(深圳)有限公司 A kind of method and device for sending business request information
CN108280189A (en) * 2018-01-24 2018-07-13 广东小天才科技有限公司 A kind of voice based on smart pen searches topic method and system
CN108920541A (en) * 2018-06-12 2018-11-30 广东小天才科技有限公司 A kind of recognition methods and private tutor's machine based on phonetic search
CN109524008A (en) * 2018-11-16 2019-03-26 广东小天才科技有限公司 A kind of audio recognition method, device and equipment
CN109587275A (en) * 2019-01-08 2019-04-05 网宿科技股份有限公司 A kind of method for building up and proxy server of communication connection
CN109768999A (en) * 2019-03-14 2019-05-17 成都安恒信息技术有限公司 A kind of SSH multichannel TCP agent method based on WebSocket

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107979592A (en) * 2013-09-30 2018-05-01 腾讯科技(深圳)有限公司 A kind of method and device for sending business request information
CN104980419A (en) * 2014-09-11 2015-10-14 腾讯科技(深圳)有限公司 Agent communication method and device
CN107862021A (en) * 2017-10-31 2018-03-30 广东小天才科技有限公司 A kind of learning method and system based on intelligent microphone apparatus
CN108280189A (en) * 2018-01-24 2018-07-13 广东小天才科技有限公司 A kind of voice based on smart pen searches topic method and system
CN108920541A (en) * 2018-06-12 2018-11-30 广东小天才科技有限公司 A kind of recognition methods and private tutor's machine based on phonetic search
CN109524008A (en) * 2018-11-16 2019-03-26 广东小天才科技有限公司 A kind of audio recognition method, device and equipment
CN109587275A (en) * 2019-01-08 2019-04-05 网宿科技股份有限公司 A kind of method for building up and proxy server of communication connection
CN109768999A (en) * 2019-03-14 2019-05-17 成都安恒信息技术有限公司 A kind of SSH multichannel TCP agent method based on WebSocket

Also Published As

Publication number Publication date
CN111031063A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN109361703B (en) Voice equipment binding method, device, equipment and computer readable medium
CN110392054B (en) Login verification method, device, system, equipment and readable storage medium
CN109514586B (en) Method and system for realizing intelligent customer service robot
CN108172223A (en) Voice instruction recognition method, device and server and computer readable storage medium
CN107370610B (en) Conference synchronization method and device
CN104144106B (en) A kind of message forwarding method, Apparatus and system
US10142035B2 (en) Information transmission method, apparatus and system
CN111031063B (en) Data transmission method and device based on family education machine
CN110941563B (en) Automatic script testing method and device
CN108027725B (en) Method, device and equipment for guiding terminal equipment operation
US11205432B2 (en) Cross-platform communication method, server device and electronic device
US10652185B2 (en) Information sending method and information sending apparatus
US20180046707A1 (en) Providing searching strategy in connection with answering question in message
CN111611365A (en) Flow control method, device, equipment and storage medium of dialog system
CN113630309B (en) Robot conversation system, method, device, computer equipment and storage medium
CN111563037B (en) Test optimization method and device based on test questions, storage medium and terminal
US10735357B1 (en) Cross-platform messaging system
CN112840305B (en) Font switching method and related product
US11893172B2 (en) Information processing method based on electronic device interaction, and electronic device for establishing communication by sending communication protocol
CN106209583A (en) A kind of message input method, device and user terminal thereof
CN110602194B (en) IOT message subscription method, IOT message subscription device and computer readable storage medium
CN109412931B (en) Method, device and terminal equipment for performing knowledge question answering by using instant messaging mode
CN111246439A (en) Watch binding method and terminal
CN112533007A (en) Network live broadcast method, system, terminal device and storage medium
CN111770236A (en) Conversation processing method, device, system, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220322

CF01 Termination of patent right due to non-payment of annual fee