Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present inventionIn attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment isA part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the artEvery other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Referring to FIG. 1, it illustrates the flow chart of communication one embodiment of compensation method for voice dialogue of the application,The communication compensation method for voice dialogue of the present embodiment can be adapted for having communication or real-time voice dialogue functionTerminal, such as smart phone, plate, computer.
As shown in Figure 1, in a step 101, opening communication process voice dialogue in response to user and parsing task, connection parsingServer carries out real time parsing to the voice dialogue of user and obtains the first real time parsing result;
In a step 102, the communication connection state during Current communications is obtained;
In step 103, if in communication process occur connection disconnect, from real time parsing task switch to recording task withRecord the recorded audio of user during communication connection disconnects;
At step 104, if there is communication connection recovery in recording, real time parsing task is switched to simultaneously from recording taskObtain the second real time parsing result;
In step 105, it uploads and parses recorded audio to generate the first recording parsing result;
In step 106, the first real time parsing result, the first recording parsing result and the second real time parsing result are carried outMerge to obtain complete parsing result.
In the present embodiment, for step 101, compensation device is communicated in user and opens the parsing times of communication process voice dialogueAfter business, connection resolution server carries out real time parsing to the voice dialogue of user and obtains the first real time parsing result.WhereinIt includes real time parsing task and recording task that voice dialogue, which parses task,.Later, it for step 102, communicates compensation device and needsThe communication connection state during Current communications is obtained always, and judges that current connection is to disconnect or normally connect.Then,For step 103, if in communication process occur connection disconnect, need to switch to from real time parsing task recording task withThe recorded audio of user during communication connection disconnects is recorded, the part for the real time parsing that cannot network in this way can be recorded later againUpload parsing.Then, it for step 104, if there is communication connection recovery in recording, needs to switch to from recording taskReal time parsing task and obtain the second real time parsing as a result, i.e. communication connection restored just again can be with real time parsing.Later, rightIn step 105, communication compensation device uploads recorded audio when interrupting real time parsing before and parses the recorded audio with lifeAt the first recording parsing result.Finally, for step 106, compensation device is communicated by the first real time parsing result, first recordSound parsing result and the second real time parsing result are merged to obtain complete parsing result.Certainly, in practical applications,It is possible that repeatedly interrupting, therefore there may be multiple, above-mentioned second real time parsing knots for the first above-mentioned recording parsing resultFruit be also likely to be present it is multiple, the application herein there is no limit.Then all results are stitched together sequentially in timeForm complete parsing result.
The method of the present embodiment is by being uploaded and being parsed to recording after being recorded when communicating interrupt, soThe result of the parsing result of recording and real time parsing is spliced afterwards, complete parsing result can be formed, therefore useThe communication connection at family is unstable, also can obtain complete speech analysis as a result, user experience is fabulous.
With further reference to Fig. 2, it illustrates the communication benefits that the another kind that one embodiment of the application provides is used for voice dialogueThe flow chart of compensation method.The flow chart is mainly flow chart the step of further limiting to the additional flow of process Fig. 1.At thisIn embodiment, the first real time parsing result and the second real time parsing result are stored in parsing result set.
As shown in Fig. 2, in step 201, when there is communication connection recovery every time, adding phase in parsing result setThe communication answered restores label;
In step 202, corresponding communication is replaced using the first recording parsing result restore label to form complete solutionAnalyse results set.
In the present embodiment, for step 201, communicate compensation device need occur every time communication connection recovery whenIt waits, corresponding communication is added in parsing result set and restores label, communication each time restores can all have a corresponding communicationRestore label, which is restored label and be for example named using the identifier of entire speech analysis result plus the time.ItAfterwards, for step 202, the corresponding recording parsing result of recording before being restored using communication can replace corresponding communication and restoreLabel, to form complete parsing result set.
It the time point that the method for the present embodiment by using communication restores label communication connection is marked to restore, later can be withThe mode of the label is replaced with the recording parsing result before the label to form complete parsing result set, is simply easily graspedMake and is not take up too many space.
With further reference to Fig. 3, another provided it illustrates one embodiment of the application is used for the communication benefit of voice dialogueThe flow chart of compensation method.The case where flow chart is mainly to " communication connection disconnect after does not restore to connect always " it is furtherThe flow chart of the step of restriction.
As shown in figure 3, in step 301, if not occurring communication connection recovery in recording, appointing in voice dialogue parsingBusiness saves recorded audio after terminating;
In step 302, the second recording parsing result for obtaining the recorded audio uploaded after communication connection is restored, by theTwo recording parsing results are inserted into parsing result set.
In the present embodiment, for step 301, if communication compensation device detects that communication disconnection is not extensive always laterIt is multiple, then recorded audio can be saved after voice dialogue parsing task terminates.Later, for step 302, due to communicating always notRestore, also there is no communications to restore label for only one recording, directly will be before being attached to the parsing result of the recorded audioAfter the result of real time parsing.To which the method for the present embodiment is easy to operate, it is not take up too many resource.
Referring to FIG. 4, it illustrates another that one embodiment of the application provides to be used for the communication compensation side of voice dialogueThe flow chart of method.The process for the step of flow chart is further limited primarily directed to the case where " communication connection is more stable "Figure.
As shown in figure 4, in step 401, if Current communications connection is available, establishing long connection with resolution server;
In step 402, the real time parsing result that resolution server returns is obtained;
In step 403, real time parsing result is stored into parsing result set.
In the present embodiment, step 401 can then be built if it is determined that Current communications connection is available with resolution serverVertical long connection, without being attached waste network bandwidth and system resource all the time.Later, in step 402,The real time parsing of resolution server return is obtained as a result, simultaneously in step 403 by the corresponding parsing of real time parsing result storageIn results set.
The method of the present embodiment passes through multiplexing TCP by establishing long connection with resolution server when connection can be usedLink can reduce the time that 3 TCP shake hands, and can maintain a comparison always in the case where being connected to the network unbroken situationThe faster network connection state of stabilization ratio and data transmission environments, are conducive to the transmission of real time parsing result.
In some alternative embodiments, the above method further include: every time there is communication connection recovery when, again with solutionIt analyses server and establishes long connection.Restore to can be transferred through unnecessary time and the energy of shaking hands of long connection reduction later to communicate every timeMaintain a faster transmission speed.
It should be noted that above method step be not limited to each step execute sequence, in fact, certain stepsIt may be performed simultaneously or to execute with the opposite sequence that step limits, there is no limit herein by the application.
Yet there are no on the market at present can keep the lasting typing of voice dialogue in the case where communicating interrupt, andCommunication keeps current speech dialogue parsing and to the technical solution of the synchronous parsing of voice dialogue during communicating interrupt after restoring.
Below to some problems encountered in the implementation of the present invention by description inventor and to finally determinationOne specific embodiment of scheme is illustrated, so that those skilled in the art more fully understand the scheme of the application.
Inventor has found that defect existing in the prior art is mainly led by following reason during realizing the applicationCause: voice dialogue excessively relies on real time parsing, does not support the offline parsing in the case of communicating interrupt.
Inventor also found that product function at present on the market is relatively simple, relatively high to communication connection requirement, and reason hasThe following aspects:
Firstly, product on the market is towards specific user group, audient is relatively simple.
Secondly, the voice dialogue real time parsing logic of fusion function is complicated, abnormal conditions are more and are not easily solved.
Finally, the voice dialogue real time parsing of fusion function is bigger to the pressure of server-side, long connection is not only establishedIt realizes the real time parsing of voice dialogue, and also provides the upload parsing for big file of recording, the cost for software and hardwareIt is relatively high.
The scheme of the application, which is mainly started with from the following aspects, to be designed and optimizes:
1, during voice dialogue real time parsing, if communication connection is interrupted, recording state is automatically switched to, and recordRecording file.
2, when communication connection is restored, then real time parsing state is switched back into.Simultaneously by recording file be uploaded to server-side intoThe parsing of row voice dialogue, and will be in the result before parsing result insertion communication connection recovery.
3, communication connection is not restored yet at the end of voice dialogue, then saves recording file, can be by user in communication connectionWhen manually select upload, and parsing result deposit is assigned in corresponding voice dialogue resolution file.
Referring to FIG. 5, it illustrates the specific flow charts of one scheme of the application.
As shown in figure 5, the scheme of the application mainly comprises the steps that
User parses task firstly the need of creation voice dialogue, triggers process flow.
Process flow is as shown in Figure 5:
Step 1: client opens voice dialogue and parses task.
Step 2: judging Current communications connection status.
Step 3: communication connection is available.
A. client is connected to voice dialogue analysis service, obtains result in real time.
B. real-time voice talks with resolving, if communication abnormality, return step 1.
Step 4: communication connection disconnects.
A. recording is opened, and saves recording file.
B. communication connection is restored.
A) label is added in parsing result set.
B) it uploads recording and carries out voice dialogue parsing, parsing result is replaced into the marker bit in results set.
C) connection is established with real time parsing service, and obtains parsing result and is attached in results set.
C. communication connection is not restored until voice dialogue parsing task terminates.
A) recording file after communication connection is interrupted is saved.
B) in the case where determining the available situation of communication connection, recording file can be selected to upload in client and carries out voice dialogue solutionAnalysis.
C) parsing result will be attached in selected voice dialogue parsing result set.
Step 5: obtaining complete voice dialogue parsing result.
Inventor also attempted following scheme during realizing the application: in the case where communication condition is poor,It switches to mobile phone and carries out voice dialogue acquisition, cell phone network stability is relatively high, it is possible to reduce when server-side recording file parsesResource consumption, and the encoding amount of complex logic is effectively reduced.But disadvantage is it is also obvious that mobile phone pickup is adjusted the distance that requirement is comparedHeight, when voice dialogue apart from mobile phone farther out when, the result accuracy of parsing is low, and effect is poor.
After the service condition for having measured practical application scene, current scheme is carried out with this programme.
It can allow user under any communication condition without worry voice dialogue parsing result by this solutionIt is imperfect, even if communication connection situation is poor, the time that parsing is uploaded after live pick-up can also be greatly reduced.
Referring to FIG. 6, the frame of the communication compensation device for voice dialogue provided it illustrates one embodiment of the inventionFigure.
As shown in fig. 6, being used for the communication compensation device 600 of voice dialogue, including the first parsing module 610, connection statusObtain module 620, recording module 630, the second parsing module 640, recording parsing module 650 and merging module 660.
Wherein, the first parsing module 610 is configured to open communication process voice dialogue parsing task in response to user, evenResolution server is connect to carry out real time parsing to the voice dialogue of user and obtain the first real time parsing result;Connection status obtains mouldBlock 620 is configured to obtain the communication connection state during Current communications;Recording module 630, if being configured in communication processThere is connection to disconnect, switches to recording task from real time parsing task to record the recording sound of user during communication connection disconnectsFrequently;Second parsing module 640 switches to real time parsing from recording task if being configured to communication connection recovery occur in recordingTask simultaneously obtains the second real time parsing result;Recording parsing module 650, is configured to upload and parse recorded audio to generate firstRecording parsing result;And merging module 660, it is configured to the first real time parsing result, the first recording parsing result and secondReal time parsing result is merged to obtain complete parsing result.
In some alternative embodiments, the first real time parsing result and the second real time parsing result are stored in parsing resultIn set, the above-mentioned communication compensation device 600 for voice dialogue further include: restore label adding module (not shown),It is configured to when there is communication connection recovery every time, corresponding communication is added in parsing result set and restores label;Replace mouldBlock (not shown) is configured so that the corresponding communication of the first recording parsing result replacement restores label to form complete solutionAnalyse results set.
In other optional embodiments, above-mentioned 600 device of communication compensation device for voice dialogue, further includes:Preserving module (not shown) parses task in voice dialogue if being configured to not occur communication connection recovery in recordingRecorded audio is saved after terminating;And recording insertion module (not shown), it is configured to after acquisition communication connection recoverySecond recording parsing result of the recorded audio of upload, the second recording parsing result is inserted into parsing result set.
It should be appreciated that all modules recorded in Fig. 6 with reference to each in method described in Fig. 1, Fig. 2, Fig. 3 and Fig. 4Step is corresponding.The operation above with respect to method description and feature and corresponding technical effect are equally applicable in Fig. 6 as a result,All modules, details are not described herein.
It is worth noting that, the module in embodiment of the disclosure is not limited to the scheme of the disclosure, such as judgeModule can be described as judging whether interaction mode is the module for playing scene when equipment is in interaction mode.In addition, may be used alsoIt is no longer superfluous herein to realize that related function module, such as judgment module can also be realized with processor by hardware processorIt states.
In further embodiments, the embodiment of the invention also provides a kind of nonvolatile computer storage medias, calculateMachine storage medium is stored with computer executable instructions, which can be performed in above-mentioned any means embodimentThe communication compensation method for voice dialogue;
As an implementation, nonvolatile computer storage media of the invention is stored with the executable finger of computerIt enables, computer executable instructions setting are as follows:
Communication process voice dialogue, which is opened, in response to user parses task, voice dialogue of the connection resolution server to userIt carries out real time parsing and obtains the first real time parsing result;
Obtain the communication connection state during Current communications;
If occurring connection in communication process to disconnect, recording task is switched to record communication connection from real time parsing taskThe recorded audio of user during disconnection;
If there is communication connection recovery in recording, real time parsing task is switched to from recording task and obtains second in real timeParsing result;
It uploads and parses the recorded audio to generate the first recording parsing result;
The first real time parsing result, the first recording parsing result and the second real time parsing result are carried outMerge to obtain complete parsing result.
Non-volatile computer readable storage medium storing program for executing may include storing program area and storage data area, wherein storage journeyIt sequence area can application program required for storage program area, at least one function;Storage data area can be stored according to for voiceThe communication compensation device of dialogue uses created data etc..In addition, non-volatile computer readable storage medium storing program for executing can wrapHigh-speed random access memory is included, can also include nonvolatile memory, for example, at least disk memory, a flash memoriesPart or other non-volatile solid state memory parts.In some embodiments, the optional packet of non-volatile computer readable storage medium storing program for executingThe memory remotely located relative to processor is included, these remote memories can be by being connected to the network to for voice dialogueCommunicate compensation device.The example of above-mentioned network include but is not limited to internet, intranet, local area network, mobile radio communication andA combination thereof.
The embodiment of the present invention also provides a kind of computer program product, and computer program product is non-volatile including being stored inComputer program on computer readable storage medium, computer program include program instruction, when program instruction is held by computerWhen row, computer is made to execute the communication compensation method that any of the above-described is used for voice dialogue.
Fig. 7 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention, as shown in fig. 7, the equipment includes: oneOr multiple processors 710 and memory 720, in Fig. 7 by taking a processor 710 as an example.Communication for voice dialogue compensatesThe equipment of method can also include: input unit 730 and output device 740.Processor 710, memory 720, input unit 730It can be connected by bus or other modes with output device 740, in Fig. 7 for being connected by bus.Memory 720 isAbove-mentioned non-volatile computer readable storage medium storing program for executing.Processor 710 is stored in non-volatile in memory 720 by operationSoftware program, instruction and module, thereby executing the various function application and data processing of server, i.e. the realization above methodEmbodiment is used for the communication compensation method of voice dialogue.Input unit 730 can receive the number or character information of input, and produceRaw key signals related with the user setting of communication compensation device and function control input.Output device 740 may include displayThe display equipment such as screen.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and hasBeneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
As an implementation, above-mentioned electronic apparatus application is used in the communication compensation device for voice dialogueClient, comprising: at least one processor;And the memory being connect at least one processor communication;Wherein, memoryIt is stored with the instruction that can be executed by least one processor, instruction is executed by least one processor, so that at least one is handledDevice can:
Communication process voice dialogue, which is opened, in response to user parses task, voice dialogue of the connection resolution server to userIt carries out real time parsing and obtains the first real time parsing result;
Obtain the communication connection state during Current communications;
If occurring connection in communication process to disconnect, recording task is switched to record communication connection from real time parsing taskThe recorded audio of user during disconnection;
If there is communication connection recovery in recording, real time parsing task is switched to from recording task and obtains second in real timeParsing result;
It uploads and parses the recorded audio to generate the first recording parsing result;
The first real time parsing result, the first recording parsing result and the second real time parsing result are carried outMerge to obtain complete parsing result.
The electronic equipment of the embodiment of the present application exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, dataCommunication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and lowHold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing functionCan, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are totalLine etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energyPower, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic devices with data interaction function.
The apparatus embodiments described above are merely exemplary, wherein unit can be as illustrated by the separation memberOr may not be and be physically separated, component shown as a unit may or may not be physical unit, i.e.,It can be located in one place, or may be distributed over multiple network units.It can select according to the actual needs thereinSome or all of the modules achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creative laborIn the case where dynamic, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment canIt realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, onStating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, shouldComputer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingersIt enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementationThe method of certain parts of example or embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;AlthoughPresent invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be usedTo modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit andRange.