Speech recognition method and device based on online and offline mode switching and medium

By switching between online and offline modes in the voice recognition device, and flexibly selecting the recognition mode according to the network status, the problem of inability to voice recognition when the device is disconnected from the network is solved, and the application effect of voice recognition is improved.

CN119541463APending Publication Date: 2025-02-28深圳新芯智能有限公司

Patent Information

Application Number
CN202510061066.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, voice recognition cannot be performed when the device is disconnected from the network.

Method used

A speech recognition method based on online and offline mode switching is provided, by configuring a speech recognition policy based on input configuration information, and determining the recognition mode in combination with the current network status. If it is offline mode, preprocessing and local identification are performed; if it is online mode, audio data is generated and sent to a cloud server for identification.

Benefits of technology

It realizes that voice recognition can still be performed when the device is disconnected from the network, improving the application effect and reliability of voice recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119541463A_ABST
    Figure CN119541463A_ABST
Patent Text Reader

Abstract

The invention discloses a voice recognition method and device based on online and offline mode switching and a medium, and the method comprises the steps: configuring a corresponding voice recognition strategy according to input configuration information, and determining a recognition mode according to the voice recognition strategy and a current network state; if the mode is the off-line mode, preprocessing the to-be-recognized voice according to a preprocessing rule, and recognizing the to-be-recognized voice through a local recognition model to obtain a voice recognition result; and if the voice recognition mode is the online mode, generating audio data corresponding to the to-be-recognized voice according to the online recognition configuration information, and sending the audio data to the cloud server to obtain a voice recognition result fed back by the cloud server. According to the method, the recognition mode can be flexibly determined according to the configured voice recognition strategy, so that flexible switching between the online recognition mode and the offline recognition mode is achieved, when the current network state does not meet the requirement for online recognition, the mode can be flexibly switched to the offline mode for voice recognition, and the application effect of voice recognition is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech recognition technology, and in particular to a speech recognition method, device and medium based on switching between online and offline modes. Background Art

[0002] In today's intelligent society, voice recognition technology has become an important bridge for users to interact with devices. With the development of technology, the feedback speed of online voice recognition has been very fast, and there is basically no delay. At the same time, cloud computing and big data technology are used to upload the user's voice data to the cloud server in real time for recognition. This method relies on a stable network connection and can use the powerful computing power of the cloud to perform complex voice recognition processing. The existing technical methods are usually only equipped with online voice recognition technology. If the device is disconnected from the network, voice recognition cannot be performed. Therefore, there is a problem in the existing technical methods that voice recognition cannot be performed when the device is disconnected from the network. Summary of the invention

[0003] The embodiments of the present invention provide a speech recognition method, device and medium based on switching between online and offline modes, aiming to solve the problem in the prior art that speech recognition cannot be performed when the device is disconnected from the network.

[0004] In a first aspect, an embodiment of the present invention provides a speech recognition method based on switching between online and offline modes, the method being applied to a speech recognition device, the speech recognition device establishing a network connection with a cloud server, the method comprising: A corresponding speech recognition strategy is configured according to the input configuration information; If the input speech to be recognized is received, a corresponding recognition mode is determined according to the speech recognition strategy and the current network status; If the recognition mode is an offline mode, preprocessing the speech to be recognized according to a preset preprocessing rule to obtain a corresponding preprocessed audio; Recognize the preprocessed audio according to a pre-stored local recognition model to obtain a corresponding speech recognition result; If the recognition mode is an online mode, generating audio data corresponding to the speech to be recognized according to preset online recognition configuration information; The audio data is sent to a cloud server to obtain a speech recognition result that the cloud server recognizes the audio data and feeds back.

[0005] In a second aspect, an embodiment of the present invention further provides a speech recognition device based on switching between online and offline modes, wherein the speech recognition device applies the speech recognition method based on switching between online and offline modes as described in the first aspect above, and the speech recognition device includes a microphone, a main control chip, an offline recognition module, a network communication module, and a radio frequency communication module; The main control chip establishes communication connections with the offline recognition module, the network communication module and the radio frequency communication module respectively; the offline recognition module is also communicated with a microphone.

[0006] The embodiment of the present invention provides a speech recognition method, device and medium based on switching between online and offline modes, the method comprising: configuring a corresponding speech recognition strategy according to the input configuration information, determining the recognition mode according to the speech recognition strategy and the current network status; if it is an offline mode, preprocessing the speech to be recognized according to the preprocessing rules and recognizing through the local recognition model to obtain the speech recognition result; if it is an online mode, generating audio data corresponding to the speech to be recognized according to the online recognition configuration information and sending it to the cloud server to obtain the speech recognition result fed back by the cloud server. The above method can flexibly determine the recognition mode according to the configured speech recognition strategy, thereby realizing flexible switching between the online recognition mode and the offline recognition mode. When the current network status does not meet the requirements for online recognition, it can flexibly switch to the offline mode for speech recognition, which greatly improves the application effect of speech recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0008] Figure 1 A method flow chart of a speech recognition method based on switching between online and offline modes provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a speech recognition device based on switching between online and offline modes provided by an embodiment of the present invention; Figure 3 A partial structural diagram of a main control chip in a speech recognition device based on online and offline mode switching provided by an embodiment of the present invention; Figure 4 A partial structural diagram of a network communication module in a speech recognition device based on switching between online and offline modes provided by an embodiment of the present invention; Figure 5A structural diagram of the connection between a network communication module and an external antenna interface in a speech recognition device based on switching between online and offline modes provided by an embodiment of the present invention; Figure 6 A structural diagram of a radio frequency connection port of a main control chip in a speech recognition device based on switching between online and offline modes provided by an embodiment of the present invention; Figure 7 A partial structural diagram of a radio frequency communication module in a speech recognition device based on switching between online and offline modes provided in an embodiment of the present invention; Figure 8 A structural diagram of an offline recognition connection port of a main control chip in a speech recognition device based on online and offline mode switching provided by an embodiment of the present invention; Fig. 9 A structural diagram of an offline recognition module in a speech recognition device based on switching between online and offline modes provided by an embodiment of the present invention; Fig.10 is a schematic block diagram of a computer device provided by an embodiment of the present invention; Reference numerals: MIC, microphone; MT8781, main control chip; GX8002, offline identification module; MT6631, network communication module; MT6186, radio frequency communication module. DETAILED DESCRIPTION

[0009] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0010] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0011] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0012] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0013] See also Figure 1 As shown in the figure, the embodiment of the present invention provides a speech recognition method based on switching between online and offline modes, which is applied to a speech recognition device 1 and is executed by application software installed in the speech recognition device 1. Specific application scenarios are as follows Figure 2 As shown, the voice recognition device 1 establishes a network connection with the cloud server 2. The voice recognition device 1 can establish a network connection with the cloud server 2 through a local area network (such as a WIFI network), and the voice recognition device 1 can also establish a network connection with the cloud server 2 through a radio frequency communication network (such as C2K / 2G / 3G / 4G). The voice recognition device 1 is a terminal device with voice recognition processing and information transmission and reception; the cloud server 2 is a server end configured with the cloud and can be used for voice recognition. Figure 1 As shown, the method includes steps S110 to S160.

[0014] S110. Obtain a corresponding speech recognition strategy according to the input configuration information.

[0015] The corresponding voice recognition strategy is configured according to the input configuration information. The user can input configuration information to the voice recognition device, and the voice recognition device can configure the voice recognition strategy according to the configuration information input by the user.

[0016] In a specific embodiment, step S110 includes sub-steps: determining whether the privacy protection item in the configuration information has been set; if the privacy protection item has been set, configuring the speech recognition strategy to be offline recognition; if the privacy protection item has not been set, configuring the speech recognition strategy to be online recognition or offline recognition.

[0017] Specifically, the user can set the privacy protection item in the configuration information. If the privacy protection item is set, the voice needs to be recognized offline to protect the user's privacy. At this time, the voice recognition strategy can be configured as offline recognition. If the privacy protection item is not set, it means that the voice can be recognized offline or online at this time. In this case, the voice recognition strategy can be configured as online recognition or offline recognition.

[0018] S120: If the input speech to be recognized is received, a corresponding recognition mode is determined according to the speech recognition strategy and the current network status.

[0019] If the input voice to be recognized is received, the corresponding recognition mode is determined according to the voice recognition strategy and the current network status. After completing the configuration of the voice recognition strategy, the voice information input by the user can be collected through the microphone, and the collected voice information is used as the voice to be recognized. At this time, the corresponding recognition mode can be determined by the voice recognition strategy and the current network status, that is, whether to perform voice recognition in online mode or offline mode.

[0020] In a specific embodiment, step S120 includes sub-steps: if the speech recognition strategy is only an offline mode, determining that the recognition mode is an offline mode; if the speech recognition strategy includes an online mode, determining whether the local network state in the current network state is normal; if the local network state is abnormal, determining whether the radio frequency communication network state in the current network state is normal; if the radio frequency communication network state is abnormal, determining that the recognition mode is an offline mode; if the local network state is normal or the radio frequency communication network state is normal, determining that the recognition mode is an online mode.

[0021] Specifically, if the speech recognition strategy is only in offline mode, the recognition mode is determined to be offline mode. If the speech recognition strategy includes an online mode, it is necessary to determine whether the local network status in the current network status is normal. The connection status information and network delay information of the local network status can be obtained to determine whether the connection status information is connected and whether the network delay information is not greater than the preset delay judgment time; for example, the delay judgment time can be set to 200ms. If the status connection information is connected and the network delay information is not greater than the delay judgment time, the local network status is determined to be normal, otherwise the local network status is determined to be abnormal.

[0022] If the local network status is abnormal, it is further determined whether the RF communication network status is normal. Specifically, the communication status information and communication delay information of the RF communication network status can be obtained to determine whether the communication status information is connected and whether the communication delay information is not greater than the above-mentioned delay judgment time. If the communication status information is connected and the communication delay information is not greater than the delay judgment time, it is determined that the RF communication network status is normal, otherwise it is determined that the RF communication network status is abnormal.

[0023] If any one of the network states is normal, the identification mode is determined to be the online mode; if both network states are abnormal, the identification mode is determined to be the offline mode.

[0024] S130: If the recognition mode is an offline mode, preprocess the speech to be recognized according to a preset preprocessing rule to obtain a corresponding preprocessed audio.

[0025] If the recognition mode is an offline mode, the speech to be recognized is preprocessed according to a preset preprocessing rule to obtain a corresponding preprocessed audio. If the recognition mode is an offline mode, the speech to be recognized can be preprocessed according to a preset preprocessing rule, and the accuracy of subsequent speech recognition can be improved by preprocessing; preprocessing can obtain a preprocessed audio corresponding to the speech to be recognized.

[0026] In a specific embodiment, step S130 includes sub-steps: intercepting a corresponding valid audio segment from the speech to be recognized according to the loudness threshold in the preprocessing rule; performing audio noise reduction processing on the valid audio segment according to the noise reduction frequency band in the preprocessing rule to obtain a corresponding preprocessed audio.

[0027] Specifically, the speech to be recognized includes multiple audio segments. The speech to be recognized can be intercepted according to the loudness threshold in the preprocessing rule, so as to obtain the audio segment whose loudness is not less than the loudness threshold in the speech to be recognized as the valid audio segment. Further, the effective audio segment is subjected to audio noise reduction processing according to the noise reduction frequency band in the preprocessing rule. In order to highlight the speaking voice, the audio corresponding to the noise reduction frequency band in the effective audio segment can be obtained, and the loudness of the audio corresponding to the noise reduction frequency band can be adjusted, so as to reduce the loudness of the non-speaking voice. One or more noise reduction frequency bands can be set. For example, the frequency corresponding to the noise reduction frequency band 1 is [0,80Hz] and the adjustment coefficient is 0, then the audio loudness corresponding to the noise reduction frequency band 1 is multiplied by the adjustment coefficient 0; the frequency corresponding to the noise reduction frequency band 2 is [1000Hz,1350Hz] and the adjustment coefficient is 0.2, then the audio loudness corresponding to the noise reduction frequency band 2 is multiplied by the adjustment coefficient 0.2. The audio after the audio loudness adjustment is combined into the corresponding preprocessed audio.

[0028] S140: Recognize the preprocessed audio according to a pre-stored local recognition model to obtain a corresponding speech recognition result.

[0029] The pre-processed audio is recognized according to a pre-stored local recognition model to obtain a corresponding speech recognition result. The local recognition model can recognize speech locally offline, and the local recognition model includes a neural network, which can run in a neural network processor gxNPU V200 to improve speech recognition efficiency; the pre-processed audio can be recognized according to the local recognition model to obtain a speech recognition result.

[0030] In a specific embodiment, step S140 includes sub-steps: converting the preprocessed audio into a corresponding audio spectrum according to a spectrum conversion rule in the local recognition model; extracting corresponding audio features from the audio spectrum according to spectrum feature extraction items in the local recognition model; inputting the audio features into a neural network in the local recognition model to recognize the audio features and obtain corresponding speech recognition results.

[0031] Specifically, the preprocessed audio can be converted according to the spectrum conversion rules in the local recognition model, and each audio segment in the preprocessed audio (such as an audio segment with a duration of 0.3S-0.5S) can be converted separately. The spectrum conversion rules for audio conversion can be conversion rules based on fast Fourier transform. Fast Fourier transform can be performed on each audio segment to obtain the corresponding audio spectrum, and the audio spectrum can be represented by a spectrum curve. The spectrum feature extraction item can be a Mel spectrum feature item, and the corresponding Mel spectrum coefficient can be extracted from the spectrum curve according to the Mel spectrum calculation formula; according to the Mel spectrum feature item, multiple Mel spectrum coefficients corresponding to the Mel spectrum feature item are obtained as the corresponding audio feature, and the audio feature contains multiple coefficient values. An audio feature array composed of the multiple coefficient values ​​can characterize the audio feature of an audio segment.

[0032] The obtained audio features are input into the neural network in the local recognition model to recognize the audio features of each audio segment. The neural network can be a long short-term memory audio recognition neural network. The long short-term memory audio recognition neural network can associate and recognize the adjacent audio segments, further improving the accuracy of audio recognition. The neural network outputs the coding sequence corresponding to each audio segment. Each coding value in the coding sequence corresponds to a character (a single Chinese character). The coding sequence can be converted into a character sequence (a sentence or phrase consisting of a single Chinese character) as the final speech recognition result.

[0033] In a specific embodiment, the step before step S140 also includes the step of: performing model training on the neural network in the local recognition model according to a preconfigured training speech set to obtain a trained neural network. Specifically, before using the neural network in the local recognition model, the neural network can be model trained using a preconfigured training speech set. The training speech set contains multiple training speech lines, and the audio features corresponding to each training speech can be extracted and input into the neural network to obtain the corresponding output coding sequence. The parameters in the neural network are optimized and adjusted based on the standard coding sequence of each training speech and the output coding sequence, thereby achieving model training for the neural network. For example, the parameters in the neural network can be optimized and adjusted based on the gradient descent operation rules and the preset learning rate, and the trained neural network can be finally obtained by iteratively training the neural network for use.

[0034] S150: If the recognition mode is an online mode, generate audio data corresponding to the speech to be recognized according to preset online recognition configuration information.

[0035] If the recognition mode is an online mode, audio data corresponding to the speech to be recognized is generated according to the preset online recognition configuration information. If online recognition of speech is required, audio data can be generated according to the preset online recognition configuration information, and the generated audio data can be transmitted to the cloud server. The online recognition configuration information includes authentication identification, encryption key and network request code, etc.

[0036] In a specific embodiment, step S150 includes sub-steps: obtaining the authentication identifier in the online recognition configuration information and combining it with the voice to be recognized to obtain corresponding combined data information; encrypting the combined data information according to the encryption key in the online recognition configuration information to obtain corresponding audio data.

[0037] For online speech recognition, it is necessary to configure the recognition engine to connect to the cloud server and pass the necessary authentication identifier. The authentication identifier can be an API Key. The authentication identifier can be combined with the speech to be recognized to obtain combined data information. Furthermore, in order to ensure the security of the transmitted information and avoid privacy leakage, the combined data information can be encrypted by an encryption key. The encryption algorithm can be the national secret algorithm SM4, or other symmetric encryption algorithms or asymmetric encryption algorithms. The encrypted information can be used as audio data.

[0038] S160: Send the audio data to a cloud server to obtain a speech recognition result that is fed back by the cloud server after recognizing the audio data.

[0039] The audio data is sent to the cloud server to obtain the speech recognition result that the cloud server recognizes the audio data and feeds back. Furthermore, the obtained audio data can be sent to the cloud server according to the network request code in the online recognition configuration information. The cloud server receives the audio data and decrypts it, and verifies the authentication identifier contained in the decrypted information. If the verification is passed, speech recognition is performed to obtain the corresponding speech recognition result and feed it back to the speech recognition device. Since the computing power of the cloud server is significantly stronger than that of the speech recognition device, the cloud server can run a large language recognition model, so that accurate speech recognition results can be obtained more quickly.

[0040] The speech recognition method, device and medium based on switching between online and offline modes disclosed in the above embodiments include: configuring the corresponding speech recognition strategy according to the input configuration information, and determining the recognition mode according to the speech recognition strategy and the current network status; if it is an offline mode, preprocessing the speech to be recognized according to the preprocessing rules and recognizing it through the local recognition model to obtain the speech recognition result; if it is an online mode, generating audio data corresponding to the speech to be recognized according to the online recognition configuration information and sending it to the cloud server to obtain the speech recognition result fed back by the cloud server. The above method can flexibly determine the recognition mode according to the configured speech recognition strategy, thereby realizing flexible switching between the online recognition mode and the offline recognition mode. When the current network status does not meet the requirements for online recognition, it can flexibly switch to the offline mode for speech recognition, which greatly improves the application effect of speech recognition.

[0041] The embodiment of the present invention further provides a speech recognition device based on switching between online and offline modes, and the speech recognition device applies any embodiment of the speech recognition method based on switching between online and offline modes. Figures 2 to 9 .

[0042] like Figure 2 As shown, the speech recognition device includes a microphone MIC, a main control chip MT8781, an offline recognition module GX8002, a network communication module MT6631 and a radio frequency communication module MT6186; the main control chip MT8781 establishes communication connections with the offline recognition module GX8002, the network communication module MT6631 and the radio frequency communication module MT6186 respectively; the offline recognition module GX8002 is also communicated with the microphone MIC.

[0043] Among them, the MTK platform chip processor is used as the main control chip MT8781, which can run Android programs to facilitate secondary development. The network communication module MT6631 (also known as the WIFI module) uses a network communication chip, supporting dual-band (2.4GHz and 5GHz) single-stream 802.11 a / b / g / n / ac RF, 20 / 40 / 80MHz bandwidth. The RF communication module MT6186 uses an RF communication chip and supports multi-mode RF C2K / 2G / 3G / 4G. The offline recognition module GX8002 uses a neural network processing chip. With the help of the integrated neural network processor gxNPU V200, it can support voice wake-up and recognition, allowing users to easily interact with the device through voice. The microphone uses a silicon microphone with a sensitivity of -40+ / - 2dB.

[0044] In a more specific embodiment, Figure 3 and Figure 4As shown, the CONNSYS IF interface of the main control chip MT8781 (including WF_IP, WF_IN, WF_QP, WF_QN, CONN_XO_IN_BB, CONN_BT_CLK, CONN_BT_DATA, CONN_WF_CTRL0, CONN_WF_CTRL1, CONN_WF_CTRL2 and other interfaces) is electrically connected to the WF interface of the network communication module MT6631 to establish a wireless WIFI network connection. Figure 5 The J25 external antenna interface enhances the signal and utilizes the stability of the connection between the main control chip MT8781 and the WIFI communication network; the user's voice data is uploaded to the MediaTek cloud server or a third-party voice recognition service provider in real time. The cloud server runs advanced voice recognition algorithms for voice recognition.

[0045] like Figure 6 and Figure 7 As shown, the RF interface of the main control chip MT8781 (including multiple interfaces marked with LET such as LET_TX_BB_IP0) and the RF communication module MT6186 (DETIF interface, DRX (I / Q) interface, PRX (I / Q) interface, TX (I / Q interface), BSI interface) are electrically connected to establish a communication network connection, and the user voice data is uploaded to the MediaTek cloud server or a third-party voice recognition service provider in real time by utilizing the stability of the communication network connection between the main control chip MT8781 and the RF communication module MT6186.

[0046] like Figure 8 and Fig. 9 As shown, the I2C interface (including SCL5 interface and SDA5 interface) of the main control chip MT8781 is electrically connected to the offline recognition module GX8002 to establish offline recognition mode transmission communication, wherein VUN1V8 and VCORE1V2 supply power to the offline recognition module GX8002, and the MIC5+ interface and MIC5- interface are external MIC interfaces for voice reception, and the offline recognition module GX8002 communicates electrically with the main control chip MT8781 through the hardware I2C interface.

[0047] The speech recognition device based on switching between online and offline modes provided in the embodiment of the present invention applies the above-mentioned speech recognition method based on switching between online and offline modes, configures the corresponding speech recognition strategy according to the input configuration information, and determines the recognition mode according to the speech recognition strategy and the current network status; if it is in offline mode, the speech to be recognized is preprocessed according to the preprocessing rules and recognized through the local recognition model to obtain the speech recognition result; if it is in online mode, the audio data corresponding to the speech to be recognized is generated according to the online recognition configuration information and sent to the cloud server to obtain the speech recognition result fed back by the cloud server. The above-mentioned method can flexibly determine the recognition mode according to the configured speech recognition strategy, thereby realizing the flexible switching between the online recognition mode and the offline recognition mode. When the current network status does not meet the requirements for online recognition, it can flexibly switch to the offline mode for speech recognition, which greatly improves the application effect of speech recognition.

[0048] The above-mentioned speech recognition method based on switching between online and offline modes can be implemented in the form of a computer program. The computer program can be used in Fig.10 If the computer device shown in FIG. 1 is run, the speech recognition device can be implemented as follows: Fig.10 Computer equipment shown.

[0049] See also Fig.10 , Fig.10 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device may be a speech recognition device for executing a speech recognition method based on switching between online and offline modes to recognize an input speech to be recognized.

[0050] See also Fig.10 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a communication bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .

[0051] The storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 may execute a speech recognition method based on switching between online and offline modes, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.

[0052] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0053] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a speech recognition method based on switching between online and offline modes.

[0054] The network interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0055] The processor 502 is used to run the computer program 5032 stored in the memory to implement the corresponding functions in the above-mentioned speech recognition method based on switching between online and offline modes.

[0056] Those skilled in the art will understand that Fig.10 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Fig.10 The embodiments shown are consistent and will not be described again here.

[0057] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0058] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned speech recognition method based on switching between online and offline modes are implemented.

[0059] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0060] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.

[0061] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0062] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0063] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk.

[0064] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A speech recognition method based on switching between online and offline modes, characterized in that: The method is applied to a speech recognition device, the speech recognition device establishes a network connection with a cloud server, and the method includes: A corresponding speech recognition strategy is configured according to the input configuration information; If the input speech to be recognized is received, a corresponding recognition mode is determined according to the speech recognition strategy and the current network status; If the recognition mode is an offline mode, preprocessing the speech to be recognized according to a preset preprocessing rule to obtain a corresponding preprocessed audio; Recognize the preprocessed audio according to a pre-stored local recognition model to obtain a corresponding speech recognition result; If the recognition mode is an online mode, generating audio data corresponding to the speech to be recognized according to preset online recognition configuration information; The audio data is sent to a cloud server to obtain a speech recognition result that the cloud server recognizes the audio data and feeds back.

2. The speech recognition method based on switching between online and offline modes according to claim 1, characterized in that: The configuring of the corresponding speech recognition strategy according to the input configuration information includes: Determining whether the privacy protection item in the configuration information has been set; If the privacy protection item is set, configure the speech recognition strategy to offline recognition; If the privacy protection item is not set, configure the speech recognition strategy to be online recognition or offline recognition.

3. The speech recognition method based on switching between online and offline modes according to claim 1 or 2, characterized in that: Determining the corresponding recognition mode according to the speech recognition strategy and the current network status includes: If the speech recognition strategy is only in offline mode, determining that the recognition mode is in offline mode; If the speech recognition strategy includes an online mode, determining whether the local network status in the current network status is normal; If the local network state is abnormal, determining whether the radio frequency communication network state in the current network state is normal; If the state of the radio frequency communication network is abnormal, determining that the identification mode is an offline mode; If the local network state is normal or the radio frequency communication network state is normal, it is determined that the identification mode is an online mode.

4. The speech recognition method based on switching between online and offline modes according to claim 1, characterized in that: The preprocessing of the speech to be recognized according to a preset preprocessing rule to obtain a corresponding preprocessed audio includes: According to the loudness threshold in the preprocessing rule, a corresponding valid audio segment is intercepted from the speech to be recognized; The effective audio segment is subjected to audio noise reduction processing according to the noise reduction frequency band in the preprocessing rule to obtain corresponding preprocessed audio.

5. The speech recognition method based on switching between online and offline modes according to claim 1, characterized in that: The step of recognizing the preprocessed audio according to the pre-stored local recognition model to obtain a corresponding speech recognition result includes: Converting the preprocessed audio into a corresponding audio spectrum according to a spectrum conversion rule in the local recognition model; Extracting corresponding audio features from the audio spectrum according to the spectrum feature extraction item in the local recognition model; The audio features are input into the neural network in the local recognition model to recognize the audio features and obtain corresponding speech recognition results.

6. The speech recognition method based on switching between online and offline modes according to claim 5, characterized in that: Before the pre-processed audio is recognized according to the pre-stored local recognition model to obtain the corresponding speech recognition result, the method further includes: Model training is performed on the neural network in the local recognition model according to a preconfigured training speech set to obtain a trained neural network.

7. The speech recognition method based on switching between online and offline modes according to claim 1, characterized in that: The step of generating audio data corresponding to the to-be-recognized speech according to preset online recognition configuration information includes: Acquire the authentication identifier in the online recognition configuration information and combine it with the voice to be recognized to obtain corresponding combined data information; The combined data information is encrypted according to the encryption key in the online recognition configuration information to obtain corresponding audio data.

8. A speech recognition device based on switching between online and offline modes, characterized in that: The speech recognition device applies the speech recognition method based on online and offline mode switching as described in any one of claims 1 to 7, and the speech recognition device includes a microphone, a main control chip, an offline recognition module, a network communication module and a radio frequency communication module; The main control chip establishes communication connections with the offline recognition module, the network communication module and the radio frequency communication module respectively; the offline recognition module is also communicated with a microphone.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer device executes the computer program, the speech recognition method based on switching between online and offline modes as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the speech recognition method based on switching between online and offline modes as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Voice control method and related device

    CN110740084A

  • Control method and device of intelligent equipment, electronic equipment and storage medium

    CN112037785A

  • Online and offline dual-mode voice control method and system and storage medium

    CN112735414A

  • Continuous voice instruction rapid identification control system

    CN114664303A

  • Methods and apparatus for hybrid speech recognition processing

    US20180197545A1

Cited By

  • Multi-mode collaborative off-line and on-line voice interaction method, system, equipment and medium

    CN120071937A