Method and device for information query, electronic device, and readable storage medium

By converting the Chinese characters in the query information into pinyin strings and generating standardized Chinese strings in combination with English characters, the problem of inaccurate results in information query is solved, and more accurate query results are achieved.

CN113239245BActive Publication Date: 2025-04-15BEIJING XUEZHITU NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110544220.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-19
Publication Date
2025-04-15
Estimated Expiration
2041-05-19

AI Technical Summary

Technical Problem

During the information query process, irregular expression of query information can easily make it difficult to accurately obtain the required query results.

Method used

By obtaining the character situation of the query information, if Chinese and English characters are included, convert the Chinese characters into pinyin strings, combine English characters to generate the string to be converted, and use the preset character conversion model to convert it into a standard Chinese string to perform information query.

Benefits of technology

Convert irregular query information into more standardized query information, so as to obtain the required query results more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113239245B_ABST
    Figure CN113239245B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of information query, and discloses a method for information query, including: obtaining query information, obtaining the character situation of the query information; the character situation is used to characterize the character type situation contained in the query information, and when the character situation is that the query information includes Chinese characters and English characters, the Chinese characters in the query information are converted into a pinyin string, a string to be converted is generated according to the pinyin string and the English characters in the query information, the string to be converted is converted into a first Chinese string using a preset character conversion model, and information query is performed according to the first Chinese string. The present application can convert non-standard query information into more standardized query information, so as to obtain the required query results more accurately. The present application also discloses a device, an electronic device and a readable storage medium for information query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of information query, and in particular to a method and device for information query, an electronic device, and a readable storage medium. Background Art

[0002] When searching in a knowledge base, correct or relevant content can only be found if the correct content is entered in the input box. However, in actual situations where users search for information, they often make mistakes or do not have a good grasp of the input query information, resulting in the input query information often including one or more of Chinese characters, pinyin characters, and English characters.

[0003] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:

[0004] When performing information queries, the non-standard expression of the query information can easily lead to difficulty in accurately obtaining the required query results. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] The embodiments of the present disclosure provide a method and device for information query, an electronic device, and a readable storage medium to improve the accuracy of information query.

[0007] In some embodiments, the above-mentioned method for information query includes: obtaining query information; obtaining character conditions of the query information; the character conditions are used to characterize the character types contained in the query information; when the character conditions are that the query information includes Chinese characters and English characters, converting the Chinese characters in the query information into pinyin strings; generating a character string to be converted based on the pinyin string and the English characters in the query information; converting the character string to be converted into a first Chinese character string using a preset character conversion model; and performing information query based on the first Chinese character string.

[0008] In some embodiments, the above-mentioned device for information query includes: a first acquisition module, configured to acquire query information; a second acquisition module, configured to acquire the character situation of the query information; the character situation is used to characterize the character type situation contained in the query information; a first conversion module, configured to convert the Chinese characters in the query information into a pinyin string when the character situation is that the query information includes Chinese characters and English characters; a generation module, configured to generate a character string to be converted based on the pinyin string and the English characters in the query information; a second conversion module, configured to convert the character string to be converted into a first Chinese character string using a preset character conversion model; a query module, configured to perform information query based on the first Chinese character string.

[0009] In some embodiments, the electronic device comprises: a processor and a memory storing program instructions, and the processor is configured to execute the method for information query when running the program instructions.

[0010] In some embodiments, the readable storage medium stores executable instructions, and the executable instructions execute the method for information query when running.

[0011] The method and device for information query, electronic device, and readable storage medium provided by the embodiments of the present disclosure can achieve the following technical effects: by converting Chinese characters in the query information into a pinyin string, a string to be converted is generated according to the pinyin string and the English characters in the query information; the string to be converted is converted into a first Chinese string using a preset character conversion model; in this way, non-standard query information can be converted into more standardized query information, thereby more accurately obtaining the required query results.

[0012] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0014] Figure 1 is a schematic diagram of a method for information query provided by an embodiment of the present disclosure;

[0015] Figure 2 is a schematic diagram of a device for information query provided by an embodiment of the present disclosure;

[0016] Figure 3It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0018] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0019] Unless otherwise stated, the term "plurality" means two or more.

[0020] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0021] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0022] Combination Figure 1 As shown, the present disclosure provides a method for information query, including:

[0023] Step S101, obtaining query information;

[0024] Step S102, obtaining the character status of the query information; the character status is used to represent the character type status contained in the query information;

[0025] Step S103: when the query information includes Chinese characters and English characters, convert the Chinese characters in the query information into a pinyin character string;

[0026] Step S104, generating a character string to be converted according to the pinyin character string and the English characters in the query information;

[0027] Step S105, converting the character string to be converted into a first Chinese character string using a preset character conversion model;

[0028] Step S106: perform information search based on the first Chinese character string.

[0029] The disclosed embodiment converts Chinese characters in the query information into a pinyin string, generates a string to be converted according to the pinyin string and the English characters in the query information; and converts the string to be converted into a first Chinese string using a preset character conversion model; in this way, non-standard query information can be converted into more standardized query information, thereby obtaining the required query results more accurately.

[0030] In some embodiments, when the character situation is that the query information includes Chinese characters and English characters, the Chinese characters in the query information are converted into pinyin strings; the string to be converted is generated according to the pinyin string and the English characters in the query information, including: replacing the Chinese characters in the query information with the corresponding pinyin string to obtain the query information to be corrected, removing special characters such as spaces, tabs \t, carriage returns and line feeds in the query information to be corrected, and obtaining the string to be converted.

[0031] Optionally, after obtaining the character situation of the query information, it also includes: when the character situation is that the query information only includes English characters, determining the composition situation of the query information; the composition situation is used to characterize the type of information contained in the query information; when the composition situation is that the query information includes pinyin information, converting the pinyin information into a second Chinese character string; generating target query information according to the second Chinese character string and the English characters in the query information, and performing information query based on the target query information.

[0032] Optionally, determining the composition of the query information includes: determining any English character string in the query information as a character string to be detected; comparing the character string to be detected with a second preset Pinyin character string in a preset Pinyin dictionary, and when there is a second preset Pinyin character string that is identical to the character string to be detected in the Pinyin dictionary, determining the composition of the query information is that the query information includes Pinyin information, and the Pinyin dictionary stores the second preset Pinyin character string and the correspondence between the second preset Pinyin character string and the second Chinese character string.

[0033] Optionally, converting the pinyin information into a second Chinese character string includes: matching a second Chinese character string corresponding to a second preset pinyin character string that is the same as the character string to be detected in a pinyin dictionary.

[0034] Optionally, after obtaining the character situation of the query information, it also includes: when the character situation is that the query information only includes English characters, determining the composition situation of the query information; the composition situation is used to characterize the type of information contained in the query information; when the composition situation is that the query information only includes English information, performing information query based on the query information.

[0035] Optionally, determine the composition of the query information, including: determining any English character string in the query information as the string to be detected; comparing the string to be detected with the second preset pinyin string in the preset pinyin dictionary, and if there is no second preset pinyin string in the pinyin dictionary that is the same as the string to be detected, determine that the composition of the query information is that the query information only includes English information, and the second preset pinyin string is stored in the pinyin dictionary.

[0036] Optionally, after obtaining the character situation of the query information, it further includes: when the character situation is that the query information only includes Chinese characters, perform information query according to the query information.

[0037] In some embodiments, obtain the query information, obtain the character situation of the query information, and determine whether the Unicode encoding of each character in the query information is within 4E00 - 9FFF. If the Unicode encoding of the character is within 4E00 - 9FFF, determine that the character is a Chinese character and increment the Chinese character count by 1. For example: the Unicode encoding of the character '人' in the query information is within 4E00 - 9FFF, and the Chinese character count is incremented by 1. After determining whether the Unicode encoding of each character in the query information is within 4E00 - 9FFF, compare the total count of Chinese characters with the length of the text string of the input query information. If they are equal, determine that the query information consists entirely of Chinese characters; if not, determine that the query information contains other characters. Then perform English character judgment, determine whether each character in the query information belongs to the range a - z or A - Z. If it belongs to the range a - z or A - Z, increment the English character count by 1. For example: the character 'ch' in the query information belongs to the range a - z. After determining whether each character in the query information is within a - z or A - Z, compare the total count of English characters with the length of the text string of the input query information. If they are equal, determine that the query information consists entirely of English characters; if not, determine that the query information contains other characters. When the total count of Chinese characters is not zero and less than the length of the text string of the input query information, and the total count of English character lengths is not zero and less than the length of the text string of the input query information, determine that the input text string is a mixture of Chinese and pinyin.

[0038] In the case where the input query information is all English characters, it is impossible to perform reasonable word segmentation because there are no spaces between the input English characters. Determine any English character string in the query information as the character string to be detected, and compare the character string to be detected with the second preset Pinyin character string in the preset Pinyin dictionary; first compare whether the first letter of the character string to be detected is the same as the first letter of the second preset Pinyin character string, if the same, continue to compare whether the second letter of the character string to be detected is the same as the second letter of the second preset Pinyin character string, until all the letters of the character string to be detected are compared, if all the letters of the character string to be detected are exactly the same as the second preset Pinyin character string, then determine that the character string to be detected is Pinyin information; if the mth letter of the character string to be detected is different from the mth letter of the second preset Pinyin character string, then use the m+1th letter as the first letter of the new character string to be detected, and compare the new character string to be detected with the second preset Pinyin character string in the preset Pinyin dictionary, until all the English characters in the query information are compared.

[0039] Optionally, if the mth letter of the string to be detected is different from the mth letter of the second preset pinyin string, the m-1th letter is used as the first letter of the new string to be detected, and the new string to be detected is compared with the second preset pinyin string in the preset pinyin dictionary until all English characters in the query information are compared.

[0040] Optionally, an English character string that is different from a second preset pinyin character string in a preset pinyin dictionary is determined as English information.

[0041] Optionally, the preset pinyin dictionary is a pinyin-Chinese character dictionary based on the knowledge base map, and the pinyin-Chinese character dictionary based on the knowledge base map includes various entities and various document name Chinese strings and corresponding pinyin strings. Optionally, the pinyin strings in the preset pinyin dictionary that are the same as the stop word dictionary are removed. Optionally, entities include: names, product names, etc., and document names include XXX installation manuals, XXX usage documents, etc. The stop word dictionary includes: English strings that can be both pinyin information and English information and corresponding Chinese strings, for example: we (women); the stop word dictionary also includes modal particles and English characters corresponding to modal particles, for example, oh (o), etc. In this way, it is avoided to directly determine English characters as pinyin information for information query, thereby more accurately identifying the user's query intention.

[0042] When the query information is all in Chinese characters, the information query is directly performed based on the query information.

[0043] When the query information is all in English, directly perform information query based on the query information.

[0044] In the case where the query information includes both Chinese characters and English characters, the Chinese characters in the query information are converted into a pinyin string through the HanLP (Chinese Language Processing Package) Chinese character to pinyin interface to obtain the intermediate query information, and the special characters such as spaces, tabs, carriage returns and line feeds in the intermediate query information are removed to obtain the query information to be segmented. For example: the intermediate query information is an zhuang shouce, and the query information to be segmented is: anzhuangshouce. The query information to be segmented anzhuangshouce is segmented using a regular expression: by calculating: "[^aoeiuv]?h?[iuv]?(ai|ei|ao|ou|er|ang?|eng?|ong|a|o|e|i|u|ng|n)?", the segmented query information an zhuang shou ce is obtained, and the segmented query information is determined as the string to be converted. The character string to be converted is converted into a first Chinese character string according to a preset HMM (Hidden Markov Model), including: performing Chinese syllable division processing on the candidate pinyin character string or the character string to be corrected to obtain a syllable sequence; obtaining a group of candidate Chinese characters corresponding to each Chinese syllable in the syllable sequence, and determining a target Chinese character corresponding to each Chinese syllable from a group of candidate characters corresponding to each Chinese syllable based on a preset statistical model, wherein the preset statistical model is used to represent the correlation between the candidate Chinese characters corresponding to every two Chinese syllables; combining the target Chinese characters into a sentence according to the order of the Chinese syllables in the syllable sequence, and determining the sentence as the first Chinese character string.

[0045] Hidden Markov Model (HMM) is a statistical model used to describe a Markov process with hidden unknown parameters. Hidden Markov Model includes initial probability matrix model, state transition matrix model and observation matrix model.

[0046] Optionally, the initial probability matrix model includes the statistical probability value corresponding to each candidate Chinese character in the first Chinese character group, wherein the first Chinese character group is a group of candidate Chinese characters corresponding to the first Chinese syllable in the syllable sequence. The state transition matrix model includes the statistical probability value corresponding to each pronunciation of each candidate Chinese character. The observation matrix model includes the target Chinese character corresponding to each candidate Chinese character.

[0047] Optionally, an initial probability matrix model is obtained according to a pinyin-Chinese character dictionary based on a knowledge base graph. Optionally, an initial probability matrix model is established, including: obtaining a pinyin-Chinese character dictionary based on a knowledge base graph, determining all the initial Chinese characters in the pinyin-Chinese character dictionary based on the knowledge base graph, and counting the number of occurrences of each initial Chinese character, and then calculating the logarithm of the number of occurrences, and recording the logarithm as the statistical probability value of the initial Chinese character. If a Chinese character has never appeared at the beginning of a word, the statistical probability value corresponding to the Chinese character is 0. The data format of the initial probability matrix model is json.

[0048] Optionally, an observation matrix model is obtained according to the pinyin-Chinese character dictionary based on the knowledge base graph. According to the pinyin-Chinese character dictionary based on the knowledge base graph, the various pronunciations of each Chinese character and the number of times each pronunciation appears are counted, and the logarithm of the number of times is recorded as the statistical probability value corresponding to the pronunciation. For example, the pronunciations of the character '了' include 'liao' and 'le', the statistical probability value corresponding to 'liao' is 0.5, and the statistical probability value corresponding to 'le' is 0.5, and it is stored as: {'了': {'liao': 0.5, 'le': 0.5}}; the data format of the observation matrix model is json.

[0049] Optionally, a state transition matrix model is obtained according to the pinyin-Chinese character dictionary based on the knowledge base graph. Optionally, establishing a state transition matrix model includes: determining each Chinese character in the initial probability matrix model as the preceding Chinese character, counting the succeeding Chinese characters (i.e., the Chinese characters located after the preceding Chinese character) of the preceding Chinese character in the pinyin-Chinese character dictionary based on the knowledge base graph, and counting the logarithm of the number of times each succeeding Chinese character appears after the preceding Chinese character. The logarithm corresponding to each succeeding Chinese character is used as the association probability value between the preceding Chinese character and the succeeding Chinese character. For example: the preceding Chinese character is '你', the succeeding Chinese characters of '你' in the Chinese dictionary based on the knowledge base graph are '好' and '们'. The logarithms of the number of times '你好' and '你们' appear are counted respectively. The logarithm 0.8 corresponding to '你好' is recorded as the association probability value between '你' and '好', and the logarithm 0.2 corresponding to '你们' is recorded as the association probability value between '你' and '们'. It is stored as: {'你': {'好': 0.8, '们': 0.2}}, and the data format of the state transition matrix model is json.

[0050] Optionally, based on a preset statistical model, the target Chinese character corresponding to each Chinese syllable is determined from a group of candidate Chinese characters corresponding to each Chinese syllable, including: calculating the probability maximum and minimum of each candidate Chinese character corresponding to each Chinese syllable in sequence according to the order of the Chinese syllables in the syllable sequence.

[0051] Optionally, by calculating δ 1 (i) = π i B i (O 1 ) the probability maximum and minimum of each candidate Chinese character in the first Chinese character group are obtained; where δ 1 (i) is the probability maximum and minimum of the i-th candidate Chinese character in the first Chinese character group, π i is the statistical probability value of the i-th candidate Chinese character in the first Chinese character group in the initial probability matrix, B i (O 1 ) is the statistical probability value corresponding to the pronunciation O 1 of the i-th candidate Chinese character in the first Chinese character group in the observation matrix, and O 1Consistent with the first Chinese syllable in the syllable sequence, i=1, ...M1, where M1 is the number of candidate Chinese characters in the first Chinese character group.

[0052] By calculation Obtain the maximum probability value of each candidate Chinese character in the t-th Chinese character group; where δt(i) is the maximum probability value of the i-th candidate Chinese character in the t-th Chinese character group, δ t-1 (j) is the maximum probability value of the jth candidate Chinese character in the t-1th Chinese character group, a ji is the association probability value between the i-th candidate Chinese character in the t-th Chinese character group and the j-th candidate Chinese character in the t-1-th Chinese character group in the state transfer matrix, B i (O t ) is the pronunciation of the ith candidate Chinese character in the tth Chinese character group in the observation matrix t The corresponding statistical probability value, i = 1, 2...N, N is the number of candidate Chinese characters in the tth Chinese character group, j = 1, 2...M t-1 , M t-1 is the number of candidate Chinese characters in the t-1 Chinese character group, and δ 1 (i) and δ t (i) The corresponding candidate Chinese characters are determined as target Chinese characters, and the target Chinese characters are combined into a sentence according to the order of Chinese syllables in the syllable sequence, and the sentence is determined to be the first Chinese character string.

[0053] Optionally, the knowledge in the knowledge base graph is acquired regularly, the pinyin-Chinese character dictionary based on the knowledge base graph is updated in real time, and the HMM is acquired again based on the updated pinyin-Chinese character dictionary to ensure that the words in the pinyin-Chinese character dictionary based on the knowledge base graph are the latest words in the knowledge base graph, so that the HMM can be corrected in time. In this way, the HMM is updated in real time through deep learning technology, so that the pinyin information and English information can be effectively judged, the accuracy of converting the pinyin information into Chinese characters is improved, and the required query results can be obtained more accurately.

[0054] The method for information query provided by the embodiment of the present disclosure converts Chinese characters in the query information into a pinyin string, generates a string to be converted according to the pinyin string and the English characters in the query information; converts the string to be converted into a first Chinese string using a preset character conversion model; and converts non-standard query information into more standardized query information through natural language processing, so as to more accurately obtain the required query results.

[0055] Combination Figure 2As shown, the embodiment of the present disclosure provides a device for information query, including: a first acquisition module 201, a second acquisition module 202, a first conversion module 203, a generation module 204, a second conversion module 205 and a query module 206. The first acquisition module 201 is configured to acquire query information; the second acquisition module 202 is configured to acquire the character situation of the query information; the character situation is used to characterize the character type situation contained in the query information; the first conversion module 203 is configured to convert the Chinese characters in the query information into a pinyin character string when the character situation is that the query information includes Chinese characters and English characters; the generation module 204 is configured to generate a character string to be converted according to the pinyin character string and the English characters in the query information; the second conversion module 205 is configured to convert the character string to be converted into a first Chinese character string using a preset character conversion model; the query module 206 is configured to perform information query according to the first Chinese character string.

[0056] The device for information query provided by the embodiment of the present disclosure converts Chinese characters in the query information into a pinyin string through a first conversion module, and generates a string to be converted by using the pinyin string and English characters in the query information according to a generation module; the second conversion module converts the string to be converted into a first Chinese string using a preset character conversion model; in this way, non-standard query information can be converted into more standardized query information, thereby obtaining the required query results more accurately.

[0057] Optionally, the device for information query further includes: a determination module configured to determine the composition of the query information when the character situation is that the query information only includes English characters.

[0058] Optionally, the second conversion module 205 is further configured to convert the pinyin information into a second Chinese character string when the query information includes pinyin information.

[0059] Optionally, the query module 206 is further configured to generate target query information according to the second Chinese character string and English characters in the query information, and perform information query according to the target query information.

[0060] Optionally, the determination module is also configured to determine any English character string in the query information as the character string to be detected; compare the character string to be detected with a second preset Pinyin character string in a preset Pinyin dictionary, and when there is a second preset Pinyin character string that is identical to the character string to be detected in the Pinyin dictionary, determine that the composition of the query information is that the query information includes Pinyin information, and the Pinyin dictionary stores the second preset Pinyin character string and the correspondence between the second preset Pinyin character string and the second Chinese character string.

[0061] Optionally, the second conversion module 205 is configured to match a second Chinese character string corresponding to a second preset pinyin character string that is the same as the character string to be detected in the pinyin dictionary.

[0062] Optionally, the determination module is further configured to determine the composition of the query information when the character condition is that the query information only includes English characters;

[0063] Optionally, the query module 206 is further configured to perform information query according to the query information when the query information only includes English information.

[0064] Optionally, the determination module is also configured to determine any English character string in the query information as the character string to be detected; compare the character string to be detected with a second preset Pinyin character string in a preset Pinyin dictionary, and when there is no second preset Pinyin character string identical to the character string to be detected in the Pinyin dictionary, determine that the composition of the query information is that the query information only includes English information, and the second preset Pinyin character string is stored in the Pinyin dictionary.

[0065] Optionally, the query module 206 is further configured to perform information query according to the query information when the character situation is that the query information only includes Chinese characters.

[0066] Combination Figure 3 As shown, an embodiment of the present disclosure provides an electronic device, including a processor (processor) 300 and a memory (memory) 301. Optionally, the device may also include a communication interface (Communication Interface) 302 and a bus 303. Among them, the processor 300, the communication interface 302, and the memory 301 can communicate with each other through the bus 303. The communication interface 302 can be used for information transmission. The processor 300 can call the logic instructions in the memory 301 to execute the method for information query of the above embodiment.

[0067] The electronic device provided by the embodiment of the present disclosure converts Chinese characters in the query information into a pinyin string, generates a character string to be converted according to the pinyin string and the English characters in the query information; and converts the character string to be converted into a first Chinese character string using a preset character conversion model; in this way, non-standard query information can be converted into more standardized query information, thereby obtaining the required query results more accurately.

[0068] In addition, the logic instructions in the memory 301 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0069] The memory 301 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 300 executes functional applications and data processing by running the program instructions / modules stored in the memory 301, that is, implementing the method for information query in the above embodiment.

[0070] The memory 301 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 301 may include a high-speed random access memory and may also include a non-volatile memory.

[0071] Optionally, the electronic device includes a computer.

[0072] An embodiment of the present disclosure provides a readable storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above-mentioned method for information query.

[0073] The readable storage medium provided by the embodiment of the present disclosure converts Chinese characters in the query information into a pinyin string, generates a string to be converted according to the pinyin string and the English characters in the query information; and converts the string to be converted into a first Chinese string using a preset character conversion model; in this way, non-standard query information can be converted into more standardized query information, thereby obtaining the required query results more accurately.

[0074] An embodiment of the present disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned method for information query.

[0075] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0076] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0077] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0078] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0079] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other 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. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0080] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for information query, characterized in that: include: Get query information; Obtaining the character status of the query information; In the case where the character situation is that the query information includes Chinese characters and English characters, converting the Chinese characters in the query information into a pinyin character string; Generate a character string to be converted according to the pinyin character string and the English characters in the query information; Using a preset character conversion model to convert the character string to be converted into a first Chinese character string; Performing information query according to the first Chinese character string; In the case where the character situation is that the query information only includes English characters, any English character string in the query information is determined as a character string to be detected; the character string to be detected is compared with a second preset pinyin character string in a preset pinyin dictionary, and in the case where there is a second preset pinyin character string that is the same as the character string to be detected in the pinyin dictionary, it is determined that the composition of the query information is that the query information includes pinyin information, and the pinyin dictionary stores the second preset pinyin character string and the corresponding relationship between the second preset pinyin character string and the second Chinese character string; In the case where the query information includes pinyin information, converting the pinyin information into a second Chinese character string; Target query information is generated according to the second Chinese character string and the English characters in the query information, and information query is performed according to the target query information.

2. The method according to claim 1, characterized in that Converting the pinyin information into a second Chinese character string includes: A second Chinese character string corresponding to a second preset Pinyin character string identical to the character string to be detected is matched in the Pinyin dictionary.

3. The method according to claim 1, characterized in that After obtaining the character information of the query information, the following steps are also included: In the case where the character condition is that the query information only includes English characters, determining the composition of the query information; In the case where the query information only includes English information, information query is performed according to the query information.

4. The method according to claim 3, characterized in that Determining the composition of the query information, including: Determine any English character string in the query information as the character string to be detected; compare the character string to be detected with a second preset Pinyin character string in a preset Pinyin dictionary. When there is no second preset Pinyin character string identical to the character string to be detected in the Pinyin dictionary, determine that the composition of the query information is that the query information only includes English information, and the Pinyin dictionary stores the second preset Pinyin character string.

5. The method according to claim 1, characterized in that After obtaining the character information of the query information, the following steps are also included: In the case where the character situation is that the query information only includes Chinese characters, information query is performed according to the query information.

6. A device for information query, characterized in that: include: A first acquisition module is configured to acquire query information; A second acquisition module is configured to acquire the character status of the query information; A first conversion module is configured to convert the Chinese characters in the query information into a pinyin character string when the character situation is that the query information includes Chinese characters and English characters; A generating module, configured to generate a character string to be converted according to the pinyin character string and the English characters in the query information; A second conversion module is configured to convert the character string to be converted into a first Chinese character string using a preset character conversion model; A query module, configured to perform information query according to the first Chinese character string; A determination module is configured to, when the character situation is that the query information only includes English characters, determine any English character string in the query information as a character string to be detected; compare the character string to be detected with a second preset pinyin character string in a preset pinyin dictionary, and when there is a second preset pinyin character string that is the same as the character string to be detected in the pinyin dictionary, determine that the composition of the query information is that the query information includes pinyin information, and the pinyin dictionary stores the second preset pinyin character string and the corresponding relationship between the second preset pinyin character string and the second Chinese character string; The second conversion module is also configured to convert the pinyin information into a second Chinese character string when the query information includes pinyin information; the query module is also configured to generate target query information based on the second Chinese character string and English characters in the query information, and perform information query based on the target query information.

7. An electronic device comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for information query according to any one of claims 1 to 5 when running the program instructions.

8. A readable storage medium storing executable instructions, characterized in that: The executable instructions execute the method for information query according to any one of claims 1 to 5 when run.

Citation Information

Patent Citations

  • Method and system for query error correction

    CN103198149A

  • Error correction method, device and equipment and readable storage medium

    CN111444705A