Language setting method and device, electronic equipment and storage medium
By extracting the language information from the environmental images and sound signals of the terminal device, and matching it with the regional language, the language settings of the terminal device are automatically switched, which solves the problem of users needing to manually adjust language settings in different regions, and improves the user experience and system level of intelligence.
Patent Information
- Application Number
- CN202411374424.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, terminal devices need to manually adjust the interface language when used in different regions, resulting in a decrease in user experience.
By obtaining the environmental characteristics and location information of the terminal device, the text identification in the environmental image and the text information in the environmental sound signal to determine the corresponding language type, and match the regional language to automatically switch the language settings of the terminal equipment.
It improves the accuracy of automatic language matching for terminal devices in different regions, simplifies user operation steps, and improves user experience and system intelligence.
Smart Images

Figure CN119356776A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of language processing, and in particular to a language setting method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of transportation, international travel has become more and more popular among residents in various regions. In related technologies, since the device system binds the language configuration to the sales region by default, users must manually adjust the interface language of the terminal device to match the current region when using the terminal device in other regions, thereby reducing the user experience. Summary of the invention
[0003] The present application provides a language setting method, device, electronic device and storage medium, which aims to perform real-time dynamic control on electronic devices, thereby improving driving safety. The technical solution is as follows:
[0004] In a first aspect, the present application provides a language setting method, comprising: obtaining environmental feature data of a terminal device and location information of the terminal device, the environmental feature data comprising an environmental image and an environmental sound signal; extracting a text mark from the environmental image, determining a first language type corresponding to the text mark, converting the environmental sound signal into text information, and determining a second language type corresponding to the text information; determining a regional location of the terminal device based on the location information, and obtaining a regional language corresponding to the regional location; if the first language type and the second language type are respectively the same as the language type of the regional language, switching the language of the terminal device based on the regional language.
[0005] In the above technical solution, by extracting text logos from environmental images and determining the corresponding first language type, it is helpful to quickly identify the main language in the visual environment. At the same time, the environmental sound signal is converted into text information and the second language type is determined, so as to capture the dominant language in the auditory environment. Based on the location information of the terminal device, it is possible to accurately determine the regional location of the terminal device and obtain the regional language corresponding to the region. When the identified first language type and second language type are consistent with the regional language, it automatically switches to the regional language, thereby improving the accuracy of automatic language matching of the terminal device in different regions.
[0006] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, text symbols are extracted from the environment image and the first language type corresponding to the text symbols is determined, including: converting the environment image into an environment grayscale image, performing edge detection on the environment grayscale image to obtain edge pixels corresponding to each text in the environment grayscale image; generating a text contour image based on the edge pixels corresponding to each text; extracting the text symbol from the text contour image, and determining the first language type corresponding to the text symbol.
[0007] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, a text mark is extracted from a text outline image, and a first language type corresponding to the text mark is determined, including: converting the text mark into editable text; matching the editable text with a preset language feature library to obtain the language type corresponding to the editable text, and determining the language type as the first language type.
[0008] In the above technical solution, a clear text contour image is generated by converting the environment image into a grayscale image and performing edge detection, and extracting the edge pixels of the text. This step not only simplifies the complexity of image processing, but also improves the accuracy of text recognition. Secondly, the text logo is extracted from the text contour image and its corresponding first language type is determined, so that the system can automatically recognize and adapt to different language environments. Finally, the text logo is converted into editable text and matched with the preset language feature library to further verify and confirm the language type, ensuring the accuracy and reliability of the recognition result.
[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, converting the ambient sound signal into text information and determining the second language type corresponding to the text information include: performing noise reduction processing and noise filtering on the ambient sound signal to extract a human voice signal from the ambient sound signal; converting the human voice signal into text information; inputting the text information into a preset language feature library to obtain the language type corresponding to the text information, and determining the text type as the second language type.
[0010] In the above technical solution, by performing noise reduction processing and noise filtering on the ambient sound signal, a clear human voice signal can be effectively extracted, reducing the interference of background noise, thereby improving the accuracy and reliability of speech recognition. Secondly, converting the human voice signal into text information can speed up subsequent information retrieval and data analysis. By inputting the text information into a preset language feature library for matching analysis, the language type used in the text can be automatically identified and determined, and it can be marked as a second language type, thereby further improving the recognition accuracy of the language type.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the regional location of the terminal device is determined based on the location information, and the regional language corresponding to the regional location is obtained, including: determining the target location set to which the location information belongs in the location set of each region, and determining the target area corresponding to the target location set as the regional location of the terminal device; matching the regional location with a preset regional language information library to determine the regional language corresponding to the regional location.
[0012] In the above technical solution, by determining the target location set to which the location information of the terminal device belongs in the location set of each area, the specific geographical area where the device is located can be quickly and accurately identified, thereby speeding up the subsequent process processing speed; secondly, the regional location is matched with the preset regional language information library, which can automatically determine the main language of the area, avoiding manual settings by users, thereby improving the user experience.
[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the language of the terminal device is switched based on the regional language, including: generating language prompt information based on the regional language; obtaining an operation instruction of the user of the terminal device for the language prompt information; if the operation instruction is a confirmation instruction, applying the regional language to the terminal device.
[0014] In combination with the first aspect and the above implementations, in some possible implementations, the method further includes: if the operation instruction is a cancel instruction, obtaining a custom regional language manually selected by the user; and applying the custom regional language to the terminal device.
[0015] In the above technical solution, by obtaining the terminal device user's operating instructions for the language prompt information, it is possible to respond to the user's preferences and needs in real time, thereby improving the system's interactivity and user experience. Secondly, if the user confirms the regional language automatically recommended by the system, the language setting is quickly applied, which simplifies the user's operating steps and improves efficiency. In addition, if the user chooses to cancel the system-recommended language and manually selects a custom regional language, the user is allowed to make personalized settings according to his or her preferences, thereby meeting the user's personalized needs. The entire process combines automatic recommendation and manual selection, which not only improves the intelligence level of the system, but also takes into account the user's personalized needs, making the language setting of the terminal device more efficient and convenient.
[0016] In a second aspect, the present application provides a language setting device, comprising:
[0017] A data acquisition unit, used to acquire environmental feature data of a terminal device and location information of the terminal device, wherein the environmental feature data includes an environmental image and an environmental sound signal;
[0018] A type analysis unit, used to extract a text mark from the environment image, determine a first language type corresponding to the text mark, convert the environment sound signal into text information, and determine a second language type corresponding to the text information;
[0019] A location matching unit, used to determine the regional location of the terminal device based on the location information, and obtain the regional language corresponding to the regional location;
[0020] The type matching unit is used to switch the language of the terminal device based on the regional language if the first language type and the second language type are respectively the same as the language type of the regional language.
[0021] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, any of the above language setting methods is implemented.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed, any of the above language setting methods is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 is a system architecture diagram of a language setting method provided in an embodiment of the present application;
[0025] Figure 2 is a flow chart of a language setting method provided in an embodiment of the present application;
[0026] Figure 3 is a scenario diagram of a language setting method provided in an embodiment of the present application;
[0027] Figure 4 is a flow chart of a language setting method provided in an embodiment of the present application;
[0028] Figure 5 is a scenario diagram of a language setting method provided in an embodiment of the present application;
[0029] Figure 6 is a flow chart of a language setting method provided in an embodiment of the present application;
[0030] Figure 7 is a flow chart of a language setting method provided in an embodiment of the present application;
[0031] Figure 8 is a flow chart of a language setting method provided in an embodiment of the present application;
[0032] Fig. 9 is a structural diagram of a language setting device provided in an embodiment of the present application;
[0033] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0035] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0036] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0037] In the related art, when the terminal device is sold to other countries and regions and purchased by users, the users need to manually adjust the interface language. However, manually adjusting the language setting increases the difficulty and inconvenience of use for the users. Secondly, if the device is reset to the default language by the user, the user needs to manually set it again, which affects the user's actual experience.
[0038] In order to improve the execution efficiency of the terminal device, the embodiment of the present application provides a language setting method, and the execution subject of the language setting method is a terminal device, wherein the terminal device can be a vehicle, a mobile phone, a mobile computer, and a smart wearable device. The following are detailed descriptions respectively. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Please refer to Figure 1 , Figure 1 : is a system architecture diagram of a language setting method provided in an embodiment of the present application. The specific process of the language setting method can be as follows:
[0039] Figure 1It is a system architecture diagram of a language setting method provided in an embodiment of the present application.
[0040] It should be noted that the execution module in this solution includes but is not limited to the global positioning system (GPS): a group of satellites operating in the earth's orbit send radio signals to ground receivers, and the receivers calculate the three-dimensional position, speed and time information of the terminal device based on the radio signals. Data acquisition equipment, in this embodiment, the data acquisition equipment includes but is not limited to image acquisition equipment and audio acquisition equipment. The image acquisition equipment can be a camera or a scanner that can be used to capture visual information in the real world and convert it into a digital signal to generate processable image data; the audio acquisition equipment is used to capture the sound signal in the real scene and convert it into an electronic signal. The display component is responsible for displaying the processed data and information in the terminal device in the form of images, texts and videos. ECU (Electronic Control Unit): It is the core computing module in the terminal device, responsible for running and managing the data communication interaction system, including but not limited to CAN (Controller Area Network), LIN (Local Internet) and Ethernet. ECU can realize data exchange and control instruction transmission between the terminal device and the local server or cloud server through the communication protocol.
[0041] It should be noted that when the terminal device is factory set up, the relevant operator will set the initial longitude and latitude of the terminal device according to the production location of the terminal device, that is, the initial position of the terminal device corresponds to the position corresponding to the production location.
[0042] Specifically, when it is detected that the terminal device is turned on, the current longitude and latitude information of the terminal device is obtained through the GPS of the terminal device, and then the currently obtained longitude and latitude information is matched with the initial position recorded by the terminal device to detect whether the current location of the terminal device has changed. If it is detected that the location of the terminal device has changed, when the terminal device is in use and the user's privacy is authorized, the environmental image data of the terminal device is obtained through the built-in image acquisition device, and the environmental sound signal of the terminal device is obtained through the built-in audio acquisition device.
[0043] Further edge detection is performed on the environmental grayscale image to identify the edge pixels corresponding to the text area in the environmental grayscale image. Based on the edge pixels of the text area, a text contour image is automatically generated, so that the shape of each text can be clearly displayed. The text mark is extracted from the text contour image, and matched with a preset language feature library to determine the first language type corresponding to the text mark, wherein the preset language feature library is a pre-built database containing feature information of multiple languages, wherein the feature information includes alphabets, character sets, grammatical structures, common vocabulary, spelling rules and other unique attributes related to a specific language. The main purpose of the language feature library is to provide a reference standard for language recognition and processing so that different languages can be accurately recognized and distinguished. Finally, the electronic control unit converts the text mark into editable text and matches it with the language feature library again to accurately identify the first language type corresponding to the editable text. The above process realizes the function of automatically extracting text from the environmental image and determining its language type by combining image processing technology and language recognition technology.
[0044] At the same time, the electronic control unit performs noise reduction and noise filtering on the captured ambient sound signal to eliminate the interference of background noise, so as to accurately extract the human voice signal. The electronic control unit will then convert the extracted human voice signal into text information through the speech recognition module, and input the converted text information into the preset language feature library for matching analysis to determine the language type corresponding to the text information and use it as the second language type.
[0045] The precise location information of the device is obtained through the built-in GPS or other positioning system of the terminal device, and the specific regional location of the terminal device is further determined through the location information. In this process, the electronic control unit will filter out the corresponding target location set from a predefined regional location set according to the actual location information of the terminal device, and determine the specific geographical area represented by the target location set as the current regional location of the terminal device, and at the same time obtain the regional language used in the current regional location from the preset language package.
[0046] The first language type, the second language type, and the language type corresponding to the regional language are matched. If the matching result shows that the language types are the same, the regional language is used as the system language of the terminal device.
[0047] based on Figure 1 The system architecture diagram shown below will be combined with Figure 2-Figure 7 , a language setting method provided in an embodiment of the present application is introduced in detail. In order to illustrate the present solution, the following description will be expanded using a vehicle as a terminal device.
[0048] Based on the above situation, the present application embodiment proposes a language setting method. Figure 2 , Figure 2 is a flow chart of a language setting method provided in an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps S101-S104.
[0049] S101, obtaining environmental feature data of a terminal device and location information of the terminal device.
[0050] In an embodiment of the present application, environmental feature data includes environmental images and environmental sound signals, wherein environmental images refer to visual information of the surrounding environment captured by an image acquisition device, including but not limited to various visual elements such as buildings, roads, and people; environmental sound signals refer to sound information of the surrounding environment captured by an audio acquisition device, including human voices and equipment noise, etc.; and location information refers to the longitude and latitude information after the terminal device is globally positioned by the GPS of the terminal device.
[0051] Specifically, when the terminal device first enters the startup state, it will apply to the user for privacy permissions for image and sound collection through the display component. After detecting that the user has authorized the terminal device, the terminal device will enable the image acquisition device and the audio acquisition device through background calls based on the preset interval time to obtain the environmental image and environmental sound signal of the terminal device. At the same time, when the terminal device turns on the GPS function, the terminal device will simultaneously receive signals from GPS satellites. The GPS receiver of the terminal device calculates the distance between the device and the signal transmitter by measuring the propagation time of the signal. Since the receiver receives signals from multiple signal transmitters at the same time, the longitude and latitude information of the terminal device can be calculated through triangulation positioning, and the longitude and latitude information is determined as the location information of the terminal device.
[0052] S102, extracting a text mark from the environment image, determining a first language type corresponding to the text mark, converting the environment sound signal into text information, and determining a second language type corresponding to the text information.
[0053] Specifically, a filtering noise reduction algorithm is used to filter the noise in the environmental image, such as electronic noise or ambient light interference, and the environmental image after noise filtering is converted into an environmental grayscale image, where the environmental grayscale image only contains brightness information to achieve the effect of improving data processing speed. Then, edge detection is performed on the environmental grayscale image, where edge detection is an algorithm that identifies changes in pixel intensity in an image and aims to identify edge pixels in the text area. After edge detection is completed, a text contour image will be automatically generated based on the edge pixels of the text area, and the shape of each text will be highlighted in the text contour image to improve the accuracy of text recognition.
[0054] Further, a text mark is extracted from the text outline image, wherein the text mark is the basic unit of text, which can be a single character or a group of characters. After the text mark is extracted, it is matched through a preset language feature library, wherein the language feature library is a comprehensive database containing detailed feature information of multiple languages including but not limited to alphabets, character sets, grammatical structures, common vocabulary, spelling rules and other attributes. By comparing the text mark with the information in the language feature library one by one, the first language type corresponding to the text mark is accurately determined. At the same time, in order to further verify the recognition result, the extracted text mark is converted into an editable text format and matched with the language feature library again for verification. By comprehensively applying image processing technology and language recognition technology, the technical effect of automatically extracting text from complex environmental images and accurately determining the language type of editable text is achieved.
[0055] The captured ambient sound signal is subjected to noise reduction processing, such as adaptive filtering, wavelet transform, etc., to eliminate the ambient background noise and highlight the human voice signal. The human voice signal after noise reduction processing is converted into text information through the built-in speech recognition module of the terminal device to identify the words and sentences in the human voice, and the words or sentences are converted into text information and input into the preset language feature library for matching analysis, so as to accurately determine the language type corresponding to the text information and use it as the second language type.
[0056] S103, determining the regional location of the terminal device based on the location information, and acquiring the regional language corresponding to the regional location.
[0057] Specifically, the terminal device obtains information such as the longitude, latitude, and altitude of the terminal device through the built-in GPS, and uses the longitude, latitude, and altitude as the location information of the terminal device, and further searches for the area corresponding to the location information in a predefined regional location set, wherein the regional location set contains the longitude and latitude information of multiple geographical areas. According to the location information of the terminal device, a corresponding target location set is screened out from the regional location set, wherein the target location set is composed of a series of geographical location points. The regional language used by the current regional location is searched in a preset language package, wherein the language package is a database containing multiple language resources, and each language has its corresponding translation file and localization settings. By searching the language package, the regional language corresponding to the regional location can be determined.
[0058] S104: If the first language type and the second language type are respectively the same as the language type of the regional language, then switching the language of the terminal device is performed based on the regional language.
[0059] Specifically, check whether the first language type and the second language type are the same as the language type of the regional language. If the first language type or the second language type is the same as the regional language, set the default language of the terminal device to the regional language, thereby reducing the need for users to manually set the language, thereby improving the user experience.
[0060] Exemplarily, if the first language type and the second language type are English, and the language type of the regional language is also English, English is set as the default language of the terminal device.
[0061] Please also read Figure 3 , Figure 3 Schematic diagram of a language setting method provided in an embodiment of the present application. Figure 3 As shown, the terminal device is a vehicle, wherein the vehicle is equipped with an image acquisition device for acquiring environmental image data of the vehicle. At the same time, there are multiple sound acquisition devices in the vehicle for acquiring environmental sound signals inside or outside the vehicle in real time.
[0062] As can be seen from the above, by extracting text logos from environmental images and determining their corresponding first language type, it is helpful to quickly identify the main language in the visual environment. At the same time, the environmental sound signal is converted into text information and the second language type is determined to capture the dominant language in the auditory environment. Based on the location information of the terminal device, it is possible to accurately determine the regional location of the terminal device and obtain the regional language corresponding to the region. When the identified first language type and second language type are consistent with the regional language, they are automatically switched to the regional language, thereby improving the accuracy of automatic language matching of the terminal device in different regions.
[0063] Since there is a lot of redundant data in the image, it will affect the subsequent processing speed, so the image needs to be processed. Figure 4 , Figure 4 is a flow chart of a language setting method provided in an embodiment of the present application. Figure 4 As shown, the method of the embodiment of the present application may include the following steps S201-S205.
[0064] S201, converting the environment image into an environment grayscale image, performing edge detection on the environment grayscale image to obtain edge pixels corresponding to each character in the environment grayscale image.
[0065] Specifically, by converting a color environment image into an environment grayscale image, the complexity of data processing is simplified, thereby reducing the amount of data to be processed and improving the speed and efficiency of processing. By calling a preset edge detection algorithm, such as the Canny edge detection algorithm, edge detection is performed on the environment grayscale image to identify the edge pixels of the text area in the environment grayscale image, and then the gradient change of each pixel in the environment grayscale image is calculated to identify the edge of each text in the environment grayscale image. For example, in an environment image containing a store sign, the edge detection algorithm can identify the outline of the text on the sign, such as the edge pixels of the words "coffee shop".
[0066] S202, generating a character outline image based on edge pixels corresponding to each character.
[0067] Specifically, a preset contour tracking algorithm is used to obtain adjacent edge pixels within a preset range of each edge pixel, and pixels are connected to generate a continuous pixel contour line, and the generated contour line is converted into a text contour image, wherein the text contour is represented by white and the background is represented by black, that is, the area with pixel values higher than the preset pixel threshold is set to white, and the area with pixel values lower than the preset pixel threshold is set to black.
[0068] For example, there is an environmental grayscale image containing the four characters "Welcome". Through the edge detection algorithm, the edge pixels of each character in the environmental grayscale image are identified. For example, the outer contour and the edge of the internal strokes of the character "Huan" are connected to form a continuous contour line, and finally a text contour image is generated. In the text contour image, the four characters "Welcome" are white and the background is black.
[0069] S203: extracting a text mark from the text outline image, and determining a first language type corresponding to the text mark.
[0070] Specifically, through the text segmentation technology, the single text or character in the text outline image is segmented. Then, for each segmented text part, key information such as shape features, line direction, structural characteristics, etc. is extracted as feature data, and the extracted feature data is identified and matched, so as to obtain the specific content of the text to form a text mark. The text mark is compared and analyzed in detail with the preset language feature library, that is, by analyzing the character composition, grammatical structure, common phrase collocation and many other aspects of the text mark, it is determined which language in the language feature library has the most similar features, and based on the matching results, the first language type corresponding to the text mark is accurately obtained.
[0071] S204, converting the text mark into editable text.
[0072] S205: Match the editable text with a preset language feature library to obtain a language type corresponding to the editable text, and determine the language type as a first language type.
[0073] Specifically, in S204-S205, the extracted text mark is converted into an editable text format through a character recognition algorithm, and the editable text is compared and analyzed with a preset language feature library, wherein the language feature library contains typical features of multiple languages, such as vocabulary, grammatical structure, and punctuation usage habits. By matching the vocabulary, sentence structure, and language features of the editable text with the language feature library, the language type corresponding to the language feature library can be identified.
[0074] For example, the editable text obtained by conversion is "Bonjour, comment va", the system will compare this text with multiple languages in the language feature library. By identifying the French vocabulary and grammatical structure in the text, the system determines that the language type corresponding to this text is French, and uses French as the first language type. In this process, the character recognition algorithm and the language feature matching algorithm are combined to realize the automation process from text identification to language type determination, ensuring the accuracy and efficiency of language recognition.
[0075] Please also read Figure 5 , Figure 5 Schematic diagram of a language setting method provided in an embodiment of the present application. Figure 5 As shown, there is information of elements such as vegetation, roads and road signs in the environmental grayscale image. The pixel contours of the text in the road signs are obtained by using a preset contour tracking algorithm on the environmental grayscale image, and the pixel contours of the text are connected to generate continuous pixel contour lines, thereby obtaining a text contour image. In this image, the color of the pixels in the area of "Slow down at the intersection ahead" is white, that is, the pixel value of this area is greater than the preset pixel threshold.
[0076] As can be seen from the above, by converting the environment image into a grayscale image and performing edge detection, and extracting the edge pixels of the text, a clear text contour image is generated. This step not only simplifies the complexity of image processing, but also improves the accuracy of text recognition. Secondly, the text logo is extracted from the text contour image and its corresponding first language type is determined, so that the system can automatically recognize and adapt to different language environments. Finally, the text logo is converted into editable text and matched with the preset language feature library to further verify and confirm the language type, ensuring the accuracy and reliability of the recognition results.
[0077] Since a large amount of noise signals will be collected when collecting sound signals, which will affect the accuracy of data recognition, it is necessary to enhance the sound signals. Figure 6 , Figure 6 is a flow chart of a language setting method provided in an embodiment of the present application. Figure 6 As shown, the method of the embodiment of the present application may include the following steps S301-S304.
[0078] S301, converting the ambient sound signal into text information, and determining a second language type corresponding to the text information.
[0079] Specifically, please refer to the above S102 for S301, which will not be described in detail here.
[0080] S302: Perform noise reduction processing and noise filtering on the ambient sound signal to extract a human voice signal from the ambient sound signal.
[0081] Specifically, the captured sound signal is subjected to noise reduction processing, wherein the noise reduction processing may include frequency domain filtering, time domain filtering, adaptive filtering, etc., to reduce or eliminate the interference of background noise. For example, an adaptive filter can be used to dynamically adjust the filtering parameters according to the characteristics of the noise to remove specific types of noise to ensure that only the human voice signal is retained. Among them, noise filtering involves wavelet transform, independent component analysis, etc., which can make the extracted human voice signal clearer by separating signal components of different frequencies and phases.
[0082] Exemplarily, the ambient sound signals captured by the terminal device are a variety of sound signals such as the sound of customers' conversations, background music, and equipment noise. Through noise reduction processing and noise filtering, the background music and equipment noise are removed, and only the human voice signals of customers' conversations are retained, thereby improving the accuracy of speech recognition and user experience.
[0083] S303, converting the human voice signal into text information.
[0084] S304: Input the text information into a preset language feature library to obtain a language type corresponding to the text information, and determine the text type as a second language type.
[0085] Specifically, in S303-S304, after detecting that the human voice signal is converted into text information, the text information is input into a preset language feature library for comparison and analysis, wherein the language feature library contains typical features of multiple languages, such as vocabulary, grammatical structure, punctuation marks, etc. By comparing the vocabulary, sentence structure and language features in the text information with the language feature library one by one, the language type used in the text information can be identified.
[0086] Exemplarily, the text information is "Wie geht es Ihnen". By comparing this text information with multiple languages in the language feature library and identifying German vocabulary and grammatical structures, it is determined that the language type corresponding to the text information is German, and German is marked as the second language type.
[0087] As can be seen from the above, by performing noise reduction and noise filtering on the ambient sound signal, a clear human voice signal can be effectively extracted, reducing the interference of background noise, thereby improving the accuracy and reliability of speech recognition. Secondly, converting the human voice signal into text information can speed up subsequent information retrieval and data analysis. By inputting the text information into a preset language feature library for matching analysis, the language type used in the text can be automatically identified and determined, and it can be marked as a second language type, thereby further improving the recognition accuracy of the language type.
[0088] When the terminal device is in an area with weak signal, it is impossible to accurately obtain the area where the terminal device is located. In this case, it is necessary to improve the accuracy of obtaining the location information of the terminal device. Figure 7 , Figure 7 is a flow chart of a language setting method provided in an embodiment of the present application. Figure 7 As shown, the method of the embodiment of the present application may include the following steps S401-S402.
[0089] S401, determining a target location set to which location information belongs in the location sets of each area, and determining a target area corresponding to the target location set as the regional location of the terminal device.
[0090] Specifically, the terminal device obtains a set of longitude and latitude coordinates as location information through GPS. The location set of each region includes the longitude and latitude information of each country in Asia, Europe, Africa and each state. For example, in the Asian region, location information of multiple countries such as China and Russia can be obtained. By comparing the location information of the terminal device with the corresponding longitude and latitude coordinates of each region in the location set one by one, the target location set corresponding to the location information can be determined, and a specific country region can be further found from the target location set, and the location information of the country region is determined as the regional location of the terminal device.
[0091] Exemplarily, the location information of the terminal device shows that it is between 19 and 169 degrees east longitude and 41 and 82 degrees north latitude. After comparing with the location set, it is found that the coordinate range falls within the location range of the Russian region, and the location set corresponding to each region of Russia is determined to be the target location set.
[0092] S402: Match the regional location with a preset regional language information database to determine the regional language corresponding to the regional location.
[0093] In the embodiment of the present application, the language information database contains a mapping relationship between each geographical area and the corresponding used language.
[0094] Exemplarily, when the regional location corresponds to a city image in Russia, after matching information in the regional language information database, it is found that the regional language of the city is Russian, and then it is determined that the regional language corresponding to the regional location is Russian.
[0095] From the above, it can be seen that by determining the target location set to which the location information of the terminal device belongs in the location set of each area, the specific geographical area where the device is located can be quickly and accurately identified, thereby speeding up the subsequent process processing speed; secondly, matching the regional location with the preset regional language information library can automatically determine the main language of the area, avoiding manual settings by users, thereby improving the user experience.
[0096] To improve the language setting tolerance of terminal devices. Figure 8 , Figure 8 is a flow chart of a language setting method provided in an embodiment of the present application. Figure 8 As shown, the method of the embodiment of the present application may include the following steps S501-S505.
[0097] S501: Generate language prompt information based on the regional language.
[0098] Specifically, when the regional language is determined, the terminal device is required to generate language prompt information in the display component based on the regional language, wherein the language prompt information is used to prompt the user whether to set the regional language as the default display language of the terminal device.
[0099] Exemplarily, if the regional language is Russian, a language prompt message "whether to set the default language to Russian" is generated in the display component of the terminal device.
[0100] S502: Obtaining an operation instruction of a user of a terminal device in response to language prompt information.
[0101] S503: If the operation instruction is a confirmation instruction, apply the regional language to the terminal device.
[0102] Specifically, while the display component displays the language prompt information, it also provides the user with virtual keys for issuing operation instructions, and the virtual keys correspond to a confirmation virtual key and a cancellation virtual key.
[0103] The user clicks the confirmation virtual button, and the operation instruction generated at this time is a confirmation instruction, which means that the user allows the regional language to be used as the default language of the terminal device.
[0104] Exemplarily, the language prompt information is “whether to set the default language to Russian”, and after the user clicks the confirmation virtual button, the device is controlled to set Russian as the default language of the terminal device.
[0105] S504: If the operation instruction is a cancel instruction, obtain the custom regional language manually selected by the user.
[0106] S505, applying the customized regional language to the terminal device.
[0107] Specifically, in S504-S505, when the user clicks the Cancel virtual button, it indicates that the regional language is not what the user actually needs. At this time, the corresponding language of each region will be displayed in the display component of the terminal device for the user to manually select. When it is detected that the user has selected a specific regional language, the regional language will be used as the custom regional language.
[0108] Exemplarily, the language prompt information is "Do you want to set the default language to Russian?". At this time, it is detected that the user's operation instruction is a cancel instruction, and the display component displays the language options of "Simplified Chinese, English, Russian". At the same time, it is detected that the user manually selects the "English" language option, then "English" is used as the custom regional language and applied to the terminal device. At this time, "English" will be set as the default language of the terminal device.
[0109] From the above, it can be seen that by obtaining the terminal device user's operating instructions for language prompt information, it is possible to respond to the user's preferences and needs in real time, thereby improving the system's interactivity and user experience. Secondly, if the user confirms the regional language automatically recommended by the system, the language setting is quickly applied, which simplifies the user's operation steps and improves efficiency. In addition, if the user chooses to cancel the system-recommended language and manually selects a custom regional language, the user is allowed to make personalized settings according to his or her preferences, thereby meeting the user's personalized needs. The entire process combines automatic recommendation and manual selection, which not only improves the intelligence level of the system, but also takes into account the user's personalized needs, making the language setting of the terminal device more efficient and convenient.
[0110] based on Figure 1 The system architecture will be combined with Fig. 9 , the language setting device provided in the embodiment of the present application is introduced in detail. It should be noted that, Fig. 9 The language setting device in is used to execute this application Figure 2-Figure 8 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 6In the embodiment shown, the language setting device 600 may include a data acquisition unit 601, a type analysis unit 602, a position matching unit 603 and a type matching unit 604, as follows:
[0111] A data acquisition unit 601 is used to acquire environmental feature data of a terminal device and location information of the terminal device, where the environmental feature data includes an environmental image and an environmental sound signal;
[0112] The type analysis unit 602 is used to extract the text mark from the environment image, determine the first language type corresponding to the text mark, convert the environment sound signal into text information, and determine the second language type corresponding to the text information;
[0113] A location matching unit 603, configured to determine a regional location of the terminal device based on the location information, and obtain a regional language corresponding to the regional location;
[0114] The type matching unit 604 is configured to switch the language of the terminal device based on the regional language if the first language type and the second language type are respectively the same as the language type of the regional language.
[0115] In some embodiments, the type analysis unit 602 also includes an image detection unit, an image generation unit, and an image extraction unit.
[0116] An image detection unit, used to convert the environment image into an environment grayscale image, and perform edge detection on the environment grayscale image to obtain edge pixels corresponding to each character in the environment grayscale image;
[0117] An image generating unit, used for generating a character outline image based on edge pixels corresponding to each character;
[0118] The image extraction unit is used to extract the text mark from the text outline image and determine the first language type corresponding to the text mark.
[0119] In some embodiments, the connection type analysis unit 602 further includes a first text conversion unit and a first text matching unit.
[0120] A text conversion unit, used to convert text logos into editable text;
[0121] The text matching unit is used to match the editable text with a preset language feature library to obtain a language type corresponding to the editable text, and determine the language type as a first language type.
[0122] In some embodiments, the connection type analysis unit 602 further includes a signal extraction unit, a second text conversion unit, and a second text matching unit.
[0123] A signal extraction unit, used for performing noise reduction processing and noise filtering on the ambient sound signal to extract a human voice signal from the ambient sound signal;
[0124] A second text conversion unit, used for converting the human voice signal into text information;
[0125] The second text matching unit is used to input the text information into a preset language feature library to obtain the language type corresponding to the text information, and determine the text type as the second language type.
[0126] In some embodiments, the location analysis unit 603 further includes a location set determination unit and an information matching unit.
[0127] A location set determining unit, used to determine a target location set to which the location information belongs in the location set of each area, and determine a target area corresponding to the target location set as the area location of the terminal device;
[0128] The information matching unit is used to match the regional location with a preset regional language information database to determine the regional language corresponding to the regional location.
[0129] In some embodiments, the type matching unit 604 further includes a prompt information generating unit, an instruction acquiring unit and a first instruction analyzing unit.
[0130] A prompt information generating unit, used for generating language prompt information based on the regional language;
[0131] An instruction acquisition unit, used to acquire an operation instruction of a user of a terminal device for the language prompt information;
[0132] The first instruction analysis unit is used to apply the regional language to the terminal device if the operation instruction is a confirmation instruction.
[0133] In some embodiments, the type matching unit 604 further includes a second instruction analysis unit and a language application unit.
[0134] A second instruction analysis unit, configured to obtain a custom regional language manually selected by a user if the operation instruction is a cancel instruction;
[0135] The language application unit is used to apply a custom regional language to a terminal device.
[0136] In an embodiment of the present application, by extracting text logos from environmental images and determining the corresponding first language type, it is helpful to quickly identify the main language in the visual environment. At the same time, the environmental sound signal is converted into text information and the second language type is determined, so as to capture the dominant language in the auditory environment. Based on the location information of the terminal device, it is possible to accurately determine the regional location of the terminal device and obtain the regional language corresponding to the region. When the identified first language type and second language type are consistent with the regional language, it automatically switches to the regional language, thereby improving the accuracy of automatic language matching of the terminal device in different regions.
[0137] In addition, the language setting device provided in the above embodiment and a language setting method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0138] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0139] See also Fig.10 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device 700 includes a processor 701 and a memory 702. The processor 701 is electrically connected to the memory 702.
[0140] The processor 701 is the control center of the electronic device 700 and may include one or more processing cores. The processor 701 connects the various parts of the entire electronic device through various interfaces and lines, executes various functions of the electronic device and processes data by running or calling the computer program stored in the memory 702, and calling the data stored in the memory 702, so as to control the electronic device as a whole. Optionally, the processor 701 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 701 may integrate one or more combinations of CPU, graphics processing unit (GPU), modem, etc. Among them, the CPU mainly processes the operating system, user pages, and applications; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 701, but may be implemented separately through a communication chip.
[0141] The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by running computer programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc.
[0142] In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
[0143] In the embodiment of the present application, the processor 701 in the electronic device 700 loads instructions corresponding to the processes of one or more computer programs into the memory 702 according to the following steps, and the processor 701 runs the computer program stored in the memory 702 to implement various functions, as follows:
[0144] Acquire environmental characteristic data of a terminal device and location information of the terminal device, the environmental characteristic data including an environmental image and an environmental sound signal; extract text labels from the environmental image, determine a first language type corresponding to the text labels, convert the environmental sound signal into text information, and determine a second language type corresponding to the text information; determine a regional location of the terminal device based on the location information, and acquire a regional language corresponding to the regional location; if the first language type and the second language type are respectively the same as the language type of the regional language, switch the language of the terminal device based on the regional language.
[0145] Optionally, when the processor 701 extracts the text logo from the environment image and determines the first language type corresponding to the text logo, the processor 701 specifically executes: converting the environment image into an environment grayscale image, performing edge detection on the environment grayscale image to obtain edge pixels corresponding to each text in the environment grayscale image; generating a text contour image based on the edge pixels corresponding to each text; extracting the text logo from the text contour image, and determining the first language type corresponding to the text logo.
[0146] Optionally, when the processor 701 extracts the text mark from the text outline image and determines the first language type corresponding to the text mark, it specifically performs: converting the text mark into editable text; matching the editable text with a preset language feature library to obtain the language type corresponding to the editable text, and determining the language type as the first language type.
[0147] Optionally, when the processor 701 converts the ambient sound signal into text information and determines the second language type corresponding to the text information, the processor 701 specifically performs: noise reduction processing and noise filtering on the ambient sound signal to extract a human voice signal from the ambient sound signal; converts the human voice signal into text information; inputs the text information into a preset language feature library to obtain the language type corresponding to the text information, and determines the text type as the second language type.
[0148] Optionally, the processor 701 determines the regional location of the terminal device based on the location information and obtains the regional language corresponding to the regional location. Specifically, the following are performed: determining a target location set to which the location information belongs in the location set of each region, and determining the target area corresponding to the target location set as the regional location of the terminal device; matching the regional location with a preset regional language information library to determine the regional language corresponding to the regional location.
[0149] Optionally, the processor 701 performs language switching of the terminal device based on the regional language, specifically performing: generating language prompt information based on the regional language; obtaining an operation instruction of the user of the terminal device for the language prompt information; if the operation instruction is a confirmation instruction, applying the regional language to the terminal device.
[0150] Optionally, the processor 701 is further configured to specifically execute: if the operation instruction is a cancel instruction, obtaining a custom regional language manually selected by a user; and applying the custom regional language to the terminal device.
[0151] In an embodiment of the present application, by extracting text logos from environmental images and determining the corresponding first language type, it is helpful to quickly identify the main language in the visual environment. At the same time, the environmental sound signal is converted into text information and the second language type is determined, so as to capture the dominant language in the auditory environment. Based on the location information of the terminal device, it is possible to accurately determine the regional location of the terminal device and obtain the regional language corresponding to the region. When the identified first language type and second language type are consistent with the regional language, it automatically switches to the regional language, thereby improving the accuracy of automatic language matching of the terminal device in different regions.
[0152] In addition, the device provided in the embodiment of the present application can specifically be a chip, component or module, and the chip may include a connected processor and memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a language setting method provided in the above embodiment.
[0153] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a language setting method provided in the above embodiment.
[0154] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement a language setting method provided in the above embodiment.
[0155] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0156] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0157] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the related ones shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0158] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A language setting method, characterized in that: The method comprises: Acquire environmental feature data of a terminal device and location information of the terminal device, wherein the environmental feature data includes an environmental image and an environmental sound signal; Extracting a text mark from the environment image, determining a first language type corresponding to the text mark, converting the environment sound signal into text information, and determining a second language type corresponding to the text information; Determine the regional location of the terminal device based on the location information, and obtain the regional language corresponding to the regional location; If the first language type and the second language type are respectively the same as the language type of the regional language, the language of the terminal device is switched based on the regional language.
2. The method according to claim 1, characterized in that: The step of extracting a text mark from the environment image and determining a first language type corresponding to the text mark includes: Converting the environment image into an environment grayscale image, and performing edge detection on the environment grayscale image to obtain edge pixels corresponding to each character in the environment grayscale image; Generate a character outline image based on the edge pixels corresponding to each of the characters; A text mark is extracted from the text outline image, and a first language type corresponding to the text mark is determined.
3. The method according to claim 2, characterized in that The step of extracting a text mark from the text outline image and determining a first language type corresponding to the text mark includes: Converting the text mark into editable text; The editable text is matched with a preset language feature library to obtain a language type corresponding to the editable text, and the language type is determined as the first language type.
4. The method according to claim 1, characterized in that: The converting the ambient sound signal into text information and determining the second language type corresponding to the text information includes: Performing noise reduction processing and noise filtering on the ambient sound signal to extract a human voice signal from the ambient sound signal; Converting the human voice signal into the text information; The text information is input into a preset language feature library to obtain a language type corresponding to the text information, and the text type is determined as the second language type.
5. The method according to claim 1, characterized in that The determining the regional location of the terminal device based on the location information and acquiring the regional language corresponding to the regional location includes: Determine a target location set to which the location information belongs in the location sets of each area, and determine a target area corresponding to the target location set as the area location of the terminal device; The regional location is matched with a preset regional language information database to determine the regional language corresponding to the regional location.
6. The method according to claim 1, characterized in that The performing language switching on the terminal device based on the regional language includes: generating language prompt information based on the regional language; Acquire an operation instruction of a user of the terminal device in response to the language prompt information; If the operation instruction is a confirmation instruction, the regional language is applied to the terminal device.
7. The method according to claim 6, characterized in that The method further comprises: If the operation instruction is a cancel instruction, obtaining the custom regional language manually selected by the user; The custom regional language is applied to the terminal device.
8. A language setting device, characterized in that: include: A data acquisition unit, used to acquire environmental feature data of a terminal device and location information of the terminal device, wherein the environmental feature data includes an environmental image and an environmental sound signal; A type analysis unit, configured to extract a text mark from the environment image, determine a first language type corresponding to the text mark, convert the environment sound signal into text information, and determine a second language type corresponding to the text information; A location matching unit, configured to determine a regional location of the terminal device based on the location information, and obtain a regional language corresponding to the regional location; A type matching unit is configured to switch the language of the terminal device based on the regional language if the first language type and the second language type are respectively the same as the language type of the regional language.
9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor is used to call and run the executable program code from the memory, so that the electronic device executes the language setting method according to any one of claims 1 to 7.
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, the language setting method according to any one of claims 1 to 7 is implemented.