Information processing method and electronic equipmentTechnical Field
The present invention relates to the field of internet, and in particular, to an information processing method and an electronic device.
Background
With the rapid development of internet technology, users can not only communicate through information, but also record some important things through information. For example, the user can communicate by means of short messages, instant messaging messages and the like, and can edit a memo to record important things.
At present, when a user communicates through information or records something through information, the user needs to input the information in a text box included in a terminal, and the terminal receives the information input by the user and displays the information. However, some information includes date information, for example, the date information may be 3/5. Because the concept of the date information is unfamiliar, the specific day cannot be reflected after the date information is seen, and the user can only check the calendar to determine the day, so that important things of the user can be delayed.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an information processing method and an electronic device. The technical scheme is as follows:
in one aspect, a method for information processing is provided, where the method is applied to an electronic device including a display unit, and the method includes:
acquiring text information to be output and displayed;
analyzing the text information, and extracting first date information contained in the text information;
converting the first date information into second date information based on current date information recorded by the electronic equipment, wherein the first date information and the second date information are displayed in different forms;
outputting the second date information while the text information is displayed and output through the display unit.
Further, the method further comprises:
outputting the first date information while the text information is being displayed and output by the display unit, the second date information being displayed adjacent to the first date information.
Wherein the converting the first date information into second date information based on the current date information recorded by the electronic device includes:
according to a first preset rule, calculating a time interval between current date information recorded by the electronic equipment and the first date information;
and according to a second preset rule, increasing the time interval of the current date information to obtain second date information.
Further, before increasing the time interval to the current date information according to a second preset rule and obtaining second date information, the method further includes:
judging whether the time interval is smaller than or equal to a first preset value or not;
and if so, executing the step of increasing the time interval of the current date information according to a second preset rule to obtain second date information.
Wherein the converting the first date information into second date information based on the current date information recorded by the electronic device includes:
according to a first preset rule, calculating a time interval between current date information recorded by the electronic equipment and the first date information;
judging whether the time interval is less than or equal to a second preset value or not;
and if so, acquiring corresponding second date information from the corresponding relation between the stored time interval and the second date information according to the time interval.
In another aspect, an electronic device for information processing is provided, the electronic device including a display unit, the electronic device further including: the device comprises an acquisition unit, an extraction unit and a conversion unit;
the acquisition unit is used for acquiring text information to be output and displayed;
the extraction unit is used for analyzing the text information and extracting first date information contained in the text information;
the conversion unit is used for converting the first date information into second date information based on the current date information recorded by the electronic equipment, and the display form of the first date information is different from that of the second date information;
the display unit is used for outputting the second date information while displaying and outputting the text information.
Further, the air conditioner is provided with a fan,
the display unit is further configured to output the first date information while displaying and outputting the text information, and the second date information is displayed adjacent to the first date information.
Optionally, the conversion unit includes:
the first calculating subunit is used for calculating a time interval between the current date information recorded by the electronic equipment and the first date information according to a first preset rule;
and the adding subunit is used for adding the time interval to the current date information according to a second preset rule to obtain second date information.
Further, the conversion unit further includes:
the first judgment subunit is used for judging whether the time interval is smaller than or equal to a first preset value or not;
and the execution subunit is used for executing the step of increasing the current date information by the time interval according to a second preset rule to obtain second date information if the current date information is the current date information.
Optionally, the conversion unit includes:
the second calculating subunit is used for calculating a time interval between the current date information recorded by the electronic equipment and the first date information according to a first preset rule;
the second judgment subunit is used for judging whether the time interval is smaller than or equal to a second preset value or not;
and the acquisition subunit is used for acquiring the corresponding second date information from the corresponding relation between the stored time interval and the second date information according to the time interval if the time interval is positive.
In the embodiment of the present invention, the first date information in the text information to be output and displayed is acquired, and the first date information is converted into the second date information, and the second date information may be information in the form of day of the week, tomorrow, or the next day. Therefore, when the user sees the first date information and the second date information, the user can determine the day of the first date information according to the second date information without looking up a calendar, the user can conveniently memorize the first date information, and the use experience of the user is further improved. And the user can be effectively reminded through the second date information, so that the influence on the viscosity of the user is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of an information processing method provided in embodiment 1 of the present invention;
fig. 2 is a flowchart of an information processing method provided in embodiment 2 of the present invention;
fig. 3 is a schematic view of a text information display interface provided in embodiment 2 of the present invention;
fig. 4 is a schematic view of another text information display interface provided in embodiment 2 of the present invention;
fig. 5 is a schematic view of another text information display interface provided in embodiment 2 of the present invention;
fig. 6 is a schematic view of another text information display interface provided in embodiment 2 of the present invention;
fig. 7 is a schematic view of another text information display interface provided in embodiment 2 of the present invention;
fig. 8 is a schematic structural diagram of an information processing electronic device according to embodiment 3 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example 1
Referring to fig. 1, an embodiment of the present invention provides an information processing method, which is applied to an electronic device including a display unit, and includes:
step 101: acquiring text information to be output and displayed;
step 102: analyzing the text information, and extracting first date information contained in the text information;
step 103: converting the first date information into second date information based on the current date information recorded by the electronic equipment, wherein the first date information and the second date information are displayed in different forms;
step 104: the second date information is output while the text information is displayed and output through the display unit.
Further, the method further comprises:
the first date information is output while the text information is displayed and output by the display unit, and the second date information is displayed adjacent to the first date information.
Wherein converting the first date information into second date information based on the current date information recorded by the electronic device includes:
calculating a time interval between current date information and first date information recorded by the electronic equipment according to a first preset rule;
and according to a second preset rule, increasing the current date information by the time interval to obtain second date information.
Further, according to a second preset rule, before the current date information is increased by the time interval and the second date information is obtained, the method further includes:
judging whether the time interval is less than or equal to a first preset value;
if yes, the step of increasing the current date information by the time interval according to a second preset rule to obtain second date information is executed.
Wherein converting the first date information into the second date information based on the current date information recorded by the electronic device includes:
calculating a time interval between current date information and first date information recorded by the electronic equipment according to a first preset rule;
judging whether the time interval is less than or equal to a second preset value;
if yes, according to the time interval, corresponding second date information is obtained from the corresponding relation between the stored time interval and the second date information.
In the embodiment of the present invention, the first date information in the text information to be output and displayed is acquired, and the first date information is converted into the second date information, and the second date information may be information in the form of day of the week, tomorrow, or the next day. Therefore, when the user sees the first date information and the second date information, the user can determine the day of the first date information according to the second date information without looking up a calendar, the user can conveniently memorize the first date information, and the use experience of the user is further improved. And the user can be effectively reminded through the second date information, so that the influence on the viscosity of the user is avoided.
Example 2
Referring to fig. 2, an embodiment of the present invention provides an information processing method, which is applied to an electronic device including a display unit, and includes:
step 201: text information to be output and displayed is acquired.
The text information may be information input in a text input box included in the electronic device of the user, or may be information transmitted by another electronic device.
When the text information is text information input by a user in a text input box included in the electronic device, if the user inputs information into the text input box, the electronic device may acquire text information to be output and displayed from the text box.
When the text information is text information sent to the electronic device by other electronic devices, the electronic device may determine the received text information as text information to be output and displayed.
Step 202: the acquired text information is analyzed, and first date information contained in the text information is extracted.
Specifically, the acquired text information is analyzed, information in a preset format is extracted from the text information, and the extracted information is determined as first date information contained in the text information.
It should be noted that the preset format may be set in the electronic device by a technician when developing a system of the electronic device, or may be set in the electronic device in advance by a user, which is not specifically limited in this embodiment of the present invention.
For example, when the date information is 3/month-5, the preset format may be 3/month-5, 3.5, 3-5.
Step 203: the first date information is converted into second date information based on the current date information recorded by the electronic device, and the first date information and the second date information are displayed in different forms.
Specifically, according to a first preset rule, calculating a time interval between current date information and first date information recorded by the electronic equipment; and according to a second preset rule, increasing the current date information by the time interval to obtain second date information.
The first preset rule and the second preset rule are preset in advance, and the first preset rule and the second preset rule are known. For example, a first preset rule may specify the number of days per month and a second preset rule may specify a period from sunday to monday. Of course, the second preset rule may also specify a period from monday to sunday.
When the first date information and the current date information recorded by the electronic device are in the same month, according to the first preset rule, the specific operation of calculating the time interval between the current date information recorded by the electronic device and the first date information may be: a difference between the current date information and the first date information recorded by the electronic device is directly calculated, and the difference is determined as a time interval between the current date information and the first date information.
For example, if the current date information is No. 3/month 5 and the first date information is No. 3/month 8, the time interval between the current date information and the first date information obtained by subtracting the current date information from the first date information is 3 days.
When the first date information is not in the same month as the current date information recorded by the electronic device, according to a first preset rule, the specific operation of calculating the time interval between the current date information recorded by the electronic device and the first date information may be: subtracting the current date information from the total date information of the month in which the current date information is positioned to obtain a first time interval; calculating a second time interval from the first date information of the month in which the first date information is located to the first date information; the sum of total date information for each month between the current date information and the first date information is calculated, resulting in a third time interval. And adding the first time interval, the second time interval and the third time interval to obtain the time interval between the current date information and the first date information recorded by the electronic equipment.
For example, the current date information is No. 5 of 3 months, the first date information is No. 10 of 5 months, the total date information of 3 months is 31 days, and the total date information of 4 months is 30 days. Subtracting No. 3/5 from the total date information of 3 months by 31 days to obtain a first time interval of 26 days; the second time interval is 10 days; the third time interval is 30 days of total date information of 4 months, so the time interval between the current date information and the first date information recorded by the electronic equipment is 66 days by adding the first time interval of 26 days, the second time interval of 10 days and the third time interval of 30 days.
Further, according to a first preset rule, calculating the time interval between the current date information No. 3/month 5 and the first date information No. 5/month 10 recorded by the electronic equipment to be 66 days; and as the number 3/month 5 is Wednesday, increasing the current date information by 66 days according to a second preset rule to obtain second date information of Saturday. The electronic apparatus may display the second date information saturday by an adjacent position to the first date information No. 5/10 in the interface as shown in fig. 3.
Further, if the time interval between the current date information and the first date information is large, the role of converting the first date information into the second date information is also not large, so that it is necessary to judge the time interval between the current date information and the first date information before converting the first date information into the second date information. Specifically, according to a second preset rule, the current date information is added with the time interval, and before second date information is obtained, whether the time interval is smaller than or equal to a first preset value is judged; and if the time interval is smaller than or equal to the first preset value, executing a step of increasing the current date information by the time interval according to a second preset rule to obtain second date information.
Further, if the time interval is greater than the first preset value, the step of increasing the current date information by the time interval according to a second preset rule to obtain second date information is not executed.
The first preset value may be 13 days, that is, when the first date information is located in the next week of the current date information, the first date information is converted into the second date information. And when the user views the text information each time, the electronic equipment acquires the current date information in real time and converts the first date information into second date information according to the current date information, namely the second date information is changed according to the current date information.
For example, the current date information is No. 3/month 5, and the first date information is No. 3/month 12. And if the time interval between month 3 and month 5 and month 3 and month 12 is 7 days, and month 3 and month 5 are wednesday, the time interval is increased by 7 days for month 3 and month 5 according to a second preset rule, and the second date information is obtained as the next wednesday. The electronic apparatus may display the second date information on wednesday in an adjacent position to the first date information No. 3/12 in the interface as shown in fig. 4.
For another example, when the user views the text information again in month 3 and 10, the current date information is month 3 and 10, the electronic device calculates the time interval between month 3 and 10 and month 3 and 12 of the current date information as 2 days, month 3 and 10 as monday, and the electronic device increases month 3 and 10 by the time interval for 2 days according to a second preset rule, so as to obtain second date information as current wednesday. The electronic apparatus may display the second date information on Wednesday at a position adjacent to the first date information No. 3/12 in the interface shown in FIG. 5.
Optionally, in the embodiment of the present invention, the second date information may be not only the day of the week, but also the day of the tomorrow, the acquired day, and the like. When the second date information is the date information such as tomorrow, the next day, etc., the operation of converting the first date information into the second date information based on the current date information recorded by the electronic apparatus may be: calculating a time interval between current date information and first date information recorded by the electronic equipment according to a first preset rule; judging whether the time interval is less than or equal to a second preset value; if yes, according to the time interval, corresponding second date information is obtained from the corresponding relation between the stored time interval and the second date information.
According to the time interval, the specific operation of acquiring the corresponding second date information from the stored corresponding relationship between the time interval and the second date information may be: if the current date information is located before the first date information, a first symbol is added before the time interval, and corresponding second date information is acquired from the stored correspondence between the time interval and the second date information according to the time interval after the addition of the first symbol. If the current date information is located after the first date information, a second symbol is added before the time interval, and corresponding second date information is acquired from the correspondence between the stored time interval and the second date information according to the time interval after the second symbol is added.
When the second date information is information such as tomorrow and the next day, the electronic device acquires the current date information in real time when the user views the text information each time, and converts the first date information into the second date information according to the current date information, namely, the second date information is changed according to the current date information.
Further, if the current date information is the first date information, the time interval is 0 days, and the first symbol may be added before the time interval, or the second symbol may be added.
The first symbol may be "+" and the second symbol may be "-".
The second preset value may be 2 days, that is, when the first date information is one or two days after the current date information, the first date information is converted into the second date information.
Wherein, the correspondence between the time interval and the second date information may be as shown in table 1 below. If the current date information is month No. 3 and 5, the first date information is month No. 3 and 8. According to a first preset rule, the time interval between the current date information No. 3/month 5 and the first date information No. 3/month 8 recorded by the electronic equipment is calculated to be 3 days, and if the second preset value is 3, the time interval is equal to the second preset value 3 within 3 days. Since the current date information No. 3/5 is located before the first date information No. 3/8, the first symbol "+" is added 3 days before the time interval, and the corresponding second date information is acquired as the next day from the correspondence between the time interval shown in the following table 1 and the second date information according to the time interval +3 days after the addition of the first symbol. The electronic device may display the second date information day after the day in the adjacent position of the first date information No. 3/8 in the interface as shown in fig. 6.
TABLE 1
| Time interval | Second date information |
| Day 1 | Before dawn |
| 2 days | The front day |
| -3 days | Yesterday |
| Day-0/+0 day | Today's appliances |
| +1 day | Tomorrow (tomorrow) |
| +2 days | Acquired sky |
| +3 days | Great posterior |
For another example, when the user views the text information again at month 3 and 6, and the current date information is month 3 and 6, the electronic device calculates the time interval between month 3 and 6 and month 3 and 8 of the current date information to be 2 days again, and the time interval of 2 days is smaller than the second preset numerical value of 3. Since the current date information No. 3/6 is located before the first date information No. 3/8, the first symbol "+" is added 2 days before the time interval, and the corresponding second date information is acquired as the next day from the correspondence between the time interval shown in table 1 and the second date information, based on the time interval +2 days after the addition of the first symbol. The electronic device may display the second date information next day in the interface shown in fig. 7 at a position adjacent to the first date information No. 3/8.
Step 204: the second date information is output while the text information is displayed and output through the display unit.
When the text information is displayed and output through the display unit, the first date information in the text information can be replaced by the second date information, and the replaced text information can be displayed.
Step 205: the first date information is output while the text information is displayed and output by the display unit, and the second date information is displayed adjacent to the first date information.
Further, when the text information is displayed and output by the display unit, the first date information and the converted second date information in the text information are simultaneously displayed, and the second date information is displayed adjacent to the first date information.
In the embodiment of the present invention, the first date information in the text information to be output and displayed is acquired, and the first date information is converted into the second date information, and the second date information may be information in the form of day of the week, tomorrow, or the next day. Therefore, when the user sees the first date information and the second date information, the user can determine the day of the first date information according to the second date information without looking up a calendar, the user can conveniently memorize the first date information, and the use experience of the user is further improved. And the user can be effectively reminded through the second date information, so that the influence on the viscosity of the user is avoided.
Example 3
As shown in fig. 8, an embodiment of the present invention provides an information processing electronic device, where the electronic device includes a display unit 801, and the electronic device further includes: an acquisition unit 802, an extraction unit 803, and a conversion unit 804;
an acquisition unit 802 configured to acquire text information to be output and displayed;
an extracting unit 803 for analyzing the text information and extracting first date information contained in the text information;
a conversion unit 804 for converting first date information into second date information based on current date information recorded by the electronic apparatus, the first date information being displayed in a different form from the second date information;
a display unit 801 for outputting the second date information while displaying and outputting the text information.
Further, the air conditioner is provided with a fan,
the display unit 801 is also configured to output the first date information while displaying and outputting the text information, and the second date information is displayed adjacent to the first date information.
Optionally, the converting unit 804 includes:
the first calculating subunit is used for calculating a time interval between the current date information and the first date information recorded by the electronic equipment according to a first preset rule;
and the adding subunit is used for adding the current date information to the time interval according to a second preset rule to obtain second date information.
Further, the conversion unit 804 further includes:
a first judging subunit, configured to judge whether the time interval is smaller than or equal to a first preset value;
and the execution subunit is used for executing the step of increasing the current date information by the time interval according to a second preset rule to obtain second date information if the current date information is the current date information.
Optionally, the converting unit 804 includes:
the second calculating subunit is used for calculating the time interval between the current date information and the first date information recorded by the electronic equipment according to a first preset rule;
a second judging subunit, configured to judge whether the time interval is smaller than or equal to a second preset value;
and the acquisition subunit is used for acquiring the corresponding second date information from the corresponding relation between the stored time interval and the second date information according to the time interval if the time interval is positive.
In the embodiment of the present invention, the first date information in the text information to be output and displayed is acquired, and the first date information is converted into the second date information, and the second date information may be information in the form of day of the week, tomorrow, or the next day. Therefore, when the user sees the first date information and the second date information, the user can determine the day of the first date information according to the second date information without looking up a calendar, the user can conveniently memorize the first date information, and the use experience of the user is further improved. And the user can be effectively reminded through the second date information, so that the influence on the viscosity of the user is avoided.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.