Language switching methods, devices, storage media, and electronic devices in applications
By utilizing keyword speech, user data, and environmental speech data within the application, the language version can be automatically identified and switched, solving the problem of low efficiency in language version switching in existing technologies and achieving intelligent and flexible language version management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-05-10
- Publication Date
- 2026-06-30
Smart Images

Figure CN116541117B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software development, and more specifically, to a language switching method, apparatus, storage medium, and electronic device in an application. Background Technology
[0002] In related technologies, domestic and international mobile banking apps (third-party smartphone applications) implement multi-language switching in the following ways: Mobile banking apps provide multiple language versions based on customer characteristics, such as Chinese, English, and local language versions. However, based on the system's default language version, customers need to log in to the mobile banking app and manually switch to other language versions in the settings, lacking an intelligent language switching mechanism. Switching between multiple language versions in mobile banking apps relies on manual intervention, resulting in low intelligence and flexibility, and inefficient language switching within the app.
[0003] There is currently no effective solution to the problem of low efficiency in switching language versions of applications in related technologies. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, storage medium, and electronic device for switching languages in an application, so as to solve the problem of low efficiency in switching language versions in related technologies.
[0005] To achieve the above objectives, according to one aspect of this application, a language switching method for an application is provided. The method includes: determining whether a user's keyword voice is received within a first preset time period after the target application is launched; if keyword voice is received, determining a first language version based on the keyword voice and switching the current language version of the target application to the first language version; if keyword voice is not received, determining whether user data is acquired within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; if user data is acquired, determining a second language version based on the user data and switching the current language version to the second language version; if user data is not acquired, acquiring target voice data in a target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is an environment within a preset distance of the device where the target application is located; determining a third language version based on the target voice data and switching the current language version to the third language version.
[0006] Optionally, before determining whether the user's keyword voice is received within a first preset time period after the target application is launched, the method further includes: launching the target application and detecting whether the target application has enabled language switching mode; if the target application has enabled language switching mode, performing the step of determining whether the user's keyword voice is received within the first preset time period; if the target application has not enabled language switching mode, receiving a language version switching instruction input by the user, and switching the current language version to a fourth language version based on the language version switching instruction.
[0007] Optionally, determining the first language version based on keyword speech includes: obtaining historical keyword speech for various language versions in the database of the target application; using each language version and the historical keyword speech corresponding to the language version as a set of first training samples to obtain multiple sets of first training samples; training an initial speech recognition model based on the multiple sets of first training samples to obtain a first speech recognition model; and inputting the keyword speech into the first speech recognition model to obtain the first language version.
[0008] Optionally, determining the second language version based on user data and switching the current language version to the second language version includes: determining whether the user's nationality information has been obtained; if the user's nationality information has been obtained, determining the second language version corresponding to the nationality information in the language version database based on the nationality information, and switching the current language version to the second language version; if the nationality information has not been obtained, determining the user's geographical location; determining the user's region based on the geographical location, determining the second language version corresponding to the user's region in the language version database based on the user's region, and switching the current language version to the second language version.
[0009] Optionally, before obtaining the user's nationality information, the method further includes: obtaining multiple language versions included in the target application, and determining the nationality and region of the user group using each language version; establishing a first association relationship between each language version and the nationality information corresponding to the nationality of the user group, and establishing a second association relationship between each language version and the region of the user group; and constructing a language version database based on the first and second association relationships.
[0010] Optionally, acquiring target voice data in the target environment within a third preset time period after the target application is launched includes: acquiring all voice data within a preset range of the device within the third preset time period through a preset voice acquisition module; determining the proportion of each type of voice data to all voice data to obtain a set of proportions; and determining the voice data with the highest proportion in the set of proportions as the target voice data.
[0011] Optionally, determining the third language version based on the target speech data includes: acquiring historical speech data for various language versions in the database of the target application; using each language version and the historical speech data corresponding to the language version as a set of second training samples to obtain multiple sets of second training samples; training an initial speech recognition model based on the multiple sets of second training samples to obtain a second speech recognition model; and inputting the target speech data into the second speech recognition model to obtain the third language version.
[0012] To achieve the above objectives, according to another aspect of this application, a language switching device for an application is provided. The device includes: a first determining unit, configured to determine whether a user's keyword voice is received within a first preset time period after the target application is launched; a first determining unit, configured to, if keyword voice is received, determine a first language version based on the keyword voice and switch the current language version of the target application to the first language version; a second determining unit, configured to, if keyword voice is not received, determine whether user data is acquired within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; a second determining unit, configured to, if user data is acquired, determine a second language version based on the user data and switch the current language version to the second language version; an acquiring unit, configured to, if user data is not acquired, acquire target voice data in a target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is an environment within a preset distance of the device where the target application is located; and a third determining unit, configured to, based on the target voice data, determine a third language version and switch the current language version to the third language version.
[0013] This application employs the following steps: determining whether user keyword voice is received within a first preset time period after the target application is launched; if keyword voice is received, determining a first language version based on the keyword voice and switching the current language version of the target application to the first language version; if no keyword voice is received, determining whether user data is acquired within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; if user data is acquired, determining a second language version based on the user data and switching the current language version to the second language version; if no user data is acquired, acquiring target voice data in the target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located; determining a third language version based on the target voice data and switching the current language version to the third language version, thus solving the problem of low efficiency in switching language versions in applications in related technologies. By identifying the language version that meets the user's needs through user keyword voice, user data, or target voice data, and realizing automatic language version switching in the application, the efficiency of language version switching in the application is improved. Attached Figure Description
[0014] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0015] Figure 1 This is a flowchart of a language switching method in an application provided according to an embodiment of this application;
[0016] Figure 2 This is a flowchart of an optional language switching method in an application provided according to an embodiment of this application;
[0017] Figure 3 This is a schematic diagram of a language switching device in an application provided according to an embodiment of this application;
[0018] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0023] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a language switching method in an application provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0024] Step S101: Determine whether the user's keyword voice is received within the first preset time period after the target application is launched.
[0025] Specifically, the language switching method provided in this application supports multiple intelligent switching modes. When the intelligent language version switching function is enabled, the language version of the application is automatically switched based on different conditions. The first mode can be switching based on keyword voice. First, it is determined whether the user's keyword voice is received within a first preset time after the target application is launched. If the keyword voice is not received, it means that the first mode is unavailable. For example, the target application can be a mobile banking application, the first preset time can be set to 1 minute, and the keyword voice can be "switch language". It is determined whether the user says "switch language" within 1 minute after the mobile banking application is launched.
[0026] Step S102: Upon receiving keyword speech, determine the first language version based on the keyword speech, and switch the current language version of the target application to the first language version.
[0027] Specifically, if a keyword voice message is received, it indicates that the first mode is available. At this point, the system automatically determines the matching first language version based on the captured keyword voice message and switches the current language version in the application to the first language version. For example, if the first language version is Chinese, the keyword voice message could be the voice keyword used by the user to wake up the phone, specifically "switch language." Once the phone captures the user's spoken "switch language" keyword voice message, it automatically switches the current voice version in the application to the Chinese version.
[0028] Step S103: If no keyword voice is received, determine whether user data has been obtained within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period.
[0029] Specifically, if no keyword voice is received within the first preset time period and the first language switching mode is unavailable, the second language switching mode is adopted. That is, it is determined whether the user's user data is obtained within the second preset time period after the target application is launched. The second preset time period can be set to 2 minutes. If the user data is not obtained within 2 minutes, it means that the second language switching mode is unavailable.
[0030] Step S104: If user data is obtained, determine the second language version based on the user data and switch the current language version to the second language version.
[0031] Specifically, if user data is acquired within 2 minutes, it indicates that the second language switching mode is available. At this point, the matching second language version is automatically determined based on the collected user data, and the application switches the current language version to the second language version. For example, user data could be the user's current geographical location, x, and the second language version, y. Once the phone acquires the user's geographical location x, it automatically switches the current language version in the application to the version y suitable for that location.
[0032] Step S105: If user data is not obtained, acquire target voice data in the target environment within a third preset duration after the target application is launched, wherein the third preset duration is longer than the second preset duration, and the target environment is the environment within a preset distance of the device where the target application is located.
[0033] Specifically, if no user data is acquired within the second preset time period and the second language switching mode is unavailable, a third language switching mode is adopted. This means acquiring target voice data in the target environment within a third preset time period after the target application is launched. The third preset time period can be 5 minutes. Target voice data within a 10-meter range of the mobile phone is collected within 5 minutes.
[0034] Step S106: Determine the third language version based on the target speech data, and switch the current language version to the third language version.
[0035] Specifically, based on the target speech data of the user's surrounding environment, the system matches the corresponding third language version and automatically switches the current speech version in the application to the language version corresponding to the target speech data.
[0036] It should be noted that the first language version, the second language version, and the third language version can be the same language version or different language versions.
[0037] The language switching method in an application provided in this application embodiment determines whether user keyword voice is received within a first preset time period after the target application is launched; if keyword voice is received, a first language version is determined based on the keyword voice, and the current language version of the target application is switched to the first language version; if no keyword voice is received, it determines whether user data is obtained within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; if user data is obtained, a second language version is determined based on the user data, and the current language version is switched to the second language version; if no user data is obtained, target voice data in the target environment is obtained within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located; a third language version is determined based on the target voice data, and the current language version is switched to the third language version. This solves the problem of low efficiency in switching language versions in related technologies. By identifying the language version that meets the user's needs through user keyword voice, user data, or target voice data, and realizing automatic language version switching in the application, the efficiency of language version switching in the application is improved.
[0038] Users can also choose not to enable the intelligent language version switching mode. Optionally, in the language switching method of the application provided in this application embodiment, before determining whether the user's keyword voice is received within a first preset time period after the target application is launched, the method further includes: launching the target application and detecting whether the target application has enabled the language switching mode; if the target application has enabled the language switching mode, performing the step of determining whether the user's keyword voice is received within a first preset time period; if the target application has not enabled the language switching mode, receiving the user's input language version switching instruction, and switching the current language version to the fourth language version based on the language version switching instruction.
[0039] Specifically, the product settings function confirms whether the application has started the automatic language version switching service based on the intelligent activation parameters. Some users can choose not to enable the intelligent language version switching function. By detecting whether the target application has enabled the language switching mode, if enabled, the language switching method in this embodiment is executed. If the language switching mode is not enabled, it detects whether a user's manual language version change instruction has been received, i.e., a language version switching instruction. Based on this language version switching instruction, the current language version in the application is switched to the fourth language version manually selected by the user. By providing a setting that allows users to choose whether to enable the language switching mode, diverse needs are met.
[0040] Optionally, in the language switching method of the application provided in this application embodiment, determining the first language version based on keyword speech includes: obtaining historical keyword speech of various language versions in the database of the target application; using each language version and the historical keyword speech corresponding to the language version as a set of first training samples to obtain multiple sets of first training samples; training an initial speech recognition model based on multiple sets of first training samples to obtain a first speech recognition model; and inputting the keyword speech into the first speech recognition model to obtain the first language version.
[0041] Specifically, the first speech recognition mode can adopt a hidden Markov model. By collecting the historical keyword voices of the user as the first training sample, the trained first speech recognition mode can input the collected keyword voice of the user into the first speech recognition model to obtain the first language version corresponding to the keyword voice. For example, when the customer opens / uses the target application, the corresponding language version can be switched through the keyword voice spoken by the customer. For example, if the keyword voice is "switch language", the first language version is the Chinese version; if the keyword voice is "切換語言" in Cantonese, the first language version is the Cantonese version; if the keyword voice is "switch language" in English, the first language version is the English version, etc. The first speech recognition model automatically switches the current language version of the target application to the first language version by recognizing the keyword voice, improving the switching efficiency of the language version.
[0042] Optionally, in the language switching method in the application provided in the embodiments of the present application, determining the second language version based on user data and switching the current language version to the second language version includes: determining whether the nationality information of the user is obtained; in the case where the nationality information of the user is obtained, determining the second language version corresponding to the nationality information in the language version database based on the nationality information, and switching the current language version to the second language version; in the case where the nationality information is not obtained, determining the geographical location of the user; determining the region where the user is located based on the geographical location, determining the second language version corresponding to the region where the user is located in the language version database based on the region where the user is located, and switching the current language version to the second language version.
[0043] Specifically, the second language switching mode requires constructing a language version database that associates user data with language versions in advance. For example, the user data can be the nationality information and geographical location of the user, etc. This mode matches according to the priority by obtaining the existing information of the user, that is, the user data. First, it judges whether there is nationality information in the user data. If there is, it matches the nationality information in the language version database, and selects the official language corresponding to the location of the nationality in the nationality information according to the general correspondence between nationality information and official languages. If the official language exists in the application, the official language is determined as the second language version. If there is no nationality information, it checks the geographical location of the user, judges the region to which the location belongs according to the location, and obtains the official language according to the region. If the official language exists in the application, the official language is determined as the second language version. Judgments are made in the order of the above priorities, and the background of the application automatically obtains the corresponding second language version in the language version database for automatic switching.
[0044] It should be noted that if the user data of the user cannot be obtained, the default language of the mobile system can also be matched, and the current language version of the application is switched to the default language.
[0045] Before using user data to determine the second language version, a language version database needs to be built. Optionally, in the language switching method in the application provided in this application embodiment, before obtaining the user's nationality information, the method further includes: obtaining multiple language versions included in the target application, and determining the nationality and region of the user group using each language version; establishing a first association relationship between each language version and the nationality information corresponding to the nationality of the user group, and establishing a second association relationship between each language version and the region of the user group; and building a language version database based on the first and second association relationships.
[0046] Specifically, based on the various language versions supported by the target application, the nationality and region of the user group using each language version are obtained, establishing a one-to-one correspondence between each language version and nationality and region information, i.e., a first association and a second association. A language version database is constructed based on the first and second associations. For this language version database, matching is performed in the order of first matching nationality information and then matching geographical location. Automatic language version switching is performed under suitable matching conditions, and user language usage habits are recorded to enrich the language version database. The algorithm is continuously optimized to improve the efficiency of language version recognition and switching. The constructed language version database provides a basis for matching user data.
[0047] The target voice data is determined based on the proportion of each type of voice data. Optionally, in the language switching method in the application provided in this application embodiment, obtaining the target voice data in the target environment within a third preset time period after the target application is launched includes: collecting all voice data within a preset range of the device within the third preset time period through a preset voice acquisition module; determining the proportion of each type of voice data in all voice data to obtain a set of proportions; and determining the voice data with the highest proportion in the set of proportions as the target voice data.
[0048] For example, a preset voice acquisition module automatically acquires the language system of the mobile phone's environment within 5 minutes of app usage, i.e., voice data, and autonomously switches to the language version based on the received environment language. The language system of the environment is collected through a virtual device on the mobile phone's hardware. The database backend uses a second voice recognition model to distinguish the language of each type of voice data and outputs the language. When recognizing the language, if all recognized voice data is in the same language, that language is returned as the target voice data. If all recognized voice data involves multiple languages, the proportion of each language's duration to the total duration of all voice data is calculated. For example, if the coverage of a certain language is greater than 50%, that language is returned as the target voice data. If the coverage is less than 50%, and the proportions of the languages involved are average or similar (with an error of about 10%), no target voice data is returned. The determined target voice data provides input samples for recognizing a third language version.
[0049] Optionally, in the language switching method of the application provided in this application embodiment, determining the third language version based on the target speech data includes: acquiring historical speech data of various language versions in the database of the target application; using each language version and the historical speech data corresponding to the language version as a set of second training samples to obtain multiple sets of second training samples; training an initial speech recognition model based on the multiple sets of second training samples to obtain a second speech recognition model; and inputting the target speech data into the second speech recognition model to obtain the third language version.
[0050] Specifically, the second speech recognition mode can adopt a hidden Markov model. By collecting users' historical speech data as the second training sample, the trained second speech recognition mode can be input into the second speech recognition model according to the collected target speech data to obtain a third language version corresponding to the target speech data.
[0051] According to another embodiment of this application, an optional language switching method in an application is also provided. Figure 2 This is a flowchart of an optional language switching method in an application provided according to an embodiment of this application. For example... Figure 2 As shown, the method includes:
[0052] When a customer opens or uses e-banking products, the system determines whether smart mode is being used. If not, the language is manually switched via traditional settings. If smart mode is being used, the system intelligently switches the language version in the order of Mode 1, Mode 2, and Mode 3. Mode 1 is a voice keyword wake-up switching mode; Mode 2 is a multi-dimensional automatic matching mode based on mobile phone information or customer information; and Mode 3 is a language environment adaptive mode.
[0053] For example, the voice keyword wake-up switching mode automatically switches based on language keywords. When the language keyword obtained by the e-banking product is "switch language" in Mandarin, the e-banking product's language version automatically switches to Chinese. When the language keyword obtained by the e-banking product is "switch language" in Cantonese, the e-banking product's language version automatically switches to Cantonese. When the language keyword obtained by the e-banking product is "switch language" in English, the e-banking product's language version automatically switches to English.
[0054] The multi-dimensional automatic matching mode for mobile phone information or customer information is based on matching the corresponding language version. If the customer information includes the mobile phone's default language, it first matches the default language and automatically switches the language version of the e-banking product to that language. If the customer information does not include the default language, and if the customer's nationality is included, the language version of the e-banking product is automatically switched to the official language corresponding to that nationality. If the customer information does not include the nationality, and if the customer's geographical location is included, it determines the customer's region and automatically switches the language version of the e-banking product to the official language corresponding to that region.
[0055] The language environment adaptive mode automatically acquires the language of the surrounding environment of the e-banking product within 10 minutes and automatically switches to the language version corresponding to the received environment language.
[0056] The optional language switching method in the application provided by the embodiments of this application improves the customer experience by using multiple language version switching modes, and enhances the automation and flexibility of language version switching in the application. This method is scalable for future expansion of product multi-language versions, other fields, or product service providers, and offers the convenience of decoupling and composability when using multiple language version switching modes.
[0057] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0058] This application also provides a language switching device for an application. It should be noted that the language switching device in this application can be used to execute the language switching method provided in this application. The following describes the language switching device in the application provided in this application.
[0059] Figure 3 This is a schematic diagram of a language switching device in an application provided according to an embodiment of this application. For example... Figure 3 As shown, the device includes:
[0060] The first judgment unit 10 is used to determine whether the user's keyword voice is received within a first preset time period after the target application is launched.
[0061] The first determining unit 20 is used to determine the first language version based on the keyword speech when the keyword speech is received, and to switch the current language version of the target application to the first language version.
[0062] The second judgment unit 30 is used to determine whether user data has been obtained within a second preset time period after the target application is launched if no keyword voice is received, wherein the second preset time period is longer than the first preset time period.
[0063] The second determining unit 40 is used to determine the second language version based on the user data when the user data is obtained, and to switch the current language version to the second language version.
[0064] The acquisition unit 50 is used to acquire target voice data in the target environment within a third preset time period after the target application is launched, in the absence of acquiring user data. The third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located.
[0065] The third determining unit 60 is used to determine the third language version based on the target speech data and switch the current language version to the third language version.
[0066] The language switching device in the application provided in this embodiment determines, through a first judgment unit 10, whether keyword voice input from the user is received within a first preset time period after the target application is launched; a first determination unit 20, if keyword voice input is received, determines a first language version based on the keyword voice input and switches the current language version of the target application to the first language version; a second judgment unit 30, if keyword voice input is not received, determines whether user data is obtained within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; and a second determination unit 40, if user data is obtained, determines a second language version based on the user data and switches the current language version to the first language version. The system includes two language versions; an acquisition unit 50, which, in the absence of user data, acquires target voice data in the target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located; and a third determination unit 60, which determines a third language version based on the target voice data and switches the current language version to the third language version. This solves the problem of low efficiency in switching language versions in applications in related technologies. By identifying the language version that meets the user's needs through the user's keyword voice or user data, or target voice data, and realizing automatic switching of language versions in the application, the system achieves the effect of improving the efficiency of language version switching in the application.
[0067] Optionally, in the language switching device provided in the application embodiment of this application, the device further includes: a startup unit, used to start the target application and detect whether the target application has enabled the language switching mode; an execution unit, used to perform the step of determining whether the user's keyword voice is received within a first preset time period when the target application has enabled the language switching mode; and a receiving unit, used to receive the user's input language version switching instruction when the target application has not enabled the language switching mode, and switch the current language version to a fourth language version based on the language version switching instruction.
[0068] Optionally, in the language switching device of the application provided in this application embodiment, the first determining unit 20 includes: a first acquiring module, used to acquire historical keyword speech of various language versions in the database of the target application; a first sample determining module, used to take each language version and the historical keyword speech corresponding to the language version as a set of first training samples to obtain multiple sets of first training samples; a first training module, used to train an initial speech recognition model based on multiple sets of first training samples to obtain a first speech recognition model; and a first input module, used to input keyword speech into the first speech recognition model to obtain a first language version.
[0069] Optionally, in the language switching device of the application provided in this application embodiment, the second determining unit 40 includes: a determining module, used to determine whether the user's nationality information is obtained; a first determining module, used to determine the second language version corresponding to the nationality information in the language version database based on the nationality information if the user's nationality information is obtained, and switch the current language version to the second language version; a second determining module, used to determine the user's geographical location if the nationality information is not obtained; and a third determining module, used to determine the user's region based on the geographical location, determine the second language version corresponding to the user's region in the language version database based on the user's region, and switch the current language version to the second language version.
[0070] Optionally, in the language switching device in the application provided in this application embodiment, the device further includes: a fourth determining unit, configured to acquire multiple language versions included in the target application, and determine the nationality and region of the user group using each language version; an establishing unit, configured to establish a first association relationship between each language version and the nationality information corresponding to the nationality of the user group, and establish a second association relationship between each language version and the region of the user group; and a constructing unit, configured to construct a language version database based on the first and second association relationships.
[0071] Optionally, in the language switching device of the application provided in this application embodiment, the acquisition unit 50 includes: a acquisition module, used to acquire all voice data within a preset range of the device within a third preset duration through a preset voice acquisition module; a fourth determination module, used to determine the proportion of each type of voice data to all voice data, and obtain a set of proportions; and a fifth determination module, used to determine the voice data with the highest proportion in the set of proportions as the target voice data.
[0072] Optionally, in the language switching device of the application provided in this application embodiment, the third determining unit 60 includes: a second acquisition module, used to acquire historical speech data of various language versions in the database of the target application; a second sample determining module, used to take each language version and the historical speech data corresponding to the language version as a set of second training samples to obtain multiple sets of second training samples; a second training module, used to train an initial speech recognition model based on multiple sets of second training samples to obtain a second speech recognition model; and a second input module, used to input the target speech data into the second speech recognition model to obtain a third language version.
[0073] The language switching device in the application includes a processor and a memory. The first judgment unit 10, the first determination unit 20, the second judgment unit 30, the second determination unit 40, the acquisition unit 50, and the third determination unit 60 are all stored in the memory as program units. The processor executes the program units stored in the memory to implement the corresponding functions.
[0074] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the efficiency of language version switching in applications.
[0075] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0076] This invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a language switching method in an application.
[0077] This invention provides a processor for running a program, wherein the program executes a language switching method within the application.
[0078] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. For example... Figure 4 As shown, the electronic device 401 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: determining whether user keyword voice is received within a first preset time period after the target application is launched; if keyword voice is received, determining a first language version based on the keyword voice and switching the current language version of the target application to the first language version; if keyword voice is not received, determining whether user data is acquired within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; if user data is acquired, determining a second language version based on the user data and switching the current language version to the second language version; if user data is not acquired, acquiring target voice data in the target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located; determining a third language version based on the target voice data and switching the current language version to the third language version. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0079] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program comprising the following steps: determining whether a user's keyword voice is received within a first preset time period after the target application is launched; if keyword voice is received, determining a first language version based on the keyword voice and switching the current language version of the target application to the first language version; if keyword voice is not received, determining whether user data is acquired within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period; if user data is acquired, determining a second language version based on the user data and switching the current language version to the second language version; if user data is not acquired, acquiring target voice data in a target environment within a third preset time period after the target application is launched, wherein the third preset time period is longer than the second preset time period, and the target environment is an environment within a preset distance of the device where the target application is located; determining a third language version based on the target voice data and switching the current language version to the third language version.
[0080] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0081] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0082] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0083] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0084] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0085] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0086] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0087] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0088] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0089] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A language switching method in an application program, characterized by, include: Determine whether the user's keyword voice is received within the first preset time after the target application is launched; Upon receiving the keyword speech, the first language version is determined based on the keyword speech, and the current language version of the target application is switched to the first language version; The method of determining the first language version based on the keyword speech includes: obtaining historical keyword speech for various language versions in the database of the target application; using each language version and the historical keyword speech corresponding to the language version as a first training sample to obtain multiple sets of first training samples; training an initial speech recognition model based on the multiple sets of first training samples to obtain a first speech recognition model; and inputting the keyword speech into the first speech recognition model to obtain the first language version. If the keyword voice is not received, determine whether the user's user data is obtained within a second preset time period after the target application is launched, wherein the second preset time period is longer than the first preset time period, and the user data includes: the user's nationality information and geographical location; If the user data is obtained, a second language version is determined based on the user data, and the current language version is switched to the second language version; In the absence of the user data, target voice data in the target environment within a third preset duration after the target application is launched is obtained, wherein the third preset duration is longer than the second preset duration, and the target environment is the environment within a preset distance of the device where the target application is located; A third language version is determined based on the target speech data, and the current language version is switched to the third language version.
2. The method of claim 1, wherein, Before determining whether the user's keyword voice is received within a first preset time period after the target application is launched, the method further includes: Launch the target application and check whether the target application has enabled language switching mode; When the target application enables the language switching mode, the step of determining whether the user's keyword voice is received within a first preset time period is executed. If the target application does not enable the language switching mode, the system receives the user's input language version switching instruction and switches the current language version to the fourth language version based on the language version switching instruction.
3. The method of claim 1, wherein, Determining a second language version based on the user data and switching the current language version to the second language version includes: Determine whether the user's nationality information has been obtained; If the user's nationality information is obtained, a second language version corresponding to the nationality information is determined in the language version database based on the nationality information, and the current language version is switched to the second language version; Without obtaining the nationality information, determine the user's geographical location; Based on the geographical location, the user's region is determined, and based on the user's region, a second language version corresponding to the user's region is determined in the language version database, and the current language version is switched to the second language version.
4. The method of claim 3, wherein, Before obtaining the user's nationality information, the method further includes: Obtain the multiple language versions included in the target application, and determine the nationality and region of the user group using each language version; Establish a first association between each language version and the nationality information corresponding to the nationality of the user group, and establish a second association between each language version and the region where the user group is located; The language version database is constructed based on the first association and the second association.
5. The method of claim 1, wherein, Acquiring target speech data in the target environment within a third preset time period after the target application is launched includes: The device collects all voice data within a preset range of the third preset duration using a preset voice acquisition module. Determine the proportion of each type of voice data to all the voice data to obtain a set of proportions; The voice data with the highest proportion in the set of proportions is determined as the target voice data.
6. The method according to claim 1, characterized in that, Determining the third language version based on the target speech data includes: Obtain historical voice data for various language versions from the database of the target application; Each language version and the historical speech data corresponding to that language version are used as a set of second training samples to obtain multiple sets of second training samples. The initial speech recognition model is trained based on the multiple sets of second training samples to obtain the second speech recognition model; The target speech data is input into the second speech recognition model to obtain a third language version.
7. A language switching device in an application, characterized in that, include: The first judgment unit is used to determine whether the user's keyword voice is received within a first preset time period after the target application is launched. The first determining unit is configured to, upon receiving the keyword speech, determine a first language version based on the keyword speech, and switch the current language version of the target application to the first language version; The first determining unit includes: a first acquisition module, configured to acquire historical keyword speech of various language versions in the database of the target application; a first sample determining module, configured to take each language version and the historical keyword speech corresponding to the language version as a set of first training samples to obtain multiple sets of first training samples; a first training module, configured to train an initial speech recognition model based on the multiple sets of first training samples to obtain a first speech recognition model; and a first input module, configured to input the keyword speech into the first speech recognition model to obtain the first language version. The second judgment unit is used to determine whether user data has been obtained within a second preset time period after the target application is launched if the keyword voice is not received. The second preset time period is longer than the first preset time period. The user data includes: the user's nationality information and geographical location. The second determining unit is configured to, upon obtaining the user data, determine a second language version based on the user data and switch the current language version to the second language version; The acquisition unit is used to acquire target voice data in the target environment within a third preset time period after the target application is launched, in the absence of acquiring the user data, wherein the third preset time period is longer than the second preset time period, and the target environment is the environment within a preset distance of the device where the target application is located; The third determining unit is used to determine a third language version based on the target speech data and switch the current language version to the third language version.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein the program, when running, controls the device where the non-volatile storage medium resides to execute the language switching method in the application according to any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the language switching method in the application according to any one of claims 1 to 6.