Input information processing method and device and mobile terminal

文档序号:1296848 发布日期:2020-08-07 浏览:11次 中文

阅读说明:本技术 输入信息的处理方法、装置及移动终端 (Input information processing method and device and mobile terminal ) 是由 吕欣阳 田海燕 于 2016-10-27 设计创作,主要内容包括:本发明提供一种输入信息的处理方法、装置及移动终端。本发明提供的输入信息的处理方法,包括:确定当前输入信息支持的编码方式;确定所述编码方式对应的字符长度限值;根据所述编码方式对所述当前输入信息进行编码,确定所述编码后的字符长度;判断所述编码后的字符长度是否大于所述字符长度限值,若是,则向用户发送提示信息,以指示所述用户停止输入信息。本发明可提高移动终端的输入信息的易用性。(The invention provides an input information processing method and device and a mobile terminal. The processing method of the input information provided by the invention comprises the following steps: determining a coding mode supported by current input information; determining a character length limit value corresponding to the coding mode; encoding the current input information according to the encoding mode, and determining the length of the encoded character; and judging whether the coded character length is larger than the character length limit value or not, if so, sending prompt information to a user to indicate the user to stop inputting information. The invention can improve the usability of the input information of the mobile terminal.)

1. A method for processing input information, comprising:

the mobile terminal receives contact name information input by a user;

determining a coding mode supported by currently input contact name information, coding the currently input contact name information according to the coding mode, and determining the length of a coded character;

and if the coded character length is larger than the character length limit value corresponding to the coding mode, stopping acquiring the input information.

2. The method of claim 1, further comprising:

a prompt message appears to instruct the user to stop entering information.

3. The method of claim 1, wherein determining the encoding supported by the currently entered contact name information further comprises:

determining a coding mode supported by currently input contact name information from a plurality of preset coding modes; and the character length limit values corresponding to the preset multiple encoding modes are different.

4. The method of claim 1, wherein determining the encoding supported by the currently entered contact name information further comprises:

and determining the coding mode supported by the currently input contact name information from a plurality of preset coding modes according to the sequence of the preset coding modes, wherein the sequence of the preset coding modes is the sequence of character length limit values corresponding to the coding modes from large to small.

5. The method of claim 1, further comprising:

judging whether the currently input contact name information supports a first coding mode in the plurality of coding modes;

if so, determining that the first coding mode supported by the currently input contact name information is a first coding mode in the multiple coding modes;

if not, continuously judging whether the currently input contact name information supports a second coding mode in the plurality of coding modes or not until the coding mode supported by the currently input contact name information is determined; the character length limit value corresponding to the first coding mode is larger than the character length limit value corresponding to the second coding mode.

6. The method according to any of claims 3-5, wherein the plurality of encoding modes comprises: 8-bit coding mode, 81 coding mode of 2-byte universal character set UCS-2 and 16-bit universal code conversion format UTF-16 coding mode.

7. A processing apparatus for inputting information, comprising:

the first determining module is used for receiving the contact name information input by a user through the mobile terminal and determining the coding mode supported by the currently input contact name information;

the second determining module is used for determining the character length limit value corresponding to the coding mode;

the coding module is used for coding the currently input contact name information according to the coding mode and determining the length of the coded characters;

and the judging module is used for stopping acquiring the input information if the coded character length is larger than the character length limit value corresponding to the coding mode.

8. The apparatus of claim 7, further comprising:

and the prompting module is used for generating prompting information to indicate the user to stop inputting information if the coded character length is larger than the character length limit value corresponding to the coding mode.

9. The apparatus of claim 7, further comprising:

the first determining module is specifically configured to determine, according to a preset coding mode sequence, a coding mode supported by the currently input contact name information from multiple coding modes; and the character length limit values corresponding to the preset multiple encoding modes are different.

10. The apparatus of claim 7, wherein the determining subunit is further configured to determine whether the currently input contact name information supports a first encoding scheme of the multiple encoding schemes;

if so, determining that the first coding mode supported by the currently input contact name information is a first coding mode in the multiple coding modes;

if not, continuously judging whether the currently input contact name information supports a second coding mode in the plurality of coding modes or not until the coding mode supported by the currently input contact name information is determined; the character length limit value corresponding to the first coding mode is larger than the character length limit value corresponding to the second coding mode.

Technical Field

The present invention relates to electronic technologies, and in particular, to a method and an apparatus for processing input information, and a mobile terminal.

Background

With the development of mobile communication technology, the mobile terminal has an increasingly close relationship with the user in daily life, study, entertainment, and the like.

Users tend to use mobile terminals to process information, for example, the mobile terminals store information, and the traditional information processing methods of manually recording information are gradually abandoned. The user uses the mobile terminal to process information, at least the information is input into the mobile terminal, and the mobile terminal stores the input information.

At present, most of processing input information only prompts a user that the character length of the input information is out of limit in the process of storing the input information, and the usability is poor until the storage is abnormal.

Disclosure of Invention

The invention provides an information processing method, an information processing device and a mobile terminal, which aim to improve the usability of the mobile terminal for input information.

The invention provides a method for processing input information, which comprises the following steps:

determining a coding mode supported by current input information;

determining a character length limit value corresponding to the coding mode;

encoding the current input information according to the encoding mode, and determining the length of the encoded character;

and judging whether the coded character length is larger than the character length limit value or not, if so, sending prompt information to a user to indicate the user to stop inputting information.

The present invention also provides an input information processing apparatus, including:

the first determining module is used for determining the coding mode supported by the current input information;

the second determining module is used for determining the character length limit value corresponding to the coding mode;

the encoding module is used for encoding the current input information according to the encoding mode and determining the length of the encoded character;

a judging module for judging whether the coded character length is larger than the character length limit value,

and the prompting module is used for sending prompting information to a user to indicate the user to stop inputting information if the character length of the current input information is greater than the character length limit value.

The present invention also provides a mobile terminal, comprising: an input device, an output device, a processor, and a memory; the input device and the output device are respectively connected with the processor, and the processor is also connected with the memory;

the input device is used for receiving input information and transmitting the input information to the processor;

the memory to store program instructions;

the processor is configured to call the program instruction stored in the memory to determine a coding mode supported by the input information, determine a character length limit value corresponding to the coding mode, encode the current input information according to the coding mode, and determine the coded character length; and judging whether the coded character length is larger than the character length limit value or not, if so, controlling the output equipment to send prompt information to the user so as to instruct the user to stop inputting information.

The input information processing method, the input information processing device and the mobile terminal can determine the coding mode supported by the current input information, determine the character length limit value corresponding to the coding mode, code the current input information according to the coding mode to determine the coded character length, judge whether the coded character length is greater than the character length limit value or not, and send prompt information to a user if the coded character length is greater than the character length limit value so as to instruct the user to stop inputting information. The method can send prompt information to the user when the character length of the current input information after being coded is larger than the character length limit value in the information input process, and indicates the user to stop inputting the information, but does not prompt the user that the character length of the input information is over-limit in the input information storage process, so that abnormal storage caused by overlong input information is avoided, the usability of the mobile terminal for the input information is improved, and the user experience is improved.

Drawings

FIG. 1 is a flow chart of a method for processing input information according to the present invention;

FIG. 2 is a flow chart of another method for processing input information according to the present invention;

FIG. 3 is a flow chart of another method for processing input information according to the present invention;

FIG. 4 is a schematic structural diagram of an apparatus for processing input information according to the present invention;

FIG. 5 is a schematic structural diagram of another input information processing apparatus provided in the present invention;

fig. 6 is a schematic structural diagram of a mobile terminal according to the present invention.

Detailed Description

The processing method of each input information provided by the invention can be executed by the processing device of the input information, and the processing device of the input information can be integrated in any mobile terminal capable of inputting information in a software and/or hardware mode. The processing means for inputting information may be located in an input control of the mobile terminal, for example, or may be integrated with other controls within the mobile terminal. The mobile terminal may be any mobile terminal capable of inputting information, such as a mobile phone or a tablet computer.

Fig. 1 is a flowchart of a processing method of input information according to the present invention. As shown in fig. 1, the processing method of the input information may include the following steps:

and S101, determining a coding mode supported by the current input information.

Specifically, the current input information may include: a first character received through the input device, and a second character received through the input device before the first character. The second character is located, for example, in a cache of the mobile terminal. For example, the input device may include: at least one of a touch display screen, a physical key and a voice input device. The voice input device may be a Microphone (Mic for short). For example, in the method, the encoding mode supported by the current input information may be determined from a plurality of encoding modes. The plurality of encoding modes may be encoding modes supported by the mobile terminal.

It should be noted that the method may be a processing method that executes the input information every time an input character is received. The current input information may be characters corresponding to contact information, such as contact name characters.

And S102, determining the character length limit value corresponding to the coding mode.

Specifically, the character length limits corresponding to different encoding modes are different, and in the method, after the encoding mode supported by the current input information is determined, the character length limit corresponding to the encoding mode is determined, and then the current input information is encoded according to the encoding mode.

S103, encoding the current input information according to the encoding mode and determining the length of the encoded character.

Specifically, in S103, all characters of the current input information may be encoded according to the encoding method to obtain the encoded current input information, and then the character length of the encoded current input information may be determined.

S104, judging whether the coded character length is larger than the character length limit value or not.

Specifically, in S104, the encoded character length may be compared with the character length limit value, so as to determine whether the encoded character length is greater than the character length limit value.

And S105, if the coded character length is larger than the character length limit value, sending prompt information to a user to indicate the user to stop inputting information.

Specifically, the method may send the prompt message to the user in a vibration mode, or may send the prompt message to the user in a text or voice mode. Currently, the prompt message may be sent to the user in other manners, which is not intended to limit the present invention. If the length of the coded character is larger than the character length limit value, the method can also stop obtaining the information input by the input equipment.

Optionally, the method may further include:

if the coded word length is smaller than the word length limit, the steps of S101-S105 are continuously executed.

The input information processing method provided by the invention can determine the coding mode supported by the current input information, determine the character length limit value corresponding to the coding mode, code the current input information according to the coding mode to determine the coded character length, judge whether the coded character length is greater than the character length limit value or not, and send prompt information to a user if the coded character length is greater than the character length limit value so as to instruct the user to stop inputting information. The method can send prompt information to the user when the character length of the current input information after being coded is larger than the character length limit value in the information input process, and indicates the user to stop inputting the information, but does not prompt the user that the character length of the input information is over-limit in the input information storage process, so that abnormal storage caused by overlong input information is avoided, the usability of the mobile terminal for the input information is improved, and the user experience is improved.

Optionally, in the method for processing input information described above, the determining, in S101, the encoding mode supported by the current input information may include:

determining a first coding mode supported by the current input information from a plurality of coding modes according to a preset coding mode arrangement sequence; the sequence of the encoding modes is the sequence of the character length limit values corresponding to the encoding modes from large to small.

Since the order of the encoding modes is from large to small, the character length limit corresponding to the first encoding mode supported by the current input information in the plurality of encoding modes is the maximum character length limit supported by the current input information. Therefore, in this method, the first encoding scheme supported by the current input information is determined from the plurality of encoding schemes in the order of increasing the character length limit corresponding to the encoding scheme, so that the usability of the input information can be improved and the information amount of the input information can be increased.

Optionally, the present invention further provides a method for processing input information. Fig. 2 is a flowchart of another input information processing method provided by the present invention. As shown in fig. 2, the determining the first coding mode supported by the current input information from the multiple coding modes according to the preset coding mode ranking order may include:

s201, judging whether the current input information supports a first coding mode in the plurality of coding modes.

S202, if the current input information supports the first coding method, determining that the first coding method supported by the current input information is a first coding method of the plurality of coding methods.

S203, if the current input information does not support the first coding mode, continuously determining whether the current input information supports a second coding mode of the multiple coding modes until the first coding mode supported by the current input information is determined.

The character length limit value corresponding to the first coding mode is larger than the character length limit value corresponding to the second coding mode.

Specifically, the first encoding method and the second encoding method may be any encoding method other than the last encoding method of the plurality of encoding methods. The second encoding method may be a next encoding method of the first encoding method after the plurality of encoding methods are arranged according to a preset encoding method.

If the second encoding mode is a previous encoding mode of the last encoding mode among the plurality of encoding modes and the current input information supports a second encoding mode among the plurality of encoding modes, the method may determine the second encoding mode as a first encoding mode supported by the current input information among the plurality of encoding modes; if the current input information does not support a second encoding mode of the plurality of encoding modes, directly determining the second encoding mode, that is, the last encoding mode of the plurality of encoding modes is the first encoding mode supported by the current input information.

Optionally, the multiple encoding modes include: an 8-bit (bit) encoding mode, an 81 encoding mode of a 2-byte unit Character Set (UCS-2 for short), and a 16-bit Unicode Transformation Format (UTF-16 for short).

Specifically, the character length limit corresponding to the 8-bit (bit) encoding mode may be 14 bytes; the character length limit value corresponding to the 81 encoding mode of the UCS-2, also called 0X81 encoding mode, may be 11 bytes; the character length limit value corresponding to the UTF-16 encoding mode may be 6 bytes.

The invention also provides a processing method of the input information. Fig. 3 is a flowchart of another input information processing method provided by the present invention. As shown in fig. 3, the method for processing the input information may include:

s301, receiving information input by a user, wherein the input information comprises name information of a contact person.

S302, whether the input information supports an 8-bit coding mode is determined.

Specifically, in S302, it may be determined whether each character of the input information is in a preset encoding table, and if each character corresponding to the input information is in the encoding table, it may be determined that the input information supports an 8-bit encoding mode; on the contrary, if the character corresponding to the input information has the content which is not in the code table, the input information can be determined not to support the 8-bit coding mode. For example, the S302 may be, for example, invoking an interface control code of an Android operation (Android) system, such as a gsm alpha beta.

And S303, if the input information supports the 8-bit coding mode, determining a character length limit value corresponding to the 8-bit coding mode, coding the current input information according to the 8-bit coding mode, and determining the coded character length.

S304, judging whether the coded character length is larger than the character length limit value corresponding to the 8-bit coding mode.

S305, if the coded character length is larger than the character length limit value corresponding to the 8-bit coding mode, sending prompt information to a user to instruct the user to stop inputting information.

If the coded word length is smaller than the word length limit corresponding to the 8-bit coding scheme, the process returns to the step S301.

S306, if the input information does not support the 8-bit coding mode, determining whether the input information supports the 81 coding mode of UCS-2.

Specifically, in S306, each character in the input information may be converted into a Unicode (Unicode), such as 0 xxxxxx format, and if the 16-ary number of bits in the Unicode of each character is less than 4 bits, the higher order is complemented by 0. If the decimal number corresponding to the unicode of each character is less than 128, each character in the input Information is a character in an American Standard Code for Information Interchange (ASCII) set, and the input Information is determined to be null (null) without adopting an 81 coding mode of UCS-2; if the first hexadecimal bit in the value obtained by performing AND operation on the Unicode of one character in the input information and 0x8000 is 1, the character does not support the 81 coding mode of UCS-2 and returns to be a null value; if the first hexadecimal bit in the value obtained by AND operation of the Unicode of the character and 0x8000 is 0, each character supports the 81 coding mode of UCS-2. In the method, whether the base addresses corresponding to all characters of the input information are the same or not needs to be determined, and if the base addresses corresponding to all characters of the input information are the same, the input information can be determined to support the 81 encoding mode of the UCS-2; if the input information contains characters with different base addresses, the input information can be determined not to support the 81 encoding mode of the UCS-2.

Aiming at the fact that the decimal number corresponding to each character of the input information is smaller than 128, each character is a character in an ASCII set, and a binary system corresponding to each character and 0xff are stored in an array after operation; if the decimal number corresponding to each character of the input information is larger than 128, performing an AND operation on one character in the input information, such as a binary number corresponding to the first character, and 0x7f80, and determining 2-9 bits in the result of the AND operation as base; and carrying out exclusive OR on binary numbers corresponding to another character in the input information and base, wherein the exclusive OR result is represented as tempAlphaId. If the tempAlphaId is larger than 128, determining that the base address of the other character is different from the base address of the character, and returning a null value when the input information does not support the 81 encoding mode of UCS-2; if the tempAlphaId is less than 128, the result of the AND operation of the tempAlphaId with 0x80 is stored in the result array. The base address of the input information is obtained by right shifting the base by 7 bits and performing an AND operation with 0 xff.

If the input information can support the 81 encoding mode of the UCS-2, an array is newly established, the length of the array is the length of an input character plus 3, a first byte is stored in 81, a second byte is stored in the length of the input character, a third base address is stored, and the following bytes are sequentially stored in the encoding of each character in the input information.

For example, if the unicode corresponding to one character in the input message is 0x45E8, the binary number corresponding to the one character is 0100010111101000, and the and operation result base of the binary number corresponding to the one character and 0x7f80 is 0100010110000000. And performing exclusive or on the binary system corresponding to the other characters and the base, and if the exclusive or result is greater than 128, determining that the 2-9 bits of the binary system corresponding to the other characters are different from 0x45E8, namely the base address is different, wherein the input information cannot support the 81 encoding mode of the UCS-2.

S307, if the input information supports the 81 coding mode of the UCS-2, determining a character length limit value corresponding to the 81 coding mode of the UCS-2, coding the current input information according to the 81 coding mode of the UCS-2, and determining the coded character length.

S308, judging whether the coded character length is larger than the character length limit value corresponding to the 81 coding mode of the UCS-2.

And S309, if the coded character length is larger than the character length limit value corresponding to the 81 coding mode of the UCS-2, sending prompt information to a user to instruct the user to stop inputting information.

If the coded word length is smaller than the word length limit corresponding to the 81 coding method of UCS-2, the process returns to the step S301.

S310, if the input information does not support the 81 encoding mode of the UCS-2, determining a character length limit value corresponding to the UTF-16 encoding mode, encoding the current input information according to the UTF-16 encoding mode, and determining the encoded character length.

S311, judging whether the coded character length is larger than the character length limit value corresponding to the UTF-16 coding mode.

And S312, if the coded character length is larger than the character length limit value corresponding to the UTF-16 coding mode, sending prompt information to a user to indicate the user to stop inputting information.

If the coded character length is smaller than the character length limit value corresponding to the UTF-16 coding method, the process returns to the step S301.

The processing method of the input information provided by the invention can send prompt information to the user when the character length of the current input information after being coded is larger than the character length limit value in the information input process, and instruct the user to stop inputting the information, but not prompt the user that the character length of the input information is over-limited in the storage process of the input information, so that the storage abnormity caused by overlong input information is avoided, and the usability of the mobile terminal for the input information is improved. In addition, the method also determines the coding mode supported by the current input information from a plurality of coding modes according to the descending order of the character length limit value corresponding to the coding mode, thereby improving the usability of the input information and increasing the information quantity of the input information.

The present invention further provides an input information processing apparatus, so as to execute the input information processing apparatus described in any one of fig. 1 to 3. Fig. 4 is a schematic structural diagram of a processing apparatus for inputting information according to the present invention. As shown in fig. 4, the processing device 400 for inputting information may include:

a first determining module 401, configured to determine a coding mode supported by the current input information.

A second determining module 402, configured to determine a character length limit value corresponding to the encoding method.

And an encoding module 403, configured to encode the current input information according to the encoding mode, and determine the length of the encoded character.

The judging module 404 is configured to judge whether the encoded character length is greater than the character length limit.

A prompt module 405, configured to send a prompt message to a user to instruct the user to stop inputting information if the character length of the current input information is greater than the character length limit.

Optionally, the first determining module 401 is specifically configured to determine, according to a preset coding mode arrangement order, a first coding mode supported by the current input information from multiple coding modes; the sequence of the encoding modes is the sequence of the character length limit values corresponding to the encoding modes from large to small.

Optionally, fig. 5 is a schematic structural diagram of another input information processing apparatus provided in the present invention. As shown in fig. 5, in the apparatus 400 for processing input information, the first determining module 401 may include:

the judging sub-unit 4011 is configured to judge whether the current input information supports a first coding scheme of the plurality of coding schemes.

The determining sub-unit 4012 is configured to determine, if the current input information supports a first coding scheme of the multiple coding schemes, that a first coding scheme supported by the current input information is the first coding scheme of the multiple coding schemes.

The determining sub-unit 4011 is further configured to, if the current input information does not support a first coding scheme in the multiple coding schemes, continue to determine whether the current input information supports a second coding scheme in the multiple coding schemes until the first coding scheme supported by the current input information is determined; the character length limit value corresponding to the first coding mode is larger than the character length limit value corresponding to the second coding mode.

Optionally, the multiple encoding modes include: 8-bit coding mode, UCS-2 coding mode 81 and UTF-16 coding mode.

The input information processing apparatus provided by the present invention can execute any one of the input information processing methods described in fig. 1 to fig. 3, and specific implementation processes and beneficial effects thereof can be referred to above, and are not described herein again.

The invention also provides a mobile terminal. Fig. 6 is a schematic structural diagram of a mobile terminal according to the present invention. As shown in fig. 6, the mobile terminal 600 may include: an input device 601, an output device 602, a processor 603, and a memory 604; the input device 601 and the output device 602 are each connected to a processor 603, and the processor 603 is further connected to a memory 604.

An input device 601 for receiving input information and transmitting the input information to the processor 603.

A memory 604 for storing program instructions.

A processor 603, configured to invoke the program instruction stored in the memory 604, to determine a coding mode supported by the input information, determine a character length limit value corresponding to the coding mode, encode the current input information according to the coding mode, and determine the coded character length; and judging whether the coded character length is larger than the character length limit value or not, if so, controlling the output equipment 602 to send prompt information to the user so as to instruct the user to stop inputting information.

Optionally, the processor 603 is specifically configured to determine, according to a preset coding mode arrangement order, a first coding mode supported by the current input information from a plurality of coding modes; the sequence of the encoding modes is the sequence of the character length limit values corresponding to the encoding modes from large to small.

Optionally, the processor 603 is specifically configured to determine whether the current input information supports a first encoding method of the multiple encoding methods; if so, determining that the first coding mode supported by the current input information is a first coding mode in the plurality of coding modes; if not, continuously judging whether the current input information supports a second coding mode in the plurality of coding modes until a first coding mode supported by the current input information is determined; the character length limit value corresponding to the first coding mode is larger than the character length limit value corresponding to the second coding mode.

Optionally, the multiple encoding modes include: 8-bit coding mode, UCS-2 coding mode 81 and UTF-16 coding mode.

The mobile terminal provided by the present invention can execute the method for processing the input information described in any one of fig. 1 to fig. 3, and the specific implementation process and the beneficial effects thereof are referred to above, and are not described herein again.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种文本背诵辅助方法、系统以及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!