[go: up one dir, main page]

CN107678554B - Method and system for layout of mobile phone keyboard - Google Patents

Method and system for layout of mobile phone keyboard Download PDF

Info

Publication number
CN107678554B
CN107678554B CN201710791813.0A CN201710791813A CN107678554B CN 107678554 B CN107678554 B CN 107678554B CN 201710791813 A CN201710791813 A CN 201710791813A CN 107678554 B CN107678554 B CN 107678554B
Authority
CN
China
Prior art keywords
individual
individuals
population
dominated
target value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710791813.0A
Other languages
Chinese (zh)
Other versions
CN107678554A (en
Inventor
邹娟
王濛
张影
郑金华
杨圣祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiangtan University
Original Assignee
Xiangtan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiangtan University filed Critical Xiangtan University
Priority to CN201710791813.0A priority Critical patent/CN107678554B/en
Publication of CN107678554A publication Critical patent/CN107678554A/en
Application granted granted Critical
Publication of CN107678554B publication Critical patent/CN107678554B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/0202Constructional details or processes of manufacture of the input device
    • G06F3/0216Arrangements for ergonomically adjusting the disposition of keys of a keyboard
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Genetics & Genomics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Physiology (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a system for mobile phone keyboard layout, which comprises the steps of firstly randomly generating an initial population containing a plurality of individuals, setting iteration times, and obtaining English sentences input by users, wherein the individuals represent the arrangement form of 26 letters on a Sudoku keyboard, and words in the English sentences represent words required by the users and input by habits; counting the occurrence frequency of letters in English sentences at each position in words; then, processing the individuals in the initial population by adopting a non-dominated multi-target algorithm, selecting the first N individuals with high aggregation degree to add into the evolved population, and finishing one-time evolution; judging whether the evolution times are less than the iteration times; if so, processing the individuals in the evolved population by adopting a non-dominated multi-target algorithm; and if not, outputting the individual with the maximum aggregation in the evolved population as the optimal individual. Therefore, the method or the system provided by the invention can rearrange the keyboard pattern of the mobile phone based on the user requirement and the user habit, reduce spelling conflicts and improve the input efficiency.

Description

一种手机键盘布局的方法及系统Method and system for layout of mobile phone keyboard

技术领域technical field

本发明涉及人工智能领域,特别是涉及一种基于用户需求的手机键盘布局的方法及系统。The present invention relates to the field of artificial intelligence, in particular to a method and system for a mobile phone keyboard layout based on user requirements.

背景技术Background technique

随着现代科学技术的发展,手机被广泛认可为继报纸、广播、电视、网络后的“第五媒体”,其拥有着越来越大的用户群体。智能手机的普及,使越来越多的人将手机作为基本的、简单快捷并且高效的办公工具。在早班地铁上,在等待过马路的人群中,甚至于在校园里奔走的学生,每个人都在使用手机快速的敲击键盘,进行着各自的工作。此时,手机输入效率显得尤为重要,据调查显示,目前使用手机九宫格输入法的人数约占手机使用总人数的50%。With the development of modern science and technology, mobile phones are widely recognized as the "fifth media" after newspapers, radio, television, and the Internet, and they have a larger and larger user group. With the popularity of smart phones, more and more people use mobile phones as a basic, simple, fast and efficient office tool. On the morning subway, among the crowds waiting to cross the road, and even the students running around the campus, everyone is using their mobile phones to quickly tap the keyboard and do their own work. At this time, the efficiency of mobile phone input is particularly important. According to the survey, the number of people who use the mobile phone Jiugongge input method accounts for about 50% of the total number of mobile phone users.

在现有的手机九宫格键盘排序上,字符按照A-Z的顺序进行的简单分布,当我们想要输入“Li”这个字符时,会出现“Ji”等一系列不需要的无效字符,需要我们去花时间选择,长久以来大大增加了人们打字的时间。因此,如何提高手机输入效率,减少打字时间,是目前人工智能领域急需解决的问题。In the existing mobile phone Jiugongge keyboard sorting, the characters are simply distributed in the order of A-Z. When we want to enter the character "Li", a series of unnecessary invalid characters such as "Ji" will appear, which requires us to spend Timing has long greatly increased the time people spend typing. Therefore, how to improve the efficiency of mobile phone input and reduce typing time is an urgent problem to be solved in the field of artificial intelligence.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种基于用户需求的手机键盘布局的方法及系统,能够减少拼写冲突,减小输入时间,提高输入效率。The purpose of the present invention is to provide a method and system for a mobile phone keyboard layout based on user requirements, which can reduce spelling conflicts, reduce input time, and improve input efficiency.

为实现上述目的,本发明提供了如下方案:For achieving the above object, the present invention provides the following scheme:

一种手机键盘布局的方法,所述方法包括:A method for layout of a mobile phone keyboard, the method comprising:

随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同;Randomly generate an initial population containing a plurality of individuals; the individual represents the arrangement of 26 letters on the nine-square keyboard; the arrangement of different individuals is different;

获取用户输入的英语语句;所述英文语句包含多个单词;Obtain the English sentence input by the user; the English sentence contains a plurality of words;

获取每个字母在所述单词中每个位置出现的频率;Get the frequency of each letter in each position in the word;

获取迭代次数;Get the number of iterations;

对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群;Perform mating, recombination, and mutation processing on the individuals in the initial population to obtain a new individual, and add the new individual to the initial population to obtain a mutant population;

根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值;According to the frequency, calculate the first target value and the second target value of each individual in the variant population;

根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合;According to the first target value and the second target value of each of the individuals, obtain a first-layer non-dominated individual set;

判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果;Judging whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtain a first judgment result;

若所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N,则根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果步骤;If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, then according to the number of the individuals except the individuals in the first-layer non-dominated individual set a target value and a second target value, obtain the second-layer non-dominated individual set, add the individuals in the second-layer non-dominated individual set to the first-layer non-dominated individual set, and update the first layer After the set of non-dominated individuals, return to the step of judging whether the number of individuals in the set of non-dominated individuals of the first layer is greater than or equal to N, and obtain the first judgment result;

若所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N,则计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化;If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N, then calculate the aggregation degree of each individual in the first-layer non-dominated individual set, and according to each Arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of the individuals, select the first N individuals from the first-layer non-dominated individual set after the arrangement to join the evolutionary population, and complete an evolution ;

判断进化次数是否小于所述迭代次数,得到第二判断结果;Judging whether the number of evolutions is less than the number of iterations, and obtaining a second judgment result;

若所述第二判断结果表示所述进化次数小于所述迭代次数,则返回对所述初始种群中的个体进行交配、重组、变异处理步骤,将所述初始种群中的个体替换成所述进化种群中的个体;If the second judgment result indicates that the number of evolutions is less than the number of iterations, returning to the steps of mating, recombining, and mutating the individuals in the initial population, and replacing the individuals in the initial population with the evolutionary individuals in a population;

若所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则将所述进化种群中聚集度最大的个体作为最优个体输出。If the second judgment result indicates that the number of evolutions is greater than or equal to the number of iterations, the individual with the largest aggregation degree in the evolutionary population is output as the optimal individual.

可选的,所述根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值,具体包括:Optionally, calculating the first target value and the second target value of each individual in the mutant population according to the frequency, specifically includes:

根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:

Figure BDA0001399392920000031
Calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure BDA0001399392920000031

根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:

Figure BDA0001399392920000032
Calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure BDA0001399392920000032

式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值。In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word.

可选的,所述对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群,具体包括:Optionally, performing mating, recombination, and mutation processing on the individuals in the initial population to obtain new individuals, and adding the new individuals to the initial population to obtain a mutant population, specifically including:

根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值;Calculate the first target value and the second target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2);

多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群;Selecting two of the individuals from the initial population for multiple times for comparison, and moving the individuals with both the first target value and the second target value smaller to the offspring population, until the number of individuals in the offspring population When the set threshold is reached, the selection is stopped to obtain the progeny population;

对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群;Perform discrete recombination and mutation operations on each individual in the progeny population to obtain a processed progeny population;

将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。Individuals in the treated progeny population are added to the initial population to obtain a mutant population.

可选的,所述根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合,具体包括:Optionally, obtaining the first-layer non-dominated individual set according to the first target value and the second target value of each individual, specifically includes:

判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;Judging whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtaining a third judgment result; the non-dominated individuals represent individuals in the mutant population whose first target value and second target value are both minimum values ;

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第一层非支配个体集合;If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero, moving the individual to the first-layer non-dominated individual set;

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述变异种群中。If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero, the individual is retained in the mutant population.

可选的,所述根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,具体包括:Optionally, obtaining the second-layer non-dominated individual set according to the first target value and the second target value of each of the individuals except the individuals in the first-layer non-dominated individual set specifically includes:

判断剩余种群中各个体的非支配个体的数量是否为零,得到第四判断结果;所述非支配个体表示所述剩余种群中第一目标值小于所述个体的第一目标值且第二目标值小于所述个体的第二目标值的个体;所述剩余种群为所述变异种群中除所述第一层非支配个体集合的个体外的个体组成的种群;Determine whether the number of non-dominated individuals of each individual in the remaining population is zero, and obtain a fourth judgment result; the non-dominated individual indicates that the first target value in the remaining population is less than the first target value of the individual and the second target Individuals whose value is less than the second target value of the individual; the remaining population is a population composed of individuals in the mutant population except for the individuals in the first-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第二层非支配个体集合;If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is zero, moving the individual to the second-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述剩余种群中。If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is not zero, the individual is retained in the remaining population.

可选的,所述计算所述第一层非支配个体集合中每个个体的聚集度,具体包括:Optionally, the calculating the aggregation degree of each individual in the first-layer non-dominated individual set specifically includes:

根据公式(3)计算所述第一层非支配个体集合中每个个体的聚集度;所述公式(3)为:P(n)=[P(n-1)*q1+P(n+1)*q1]+[P(n-1)*q2+P(n+1)*q2](2);The aggregation degree of each individual in the first-layer non-dominated individual set is calculated according to formula (3); the formula (3) is: P(n)=[P(n-1)*q 1 +P(n +1)*q 1 ]+[P(n-1)*q 2 +P(n+1)*q 2 ](2);

式(3)中,P(n)表示第n个个体的聚集度;

Figure BDA0001399392920000041
Figure BDA0001399392920000042
In formula (3), P(n) represents the aggregation degree of the nth individual;
Figure BDA0001399392920000041
Figure BDA0001399392920000042

本发明还提供了一种手机键盘布局的系统,所述系统包括:The present invention also provides a system for the layout of a mobile phone keyboard, the system comprising:

初始种群生成模块,用于随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同;The initial population generation module is used to randomly generate an initial population containing a plurality of individuals; the individual represents the arrangement of 26 letters on the nine-square keyboard; the arrangement of different individuals is different;

英文语句获取模块,用于获取用户输入的英语语句;所述英文语句包含多个单词;an English sentence acquisition module, used for acquiring an English sentence input by a user; the English sentence contains a plurality of words;

频率获取模块,用于获取每个字母在所述单词中每个位置出现的频率;a frequency acquisition module for acquiring the frequency of each letter appearing in each position in the word;

迭代次数获取模块,用于获取迭代次数;The number of iterations acquisition module is used to obtain the number of iterations;

变异种群得到模块,用于对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群;A mutant population obtaining module, used for mating, recombining, and mutating individuals in the initial population to obtain a new individual, and adding the new individual to the initial population to obtain a mutant population;

第一目标值和第二目标值计算模块,用于根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值;a first target value and a second target value calculation module, configured to calculate the first target value and the second target value of each individual in the variant population according to the frequency;

第一层非支配个体集合获取模块,用于根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合;a first-layer non-dominated individual set acquisition module, configured to acquire a first-layer non-dominated individual set according to the first target value and the second target value of each of the individuals;

第一判断结果得到模块,用于判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果;The first judgment result obtaining module is used for judging whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtains the first judgment result;

第一层非支配个体集合更新模块,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N时,根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果步骤;The first-layer non-dominated individual set update module is configured to, when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, according to dividing the first-layer non-dominated individual set the first target value and the second target value of each of the individuals outside the individual in the Layer non-dominated individual sets, after updating the first layer of non-dominated individual sets, return to the step of judging whether the number of individuals in the first layer of non-dominated individual sets is greater than or equal to N, and obtain a first judgment result;

进化种群得到模块,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N时,计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化;An evolutionary population obtaining module, configured to calculate each individual in the first-layer non-dominated individual set when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N and arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual, and select the first N individuals from the arranged first-layer non-dominated individual set to join To the evolutionary population, complete an evolution;

第二判断结果得到模块,用于判断进化次数是否小于所述迭代次数,得到第二判断结果;The second judgment result obtaining module is used to judge whether the number of evolution is less than the number of iterations, and obtain the second judgment result;

进化种群个体处理模块,用于当所述第二判断结果表示所述进化次数小于所述迭代次数时,则返回对所述初始种群中的个体进行交配、重组、变异处理步骤,将所述初始种群中的个体替换成所述进化种群中的个体;The evolutionary population individual processing module is used to return to the steps of mating, recombination, and mutation processing for individuals in the initial population when the second judgment result indicates that the evolution times are less than the iteration times, and the initial individuals in the population are replaced with individuals in the evolutionary population;

最优个体输出模块,用于当所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则将所述进化种群中聚集度最大的个体作为最优个体输出。The optimal individual output module is configured to output the individual with the largest aggregation degree in the evolutionary population as the optimal individual when the second judgment result indicates that the evolution number is greater than or equal to the iteration number.

可选的,所述第一目标值和第二目标值计算模块,具体包括:Optionally, the first target value and the second target value calculation module specifically includes:

第一目标值计算单元,用于根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:

Figure BDA0001399392920000061
The first target value calculation unit is used to calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure BDA0001399392920000061

第二目标值计算单元,用于根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:

Figure BDA0001399392920000062
The second target value calculation unit is configured to calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure BDA0001399392920000062

式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值。In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word.

可选的,所述变异种群得到模块,具体包括:Optionally, the variant population obtains a module, which specifically includes:

初始种群中每个个体第一目标值和第二目标值计算单元,用于根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值;The first target value and the second target value calculation unit of each individual in the initial population is used to calculate the first target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2). a target value and a second target value;

子代种群得到单元,用于多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群;The offspring population obtaining unit is used to select two individuals from the initial population for multiple comparisons, and move the individuals whose first target value and the second target value are both smaller to the offspring population, until When the number of individuals of the progeny population reaches the set threshold, the selection is stopped to obtain the progeny population;

处理后子代种群得到单元,用于对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群;After processing, the offspring population obtains a unit, which is used to perform discrete recombination and mutation operations on each individual in the offspring population to obtain the processed offspring population;

变异种群得到单元,用于将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。The mutant population obtaining unit is used for adding the individuals in the treated progeny population to the initial population to obtain the mutant population.

可选的,所述第一层非支配个体集合获取模块,具体包括:Optionally, the first-layer non-dominated individual set acquisition module specifically includes:

第三判断结果得到单元,用于判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;The third judgment result obtaining unit is used to judge whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtain a third judgment result; the non-dominated individuals represent the first target value and the first target value in the mutant population. Individuals whose two target values are both minimum values;

移动单元,用于当所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零时,将所述个体移动至到所述第一层非支配个体集合;a moving unit, configured to move the individual to the first-layer non-dominated individual set when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero;

保留单元,用于所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零时,将所述个体保留在所述变异种群中。A retention unit, used for retaining the individual in the mutant population when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero.

根据本发明提供的具体实施例,本发明公开了以下技术效果:本发明提供了一种手机键盘布局的方法及系统,是基于用户需求和用户习惯而重新布设手机键盘格局。其中,该方法首先随机生成含有多个个体的初始种群,设置迭代次数,获取用户输入的英语语句,个体表示26个字母在九宫格键盘上的排列形式,不同个体的排列形式不同,英文语句中单词代表用户需求、习惯输入的单词,并统计英文语句中每个字母在所述单词中每个位置出现的频率;然后采用锦标赛算法和遗传变异算法对初始种群中的个体进行交配、重组、变异处理,得到变异种群,并根据统计出的频率,采用非支配目标算法,得到个体数大于或者等于N的第一层非支配个体集合,计算第一层非支配个体集合中每个个体的聚集度,并按照每个个体的聚集度降序排列,选择前N个个体加入到进化种群,完成一次进化;最后判断进化次数是否小于迭代次数,若是,则采用锦标赛算法和遗传变异算法对进化种群始中的个体进行交配、重组、变异处理;若否,则将进化种群中聚集度最大的个体作为最优个体输出。因此,本发明提供的方法或者系统,能够基于用户需求和用户习惯而重新布设手机键盘格局,减少拼写冲突,减小输入时间,提高输入效率。According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention provides a method and system for the layout of a mobile phone keyboard, which re-arranges the mobile phone keyboard layout based on user needs and user habits. Among them, the method first randomly generates an initial population with multiple individuals, sets the number of iterations, and obtains the English sentence input by the user. The individual represents the arrangement form of 26 letters on the Jiugongge keyboard. The arrangement form of different individuals is different. The words in the English sentence Words that represent user needs and habitual input, and count the frequency of each letter in the English sentence appearing at each position in the word; then use the tournament algorithm and the genetic mutation algorithm to mate, recombine, and mutate the individuals in the initial population. , obtain the mutant population, and use the non-dominated target algorithm to obtain the first-level non-dominated individual set with the number of individuals greater than or equal to N according to the frequency counted, and calculate the aggregation degree of each individual in the first-level non-dominated individual set, And according to the descending order of the aggregation degree of each individual, select the first N individuals to join the evolutionary population to complete an evolution; finally judge whether the number of evolution is less than the number of iterations, if so, use the championship algorithm and the genetic mutation algorithm to analyze the evolutionary population. Individuals undergo mating, recombination, and mutation processing; if not, the individual with the largest aggregation degree in the evolutionary population is output as the optimal individual. Therefore, the method or system provided by the present invention can rearrange the mobile phone keyboard layout based on user requirements and user habits, reduce spelling conflicts, reduce input time, and improve input efficiency.

另外,本发明采用非支配多目标算法,来求解最优个体,提高运行速度和解集的收敛性,避免寻找最优解释陷入局部最优解状况,降低了非劣排序遗传算法的复杂性。In addition, the present invention adopts the non-dominated multi-objective algorithm to solve the optimal individual, improves the running speed and the convergence of the solution set, avoids finding the optimal explanation and falls into the local optimal solution situation, and reduces the complexity of the non-inferior sorting genetic algorithm.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings required in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present invention. In the embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative labor.

图1为本发明实施例手机键盘布局方法的流程示意图;1 is a schematic flowchart of a mobile phone keyboard layout method according to an embodiment of the present invention;

图2为本发明实施例的手机键盘字母布局示意图;2 is a schematic diagram of the alphabet layout of a mobile phone keyboard according to an embodiment of the present invention;

图3为本发明实施例手机键盘布局系统的结构示意图。FIG. 3 is a schematic structural diagram of a mobile phone keyboard layout system according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明的目的是提供一种基于用户需求的手机键盘布局的方法及系统,能够减少拼写冲突,减小输入时间,提高输入效率。The purpose of the present invention is to provide a method and system for a mobile phone keyboard layout based on user requirements, which can reduce spelling conflicts, reduce input time, and improve input efficiency.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

实施例一Example 1

图1为本发明实施例手机键盘布局方法的流程示意图,如图1所示,本发明提供的解密方法具体包括以下步骤:FIG. 1 is a schematic flowchart of a mobile phone keyboard layout method according to an embodiment of the present invention. As shown in FIG. 1 , the decryption method provided by the present invention specifically includes the following steps:

步骤101:随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同。Step 101: Randomly generate an initial population containing a plurality of individuals; the individuals represent the arrangement form of 26 letters on the nine-square keyboard; the arrangement forms of different individuals are different.

步骤102:获取用户输入的英语语句;所述英文语句包含多个单词。在本发明实施例中为了方便描述,用英语语句中的单词代表用户习惯输入的单词。Step 102: Acquire an English sentence input by the user; the English sentence includes a plurality of words. In this embodiment of the present invention, for the convenience of description, words in English sentences are used to represent words that users are accustomed to input.

步骤103:获取每个字母在所述单词中每个位置出现的频率。Step 103: Obtain the frequency of each letter appearing in each position in the word.

步骤104:获取迭代次数。Step 104: Obtain the number of iterations.

步骤105:对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群。Step 105: Perform mating, recombination, and mutation processing on the individuals in the initial population to obtain new individuals, and add the new individuals to the initial population to obtain a mutant population.

步骤106:根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值。Step 106: Calculate the first target value and the second target value of each individual in the mutant population according to the frequency.

步骤107:根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合。Step 107: Obtain a first-layer non-dominated individual set according to the first target value and the second target value of each of the individuals.

步骤108:判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果。Step 108: Determine whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtain a first judgment result.

若所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N,则执行步骤109。If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, step 109 is executed.

步骤109:根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合;更新所述第一层非支配个体集合后,返回步骤108。Step 109: According to the first target value and the second target value of each of the individuals except the individuals in the first-layer non-dominated individual set, obtain a second-layer non-dominated individual set, and use the second The individuals in the set of non-dominated individuals of the layer are added to the set of non-dominated individuals of the first layer, and the set of non-dominated individuals of the first layer is updated; after updating the set of non-dominated individuals of the first layer, return to step 108 .

若所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N,则执行步骤110。If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N, step 110 is executed.

步骤110:计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化。所述进化种群是由排列后的第一层非支配个体集合中前N个个体组成。Step 110: Calculate the aggregation degree of each individual in the first-layer non-dominated individual set, and arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual. Select the first N individuals from the first-layer non-dominated individual set to be added to the evolutionary population to complete an evolution. The evolutionary population is composed of the first N individuals in the set of first-level non-dominated individuals after the arrangement.

步骤111:判断进化次数是否小于所述迭代次数,得到第二判断结果。Step 111: Determine whether the number of evolutions is less than the number of iterations, and obtain a second judgment result.

若所述第二判断结果表示所述进化次数小于所述迭代次数,则执行步骤112,If the second judgment result indicates that the number of evolutions is less than the number of iterations, step 112 is executed,

步骤112:将所述初始种群中的个体替换成所述进化种群中的个体后,执行步骤105。Step 112: After replacing the individuals in the initial population with individuals in the evolutionary population, step 105 is performed.

若所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则执行步骤113。If the second judgment result indicates that the number of evolutions is greater than or equal to the number of iterations, step 113 is executed.

步骤113:将所述进化种群中聚集度最大的个体作为最优个体输出。Step 113: Output the individual with the largest aggregation degree in the evolutionary population as the optimal individual.

其中,步骤106具体包括:Wherein, step 106 specifically includes:

根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:

Figure BDA0001399392920000101
Calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure BDA0001399392920000101

根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:

Figure BDA0001399392920000102
Calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure BDA0001399392920000102

式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值。In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word.

步骤105具体包括:Step 105 specifically includes:

根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值;Calculate the first target value and the second target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2);

多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群;Selecting two of the individuals from the initial population for multiple times for comparison, and moving the individuals with both the first target value and the second target value smaller to the offspring population, until the number of individuals in the offspring population When the set threshold is reached, the selection is stopped to obtain the progeny population;

对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群;Perform discrete recombination and mutation operations on each individual in the progeny population to obtain a processed progeny population;

将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。Individuals in the treated progeny population are added to the initial population to obtain a mutant population.

步骤107具体包括:Step 107 specifically includes:

判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;Judging whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtaining a third judgment result;

所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体。The non-dominated individual represents an individual whose first target value and second target value are both minimum values in the mutant population.

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第一层非支配个体集合;If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero, moving the individual to the first-layer non-dominated individual set;

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述变异种群中。If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero, the individual is retained in the mutant population.

步骤109具体包括:Step 109 specifically includes:

判断剩余种群中各个体的非支配个体的数量是否为零,得到第四判断结果;所述非支配个体表示所述剩余种群中第一目标值小于所述个体的第一目标值且第二目标值小于所述个体的第二目标值的个体;所述剩余种群为所述变异种群中除所述第一层非支配个体集合的个体外的个体组成的种群;Determine whether the number of non-dominated individuals of each individual in the remaining population is zero, and obtain a fourth judgment result; the non-dominated individual indicates that the first target value in the remaining population is less than the first target value of the individual and the second target Individuals whose value is less than the second target value of the individual; the remaining population is a population composed of individuals in the mutant population except for the individuals in the first-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第二层非支配个体集合;If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is zero, moving the individual to the second-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述剩余种群中。If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is not zero, the individual is retained in the remaining population.

根据上述判断结果,得到所述第二层非支配个体集合,并所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回步骤108。According to the above judgment result, the second-layer non-dominated individual set is obtained, the individuals in the second-layer non-dominated individual set are added to the first-layer non-dominated individual set, and the first-layer non-dominated individual set is updated After collection, go back to step 108.

步骤110具体包括:Step 110 specifically includes:

根据公式(3)计算所述第一层非支配个体集合中每个个体的聚集度;所述公式(3)为:P(n)=[P(n-1)*q1+P(n+1)*q1]+[P(n-1)*q2+P(n+1)*q2](3);The aggregation degree of each individual in the first-layer non-dominated individual set is calculated according to formula (3); the formula (3) is: P(n)=[P(n-1)*q 1 +P(n +1)*q 1 ]+[P(n-1)*q 2 +P(n+1)*q 2 ](3);

式(3)中,P(n)表示第n个个体的聚集度;

Figure BDA0001399392920000111
Figure BDA0001399392920000112
In formula (3), P(n) represents the aggregation degree of the nth individual;
Figure BDA0001399392920000111
Figure BDA0001399392920000112

按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化。Arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual, select the first N individuals from the first-layer non-dominated individual set after the arrangement to join the evolutionary population, and complete an evolution.

实施例二Embodiment 2

为了验证本发明提供的一种基于用户需求的手机键盘布局的方法,能够减少拼写冲突,减小输入时间,提高输入效率,下面通过具体实施例来说明。In order to verify a method for a mobile phone keyboard layout based on user requirements provided by the present invention, which can reduce spelling conflicts, reduce input time, and improve input efficiency, the following specific embodiments are described.

本发明实施例同样采用了实施例一提供的方法,具体内容如下:The embodiment of the present invention also adopts the method provided by the first embodiment, and the specific content is as follows:

第一步:获取一段英文语句,所述英文语句为“I’m happy to meet you,will youtake a seat at the head of table?It’s an informal dinner,please don’t standon ceremony,would you like to have some chicken?”。在本发明实施例中为了方便描述,用英语语句中的单词代表用户习惯输入的单词。Step 1: Get an English sentence, the English sentence is "I'm happy to meet you, will you take a seat at the head of table? It's an informal dinner, please don't standon ceremony, would you like to have some chicken?". In this embodiment of the present invention, for the convenience of description, words in English sentences are used to represent words that users are accustomed to input.

第二步:统计英文语句中每个字母在单词中每个位置出现的频率,并对每个位置进行递减比重分配,统计出的频率如表1所示。Step 2: Count the frequency of each letter in the English sentence appearing in each position in the word, and assign a decreasing proportion to each position. The frequency of the statistics is shown in Table 1.

表1每个字母在单词中每个位置出现的频率表Table 1 Frequency table of each letter in each position in the word

Figure BDA0001399392920000121
Figure BDA0001399392920000121

Figure BDA0001399392920000131
Figure BDA0001399392920000131

第三步:随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同;在本发明实施例中进化次数为300,初始种群中的个体为100。The third step: randomly generate an initial population containing a plurality of individuals; the individual represents the arrangement of 26 letters on the nine-square keyboard; the arrangement of different individuals is different; in the embodiment of the present invention, the number of evolutions is 300, and the initial The number of individuals in the population is 100.

第四步:对初始种群中的个体处理,得到新个体,并将新个体与初始种群合并,得到变异种群,具体包括:Step 4: Process the individuals in the initial population to obtain new individuals, and combine the new individuals with the initial population to obtain a variant population, which includes:

首先使用锦标赛选择法进行个体选择,其次对选择后的个体进行离散重组,最后对离散重组后的个体进行染色体变异,得到变异后的新个体,并将新个体与初始种群合并,得到变异种群。Firstly, individual selection is carried out by using the tournament selection method, secondly, discrete recombination is performed on the selected individuals, and finally chromosome mutation is performed on the discretely recombined individuals to obtain a new individual after the mutation, and the new individual is merged with the initial population to obtain a mutant population.

其中,锦标赛选择法的基本步骤为:Among them, the basic steps of the tournament selection method are:

(1)从初始种群中随机选择n个个体(本实施例中n为50)。(1) randomly select n individuals from the initial population (n is 50 in this embodiment).

(2)计算每个个体的适应度值,选择其中适应度最高的个体进入子代种群。其中根据公式(1)和公式(2)计算每个个体的第一目标值和第二目标值,所述适应度高的个体表示第一目标值小于个体的第一目标值且第二目标值小于个体的第二目标值的个体。(2) Calculate the fitness value of each individual, and select the individual with the highest fitness to enter the offspring population. The first target value and the second target value of each individual are calculated according to formula (1) and formula (2), and the individual with high fitness indicates that the first target value is smaller than the first target value and the second target value of the individual Individuals that are less than the individual's second target value.

(3)重复步骤(2)直至子代种群规模达到设定值25个。(3) Repeat step (2) until the size of the offspring population reaches the set value of 25.

离散重组:Discrete Recombination:

在子代种群中的个体之间交换变量的值,例如:Swap the value of a variable between individuals in the offspring population, for example:

父个体1:12 25 5Parent 1: 12 25 5

父个体2:123 4 34Parent entity 2:123 4 34

子个体的每个变量可按等概论随机的挑选父个体,例如离散重组之后的一个子个体为:Each variable of the sub-individual can randomly select the parent individual according to the same general theory, for example, a sub-individual after discrete recombination is:

子个体1:123 4 5Child 1:123 4 5

子个体2:12 4 5Child 2:12 4 5

染色体变异:对离散重组后的个体的某一位以0.1-0.0001的概率进行变异,变异值为1-9各个数字。Chromosomal mutation: mutate a certain bit of the individual after discrete recombination with a probability of 0.1-0.0001, and the mutation value is each number of 1-9.

综上,经过锦标赛选择、离散重组以及染色体变异操作,变异种群的个体数为125个。In summary, after tournament selection, discrete recombination and chromosome mutation operations, the number of individuals in the mutant population is 125.

第五步:根据表1统计的频率,计算所述变异种群中每个个体的第一目标值和第二目标值,具体为:Step 5: Calculate the first target value and the second target value of each individual in the variant population according to the frequency counted in Table 1, specifically:

根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:

Figure BDA0001399392920000151
Calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure BDA0001399392920000151

根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:

Figure BDA0001399392920000152
Calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure BDA0001399392920000152

式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值。In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word.

第六步:根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合。所述第六步具体包括:判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值小于所述个体的第一目标值且第二目标值小于所述个体的第二目标值的个体;Step 6: According to the first target value and the second target value of each of the individuals, obtain a set of non-dominated individuals of the first layer. The sixth step specifically includes: judging whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtaining a third judgment result; the non-dominated individuals indicate that the first target value in the mutant population is smaller than the an individual whose first target value for an individual and whose second target value is less than the second target value for said individual;

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第一层非支配个体集合;If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero, moving the individual to the first-layer non-dominated individual set;

若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述变异种群中。If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero, the individual is retained in the mutant population.

第七步:判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果。本实施例中N为50;Step 7: Determine whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtain a first judgment result. In this embodiment, N is 50;

若所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N,则执行第八步。If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, step 8 is performed.

第八步:根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合;更新所述第一层非支配个体集合后,返回第七步继续判断。Step 8: According to the first target value and the second target value of each of the individuals except the individuals in the first-layer non-dominated individual set, obtain the second-layer non-dominated individual set, and use the The individuals in the second-layer non-dominated individual set are added to the first-layer non-dominated individual set, and the first-layer non-dominated individual set is updated; after updating the first-layer non-dominated individual set, return to step 7 to continue judging .

所述第八步具体包括判断剩余种群中各个体的非支配个体的数量是否为零,得到第四判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;所述剩余种群为所述变异种群中除所述第一层非支配个体集合的个体外的个体组成的种群;The eighth step specifically includes judging whether the number of non-dominated individuals in each individual in the remaining population is zero, and obtaining a fourth judgment result; the non-dominated individual indicates that the first target value and the second target value in the mutant population are both equal. is the individual with the minimum value; the remaining population is a population composed of individuals in the mutant population except for the individuals in the first-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第二层非支配个体集合;If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is zero, moving the individual to the second-layer non-dominated individual set;

若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述剩余种群中。If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is not zero, the individual is retained in the remaining population.

根据上述判断结果,得到所述第二层非支配个体集合,并所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回第七步继续判断。According to the above judgment result, the second-layer non-dominated individual set is obtained, the individuals in the second-layer non-dominated individual set are added to the first-layer non-dominated individual set, and the first-layer non-dominated individual set is updated After collection, go back to step 7 to continue judging.

若所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N,则执行第九步。If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N, step 9 is performed.

第九步:根据公式(3)计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化。所述进化种群是由排列后的第一层非支配个体集合中前N个个体组成。Step 9: Calculate the aggregation degree of each individual in the first-layer non-dominated individual set according to formula (3), and arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual. individuals, and select the first N individuals from the set of non-dominated individuals of the first layer after the arrangement to be added to the evolutionary population to complete an evolution. The evolutionary population is composed of the first N individuals in the set of first-level non-dominated individuals after the arrangement.

所述公式(3)为:P(n)=[P(n-1)*q1+P(n+1)*q1]+[P(n-1)*q2+P(n+1)*q2](3);The formula (3) is: P(n)=[P(n-1)*q 1 +P(n+1)*q 1 ]+[P(n-1)*q 2 +P(n+ 1)*q 2 ](3);

式(3)中,P(n)表示第n个个体的聚集度;

Figure BDA0001399392920000161
Figure BDA0001399392920000162
In formula (3), P(n) represents the aggregation degree of the nth individual;
Figure BDA0001399392920000161
Figure BDA0001399392920000162

第十步:判断进化次数是否小于所述迭代次数300,得到第二判断结果。Step 10: Judging whether the number of evolutions is less than the number of iterations 300, and obtaining a second judgment result.

若所述第二判断结果表示所述进化次数小于所述迭代次数300,则执行步骤第十一步,If the second judgment result indicates that the number of evolutions is less than the number of iterations 300, step 11 is performed,

第十一步:将所述初始种群中的个体替换成所述进化种群中的个体后,执行第四步。Step 11: After replacing the individuals in the initial population with individuals in the evolutionary population, perform the fourth step.

若所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则执行第十二步。If the second judgment result indicates that the number of evolutions is greater than or equal to the number of iterations, the twelfth step is performed.

第十二步:将所述进化种群中聚集度最大的个体作为最优个体输出。其中最优个体的形式如图2所示,即输出的个体编码为2 1 3 4 3 4 2 5 6 5 1 7 8 8 9 8 8 9 1 7 96 2 3 7 6 9。The twelfth step: output the individual with the largest aggregation degree in the evolutionary population as the optimal individual. The form of the optimal individual is shown in Figure 2, that is, the output individual code is 2 1 3 4 3 4 2 5 6 5 1 7 8 8 9 8 8 9 1 7 96 2 3 7 6 9.

通过本发明实施例得到的九宫格键盘减少了输入时的冲突,例如在输入单词“meet”时,只需按“83”即可在屏幕上看到选项里只有我们需要的单词“meet”,不会有其它单词所带来的冲突。The nine-square-grid keyboard obtained by the embodiment of the present invention reduces the conflict during input. For example, when inputting the word "meet", just press "83" to see on the screen that there is only the word "meet" we need in the options. There will be conflicts with other words.

另外,通过观察人们的输入习惯加入完整的键盘按键,设计如图2所示。其中,发送键位于键盘排布的右下角,并且设置的按键大小足够大,能够减小人们的错按概率;并且根据统计调查,空格键在人们拼写的使用率高达25%,所以把空格键排布在键盘的最下方,并且大小足够大,能够使人们的输入更加便捷有效。In addition, by observing people's input habits and adding complete keyboard keys, the design is shown in Figure 2. Among them, the send key is located in the lower right corner of the keyboard arrangement, and the set key size is large enough to reduce the probability of people's wrong press; and according to statistical surveys, the usage rate of the space bar in people's spelling is as high as 25%, so put the space bar Arranged at the bottom of the keyboard, and the size is large enough, it can make people's input more convenient and effective.

实施例三Embodiment 3

为达到上述目的,本发明还提供了一种手机键盘布局的系统,图3为本发明实施例手机键盘布局系统的结构示意图,如图3所示,所述系统包括:In order to achieve the above object, the present invention also provides a system for the layout of a mobile phone keyboard. FIG. 3 is a schematic structural diagram of a mobile phone keyboard layout system according to an embodiment of the present invention. As shown in FIG. 3 , the system includes:

初始种群生成模块301,用于随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同。The initial population generation module 301 is used to randomly generate an initial population containing a plurality of individuals; the individuals represent the arrangement form of 26 letters on the nine-square keyboard; the arrangement forms of different individuals are different.

英文语句获取模块302,用于获取用户输入的英语语句;所述英文语句包含多个单词。The English sentence obtaining module 302 is configured to obtain the English sentence input by the user; the English sentence includes a plurality of words.

频率获取模块303,用于获取每个字母在所述单词中每个位置出现的频率。在本发明实施例中为了方便描述,用英语语句中的单词代表用户习惯输入的单词The frequency acquisition module 303 is configured to acquire the frequency of each letter appearing in each position in the word. In this embodiment of the present invention, for the convenience of description, words in English sentences are used to represent words that users are accustomed to input.

迭代次数获取模块304,用于获取迭代次数。The iteration number acquiring module 304 is used to acquire the iteration number.

变异种群得到模块305,用于对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群。The mutant population obtaining module 305 is used for mating, recombining, and mutating individuals in the initial population to obtain new individuals, and adding the new individuals to the initial population to obtain a mutant population.

第一目标值和第二目标值计算模块306,用于根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值。The first target value and the second target value calculation module 306 is configured to calculate the first target value and the second target value of each individual in the variant population according to the frequency.

第一层非支配个体集合获取模块307,用于根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合。The first-layer non-dominated individual set obtaining module 307 is configured to obtain the first-layer non-dominated individual set according to the first target value and the second target value of each of the individuals.

第一判断结果得到模块308,用于判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果。The first judgment result obtaining module 308 is configured to judge whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtain a first judgment result.

第一层非支配个体集合更新模块309,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N时,根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果步骤。The first-layer non-dominated individual set updating module 309 is configured to, when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, according to dividing the first-layer non-dominated individual The first target value and the second target value of each individual outside the individual in the set, obtain the second-level non-dominated individual set, and add the individuals in the second-level non-dominated individual set to the first One layer of non-dominated individual sets, after updating the first layer of non-dominated individual sets, return to the step of judging whether the number of individuals in the first layer of non-dominated individual sets is greater than or equal to N, and obtain a first judgment result.

进化种群得到模块310,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N时,计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化。所述进化种群是由排列后的第一层非支配个体集合中前N个个体组成。The evolutionary population obtaining module 310 is configured to calculate each non-dominated individual set in the first layer when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N the aggregation degree of individuals, and arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual, and select the first N individuals from the arranged first-layer non-dominated individual set Join the evolutionary population and complete an evolution. The evolutionary population is composed of the first N individuals in the set of first-level non-dominated individuals after the arrangement.

第二判断结果得到模块311,用于判断进化次数是否小于所述迭代次数,得到第二判断结果。The second judgment result obtaining module 311 is used for judging whether the number of evolutions is less than the number of iterations to obtain a second judgment result.

进化种群个体处理模块312,用于当所述第二判断结果表示所述进化次数小于所述迭代次数时,则返回对所述初始种群中的个体进行交配、重组、变异处理步骤,将所述初始种群中的个体替换成所述进化种群中的个体。The evolutionary population individual processing module 312 is configured to return to the steps of mating, recombination, and mutation processing for individuals in the initial population when the second judgment result indicates that the number of evolutions is less than the number of iterations, and the Individuals in the initial population are replaced with individuals in the evolved population.

最优个体输出模块313,用于当所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则将所述进化种群中聚集度最大的个体作为最优个体输出。The optimal individual output module 313 is configured to output the individual with the largest aggregation degree in the evolutionary population as the optimal individual when the second judgment result indicates that the evolution number is greater than or equal to the iteration number.

其中,所述第一目标值和第二目标值计算模块306,具体包括:Wherein, the first target value and the second target value calculation module 306 specifically includes:

第一目标值计算单元,用于根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:

Figure BDA0001399392920000191
The first target value calculation unit is used to calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure BDA0001399392920000191

第二目标值计算单元,用于根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:

Figure BDA0001399392920000192
The second target value calculation unit is configured to calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure BDA0001399392920000192

式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值。In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word.

所述变异种群得到模块305,具体包括:The variant population obtaining module 305 specifically includes:

初始种群中每个个体第一目标值和第二目标值计算单元,用于根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值。The first target value and the second target value calculation unit of each individual in the initial population is used to calculate the first target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2). a target value and a second target value.

子代种群得到单元,用于多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群。The offspring population obtaining unit is used to select two individuals from the initial population for multiple comparisons, and move the individuals whose first target value and the second target value are both smaller to the offspring population, until When the number of individuals of the progeny population reaches the set threshold, the selection is stopped, and the progeny population is obtained.

处理后子代种群得到单元,用于对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群。After processing, the offspring population obtains a unit, which is used to perform discrete recombination and mutation operations on each individual in the offspring population to obtain the processed offspring population.

变异种群得到单元,用于将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。The mutant population obtaining unit is used for adding the individuals in the treated progeny population to the initial population to obtain the mutant population.

所述第一层非支配个体集合获取模块307,具体包括:The first-layer non-dominated individual set acquisition module 307 specifically includes:

第三判断结果得到单元,用于判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值小于所述个体的第一目标值且第二目标值小于所述个体的第二目标值的个体。The third judgment result obtaining unit is used to judge whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtain a third judgment result; the non-dominated individual indicates that the first target value in the mutant population is less than the An individual whose first target value for the individual and whose second target value is less than the individual's second target value.

移动单元,用于当所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零时,将所述个体移动至到所述第一层非支配个体集合。A moving unit, configured to move the individual to the first-level non-dominated individual set when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero.

保留单元,用于所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零时,将所述个体保留在所述变异种群中。A retention unit, used for retaining the individual in the mutant population when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero.

第一层非支配个体集合更新模块309,具体包括:The first-layer non-dominated individual set update module 309 specifically includes:

第四判断结果得到单元,用于判断剩余种群中各个体的非支配个体的数量是否为零,得到第四判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;所述剩余种群为所述变异种群中除所述第一层非支配个体集合的个体外的个体组成的种群。The fourth judgment result obtaining unit is used to judge whether the number of non-dominated individuals of each individual in the remaining population is zero, and obtain a fourth judgment result; the non-dominated individuals represent the first target value and the second target in the mutant population The values are all individuals with the minimum value; the remaining population is a population composed of individuals in the mutant population except the individuals in the first-level non-dominated individual set.

第二层非支配个体集合得到单元,用于当所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量为零时,则将所述个体移动至到所述第二层非支配个体集合,得到第二层非支配个体集合。A unit for obtaining a set of non-dominated individuals in the second layer is used to move the individual to the second layer when the fourth judgment result indicates that the number of non-dominated individuals in each individual in the remaining population is zero. The set of non-dominated individuals is obtained, and the second-level set of non-dominated individuals is obtained.

剩余种群保留单元,用于当所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量不为零时,将所述个体保留在所述剩余种群中。A remaining population retention unit, configured to retain the individual in the remaining population when the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is not zero.

第一层非支配个体集合更新单元,用于将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N个,得到第一判断结果步骤。The first-layer non-dominated individual set updating unit is used to add the individuals in the second-layer non-dominated individual set to the first-layer non-dominated individual set, and after updating the first-layer non-dominated individual set, return To the step of judging whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, obtaining a first judgment result.

进化种群得到模块310,具体包括:The evolutionary population obtains module 310, which specifically includes:

个体聚集度计算单元,用于根据公式(3)计算所述第一层非支配个体集合中每个个体的聚集度;所述公式(3)为:P(n)=[P(n-1)*q1+P(n+1)*q1]+[P(n-1)*q2+P(n+1)*q2](3);an individual aggregation degree calculation unit, configured to calculate the aggregation degree of each individual in the first-layer non-dominated individual set according to formula (3); the formula (3) is: P(n)=[P(n-1 )*q 1 +P(n+1)*q 1 ]+[P(n-1)*q 2 +P(n+1)*q 2 ](3);

式(3)中,P(n)表示第n个个体的聚集度;

Figure BDA0001399392920000201
Figure BDA0001399392920000202
In formula (3), P(n) represents the aggregation degree of the nth individual;
Figure BDA0001399392920000201
Figure BDA0001399392920000202

进化种群得到单元,用于按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化。An evolutionary population obtaining unit, used for arranging each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual, and selecting the first N from the first-layer non-dominated individual set after the arrangement An individual joins the evolutionary population and completes an evolution.

通过以上实施例说明,本发明提供的方法或者系统能够基于用户需求和用户习惯而重新布设手机键盘格局,减少拼写冲突,减小输入时间,提高输入效率。Through the description of the above embodiments, the method or system provided by the present invention can rearrange the mobile phone keyboard layout based on user requirements and user habits, reduce spelling conflicts, reduce input time, and improve input efficiency.

另外,本发明采用非支配多目标算法,来求解最优个体,提高运行速度和解集的收敛性,避免寻找最优解释陷入局部最优解状况,降低了非劣排序遗传算法的复杂性In addition, the present invention adopts the non-dominated multi-objective algorithm to solve the optimal individual, improves the running speed and the convergence of the solution set, avoids finding the optimal explanation and falls into the local optimal solution situation, and reduces the complexity of the non-inferior sorting genetic algorithm

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.

本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。In this paper, specific examples are used to illustrate the principles and implementations of the present invention. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present invention; meanwhile, for those skilled in the art, according to the present invention There will be changes in the specific implementation and application scope. In conclusion, the contents of this specification should not be construed as limiting the present invention.

Claims (7)

1.一种手机键盘布局的方法,其特征在于,所述方法包括:1. a method of mobile phone keyboard layout, is characterized in that, described method comprises: 随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同;Randomly generate an initial population containing a plurality of individuals; the individual represents the arrangement of 26 letters on the nine-square keyboard; the arrangement of different individuals is different; 获取用户输入的英语语句;所述英语语句包含多个单词;Obtain the English sentence input by the user; the English sentence contains a plurality of words; 获取每个字母在所述单词中每个位置出现的频率;Get the frequency of each letter in each position in the word; 获取迭代次数;Get the number of iterations; 对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群;Perform mating, recombination, and mutation processing on the individuals in the initial population to obtain a new individual, and add the new individual to the initial population to obtain a mutant population; 根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值;根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:
Figure FDA0002396961460000011
根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:
Figure FDA0002396961460000012
式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值;
Calculate the first target value and the second target value of each individual in the variant population according to the frequency; calculate the first target value of each individual in the variant population according to formula (1); the formula (1) )for:
Figure FDA0002396961460000011
Calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure FDA0002396961460000012
In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word;
根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合;According to the first target value and the second target value of each of the individuals, obtain a first-layer non-dominated individual set; 判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果;Judging whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtain a first judgment result; 若所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N,则根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果步骤;If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, then according to the number of the individuals except the individuals in the first-layer non-dominated individual set a target value and a second target value, obtain the second-layer non-dominated individual set, add the individuals in the second-layer non-dominated individual set to the first-layer non-dominated individual set, and update the first layer After the set of non-dominated individuals, return to the step of judging whether the number of individuals in the set of non-dominated individuals of the first layer is greater than or equal to N, and obtain the first judgment result; 若所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N,则计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化;根据公式(3)计算所述第一层非支配个体集合中每个个体的聚集度;所述公式(3)为:P(n)=[P(n-1)*q1+P(n+1)*q1]+[P(n-1)*q2+P(n+1)*q2](3);式(3)中,P(n)表示第n个个体的聚集度;
Figure FDA0002396961460000021
Figure FDA0002396961460000022
If the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N, then calculate the aggregation degree of each individual in the first-layer non-dominated individual set, and according to each Arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of the individuals, select the first N individuals from the first-layer non-dominated individual set after the arrangement to join the evolutionary population, and complete an evolution ; Calculate the aggregation degree of each individual in the first-layer non-dominated individual set according to formula (3); the formula (3) is: P(n)=[P(n-1)*q 1 +P( n+1)*q 1 ]+[P(n-1)*q 2 +P(n+1)*q 2 ](3); in formula (3), P(n) represents the nth individual’s agglomeration;
Figure FDA0002396961460000021
Figure FDA0002396961460000022
判断进化次数是否小于所述迭代次数,得到第二判断结果;Judging whether the number of evolutions is less than the number of iterations, and obtaining a second judgment result; 若所述第二判断结果表示所述进化次数小于所述迭代次数,则返回对所述初始种群中的个体进行交配、重组、变异处理步骤,将所述初始种群中的个体替换成所述进化种群中的个体;If the second judgment result indicates that the number of evolutions is less than the number of iterations, returning to the steps of mating, recombining, and mutating the individuals in the initial population, and replacing the individuals in the initial population with the evolutionary individuals in a population; 若所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则将所述进化种群中聚集度最大的个体作为最优个体输出。If the second judgment result indicates that the number of evolutions is greater than or equal to the number of iterations, the individual with the largest aggregation degree in the evolutionary population is output as the optimal individual.
2.根据权利要求1所述方法,其特征在于,所述对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群,具体包括:2. The method according to claim 1, characterized in that, the individuals in the initial population are subjected to mating, recombination, and mutation processing to obtain new individuals, and the new individuals are added to the initial population , the mutant population is obtained, including: 根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值;Calculate the first target value and the second target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2); 多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群;Selecting two of the individuals from the initial population for multiple times for comparison, and moving the individuals with both the first target value and the second target value smaller to the offspring population, until the number of individuals in the offspring population When the set threshold is reached, the selection is stopped to obtain the progeny population; 对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群;Perform discrete recombination and mutation operations on each individual in the progeny population to obtain a processed progeny population; 将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。Individuals in the treated progeny population are added to the initial population to obtain a mutant population. 3.根据权利要求1所述方法,其特征在于,所述根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合,具体包括:3. The method according to claim 1, characterized in that, acquiring the first-layer non-dominated individual set according to the first target value and the second target value of each individual, specifically comprising: 判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;Judging whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtaining a third judgment result; the non-dominated individuals represent individuals in the mutant population whose first target value and second target value are both minimum values ; 若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第一层非支配个体集合;If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero, moving the individual to the first-layer non-dominated individual set; 若所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述变异种群中。If the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero, the individual is retained in the mutant population. 4.根据权利要求3所述方法,其特征在于,所述根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,具体包括:4 . The method according to claim 3 , wherein, according to the first target value and the second target value of each of the individuals except the individuals in the first-layer non-dominated individual set, the first target value is obtained. 5 . The second-level set of non-dominated individuals, including: 判断剩余种群中各个体的非支配个体的数量是否为零,得到第四判断结果;所述非支配个体表示所述剩余种群中第一目标值小于所述个体的第一目标值且第二目标值小于所述个体的第二目标值的个体;所述剩余种群为所述变异种群中除所述第一层非支配个体集合的个体外的个体组成的种群;Determine whether the number of non-dominated individuals of each individual in the remaining population is zero, and obtain a fourth judgment result; the non-dominated individual indicates that the first target value in the remaining population is less than the first target value of the individual and the second target Individuals whose value is less than the second target value of the individual; the remaining population is a population composed of individuals in the mutant population except for the individuals in the first-layer non-dominated individual set; 若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量为零,则将所述个体移动至到所述第二层非支配个体集合;If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is zero, moving the individual to the second-layer non-dominated individual set; 若所述第四判断结果表示所述剩余种群中各个体的非支配个体的数量不为零,则将所述个体保留在所述剩余种群中。If the fourth judgment result indicates that the number of non-dominated individuals of each individual in the remaining population is not zero, the individual is retained in the remaining population. 5.一种手机键盘布局的系统,其特征在于,所述系统包括:5. A system for mobile phone keyboard layout, wherein the system comprises: 初始种群生成模块,用于随机生成含有多个个体的初始种群;所述个体表示26个字母在九宫格键盘上的排列形式;不同所述个体的排列形式不同;The initial population generation module is used to randomly generate an initial population containing a plurality of individuals; the individual represents the arrangement of 26 letters on the nine-square keyboard; the arrangement of different individuals is different; 英语语句获取模块,用于获取用户输入的英语语句;所述英语语句包含多个单词;an English sentence acquisition module for acquiring an English sentence input by a user; the English sentence contains multiple words; 频率获取模块,用于获取每个字母在所述单词中每个位置出现的频率;a frequency acquisition module for acquiring the frequency of each letter appearing in each position in the word; 迭代次数获取模块,用于获取迭代次数;The number of iterations acquisition module is used to obtain the number of iterations; 变异种群得到模块,用于对所述初始种群中的个体进行交配、重组、变异处理,得到新的个体,并将所述新的个体加入到所述初始种群中,得到变异种群;A mutant population obtaining module, used for mating, recombining, and mutating individuals in the initial population to obtain a new individual, and adding the new individual to the initial population to obtain a mutant population; 第一目标值和第二目标值计算模块,用于根据所述频率,计算所述变异种群中每个个体的第一目标值和第二目标值;具体包括:第一目标值计算单元,用于根据公式(1)计算所述变异种群中每个个体的第一目标值;所述公式(1)为:
Figure FDA0002396961460000051
第二目标值计算单元,用于根据公式(2)计算所述变异种群中每个个体的第二目标值;所述公式(2)为:
Figure FDA0002396961460000052
式(1)、(2)中n表示第n个个体;m表示九宫格键盘上的第m个按键,所述九宫格键盘上设有九个按键,每个按键上设有三个或者四个字母;pij表示每个按键中第j个字母在单词中第i个位置出现的概率;λi表示单词中第i个位置所占的比重;g(m)表示第m按键中所有字母的最小k值,g(m)=mink;k表示字母在所述单词中的位置的最大值;
The first target value and the second target value calculation module is used to calculate the first target value and the second target value of each individual in the mutant population according to the frequency; specifically, it includes: a first target value calculation unit, which uses to calculate the first target value of each individual in the variant population according to formula (1); the formula (1) is:
Figure FDA0002396961460000051
The second target value calculation unit is configured to calculate the second target value of each individual in the variant population according to formula (2); the formula (2) is:
Figure FDA0002396961460000052
In formula (1), (2), n represents the nth individual; m represents the mth key on the nine-square keyboard, and the nine-square keyboard is provided with nine keys, and each key is provided with three or four letters; p ij represents the probability that the j-th letter in each key appears in the i-th position in the word; λ i represents the proportion of the i-th position in the word; g(m) represents the minimum k of all letters in the m-th key value, g(m)=mink; k represents the maximum value of the position of the letter in the word;
第一层非支配个体集合获取模块,用于根据每个所述个体的第一目标值和第二目标值,获取第一层非支配个体集合;a first-layer non-dominated individual set acquisition module, configured to acquire a first-layer non-dominated individual set according to the first target value and the second target value of each of the individuals; 第一判断结果得到模块,用于判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果;The first judgment result obtaining module is used for judging whether the number of individuals in the first-layer non-dominated individual set is greater than or equal to N, and obtains the first judgment result; 第一层非支配个体集合更新模块,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数小于所述N时,根据除所述第一层非支配个体集合中的个体外的每个所述个体的第一目标值和第二目标值,获取第二层非支配个体集合,并将所述第二层非支配个体集合中的个体加入到所述第一层非支配个体集合,更新所述第一层非支配个体集合后,返回至判断所述第一层非支配个体集合中的个体数是否大于或者等于N,得到第一判断结果步骤;The first-layer non-dominated individual set update module is configured to, when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is less than the N, according to dividing the first-layer non-dominated individual set the first target value and the second target value of each of the individuals outside the individual in the Layer non-dominated individual sets, after updating the first layer of non-dominated individual sets, return to the step of judging whether the number of individuals in the first layer of non-dominated individual sets is greater than or equal to N, and obtain a first judgment result; 进化种群得到模块,用于当所述第一判断结果表示所述第一层非支配个体集合中的个体数大于或者等于所述N时,计算所述第一层非支配个体集合中每个个体的聚集度,并按照每个个体的所述聚集度降序排列所述第一层非支配个体集合中每个个体,从排列后的所述第一层非支配个体集合中选择前N个个体加入到进化种群,完成一次进化;An evolutionary population obtaining module, configured to calculate each individual in the first-layer non-dominated individual set when the first judgment result indicates that the number of individuals in the first-layer non-dominated individual set is greater than or equal to the N and arrange each individual in the first-layer non-dominated individual set in descending order according to the aggregation degree of each individual, and select the first N individuals from the arranged first-layer non-dominated individual set to join To the evolutionary population, complete an evolution; 第二判断结果得到模块,用于判断进化次数是否小于所述迭代次数,得到第二判断结果;The second judgment result obtaining module is used to judge whether the number of evolution is less than the number of iterations, and obtain the second judgment result; 进化种群个体处理模块,用于当所述第二判断结果表示所述进化次数小于所述迭代次数时,则返回对所述初始种群中的个体进行交配、重组、变异处理步骤,将所述初始种群中的个体替换成所述进化种群中的个体;The evolutionary population individual processing module is used to return to the steps of mating, recombination, and mutation processing for individuals in the initial population when the second judgment result indicates that the evolution times are less than the iteration times, and the initial individuals in the population are replaced with individuals in the evolutionary population; 最优个体输出模块,用于当所述第二判断结果表示所述进化次数大于或者等于所述迭代次数,则将所述进化种群中聚集度最大的个体作为最优个体输出。The optimal individual output module is configured to output the individual with the largest aggregation degree in the evolutionary population as the optimal individual when the second judgment result indicates that the evolution number is greater than or equal to the iteration number.
6.根据权利要求5所述系统,其特征在于,所述变异种群得到模块,具体包括:6. The system according to claim 5, wherein the variant population obtaining module specifically comprises: 初始种群中每个个体第一目标值和第二目标值计算单元,用于根据所述频率、所述公式(1)以及所述公式(2),计算所述初始种群中每个个体的第一目标值和第二目标值;The first target value and the second target value calculation unit of each individual in the initial population is used to calculate the first target value of each individual in the initial population according to the frequency, the formula (1) and the formula (2). a target value and a second target value; 子代种群得到单元,用于多次从所述初始种群中选择两个所述个体进行比较,将所述第一目标值和第二目标值都小的所述个体移动至子代种群,直至所述子代种群的个体数达到设定阈值,停止选择,得到所述子代种群;The offspring population obtaining unit is used to select two individuals from the initial population for multiple comparisons, and move the individuals whose first target value and the second target value are both smaller to the offspring population, until When the number of individuals of the progeny population reaches the set threshold, the selection is stopped to obtain the progeny population; 处理后子代种群得到单元,用于对所述子代种群中的每个个体进行离散重组和变异操作,得到处理后的子代种群;After processing, the offspring population obtains a unit, which is used to perform discrete recombination and mutation operations on each individual in the offspring population to obtain the processed offspring population; 变异种群得到单元,用于将所述处理后的子代种群中的个体加入到所述初始种群中,得到变异种群。The mutant population obtaining unit is used for adding the individuals in the treated progeny population to the initial population to obtain the mutant population. 7.根据权利要求5所述系统,其特征在于,所述第一层非支配个体集合获取模块,具体包括:7. The system according to claim 5, wherein the first-layer non-dominated individual set acquisition module specifically comprises: 第三判断结果得到单元,用于判断所述变异种群中各个体的非支配个体的数量是否为零,得到第三判断结果;所述非支配个体表示所述变异种群中第一目标值和第二目标值均为最小值的个体;The third judgment result obtaining unit is used to judge whether the number of non-dominated individuals of each individual in the mutant population is zero, and obtain a third judgment result; the non-dominated individuals represent the first target value and the first target value in the mutant population. Individuals whose two target values are both minimum values; 移动单元,用于当所述第三判断结果表示所述变异种群中各个体的非支配个体的数量为零时,将所述个体移动至到所述第一层非支配个体集合;a moving unit, configured to move the individual to the first-layer non-dominated individual set when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is zero; 保留单元,用于所述第三判断结果表示所述变异种群中各个体的非支配个体的数量不为零时,将所述个体保留在所述变异种群中。A retention unit, used for retaining the individual in the mutant population when the third judgment result indicates that the number of non-dominated individuals of each individual in the mutant population is not zero.
CN201710791813.0A 2017-09-05 2017-09-05 Method and system for layout of mobile phone keyboard Active CN107678554B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710791813.0A CN107678554B (en) 2017-09-05 2017-09-05 Method and system for layout of mobile phone keyboard

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710791813.0A CN107678554B (en) 2017-09-05 2017-09-05 Method and system for layout of mobile phone keyboard

Publications (2)

Publication Number Publication Date
CN107678554A CN107678554A (en) 2018-02-09
CN107678554B true CN107678554B (en) 2020-07-03

Family

ID=61136147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710791813.0A Active CN107678554B (en) 2017-09-05 2017-09-05 Method and system for layout of mobile phone keyboard

Country Status (1)

Country Link
CN (1) CN107678554B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077496A (en) * 2014-07-17 2014-10-01 中国科学院自动化研究所 Intelligent pipeline arrangement optimization method and system based on differential evolution algorithm
CN104156944A (en) * 2014-07-15 2014-11-19 西安电子科技大学 Change detection method based on NSGA-II evolutionary algorithm
CN106056208A (en) * 2016-06-20 2016-10-26 华北电力大学(保定) Bio-geographic optimization algorithm-oriented constraint handling method and device
CN106127295A (en) * 2016-06-21 2016-11-16 湘潭大学 A kind of Optimal Design of Pressure Vessel method based on self adaptation cuckoo Yu fireworks hybrid algorithm
CN106202875A (en) * 2016-06-27 2016-12-07 泰华智慧产业集团股份有限公司 Evolve based on cloud and follow the tracks of the method and system of solar street light maximum power point
CN106372756A (en) * 2016-09-07 2017-02-01 南京工程学院 Thermal power plant load optimization distribution method based on breeding particle swarm optimization

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8924909B2 (en) * 2012-06-13 2014-12-30 Purdue Research Foundation Microelectromechanical system design and layout

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156944A (en) * 2014-07-15 2014-11-19 西安电子科技大学 Change detection method based on NSGA-II evolutionary algorithm
CN104077496A (en) * 2014-07-17 2014-10-01 中国科学院自动化研究所 Intelligent pipeline arrangement optimization method and system based on differential evolution algorithm
CN106056208A (en) * 2016-06-20 2016-10-26 华北电力大学(保定) Bio-geographic optimization algorithm-oriented constraint handling method and device
CN106127295A (en) * 2016-06-21 2016-11-16 湘潭大学 A kind of Optimal Design of Pressure Vessel method based on self adaptation cuckoo Yu fireworks hybrid algorithm
CN106202875A (en) * 2016-06-27 2016-12-07 泰华智慧产业集团股份有限公司 Evolve based on cloud and follow the tracks of the method and system of solar street light maximum power point
CN106372756A (en) * 2016-09-07 2017-02-01 南京工程学院 Thermal power plant load optimization distribution method based on breeding particle swarm optimization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于遗传算法的手机键盘字母布局的研究;陈彩云,李治国;《计算机工程与应用》;20030921;全文 *

Also Published As

Publication number Publication date
CN107678554A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
Berahmand et al. A new centrality measure based on the negative and positive effects of clustering coefficient for identifying influential spreaders in complex networks
CN111538819B (en) Method for constructing question-answering system based on document set multi-hop reasoning
Phadia Prior processes and their applications
Yu et al. The wisdom of minority: Unsupervised slot filling validation based on multi-dimensional truth-finding
CN104102626B (en) A kind of method for short text Semantic Similarity Measurement
CN105183833B (en) A user model-based microblog text recommendation method and recommendation device
CN108804677A (en) In conjunction with the deep learning question classification method and system of multi-layer attention mechanism
CN104199826B (en) A kind of dissimilar medium similarity calculation method and search method based on association analysis
CN110110225B (en) Online education recommendation model and construction method based on user behavior data analysis
CN109508385B (en) Character relation analysis method in webpage news data based on Bayesian network
CN108287875B (en) Character co-occurrence relation determining method, expert recommending method, device and equipment
CN107329995A (en) A kind of controlled answer generation method of semanteme, apparatus and system
WO2020232881A1 (en) Text word segmentation method and apparatus
CN104536979A (en) Generation method and device of topic model and acquisition method and device of topic distribution
CN113673252A (en) Automatic join recommendation method for data table based on field semantics
Lyzinski et al. On the consistency of the likelihood maximization vertex nomination scheme: Bridging the gap between maximum likelihood estimation and graph matching
CN106803092B (en) Method and device for determining standard problem data
Liu et al. Efficient expert pruning for sparse mixture-of-experts language models: Enhancing performance and reducing inference costs
CN107678554B (en) Method and system for layout of mobile phone keyboard
Vu et al. Variational algorithms for biclustering models
Chu et al. A new binary biclustering algorithm based on weight adjacency difference matrix for analyzing gene expression data
CN113486649A (en) Text comment generation method and electronic equipment
Chen et al. Joint learning with keyword extraction for event detection in social media
Oates et al. Quantifying the multi-scale performance of network inference algorithms
Han et al. A fuzzy biclustering algorithm for social annotations

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant