Date input method, device, storage medium, and electronic device

By using optical character recognition technology to group and simulate selection operations, the problems of low efficiency and lack of versatility in date input are solved, enabling efficient date input in different date input controls.

CN115617183BActive Publication Date: 2026-08-25NEUSOFT CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211066073.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-08-25
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

Existing technologies for date input are inefficient and lack versatility. They cannot input date values ​​into the input box by direct assignment, and customized solutions cannot be applied to different date input controls.

Method used

The image of the date input area is obtained by optical character recognition technology, grouped into multiple date sets, and a simulated selection operation is performed according to the distribution of the target characters to be input, so as to select and input the characters in the date input area.

Benefits of technology

It improves the efficiency and versatility of date input, enabling efficient date input across different date input controls, and avoids the need for fixed customization of the position and operation of each control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617183B_ABST
    Figure CN115617183B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a date input method and device, a storage medium and an electronic device, to improve the efficiency and versatility of date input. The method comprises: obtaining a first optical character recognition result corresponding to an image of a date input area; grouping characters in the first optical character recognition result to obtain a plurality of date sets composed of numerical characters; performing a corresponding simulation selection operation according to the distribution of a target to-be-input character in a target date set to select the target to-be-input character in the date input area; and when it is determined that all to-be-input characters are selected in the date input area, performing an operation of inputting the selected characters in the date input area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a date input method, apparatus, storage medium, and electronic device. Background Technology

[0002] On mobile devices, when a date and time need to be entered, a scrolling date window can be displayed. The date, month, and day are manually scrolled to a specified position and saved, thus assigning the date value to the input box. However, this method cannot directly assign the date value to the input box, resulting in low efficiency.

[0003] To improve date input efficiency, related technologies can fix the position and operation method of the year, month, and day in each control in the scroll box for a specific calendar control, generating a unique object that is only valid for the current control. However, this solution is a customized solution and lacks universality. Summary of the Invention

[0004] The purpose of this disclosure is to provide a date input method, apparatus, storage medium, and electronic device that improves both the efficiency and versatility of date input.

[0005] To achieve the above objectives, in a first aspect, this disclosure provides a date input method, the method comprising:

[0006] Obtain the first optical character recognition result corresponding to the image of the date input area;

[0007] The characters in the first optical character recognition result are grouped to obtain multiple sets of dates composed of numeric characters, and each set of dates corresponds to a date unit.

[0008] Based on the distribution of the target input character in the target date set, a corresponding preset simulated selection operation is performed to select the target input character in the date input area. The target input character is the input character corresponding to the same date unit as the target date set. The target date set is any one of multiple date sets.

[0009] When it is determined that all characters to be entered are selected in the date input area, the operation of entering the selected characters in the date input area is performed.

[0010] Optionally, the step of grouping the characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters includes:

[0011] The target regular expression is used to match the first optical character recognition result to obtain each numeric character corresponding to each date unit;

[0012] Each numeric character corresponding to the same date unit is identified as a set of dates.

[0013] Optionally, the step of performing a corresponding simulated selection operation based on the distribution of the target input character in the target date set includes:

[0014] When the target date set includes the target character to be input, a simulated click is performed on the position of the target character to be input recorded in the first optical character recognition result.

[0015] Optionally, the method further includes:

[0016] Obtain the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target character to be input;

[0017] When the first position information corresponding to the target input character is different from the corresponding second position information, the target input character is selected in the date input area. The first position information corresponding to the target input character is the position information of the target input character recorded in the first optical character recognition result, and the second position information corresponding to the target input character is the position information of the target input character recorded in the second optical character recognition result.

[0018] Optionally, the method further includes:

[0019] When the first position information corresponding to the target input character is the same as the corresponding second position information, a first sliding parameter is determined based on the difference between the currently selected character and the target input character. The first sliding parameter includes a first sliding number and a first sliding direction.

[0020] Based on the first sliding parameter, perform the sliding operation.

[0021] Optionally, the method further includes:

[0022] Based on the location information corresponding to each numeric character in the target date set, a sub-image region corresponding to each numeric character is determined, wherein the location information is the location information recorded in the first optical character recognition result or the location information recorded in the second optical character recognition result;

[0023] The currently selected character is determined based on the color distribution of each sub-image region.

[0024] Optionally, the step of performing a corresponding simulated selection operation based on the distribution of the target input character in the target date set includes:

[0025] When the target input character does not exist in the target date set, a second sliding parameter is determined based on the difference between the target numeric character in the target date set and the target input character. The second sliding parameter includes a second sliding number and a second sliding direction.

[0026] Based on the second sliding parameter, perform the sliding operation.

[0027] Optionally, the target numeric character is a character located in the middle position in the target date set, determined according to the first optical character recognition result, or is the currently selected character in the image of the date input area.

[0028] Optionally, after performing the sliding operation based on the second sliding parameter, the method further includes:

[0029] Obtain the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation is performed;

[0030] The third optical character recognition result is used as the new first optical character recognition result, and the process returns to the step: grouping the numeric characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, until the operation of inputting the selected character in the date input area is performed.

[0031] Secondly, this disclosure provides a date input device, the device comprising:

[0032] The first acquisition module is used to acquire the optical character recognition results corresponding to the image of the area where the keyboard is located;

[0033] The grouping module is used to obtain the standard character distribution information corresponding to the keyboard based on the optical character recognition results.

[0034] The simulated selection module is used to correct the optical character recognition result based on the standard character distribution information to obtain the target recognition result of the keyboard;

[0035] The input module is used to perform the operation of inputting the selected characters in the date input area when it is determined that all characters to be input are selected in the date input area.

[0036] Thirdly, this disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects.

[0037] Fourthly, this disclosure provides an electronic device, comprising:

[0038] A memory on which computer programs are stored;

[0039] A processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects.

[0040] The above technical solution obtains the first optical character recognition result corresponding to the image of the date input area. The characters in the first optical character recognition result are grouped to obtain multiple sets of dates composed of numeric characters. Based on the distribution of the target input character in the target date set, a corresponding simulated selection operation is performed to select the target input character in the date input area. When it is determined that all input characters are selected in the date input area, the operation of inputting the selected character in the date input area is performed, thereby completing the date input. By analyzing and processing the results obtained from general optical character recognition, it is possible to select the input character in the date input area, thus realizing the function of inputting dates in a scrolling date box, improving both the efficiency and versatility of date input.

[0041] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0042] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0043] Figure 1 This is a flowchart illustrating a date input method according to an exemplary embodiment of the present disclosure;

[0044] Figure 2 This is a schematic diagram illustrating a screen display image according to an exemplary embodiment of the present disclosure;

[0045] Figure 3 This is a flowchart illustrating another date input method according to an exemplary embodiment of the present disclosure;

[0046] Figure 4 This is a block diagram illustrating a date input device according to an exemplary embodiment of the present disclosure;

[0047] Figure 5 This is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0048] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0049] It should be noted that the date input method of this disclosure can be applied to scenarios where dates are automatically input, including but not limited to automated testing scenarios and batch date input scenarios.

[0050] Please see Figure 1 , Figure 1 This is a flowchart illustrating a date input method according to an exemplary embodiment of the present disclosure. The method is applied to electronic devices, such as… Figure 1 As shown, the date input method includes:

[0051] S110, Obtain the first optical character recognition result corresponding to the image of the date input area.

[0052] In this embodiment of the disclosure, the date input area can be understood as the area where the scroll bar for date input is located.

[0053] In some implementations, the electronic device can first acquire a screen display image including the date input area, and then segment the image of the date input area from the screen display image using edge contour detection or target object recognition methods.

[0054] In some implementations, the screen display image may be obtained by the electronic device taking a screenshot of the terminal screen.

[0055] For example, such as Figure 2 As shown, Figure 2 An image of a screen display is shown, which includes a date input area 201.

[0056] In some implementations, the date input function can be accessed by clicking the date input control, thereby displaying a screen image including the date input area. For example, clicking... Figure 2 Control area 202 or control area 203 in the middle.

[0057] In this embodiment of the disclosure, after obtaining the image of the date input area, the image of the date input area can be processed by optical character recognition (OCR) technology to obtain the first optical character recognition result corresponding to the image of the date input area.

[0058] S120, group the characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, with each set of dates corresponding to a date unit.

[0059] In some implementations, the first optical character recognition result may include character recognition result, i.e., each recognized character, and position recognition result corresponding to the recognized character, i.e., position information of the recognized character.

[0060] Continue to use Figure 2 For example, the first optical character recognition result may include characters such as "cancel, start date, confirm, 2020, year, 2021, year, 2022, year, 2, month, 3, month, 4, month, 5, month, 16, day, 17, day, 18, day, 19, day, 20, day", as well as the position recognition result corresponding to each recognized character. Optionally, the position recognition result may be the coordinate information corresponding to the character.

[0061] In this embodiment of the present disclosure, after obtaining the first optical character recognition result, the characters in the first optical character recognition result can be grouped according to a preset grouping strategy to obtain multiple sets of dates composed of numeric characters.

[0062] For example, continuing with the previous example, after grouping, we can obtain date set one including the numeric characters "2020, 2021, 2022", date set two including the numeric characters "2, 3, 4, 5", and date set three including the numeric characters "16, 17, 18, 19, 20". Here, date set one corresponds to the date unit "year", date set two corresponds to the date unit "month", and date set three corresponds to the date unit "day".

[0063] S130, based on the distribution of the target input character in the target date set, perform the corresponding simulated selection operation to select the target input character in the date input area. The target input character is the input character corresponding to the same date unit as the target date set. The target date set is any one of multiple date sets.

[0064] It is understood that in this embodiment of the disclosure, since date input is required, there is a corresponding date that needs to be entered through a date scroll bar, i.e., the date to be entered, for example, November 21, 2020. It is also understood that this date to be entered cannot be entered through parameterized assignment like traditional character input; it needs to be entered by selecting a number in the date scroll bar.

[0065] In this embodiment of the disclosure, after obtaining the date to be input, the individual numeric characters included in the date to be input can be obtained as individual characters to be input. For example, the three characters to be input, 2020, 11, and 21, can be obtained.

[0066] In this embodiment of the disclosure, any set of dates can be used as the target set of dates, and for any set of dates, there can be a corresponding character to be input. For example, if the set of dates corresponding to the date unit "year" corresponds to the character to be input "2020", then when the set of dates is used as the target set of dates, the character to be input "2020" can be used as the target character to be input.

[0067] The distribution of the target input character within the target date set can include two scenarios: the target input character is included in the target date set, and the target input character is not included in the target date set. For example, when date set one is determined as the target date set, the target input character "2020" does not exist. Figure 2 The target date set shown is one.

[0068] The simulated selection operation can be understood as selecting the target character to be entered in the date input area by simulating clicks or swipes. Selecting the target character can be understood as highlighting it. (See also...) Figure 2 , Figure 2 This shows the case where the characters "2022, 4, 18" are selected.

[0069] S140, when it is determined that all characters to be entered are selected in the date input area, perform the operation of entering the characters selected in the date input area.

[0070] In this embodiment of the disclosure, when all characters to be entered are selected in the date input area, such as 2020, 11, 21, it is equivalent to adjusting to the correct date scroll box. At this point, the selected characters can be further entered. For example, in Figure 2 In the example, the user simulates clicking the "OK" control in the date input area to complete the input of the date November 21, 2020.

[0071] Using the above method, the first optical character recognition result corresponding to the image of the date input area is obtained. The characters in the first optical character recognition result are grouped to obtain multiple sets of dates composed of numeric characters. According to the distribution of the target input character in the target date set, a corresponding simulated selection operation is performed to select the target input character in the date input area. When it is determined that all input characters are selected in the date input area, the operation of inputting the selected character in the date input area is performed, thereby completing the date input. By analyzing and processing the results obtained from general optical character recognition, it is possible to select the input character in the date input area, thereby realizing the function of inputting the date in the scrolling date box. This eliminates the need to fix the position and operation method of the year, month, and day in each control of the calendar box and generate a dedicated object. Therefore, it improves the efficiency and versatility of date input.

[0072] In some embodiments, step S120 above, which groups the characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, may include the following steps:

[0073] The target regular expression is used to match the first optical character recognition result to obtain each numeric character corresponding to each date unit;

[0074] Each numeric character corresponding to the same date unit is identified as a set of dates.

[0075] Regular expressions, also known as regex, regexp, or RE, are text patterns that include ordinary characters (such as letters from a to z) and special characters (called "metacharacters"), and are a concept in computer science. Regular expressions use a single string to describe and match a series of strings that match a certain syntax rule. They are commonly used to search for and replace text that conforms to a specific pattern (rule).

[0076] The target regular expression can include regular expressions that match the date units "year", "month", and "day" respectively, thereby obtaining the corresponding numeric characters for the date units.

[0077] In this embodiment of the disclosure, the first optical character recognition result is matched using a target regular expression to obtain the numeric characters corresponding to each date unit. For example, the numeric characters "2020, 2021, 2022" corresponding to the date unit "year", "2, 3, 4, 5" corresponding to the date unit "month", and "16, 17, 18, 19, 20" corresponding to the date unit "day" can then be determined as a set of dates.

[0078] Based on the foregoing, the distribution of the target input character within the target date set can include two scenarios: the target input character is present in the target date set, and the target input character is not present in the target date set. Therefore, in some implementations, when the target date set includes the target input character, performing a corresponding simulated selection operation based on the distribution of the target input character within the target date set can include the following steps:

[0079] When the target date set includes the target input character, a simulated click is performed on the position of the target input character recorded in the first optical character recognition result.

[0080] In this embodiment of the disclosure, the first optical character recognition result may include the character recognition result and the position recognition result corresponding to the recognized character.

[0081] The inclusion of the target input character in the target date set indicates that the target input character exists in the currently displayed interface. At this time, the position of the target input character can be obtained based on the first optical character recognition result. Thus, the target input character can be selected by directly clicking the position of the target input character in a simulated click manner.

[0082] Furthermore, considering that different date input controls have different specific input rules, not all date input boxes support selecting a character to be entered by clicking. For example, for some date input boxes, assuming clicking... Figure 2 Since the selection of "2021" in the date input method does not support jumping to select "2021", in order to ensure the accuracy of date input, the date input method of this embodiment may further include the following steps:

[0083] Obtain the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target input character;

[0084] When the first position information corresponding to the target input character is different from the corresponding second position information, the target input character is selected in the date input area. The first position information corresponding to the target input character is the position information of the target input character recorded in the first optical character recognition result, and the second position information corresponding to the target input character is the position information of the target input character recorded in the second optical character recognition result.

[0085] Understandably, if the click-to-select function is not supported, then after performing a simulated click on the position of the target character to be input recorded in the first optical character recognition result, the interface will not change, and it will be visually apparent that the first position information and the second position information are the same. However, if the click-to-select function is supported, then after performing a simulated click on the position of the target character to be input recorded in the first optical character recognition result, if the target character to be input was not in a selected state before the simulated click, the interface will change, and it will be visually apparent that the first position information and the second position information are different.

[0086] Therefore, in this embodiment of the present disclosure, the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target character to be input can be obtained, and then the second position can be obtained. If the first position corresponding to the target character to be input is different from the corresponding second position, it can be determined that the jump selection can be achieved by simulating the click, that is, the target character to be input can be selected in the date input area.

[0087] Furthermore, as mentioned above, if the click-to-select function is supported, then after performing a simulated click on the position of the target character to be input recorded in the first optical character recognition result, if the target character to be input was already selected before the simulated click, the interface will not change. In this case, the same steps as those for not supporting click-to-select can be performed to ensure the accuracy of the date input. Therefore, in some embodiments, the method of this disclosure may further include the following steps:

[0088] When the first position information corresponding to the target input character is the same as the corresponding second position information, the first sliding parameter is determined based on the difference between the currently selected character and the target input character. The first sliding parameter includes the first sliding number and the first sliding direction.

[0089] Perform a sliding operation based on the first sliding parameter.

[0090] In this embodiment of the disclosure, when the first position information corresponding to the target input character is the same as the corresponding second position information, the currently selected character can be determined first, and then the difference between the currently selected character and the target input character can be obtained to determine the first sliding parameter, that is, to determine the first sliding number and the first sliding direction. After the first sliding parameter is determined, the sliding operation can be performed based on the first sliding parameter.

[0091] For example, continue to use Figure 2 Let's illustrate with an example. Assume the target date set is the date set one corresponding to the date unit "year". The currently selected character is 2022, and the target input character is 2020. We can obtain the difference between 2022 and 2020, which is 2. Therefore, we can determine the first swipe count is 2, meaning two swipes will move the character from 2022 to 2020. Furthermore, we can obtain the first swipe direction, which is downward. Thus, by swiping downward twice, we can select the target input character 2020.

[0092] For example, continuing to use Figure 2 Here's an example. Assume the target date set is the date set one corresponding to the date unit "year". The currently selected character is 2022, and the target character to be entered is also 2022. We can obtain the difference between 2022 and 2022, which is 0. Therefore, we can determine that the first swipe count is 0, meaning no swipe is needed during the swipe process, thus allowing us to select the target character to be entered in the date input area.

[0093] In some implementations, the sliding direction can be determined based on the size and positional relationships of the individual numeric characters in the date set.

[0094] In some implementations, considering that the computer cannot directly determine the currently selected character and needs to determine the currently selected character through some logical operations, the date input method of this disclosure embodiment may further include the following steps in some implementations:

[0095] Based on the location information corresponding to each numeric character in the target date set, the sub-image region corresponding to each numeric character is determined. The location information is either the location information recorded in the first optical character recognition result or the location information recorded in the second optical character recognition result.

[0096] The currently selected character is determined based on the color distribution of each sub-image region.

[0097] The sub-image region corresponding to the numeric character can be understood as a region of a preset size where the numeric character is located. For example, it can be a rectangular region, a circular region, or the like that, which includes the position information of the numeric character.

[0098] It is understandable that, since the interface has not changed, the position information corresponding to the numeric characters can be the position information recorded in the first optical character recognition result or the position information recorded in the second optical character recognition result.

[0099] In this embodiment of the disclosure, considering that the currently selected character in the date scrolling box has a color difference from other characters, for example, the currently selected character is displayed in highlighted black, the currently selected character can be determined based on the color distribution of each sub-image region after determining the sub-image region corresponding to each numeric character.

[0100] In some implementations, the color distribution can be determined based on the RGB values ​​of each sub-image region.

[0101] In the foregoing embodiments, when the target date set includes the target character to be entered, the function of selecting the target character to be entered is achieved by simulating a click. It is understood that in other embodiments, when the target date set includes the target character to be entered, the target character to be entered can also be selected by sliding. In this case, the sliding parameters can be determined based on the difference between the currently selected character and the target character to be entered. Similarly, the sliding parameters include the number of slides and the sliding direction. Then, the sliding operation can be performed based on the sliding parameters to select the target character to be entered.

[0102] It should be noted that when selecting the target character to be input by sliding as described above, after the sliding ends, the same steps can be performed to obtain the second optical character recognition result corresponding to the image of the date input area obtained after simulating a click on the position of the target character to be input, and to determine whether the first position information corresponding to the target character to be input is the same as the corresponding second position information.

[0103] Furthermore, as can be seen from the foregoing, in some embodiments, the distribution of the target input character in the target date set may also include cases where the target input character is not present in the target date set. In this case, performing the corresponding simulated selection operation based on the distribution of the target input character in the target date set may include the following steps:

[0104] When the target input character does not exist in the target date set, the second sliding parameter is determined based on the difference between the target numeric character and the target input character in the target date set. The second sliding parameter includes the second sliding number and the second sliding direction.

[0105] The sliding operation is performed based on the second sliding parameter.

[0106] In this embodiment of the disclosure, if the target date set does not include the target input character, it means that the target input character does not exist in the currently displayed interface. Therefore, the target input character cannot be selected by directly clicking the position of the target input character in a simulated click manner. In this case, the target input character can be selected by sliding.

[0107] In order to determine the sliding parameters, in this embodiment of the disclosure, a sliding reference can be determined first, that is, the target numeric character can be determined first. The sliding parameters required to slide the target input character to be displayed on the interface can be determined by the reference.

[0108] Optionally, in this embodiment of the disclosure, any numeric character in the target date set can be determined as the target numeric character.

[0109] Optionally, the target numeric character can be a character located in the middle position in the target date set, determined according to the first optical character recognition result, or the currently selected character in the image of the date input area.

[0110] In this embodiment of the disclosure, considering that in some cases, characters in the target date set that are distributed in the middle position according to the first optical character recognition result are more likely to be selected, for example, Figure 2 The numeric character "18" is located in the middle of the numeric characters "16, 17, 18, 19, 20". Therefore, by using the numeric character "18" as the target numeric character to calculate the second sliding parameter, in some cases, the target input character can be selected after the sliding operation is performed based on the second sliding parameter, thus reducing the number of subsequent simulated click or slide steps.

[0111] In this embodiment, the currently selected character can be determined first, and then the currently selected character can be determined as the target numeric character, thereby accurately determining the second sliding parameter required to slide the target input character to the selected state. It is understood that this method requires the process of determining the currently selected character to be performed in advance.

[0112] It is understood that after performing the sliding operation based on the second sliding parameter, the target character to be input can be displayed on the interface. However, considering that the target character to be input may not necessarily be selected, in order to further improve the accuracy of date input, in some embodiments, after performing the sliding operation based on the second sliding parameter, the date input method of this disclosure embodiment may further include the following steps:

[0113] Obtain the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation is performed;

[0114] The third optical character recognition result is used as the new first optical character recognition result, and the process returns to the step: grouping the numeric characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, until the operation of the character selected in the input date input area is performed.

[0115] In this embodiment of the disclosure, based on the second sliding parameter, after the sliding operation is performed, the displayed interface changes. At this time, the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation can be obtained, that is, the third optical character recognition result corresponding to the image of the date input area in the changed interface.

[0116] Next, the third optical character recognition result is used as the new first optical character recognition result. The process then returns to grouping the numeric characters in the first optical character recognition result, resulting in multiple sets of dates composed of numeric characters, until the operation of selecting the character in the input date area is executed. It can be understood that the target input character exists within the target date set after grouping the numeric characters in the first optical character recognition result. Therefore, the target input character can be accurately selected through subsequent simulated selection operations.

[0117] It should be noted that, in the above process, the above process can be executed in parallel or cyclically for each date set, so as to finally select all the characters to be entered in the date input area and perform the operation of entering the selected characters in the date input area.

[0118] like Figure 3 As shown below, the process of selecting the character to be entered in the date input method of this disclosure will be described in detail with reference to a complete embodiment.

[0119] S301, Obtain the first optical character recognition result corresponding to the image of the date input area.

[0120] S302, group the characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters.

[0121] Assuming the format of the date to be input is year-month-day, the resulting date set includes date set one corresponding to the date unit "year", date set two corresponding to the date unit "month", and date set three corresponding to the date unit "day".

[0122] S303: Select one set of dates from multiple sets of dates as the target date set, and determine whether the target input character exists in the target date set. If yes, proceed to step S304; otherwise, proceed to step S308.

[0123] The target input character is the input character that corresponds to the same date unit as the target date set, and the target date set is different each time.

[0124] S304, Perform a simulated click on the position of the target character to be input recorded in the first optical character recognition result.

[0125] S305, Obtain the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target input character.

[0126] S306, determine whether the first position information corresponding to the target input character is the same as the corresponding second position information. If yes, proceed to step S310; otherwise, proceed to step S307.

[0127] S307, confirm that the target character to be entered is selected in the date input area.

[0128] S308, determine the second sliding parameter based on the difference between the target numeric character in the target date set and the target input character, and perform the sliding operation based on the second sliding parameter.

[0129] The target numeric character can be a character located in the middle position in the target date set, determined according to the first optical character recognition result, or the currently selected character in the image of the date input area.

[0130] S309, obtain the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation, and use the third optical character recognition result as the new first optical character recognition result, and return to step S303.

[0131] S310, based on the position information corresponding to each numeric character in the target date set, determine the sub-image region corresponding to each numeric character, and based on the color distribution of each sub-image region, determine the currently selected character.

[0132] The location information is either the location information recorded in the first optical character recognition result or the location information recorded in the second optical character recognition result.

[0133] S311, based on the difference between the currently selected character and the target character to be input, determine the first sliding parameter, and based on the first sliding parameter, perform the sliding operation, and return to step S307.

[0134] Understandably, after executing S307 above, a character to be entered can be selected, and then S303 will be executed again until all characters to be entered are selected, at which point the operation of entering the selected character in the date input area can be performed.

[0135] It should be noted that a detailed description of the above steps can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.

[0136] Furthermore, it should be understood that, for the sake of simplicity, the above method embodiments are described as a series of actions; however, those skilled in the art should understand that this disclosure is not limited to the order of actions described above. Secondly, those skilled in the art should also understand that the embodiments described above are preferred embodiments, and the steps involved are not necessarily essential to this disclosure.

[0137] Based on the same concept, this disclosure also provides a date input device, which can be part or all of an electronic device by means of software, hardware, or a combination of both. (See also...) Figure 4 The date input device 400 may include:

[0138] The first acquisition module 410 is used to acquire the optical character recognition result corresponding to the image of the area where the keyboard is located;

[0139] Grouping module 420 is used to obtain standard character distribution information corresponding to the keyboard based on the optical character recognition result;

[0140] The simulated selection module 430 is used to correct the optical character recognition result based on the standard character distribution information to obtain the target recognition result of the keyboard.

[0141] The input module 440 is used to perform the operation of inputting the selected characters in the date input area when it is determined that all characters to be input are selected in the date input area.

[0142] Optionally, the grouping module 420 includes:

[0143] The matching submodule is used to match the first optical character recognition result using the target regular expression to obtain each numeric character corresponding to each date unit;

[0144] The Determine Submodule is used to determine a set of dates for each numeric character corresponding to the same date unit.

[0145] Optionally, the simulated selected module 430 includes:

[0146] The simulated click submodule is used to perform a simulated click on the position of the target input character recorded in the first optical character recognition result when the target date set includes the target input character.

[0147] Optionally, the device 400 further includes:

[0148] The second acquisition module is used to acquire the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target character to be input;

[0149] The first determining module is used to determine that the target character to be input is selected in the date input area when the first position information corresponding to the target character to be input is different from the corresponding second position information. The first position information corresponding to the target character to be input is the position information of the target character to be input recorded in the first optical character recognition result, and the second position information corresponding to the target character to be input is the position information of the target character to be input recorded in the second optical character recognition result.

[0150] Optionally, the device 400 further includes:

[0151] The first sliding parameter determination module is used to determine the first sliding parameter based on the difference between the currently selected character and the target character to be input when the first position information corresponding to the target character to be input is the same as the corresponding second position information. The first sliding parameter includes a first sliding number and a first sliding direction.

[0152] The sliding module is used to perform a sliding operation based on the first sliding parameters.

[0153] Optionally, the device 400 further includes:

[0154] The second determining module is used to determine the sub-image region corresponding to each numeric character based on the location information corresponding to each numeric character in the target date set, wherein the location information is the location information recorded in the first optical character recognition result or the location information recorded in the second optical character recognition result;

[0155] The third determination module is used to determine the currently selected character based on the color distribution of each sub-image region.

[0156] Optionally, the simulated selected module 430 includes:

[0157] The second sliding parameter determination submodule is used to determine the second sliding parameter based on the difference between the target numeric character in the target date set and the target input character when the target input character does not exist in the target date set. The second sliding parameter includes a second sliding number and a second sliding direction.

[0158] The sliding submodule performs the sliding operation based on the second sliding parameter.

[0159] Optionally, the target numeric character is a character located in the middle position in the target date set, determined according to the first optical character recognition result, or is the currently selected character in the image of the date input area.

[0160] Optionally, the device 400 further includes:

[0161] The third acquisition module is used to acquire the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation is performed;

[0162] The return module is used to take the third optical character recognition result as the new first optical character recognition result and return to the step: grouping the numeric characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, until the operation of inputting the selected character in the date input area is performed.

[0163] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0164] Based on the same inventive concept, this disclosure also provides an electronic device, comprising:

[0165] A memory on which computer programs are stored;

[0166] A processor for executing the computer program in the memory to implement the steps of any of the above date input methods.

[0167] In one possible manner, the block diagram of the electronic device can be as follows: Figure 5 As shown. (Refer to...) Figure 5 The electronic device 500 may include a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output interface 504, and a communication component 505.

[0168] The processor 501 controls the overall operation of the electronic device 500 to complete all or part of the steps in the date input method described above. The memory 502 stores various types of data to support the operation of the electronic device 500. This data may include, for example, instructions for any application or method operating on the electronic device 500, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 503 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 502 or transmitted via communication component 505. The audio component also includes at least one speaker for outputting audio signals. Input / output interface 504 provides an interface between processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be analog or physical buttons. Communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 505 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0169] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the date input method described above.

[0170] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the date input method described above. For example, the computer-readable storage medium may be the memory 502 including the program instructions described above, which may be executed by the processor 501 of the electronic device 500 to complete the date input method described above.

[0171] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the date input method described above when executed by the programmable device.

[0172] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0173] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0174] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A date input method, characterized in that, include: Obtain the first optical character recognition result corresponding to the image of the date input area; The characters in the first optical character recognition result are grouped to obtain multiple sets of dates composed of numeric characters, and each set of dates corresponds to a date unit. Based on the distribution of the target input character in the target date set, a corresponding simulated selection operation is performed to select the target input character in the date input area. The target input character is the input character corresponding to the same date unit as the target date set. The target date set is any one of multiple date sets. When it is determined that all characters to be entered are selected in the date input area, the operation of entering the characters selected in the date input area is performed; The step of performing a simulated selection operation based on the distribution of the target input character in the target date set includes: When the target date set includes the target character to be input, a simulated click is performed on the position of the target character to be input recorded in the first optical character recognition result; Obtain the second optical character recognition result corresponding to the image of the date input area obtained after performing a simulated click on the position of the target character to be input; When the first position information corresponding to the target input character is different from the corresponding second position information, the target input character is selected in the date input area. When the first position information corresponding to the target input character is the same as the corresponding second position information, the first sliding parameter is determined based on the difference between the currently selected character and the target input character.

2. The method according to claim 1, characterized in that, The process of grouping the characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters includes: The target regular expression is used to match the first optical character recognition result to obtain each numeric character corresponding to each date unit; Each numeric character corresponding to the same date unit is identified as a set of dates.

3. The method according to claim 1, characterized in that, The method further includes: The first position information corresponding to the target character to be input is the position information of the target character to be input recorded in the first optical character recognition result, and the second position information corresponding to the target character to be input is the position information of the target character to be input recorded in the second optical character recognition result.

4. The method according to claim 3, characterized in that, The method further includes: The first sliding parameters include the first number of sliding operations and the first sliding direction; Based on the first sliding parameter, perform the sliding operation.

5. The method according to claim 1, characterized in that, The step of performing a simulated selection operation based on the distribution of the target input character in the target date set includes: When the target input character does not exist in the target date set, a second sliding parameter is determined based on the difference between the target numeric character in the target date set and the target input character. The second sliding parameter includes a second sliding number and a second sliding direction. Based on the second sliding parameter, perform the sliding operation.

6. The method according to claim 5, characterized in that, After performing the sliding operation based on the second sliding parameter, the method further includes: Obtain the third optical character recognition result corresponding to the image of the date input area displayed after the sliding operation is performed; The third optical character recognition result is used as the new first optical character recognition result, and the process returns to the step: grouping the numeric characters in the first optical character recognition result to obtain multiple sets of dates composed of numeric characters, until the operation of inputting the selected character in the date input area is performed.

7. A date input device, characterized in that, Applicable to the method described in any one of claims 1-6.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-6.

9. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Key recognition method and device for soft keyboard and storage medium

    CN110795019A