Password generation method, apparatus and device
By using a pre-set emotion recognition model to identify emotion-related words in Chinese character strings and replace them with corresponding characters, while converting other parts into letters, this solves the problem of overly complex and unconnected passwords in existing technologies, thus improving password security and ease of use.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-03-27
AI Technical Summary
Current technologies generate passwords that are too complex and lack connections between characters, resulting in insufficient security.
The system identifies emotion segments in Chinese character strings using a pre-set emotion recognition model, replaces them with corresponding characters, and converts the rest of the Chinese character strings except for the emotion segments into letters to form the final password.
The generated passwords are highly secure and the characters are related, making them easy for users to remember and use.
Smart Images

Figure CN116232584B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, in particular to a password generation method, device and equipment. BACKGROUND
[0002] With the rapid development of the Internet, users are increasingly using passwords, and therefore the security requirements for passwords are increasingly high.
[0003] The prior art generates a random string as a user password by randomly matching a string type (such as English capitalization, numbers, and special symbols) configured by the user, but there is a problem that the password randomly generated by the system is too complex. SUMMARY
[0004] The present application aims to address the deficiencies in the prior art, and provides a password generation method, device and equipment to improve the security factor of the final password and to have a connection between the characters of the password.
[0005] To achieve the above-mentioned purpose, the technical solutions adopted by the embodiments of the present application are as follows:
[0006] In a first aspect, the embodiments of the present application provide a password generation method, comprising:
[0007] obtaining preset input data, the preset input data comprising a prompt word, the prompt word comprising a Chinese character string;
[0008] identifying whether the Chinese character string contains emotional segmentation according to a preset emotion recognition model;
[0009] if the Chinese character string contains emotional segmentation, replacing the emotional segmentation with a character corresponding to the emotional segmentation;
[0010] converting the Chinese character string excluding the emotional segmentation into a letter, and combining the character corresponding to the emotional segmentation to form a final password.
[0011] In an optional implementation, if the Chinese character string contains emotional segmentation, replacing the emotional segmentation with a character corresponding to the emotional segmentation comprises:
[0012] if the Chinese character string contains emotional segmentation, finding a character expression corresponding to the emotional label in a preset expression library according to the emotional label corresponding to the emotional segmentation, and replacing the emotional segmentation with the character expression;
[0013] Alternatively, according to an emotion label corresponding to the emotion word, an English word corresponding to the emotion label is found in a preset database, and the emotion word is replaced with the English word.
[0014] In an optional implementation, the converting the character string in the Chinese character string except the emotion word into letters and the combination of the character corresponding to the emotion word form an initial password comprises:
[0015] the converting the character string in the Chinese character string except the emotion word into letters and the combination of the character corresponding to the emotion word form an initial password;
[0016] traversing the initial password, replacing part of the characters in the initial password with special characters, and obtaining a final password.
[0017] In an optional implementation, the traversing the initial password, replacing part of the characters in the initial password with special characters, and obtaining a final password comprises:
[0018] traversing the initial password, obtaining a target character in a preset replacement relationship, and replacing the target character with a corresponding special character according to the preset replacement relationship to obtain the final password, wherein the preset replacement relationship comprises a replacement relationship between a character and a special character.
[0019] In an optional implementation, the traversing the initial password, obtaining a target character in a preset replacement relationship, and replacing the target character with a corresponding special character according to the preset replacement relationship to obtain the final password comprises:
[0020] traversing the initial password, obtaining a target character in a preset replacement relationship, and replacing the target character with a corresponding special character according to the preset replacement relationship to obtain a candidate password;
[0021] If the preset input data further comprises a selection configuration special character, a plurality of special characters are randomly inserted in the candidate password according to a preset rule to obtain the final password.
[0022] In an optional implementation, the converting the character string in the Chinese character string except the emotion word into letters and the combination of the character corresponding to the emotion word form an initial password comprises:
[0023] the converting the character string in the Chinese character string except the emotion word into letters and the combination of the character corresponding to the emotion word form an initial password;
[0024] if the preset input data further comprises: configuring case letters, then traversing the initial password;
[0025] if the configuring case letters indicates that the initial password does not contain capital letters, then converting part of the letters in the initial password to capital letters to obtain the final password;
[0026] if the configuring case letters indicates that the initial password contains capital letters, then converting all the capital letters in the initial password to lowercase letters to obtain the final password.
[0027] In an optional implementation, the converting the string in the Chinese character string except the emotional word into letters and the combination of characters corresponding to the emotional word constitutes the final password, comprising:
[0028] converting the string in the Chinese character string except the emotional word into letters and the combination of characters corresponding to the emotional word constitutes the initial password;
[0029] if the preset input data further comprises: configuring the preset length of the password, then judging whether the initial password meets the preset length of the password;
[0030] if the number of characters in the initial password is less than the preset length of the password, then inserting random characters in the initial password to obtain the final password meeting the preset length, wherein the random characters include one or more of the following: numbers, letters, special characters.
[0031] In an optional implementation, the converting the string in the Chinese character string except the emotional word into letters and the combination of characters corresponding to the emotional word constitutes the final password, comprising:
[0032] if the Chinese character string does not include emotional words, then converting the Chinese character string into pinyin letters to constitute the final password.
[0033] In a second aspect, the embodiments of the present application further provide a password generation device, comprising:
[0034] an obtaining module, configured to obtain preset input data, wherein the preset input data comprises: a prompt word, and the prompt word comprises: a Chinese character string;
[0035] a recognition module, configured to recognize whether the Chinese character string contains emotional words according to a preset emotional recognition model;
[0036] a replacement module, configured to replace the emotional words with characters corresponding to the emotional words if the Chinese character string contains emotional words;
[0037] A module is configured to convert the character string in the Chinese character string except the emotional word into a letter, and the characters corresponding to the emotional word are combined to form the final password.
[0038] In a third aspect, the embodiments of the present application further provide an electronic device, comprising a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the password generation method of any one of the first aspect.
[0039] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, the storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the password generation method of any one of the first aspect.
[0040] The beneficial effects of the present application are as follows:
[0041] The present application provides a password generation method, device and equipment, comprising: obtaining preset input data, the preset input data comprising: prompt words, the prompt words comprising: Chinese character strings; identifying whether the Chinese character string contains emotional word according to the preset emotion recognition model; if the Chinese character string contains emotional word, replacing the emotional word with the corresponding character; converting the character string in the Chinese character string except the emotional word into a letter, and combining the characters corresponding to the emotional word to form the final password. The method of the present application can process and identify the prompt words, i.e. Chinese character strings, input by the user according to the preset emotion recognition model, then replace the emotional word in the Chinese character string with the corresponding character, convert the character string in the Chinese character string except the emotional word into a letter, and combine the characters in the Chinese character string according to the corresponding positions of the characters to obtain the final password. The final password is generated by converting the text, i.e. the prompt words, and the final password is a combination of characters and letters, so it has a high security coefficient. Since there is a conversion relationship between the characters, the final password will not be too complex, and there is no connection between the characters of the password. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0043] Figure 1 One of the flowcharts of the password generation method provided by the embodiments of the present application;
[0044] Figure 2 Flowchart II of a password generation method according to an embodiment of the present application;
[0045] Figure 3 Flowchart III of a password generation method according to an embodiment of the present application;
[0046] Figure 4 Flowchart IV of a password generation method according to an embodiment of the present application;
[0047] Figure 5 Flowchart V of a password generation method according to an embodiment of the present application;
[0048] Figure 6 Flowchart VI of a password generation method according to an embodiment of the present application;
[0049] Figure 7 Functional module diagram of a password generation device according to an embodiment of the present application;
[0050] Figure 8 Schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application.
[0052] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the scope of protection of the present application.
[0053] In addition, the terms "first", "second", and the like in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] It should be noted that the features in the embodiments of the present application can be combined with each other without conflict.
[0055] In order to improve the security of the password, and make the characters of the password have a connection, the present application provides a password generation method, which can identify the emotional word segmentation in the Chinese character string according to the preset emotion recognition model, replace the emotional word segmentation in the Chinese character string with the corresponding character, convert the string in the Chinese character string except the emotional word segmentation into a letter, and then combine the characters in the Chinese character string according to the corresponding positions to obtain the final password, so as to improve the security of the password, and make the characters of the password have a connection.
[0056] The password generation method provided by the embodiments of the present application will be explained in detail with specific examples in combination with the accompanying drawings. The password generation method provided by the embodiments of the present application can be realized by running an algorithm or software by a computing device pre-installed with a preset algorithm or software system for password generation. The computing device can be a server or a terminal, and the terminal can be a computer, a mobile phone, a tablet computer, etc. Figure 1 One of the flowcharts of the password generation method provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method comprises the following steps. Figure 1
[0057] S101, obtaining preset input data.
[0058] In the embodiments of the present application, the preset input data indicates the relevant data input by the user for the demand of password generation, for example, the preset input data includes a prompt word, and the Chinese character string is obtained according to the prompt word, wherein the prompt word can be an activity, a sentence, a mood or other prompt word that the user is interested in, and is input by the user independently, for example, it can be "collecting the strengths of all families", "today the weather is really good", "very happy to meet you" and the like, so as to generate a Chinese character string according to the Chinese characters in the prompt word.
[0059] S102, identifying whether the Chinese character string contains emotional word segmentation according to a preset emotion recognition model.
[0060] Before identifying the Chinese character string according to the preset emotion recognition model, in order to make the identification result more accurate, the Chinese character string can be preprocessed. The data preprocessing method can specifically include data splitting, text cleaning, text reorganization, loading a stop word dictionary, etc.
[0061] The special symbols in the Chinese character string can be filtered through data splitting, text cleaning and text reorganization in data preprocessing. The special symbols can include @, #, ¥, $, * and the like. The redundant mood words in the Chinese character string can be filtered by loading a stop word dictionary. For example, if the Chinese character string is "today the weather is really good ah", the "ah" can be filtered by loading the stop word dictionary to obtain the filtered Chinese character string "today the weather is really good".
[0062] The Chinese character string processed by the data is identified according to a preset emotion recognition model to determine whether the Chinese character string contains mood words. The preset emotion recognition model is a model that can obtain the natural meaning represented by the Chinese character according to the recognition of the Chinese character. The preset emotion recognition model can be obtained by training a word sample labeled with an emotion label.
[0063] Specifically, the preset emotion recognition model analyzes the content of the Chinese character string processed by the data to obtain the natural meaning corresponding to the specific content. For example, the emotion recognition module identifies the Chinese character string processed by the data to obtain an identification result. If the identification result indicates that the Chinese character string contains mood words such as "happy", "angry" or "like", it is determined that the Chinese character string contains mood words such as "happy", "angry" or "like". If the identification result indicates that no mood words are recognized in the Chinese character string, it is determined that the Chinese character string does not contain mood words.
[0064] S103, if the Chinese character string includes mood words, the mood words are replaced by corresponding characters of the mood words.
[0065] If the Chinese character string includes mood words, for example, if the mood words are "happy", the identification of the mood words "happy" by the emotion recognition model is as follows: the probability of being happy is 0.9, the probability of not being happy is 0.1, and the like. The emotion label corresponding to the mood words "happy" is "happy", and then the mood words are replaced by the corresponding characters of the emotion label "happy".
[0066] S104, converting the Chinese character string except the mood words into letters, and combining the characters corresponding to the mood words to form the final password.
[0067] Specifically, the Chinese character string except the mood words is converted into letters, and the mood words replaced by the corresponding characters of the mood words form the final password. The letters include uppercase letters, lowercase letters or mixed case letters, or the corresponding pinyin of the string.
[0068] In an example, if the Chinese character string includes the emotional word, the Chinese character string except the emotional word is converted into letters by using the above method, and the character combination corresponding to the emotional word constitutes the final password.
[0069] In another example, if the Chinese character string does not include the emotional word, the Chinese character string is converted into pinyin letters to constitute the final password. For example, "collecting the strengths of all" is converted into "jizhongjiazhichang" as the final password.
[0070] In summary, the method of the present application can process and identify the prompt word input by the user, i.e. the Chinese character string, according to the preset emotion recognition model, then replace the emotional word in the Chinese character string with the corresponding character, convert the Chinese character string except the emotional word into letters, and then combine the characters in the Chinese character string according to the corresponding positions to obtain the final password. The final password is generated by converting the text, i.e. the prompt word, and the final password is a combination of characters and letters, so it has a high security coefficient. Moreover, since there is a conversion relationship between the characters, the final password will not be too complex, and there is no connection between the characters of the password, which is convenient for users to use and remember while ensuring security.
[0071] On the basis of the above embodiment, the character corresponding to the emotional word can have multiple cases, such as character expression, English word, etc. That is, if the Chinese character string includes the emotional word, the emotional word is replaced by the character corresponding to the emotional word, including:
[0072] (1) If the Chinese character string includes the emotional word, find the character expression corresponding to the emotional label in the preset expression library according to the emotional label corresponding to the emotional word, and replace the emotional word with the character expression.
[0073] In this embodiment, the Chinese character string is identified according to the preset emotion recognition model. If the Chinese character string includes the emotional word, for example, the emotional word is "unhappy", the identification of the emotional word "unhappy" according to the emotion recognition model is that the probability of being unhappy is 0.9, the probability of being happy is 0.1, etc., and the emotional label corresponding to the emotional word "unhappy" is "unhappy", which is output by the preset emotion recognition model. Then find the character expression corresponding to the emotional label "unhappy" in the preset expression library, for example, it can be ":(", and replace the emotional word with the character expression. The preset expression library can include character expressions corresponding to multiple emotional labels, for example, the character expression corresponding to "unhappy" can be ":(", the character expression corresponding to "happy" can be ":) ", etc.
[0074] (2) According to the emotional label corresponding to the emotional word in the preset database, find the English word corresponding to the emotional label, and replace the emotional word with the English word.
[0075] In combination with the above example, if the emotional word is "not happy", the emotional label corresponding to the emotional word "not happy" is identified as "unhappy", and the emotional word is replaced with the English word "unhappy" corresponding to the emotional label "unhappy" in the preset database. The preset database can include English words corresponding to various emotional labels, for example, the English word corresponding to "unhappy" is "unhappy", the English word corresponding to "happy" is "happy", and the English word corresponding to "sunshine" is "sunshine" or "sinosig" according to the specific application scenario.
[0076] In the method provided by the embodiment of the application, the corresponding character expression is found in the preset expression library according to the emotional label corresponding to the emotional word, or the corresponding English word is found in the preset database, and replacement is performed, so that the generated final password has higher security. Since the emotional word and the character expression or the English word are related, it is easier for the user to remember and facilitate subsequent use.
[0077] On the basis of the password generation method provided in the above embodiment, the embodiment of the application further provides another possible implementation manner of the password generation method. Figure 2 A flowchart of a password generation method provided by the embodiment of the application is shown in FIG. 2. As shown in FIG. 2, the strings in the Chinese character string except the emotional word are converted into letters, and the characters corresponding to the emotional word are combined to form the final password, which includes the following steps. Figure 2
[0078] S201, converting the strings in the Chinese character string except the emotional word into letters, and combining the characters corresponding to the emotional word to form an initial password.
[0079] In the embodiment, the strings in the Chinese character string except the emotional word are converted into letters, and the emotional word after replacement by the characters corresponding to the emotional word forms an initial password. The order of forming the initial password can be combined according to the position order of each character in the Chinese character string to form the initial password.
[0080] S202, traversing the initial password, replacing part of the characters in the initial password with special characters, and obtaining a final password.
[0081] Specifically, the initial password is traversed, that is, each character in the initial password is detected and identified, the special character can indicate a special symbol similar in shape to part of the characters in the initial password, or can also indicate a word similar in pronunciation to part of the characters in the initial password, and the part of the characters in the initial password corresponding to the special character is replaced with the special character to obtain the final password.
[0082] Optionally, according to the special character replacing part of the characters in the initial password corresponding to the special character, a target character in the preset replacement relationship is first obtained, that is, it can be determined through traversal detection whether a character in the preset replacement relationship is a target character, and the target character is replaced with a corresponding special character according to the preset replacement relationship to obtain the final password.
[0083] The preset replacement relationship includes a replacement relationship between the character and the special character. If the special character includes a special symbol and / or a word, the replacement relationship between the character and the special character can be further divided into a replacement relationship between the character and the special symbol and a replacement relationship between the character and the word. In an example, a special symbol similar in shape to the character can be set in advance according to the shape of the character, and then the corresponding special symbol in the preset replacement relationship is found according to the target character, and the target character is replaced with the corresponding special character.
[0084] The replacement relationship between the character and the special symbol may, for example, include that the special symbol corresponding to the character "g" is "!", the special symbol corresponding to the character "a" is "@", the special symbol corresponding to the character "i" is "#", and so on. Therefore, if "g" is detected in the traversal process, "g" is converted to "!".
[0085] In an example, a word in the preset database whose pronunciation is similar to the pronunciation of the target character can be found in advance according to the pronunciation of the target character, and the target character is replaced with the corresponding word. The replacement relationship between the character and the word may, for example, include that the word corresponding to the character "ji" is "join". Therefore, if "ji" is detected in the traversal process, "g" is converted to "join".
[0086] In the method provided by the embodiments of the present application, the character string in the Chinese character string except the emotion word segmentation is converted into a letter, and is combined with the character corresponding to the emotion word segmentation to form an initial password. Then, part of the characters in the initial password is replaced with a special character to obtain a final password. The final password generated has higher security. Since the special character is related to part of the characters in the initial password, the final password is easier to remember by the user and is convenient for subsequent use.
[0087] On the basis of the password generation method provided in the above embodiments, the present application further provides another possible implementation manner of the password generation method.Figure 3 Fig. 3 is a flowchart of a third method for generating a password according to an embodiment of the present application. As shown in Fig. 3, the initial password is traversed to obtain a target character in a preset replacement relationship, and the target character is replaced by a corresponding special character according to the preset replacement relationship to obtain a final password, including the following steps. Figure 3
[0088] S301. The initial password is traversed to obtain a target character in a preset replacement relationship, and the target character is replaced by a corresponding special character according to the preset replacement relationship to obtain a candidate password.
[0089] In this embodiment, the candidate password is obtained by replacing the characters in the initial password, specifically, the target character is replaced by a special character according to the preset replacement relationship.
[0090] S302. If the preset input data further includes: selecting to configure a special character, then a plurality of special characters are randomly inserted in the candidate password according to a preset rule to obtain a final password.
[0091] The selecting to configure a special character indicates that the user has selected to configure a special character in the process of generating the password, that is, the final password needs to include a special character. The preset rule can be to randomly insert one, two or more special characters between the characters in the candidate password, or to randomly insert a special character according to a preset interval between the characters in the candidate password. The preset interval can be two characters, three characters or more characters, which is not limited here.
[0092] In one example, the candidate password is traversed, and if no special character is detected, a plurality of special characters are randomly inserted in the candidate password according to a preset rule to obtain a final password.
[0093] In another example, the candidate password is traversed, and if a special character is detected, the candidate password is the final password.
[0094] In the method provided in this embodiment, the initial password is traversed to obtain a target character in a preset replacement relationship, and the target character is replaced by a corresponding special character according to the preset replacement relationship to obtain a candidate password. If the preset input data further includes: selecting to configure a special character, then a plurality of special characters are randomly inserted in the candidate password according to a preset rule to obtain a final password. Since no special character is detected, the special character is randomly inserted, so that the final password generated has higher security.
[0095] Another possible implementation of the method for generating a password is provided in this embodiment of the present application. Figure 4 Fig. 4 is a flowchart of a fourth method for generating a password according to an embodiment of the present application. As shown in Fig. 4, the initial password is traversed to obtain a target character in a preset replacement relationship, and the target character is replaced by a corresponding special character according to the preset replacement relationship to obtain a final password, including the following steps. Figure 4 As shown, the string in the Chinese character string except the emotion word segmentation is converted into letters, and the character combination corresponding to the emotion word segmentation constitutes the final password, including:
[0096] S401, converting the string in the Chinese character string except the emotion word segmentation into letters, and the character combination corresponding to the emotion word segmentation constitutes the initial password.
[0097] In this embodiment, the string in the Chinese character string except the emotion word segmentation is converted into letters, and the emotion word segmentation after being replaced by the character corresponding to the emotion word segmentation constitutes the initial password, wherein the order of constituting the initial password can be combined according to the position order corresponding to each character in the Chinese character string to constitute the initial password.
[0098] S402, if the preset input data further includes: configuring the uppercase and lowercase letters, then traversing the initial password.
[0099] Configuring the uppercase and lowercase letters indicates that the user has selected to configure the uppercase and lowercase letters in the process of password generation when inputting the data, wherein configuring the uppercase and lowercase letters can indicate that only lowercase letters or mixed uppercase and lowercase letters are included, and the initial password is traversed to detect the case of containing uppercase and lowercase letters in the initial password characters.
[0100] S403, if the configuring uppercase and lowercase letters indicates containing uppercase letters, and the initial password does not contain uppercase letters, then randomly converting part of the letters in the initial password to uppercase letters to obtain the final password.
[0101] If the configuring uppercase and lowercase letters indicates containing uppercase letters, and no uppercase letters are detected when the initial password is traversed, then randomly selecting part of the letters in the initial password to convert to uppercase letters, which can randomly select 1, 2 or more letters in the initial password to convert to uppercase letters, which is not limited herein, so as to obtain the final password.
[0102] S404, if the configuring uppercase and lowercase letters indicates all lowercase letters, and the initial password contains uppercase letters, then converting all the uppercase letters in the initial password to lowercase letters to obtain the final password.
[0103] If the configuring uppercase and lowercase letters indicates all lowercase letters, and uppercase letters are detected when the initial password is traversed, then converting all the uppercase letters in the initial password to lowercase letters to obtain the final password.
[0104] In the method provided by the embodiment of the present application, the initial password is traversed, and if the preset input data further comprises: configuring the uppercase and lowercase letters, if the configuring the uppercase and lowercase letters indicates that the uppercase letters are included and the initial password does not include the uppercase letters, the part of the letters in the initial password are randomly converted into the uppercase letters, if the configuring the uppercase and lowercase letters indicates that the lowercase letters are included and the initial password includes the uppercase letters, the uppercase letters in the initial password are all converted into the lowercase letters, and the final password is obtained. Since the initial password is traversed according to the preset input data, and the uppercase and lowercase letters are replaced according to the detection result, the configuration of the preset input data is met, so that the security of the generated final password is higher.
[0105] The embodiment of the present application also provides another possible implementation manner of the password generation method. Figure 5 A flowchart of a fifth password generation method provided by the embodiment of the present application is shown in FIG. 5. Figure 5 As shown in FIG. 5, the string in the Chinese character string except the emotion word segmentation is converted into the letter, and the character combination corresponding to the emotion word segmentation constitutes the initial password, which comprises the following steps.
[0106] S501, converting the string in the Chinese character string except the emotion word segmentation into the letter, and combining the character corresponding to the emotion word segmentation after the replacement to constitute the initial password.
[0107] In the embodiment, the string in the Chinese character string except the emotion word segmentation is converted into the letter, and the emotion word segmentation after the replacement of the character is combined to constitute the initial password, wherein the order of constituting the initial password can be combined according to the position order of each character in the Chinese character string to constitute the initial password.
[0108] S502, if the preset input data further comprises: configuring the password preset length, determining whether the initial password meets the password preset length.
[0109] The configuring the password preset length indicates that the user selects the password preset length when inputting the data, and the password preset length can be 6 bits, 8 bits, 10 bits or other preset lengths, which are not limited herein. The initial password is traversed, and it is determined whether the character number of the initial password meets the password preset length.
[0110] S503, if the character number of the initial password is less than the password preset length, inserting the random character in the initial password to obtain the final password meeting the preset length.
[0111] The random character includes one or more of a number, a letter, and a special character, and the random character is inserted into the initial password at a random position or at a position according to a set interval between strings. The number of the random characters inserted can be determined according to the preset length of the password and the number of characters of the initial password. If the preset length of the password is 10 bits and the number of characters of the initial password is 6, the number of the random characters inserted can be 4. The 4 random characters can be any 4 of a number, a letter, and a special character, so that the final password satisfying the preset length is obtained.
[0112] If the number of characters of the initial password satisfies the preset length of the password, the initial password is the final password.
[0113] Optionally, if the length of the initial password is greater than the preset length of the password, the initial password can generally not be adjusted. Of course, if the configuration must be set according to the preset length of the password, the number of characters exceeding the preset length of the password can also be randomly reduced.
[0114] In the method provided by the embodiment of the application, if the preset input data further includes a preset length of the password, it is determined whether the initial password satisfies the preset length of the password. If the number of characters of the initial password is less than the preset length of the password, a random character is inserted into the initial password to obtain a final password satisfying the preset length, so that the length of the final password meets the preset length of the password set by the user.
[0115] The embodiment of the application also provides another possible implementation manner of the password generation method. Figure 6 FIG. 6 is a flowchart of a password generation method provided by the embodiment of the application. As shown in the figure, the complete flow of the password generation is illustrated by taking one flow as an example, but the application is not limited in this respect. The order of the above-mentioned multiple password processing processes can be flexibly combined. Optionally, the method comprises the following steps. Figure 6
[0116] S601, acquiring preset input data to generate a Chinese character string.
[0117] S602, performing data preprocessing on the Chinese character string, and identifying whether the Chinese character string contains an emotional word according to a preset emotion recognition model.
[0118] S603, if the Chinese character string contains an emotional word, replacing the emotional word with a character corresponding to the emotional word.
[0119] S604, converting a string in the Chinese character string except the emotional word into a letter, and combining the character corresponding to the emotional word to form an initial password.
[0120] S605, traversing the initial password, acquiring a target character in a preset replacement relationship, and replacing the target character with a corresponding special character according to the preset replacement relationship to obtain a candidate password.
[0121] S606, determining whether the preset input data includes a special character configuration selection.
[0122] S607, if the preset input data includes a special character configuration selection, and no special character is detected when the password to be selected is traversed, a plurality of special characters are randomly inserted according to a preset rule, and then it is determined whether the preset input data includes a case letter configuration.
[0123] S608, if the preset input data does not include a special character configuration selection, or the preset input data includes a special character configuration selection and a special character is detected when the password to be selected is traversed, no special character is inserted, and it is determined whether the preset input data includes a case letter configuration.
[0124] S609, determining whether the preset input data includes a case letter configuration.
[0125] S610, if the case letter configuration indicates that the uppercase letters are included, and it is detected that the password to be selected does not include the uppercase letters when the password to be selected is traversed, some letters in the password to be selected are randomly converted to uppercase letters, and then it is determined whether the preset input data includes a password preset length configuration.
[0126] S611, if the case letter configuration indicates that all the letters are in lowercase, and it is detected that the password to be selected includes uppercase letters when the password to be selected is traversed, all the uppercase letters in the password to be selected are converted to lowercase letters, and then it is determined whether the preset input data includes a password preset length configuration.
[0127] S612, determining whether the preset input data includes a password preset length configuration.
[0128] S613, if the number of characters of the password to be selected is less than the password preset length, random characters are inserted into the password to be selected to obtain a final password that satisfies the preset length.
[0129] S614, if the number of characters of the password to be selected satisfies the password preset length, the password to be selected is the final password.
[0130] S615, outputting the final password result.
[0131] It should be noted that the implementation process of the above steps can refer to the foregoing embodiments, which will not be described here.
[0132] The following continues to explain the password generation device and electronic equipment provided by any of the embodiments of the present application, and the specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments. For brief description, the parts not mentioned in this embodiment can refer to the corresponding contents in the method embodiments.
[0133] Figure 7 A functional module schematic diagram of a password generation device provided by an embodiment of the present application is shown in FIG. 1. As shown in the figure, the password generation device 100 comprises: Figure 7
[0134] An obtaining module 110 is configured to obtain preset input data, wherein the preset input data comprises a prompt word, and the prompt word comprises a Chinese character string.
[0135] An identifying module 120 is configured to identify whether the Chinese character string contains emotional words according to a preset emotion recognition model.
[0136] A replacing module 130 is configured to replace the emotional words with corresponding characters if the Chinese character string contains the emotional words.
[0137] A constituting module 140 is configured to convert the Chinese character string except the emotional words into letters, and combine the corresponding characters of the emotional words to form a final password.
[0138] In an optional implementation, the replacing module 130 is further configured to find out a character expression corresponding to the emotional label in a preset expression library according to the emotional label corresponding to the emotional words if the Chinese character string contains the emotional words, and replace the emotional words with the character expression; or find out an English word corresponding to the emotional label in a preset database according to the emotional label corresponding to the emotional words, and replace the emotional words with the English word, wherein the emotional label is output by the preset emotion recognition model.
[0139] In an optional implementation, the constituting module 140 is further configured to convert the Chinese character string except the emotional words into letters, combine the corresponding characters of the emotional words to form an initial password, and replace part of the characters in the initial password with special characters to obtain the final password.
[0140] In an optional implementation, the constituting module 140 is further configured to traverse the initial password, obtain a target character in a preset replacement relationship, and replace the target character with a corresponding special character according to the preset replacement relationship to obtain the final password, wherein the preset replacement relationship comprises a replacement relationship between the characters and the special characters.
[0141] In an optional implementation, the constituting module 140 is further configured to traverse the initial password, obtain a target character in a preset replacement relationship, and replace the target character with a corresponding special character according to the preset replacement relationship to obtain a candidate password; and if the preset input data further comprises a selection configuration special character, randomly insert a plurality of special characters into the candidate password according to a preset rule to obtain the final password.
[0142] In an optional implementation, the constructing module 140 is further configured to convert the character string other than the emotion-based word in the Chinese character string into letters, and combine the characters corresponding to the emotion-based word to form an initial password; if the preset input data further comprises: a configuration of case letters, then traverse the initial password; if the configuration of case letters indicates that the initial password contains no capital letters, and the initial password contains no capital letters, then convert part of the letters in the initial password into capital letters randomly to obtain a final password; if the configuration of case letters indicates that the initial password contains all lower-case letters, and the initial password contains capital letters, then convert all the capital letters in the initial password into lower-case letters to obtain a final password.
[0143] In an optional implementation, the constructing module 140 is further configured to convert the character string other than the emotion-based word in the Chinese character string into letters, and combine the characters corresponding to the emotion-based word to form an initial password; if the preset input data further comprises: a configuration of case letters, then traverse the initial password; if the configuration of case letters indicates that the initial password contains no capital letters, and the initial password contains no capital letters, then convert part of the letters in the initial password into capital letters randomly to obtain a final password; if the configuration of case letters indicates that the initial password contains all lower-case letters, and the initial password contains capital letters, then convert all the capital letters in the initial password into lower-case letters to obtain a final password.
[0144] In an optional implementation, the constructing module 140 is further configured to convert the character string other than the emotion-based word in the Chinese character string into letters, and combine the characters corresponding to the emotion-based word to form an initial password; if the preset input data further comprises: a configuration of case letters, then traverse the initial password; if the configuration of case letters indicates that the initial password contains no capital letters, and the initial password contains no capital letters, then convert part of the letters in the initial password into capital letters randomly to obtain a final password; if the configuration of case letters indicates that the initial password contains all lower-case letters, and the initial password contains capital letters, then convert all the capital letters in the initial password into lower-case letters to obtain a final password.
[0145] The apparatus is configured to perform the method provided by the foregoing embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0146] The above modules can be one or more integrated circuits configured to implement the above method, for example, one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs), etc. For another example, when the above certain module is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can invoke program code. For another example, the modules can be integrated together to be implemented in the form of a system on a chip (SOC).
[0147] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 1. The electronic device can be used for password generation. As shown in FIG. 1, the electronic device comprises a constructing module 140 and a generating module 150. Figure 8As shown, the electronic device 200 includes a processor 210, a storage medium 220, and a bus 230.
[0148] The storage medium 220 stores machine readable instructions executable by the processor 210. When the electronic device is running, the processor 210 and the storage medium 220 communicate through the bus 230. The processor 210 executes the machine readable instructions to perform the steps of the above method embodiments. The specific implementation and technical effects are similar, and will not be repeated here.
[0149] Optionally, the present application also provides a storage medium 220, which stores a computer program. When the computer program is run by the processor, it performs the steps of the above method embodiments. The specific implementation and technical effects are similar, and will not be repeated here.
[0150] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the described embodiments of the apparatus are merely schematic, and the division of the units is merely a logical function division. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0151] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0152] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can be a physically independent unit, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function unit.
[0153] The integrated unit in the form of software function unit can be stored in a computer readable storage medium. The software function unit is stored in a storage medium, and includes a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute part of steps of the method according to various embodiments of the present application. The storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage media capable of storing program codes.
[0154] The above merely describes specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A password generation method, characterized in that, include: Obtain preset input data, the preset input data including: prompt words, the prompt words including: Chinese character strings; The system identifies whether the Chinese character string contains emotion-related word segments based on a preset emotion recognition model. If the Chinese character string includes an emotion segment, then the emotion segment is replaced with the character corresponding to the emotion segment; The strings in the Chinese character string, excluding the emotion segment, are converted into letters, and combined with the characters corresponding to the emotion segment to form the final password; The step of converting the Chinese character string (excluding the emotion segment) into letters and combining them with the characters corresponding to the emotion segment to form the final password includes: Convert all strings in the Chinese character string except for the emotion segmentation words into letters, and combine them with the characters corresponding to the emotion segmentation words to form the initial password; The initial password is iterated through, and some characters in the initial password are replaced with special characters to obtain the final password. The special characters are special symbols that are similar in shape to some characters in the initial password, or words that are similar in pronunciation to some characters in the initial password.
2. The method as described in claim 1, characterized in that, If the Chinese character string includes an emotion segment, then the emotion segment is replaced with the character corresponding to the emotion segment, including: If the Chinese character string includes emotion segmentation, find the character emoji corresponding to the emotion tag in the preset emoji library according to the emotion tag corresponding to the emotion segmentation, and replace the emotion segmentation with the character emoji; Alternatively, based on the emotion tag corresponding to the emotion segment, find the English word corresponding to the emotion tag in a preset database, and replace the emotion segment with the English word, wherein the emotion tag is output by the preset emotion recognition model.
3. The method as described in claim 1, characterized in that, The step of iterating through the initial password, replacing some characters in the initial password with special characters, and obtaining the final password includes: The initial password is traversed to obtain target characters in the preset replacement relationship, and the target characters are replaced with corresponding special characters according to the preset replacement relationship to obtain the final password. The preset replacement relationship includes the replacement relationship between characters and special characters.
4. The method as described in claim 3, characterized in that, The step of iterating through the initial password to obtain target characters in a preset replacement relationship, and replacing the target characters with corresponding special characters according to the preset replacement relationship to obtain the final password includes: The initial password is traversed to obtain the target characters in the preset replacement relationship, and the target characters are replaced with corresponding special characters according to the preset replacement relationship to obtain the candidate password; If the preset input data further includes: selecting and configuring special characters, then multiple special characters are randomly inserted into the candidate passwords according to preset rules to obtain the final password.
5. The method as described in claim 1 or 2, characterized in that, The step of converting the Chinese character string (excluding the emotion segment) into letters and combining them with the characters corresponding to the emotion segment to form the final password includes: Convert all strings in the Chinese character string except for the emotion segmentation words into letters, and combine them with the characters corresponding to the emotion segmentation words to form the initial password; If the preset input data also includes: configuring uppercase and lowercase letters, then iterate through the initial password; If the configured case indication contains uppercase letters and the initial password does not contain uppercase letters, then some letters in the initial password are randomly converted to uppercase letters to obtain the final password; If the configured uppercase and lowercase letter instruction indicates all lowercase letters and the initial password contains uppercase letters, then all uppercase letters in the initial password are converted to lowercase letters to obtain the final password.
6. The method as described in claim 1 or 2, characterized in that, The step of converting the Chinese character string (excluding the emotion segment) into letters and combining them with the characters corresponding to the emotion segment to form the final password includes: Convert all strings in the Chinese character string except for the emotion segmentation words into letters, and combine them with the characters corresponding to the emotion segmentation words to form the initial password; If the preset input data further includes: configuring a preset password length, then determine whether the initial password meets the preset password length; If the number of characters in the initial password is less than the preset password length, random characters are inserted into the initial password to obtain a final password that meets the preset length. The random characters include one or more of the following: numbers, letters, and special characters.
7. The method as described in claim 1, characterized in that, The step of converting the Chinese character string (excluding the emotion segment) into letters and combining them with the characters corresponding to the emotion segment to form the final password includes: If the Chinese character string does not include emotion segmentation, then the Chinese character string will be converted into Pinyin letters to form the final password.
8. A password generation device, characterized in that, include: The acquisition module is used to acquire preset input data, which includes prompt words, and the prompt words include Chinese character strings. The recognition module is used to identify whether the Chinese character string contains emotion segmentation based on a preset emotion recognition model; The replacement module is used to replace the emotion segment with the character corresponding to the emotion segment if the Chinese character string includes an emotion segment; The module is used to convert the strings in the Chinese character string, excluding the emotion segmentation words, into letters, and combine them with the characters corresponding to the emotion segmentation words to form the final password; The constitutive module is further configured to convert the strings in the Chinese character string other than the emotion segment into letters, and combine them with the characters corresponding to the emotion segment to form an initial password; traverse the initial password, replace some characters in the initial password with special characters, and obtain the final password, wherein the special characters indicate special symbols that are similar in shape to some characters in the initial password, or words that are similar in pronunciation to some characters in the initial password.
9. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the password generation method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Microcomputer bit addition verifying coded lock
CN106157395A
Password generation method and related product
CN108418682A
Natural text-based man-machine intelligent interaction control platform
CN108597008A