CN111026283B - IP address input method, device, server and storage medium - Google Patents

IP address input method, device, server and storage medium Download PDF

Info

Publication number
CN111026283B
CN111026283B CN201911243595.2A CN201911243595A CN111026283B CN 111026283 B CN111026283 B CN 111026283B CN 201911243595 A CN201911243595 A CN 201911243595A CN 111026283 B CN111026283 B CN 111026283B
Authority
CN
China
Prior art keywords
input
user
input information
box
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911243595.2A
Other languages
Chinese (zh)
Other versions
CN111026283A (en
Inventor
苏江吟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN201911243595.2A priority Critical patent/CN111026283B/en
Publication of CN111026283A publication Critical patent/CN111026283A/en
Application granted granted Critical
Publication of CN111026283B publication Critical patent/CN111026283B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Input From Keyboards Or The Like (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses an IP address input method, an IP address input device, a server and a storage medium. The method comprises the following steps: displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes; acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys; obtaining formatted input through a normalization function based on the input information; judging whether the formatted input contains dot characters or not; if yes, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking the punctuation marks as intervals; if not, the formatted input is filled into the corresponding sub-input box. The method realizes that the IP address input is completed in a form component based on the reaction+ant-design in a mode of supporting the copying of the IP address and the key input, meets more client requirements, and improves the use experience of users.

Description

IP address input method, device, server and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to an IP address entry method, apparatus, server, and storage medium.
Background
In the prior art, the requirement is realized by a form component based on the reaction+ant-design, and the length of each ip number input section is limited to be within 3 bits and the input of each ip number section is automatically jumped to the next input section when the full 3 bits are input.
Disclosure of Invention
In view of this, the embodiment of the invention provides an IP address entry method, an apparatus, a server and a storage medium, so as to provide more functions to meet the user demands.
In a first aspect, an embodiment of the present invention provides an IP address entry method, including:
displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes;
acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys;
obtaining formatted input through a normalization function based on the input information;
judging whether the formatted input contains dot characters or not;
if yes, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking dot characters as intervals;
if not, filling the formatted input into the corresponding sub-input box.
In a second aspect, an embodiment of the present invention further provides an IP address entry apparatus, including:
the configuration instruction acquisition module is used for acquiring an IP address input instruction input by a management party at the payment platform;
the display module is used for displaying an IP input box for inputting the IP address according to the IP address configuration requirement, and the IP input box comprises a plurality of sub-input boxes;
the input information acquisition module is used for acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys;
the first processing module is used for obtaining formatted input through a normalization function based on the input information;
the judging module is used for judging whether the formatted input contains dot characters or not;
the first input module is used for dividing the formatted input into a plurality of corresponding sub-input boxes by taking the dot characters as intervals if the formatted input is in the first input module;
and the second input module is used for filling the formatted input into the corresponding sub-input box if the formatted input is not.
In a third aspect, an embodiment of the present invention further provides a server, including a memory and a processor, where the memory stores a computer program that can be run by the processor, and when the processor executes the computer program, the processor implements an IP address entry method as described above.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program which when executed by a processor implements an IP address entry method as described above.
According to the technical scheme provided by the embodiment of the invention, the configurable attribute of the payment type is split, and the payment type is configured based on the split payment type attribute, so that the maintainability and expansibility of the payment type are improved, the hard coding of the payment type is reduced, and the payment type is convenient and quick to add.
Drawings
Fig. 1 is a flowchart of an IP address entry method in the first embodiment of the present invention;
fig. 2 is a flowchart of an IP address entry method in the second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an IP address entry device in the third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to a third embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Furthermore, the terms "first," "second," and the like, may be used herein to describe various directions, acts, steps, or elements, etc., but these directions, acts, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. The terms "first," "second," and the like, are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, "plurality", "batch" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Example 1
Fig. 1 is a flowchart of an IP address entry method according to a first embodiment of the present invention, where the present embodiment may be adapted to various systems for providing a payment platform, and may be capable of splitting and configuring corresponding attributes of a payment type.
An example comprises the following steps:
s110, displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes.
Considering that different users have different input requirements, and meanwhile, in combination with the conventional format of the IP address, the IP input box provided in the interface for inputting the IP address by the user in this embodiment includes a plurality of sub-input boxes, and how the sub-input boxes are arranged is not limited herein.
S120, acquiring input information of a user based on the currently selected sub-input box, wherein the input information does not contain dot characters input through keys.
In the prior art, in the method for inputting the IP address implemented by the form component based on react+ant-design, only the information input by the user through the key can be accepted, and in this embodiment, it is considered that the user needs to directly copy and paste the IP address with the correct format to complete the input, so this step actually includes: acquiring a character string in a text pasted by a user as input information; or, the character string input by the user through the keys is obtained as input information.
The two input information are processed differently in the form component based on the action+ant-design, so that the two input information need to be distinguished, the correct format IP address is analyzed to be in the place of the punctuation characters, the punctuation characters in the input information obtained by obtaining the character string in the text pasted by the user are needed, and the key event triggered when the user inputs the punctuation characters through the keys can be identified in the process of obtaining the input information by obtaining the character string input by the user, so that the punctuation characters input through the keys are identified and not used as the input information in the process of obtaining the input information, and the two input information can be identified in the subsequent process to be correspondingly and respectively processed.
The currently selected sub-input box is the position to be filled in when the corresponding character is subsequently filled in.
S130, obtaining formatted input through a normalization function based on the input information.
The input information obtained after step S120 includes the pasted IP address with dot characters or the key-input IP address without dot characters, each sub-input box is set in consideration of the correct format of the IP address, so that the character string filled in the sub-input box should also conform to the corresponding format, while the input information obtained in step S120 may not conform to the corresponding format, and the normalization function normal may be used to normalize the input array to make its norm or numerical range within a certain range, so that the input information is processed by the normalization function to obtain the formatted input conforming to the correct format of the IP input box in this embodiment, specifically, the pasted IP address fails to be pasted when not conforming to the corresponding format requirement, so that the key-input information is mainly aimed at in step S130, and the character string correspondingly filled in each sub-input box is ensured to be the numerical character within three bits.
S140, judging whether the formatted input contains dot characters or not.
In step S120, it has been described that dot characters are only included in the input information input by pasting, and thus the formatted input obtained in step S130 is also classified into two types, including dot characters, which are input by pasting when describing the user, and non-including dot characters, which are input by pressing keys when describing the user.
And S150, if so, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking dot characters as intervals.
When the input information corresponding to the formatted input is judged to be pasted, the IP address with the correct format needs to be accurately filled into the IP input frame, and an accurate IP address is a plurality of digital character strings separated by the punctuation marks, and the corresponding digital character strings should be input into each sub-input frame, so that the pasted IP address needs to be separated according to the position of the midpoint character in the formatted input to obtain a plurality of character strings, the first character string obtained after separation is filled into the currently selected sub-input frame, and the subsequent character strings are sequentially filled into the following sub-input frames.
And S160, if not, filling the formatted input into a corresponding sub-input box.
When the input information corresponding to the formatted input is judged to be obtained by key input, the formatted input is a character string meeting the format requirement, and the character string is filled into the currently selected sub-input box, so that the IP address input of the current sub-input box can be completed.
According to the technical scheme of the first embodiment, the IP address input is completed in a form component based on the reaction+ant-design in a mode of supporting the copying of the IP address and the key input, so that more client requirements are met, and the use experience of a user is improved.
Example two
Fig. 2 is a flowchart of an IP address entry method provided in the second embodiment of the present invention, where part of content is further supplemented on the basis of the first embodiment to provide more functions to meet the use requirement of a user, and specifically includes:
s210, displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes.
In step S120 of the first embodiment, input information of the user is obtained based on the currently selected sub-input box, where the input information does not include dot characters input through keys, and further explained: wherein, the obtaining the input information of the user includes: acquiring a character string in a text pasted by a user as input information; or, a character string input by the user through the key is acquired as input information.
More specifically, the obtaining, as input information, a character string in a text pasted by a user includes:
s221, acquiring a user paste text through an e.clipboard data.getdata instruction.
S222, judging whether the character string in the user paste text is an effective IP address or not through a regular expression.
And S223, if so, taking the character string in the user paste text as input information.
S224, if not, prompting a paste error and using an e.preventDefault instruction to prevent a paste operation.
The method for inputting the IP address provided by the embodiment is a form component based on the reaction+ant-design, when a user performs pasting operation, an onPaste event is triggered, and the user passes through an e.clipboard data.getData ("Text"); acquiring a pasted text, judging whether the text is an effective IP address according to a rule, and emptying the original e.target.value if the text is effective, wherein a new value can be automatically filled into a form field to be used as input information; if invalid, the toast popup prompts a paste error format and uses e.preventdefaults () to block the paste operation, i.e., no new input information is generated.
The obtaining the character string input by the user through the keys as the input information comprises the following steps:
s225, in the onKey Down event, judging whether a key triggered by a user is a tab key through an e.key instruction, if so, finding a new sub-input box to be used as a selected sub-input box through adjusting an IP line number and an input box index number.
In this embodiment, the callback uses e.key= = 'Tab' to determine whether the Tab key is pressed, in this embodiment, the sub-input box is located by the IP line number and the input box index number, when the Tab key is pressed, the dot node of the next input is calculated by the line index of the IP input number segment and the index subindex of the IP input number segment, the input corresponds to the sub-input box, and when the dot node of the next input is calculated, the operation selected under the condition of acquiring the focus and having the value is executed, and the default event e.preventdefault () is prevented.
S226, in the onKey Press event, judging whether a key triggered by a user is a key corresponding to a character by an e.char code= = 46 instruction, if so, finding a new sub-input box to be used as a selected sub-input box by adjusting an IP line number and an input box index number.
In the callback, the e.char code= =46 judges that the character is except for the period of the punctuation character, the index of the line where the IP input number section is located and the index subindex of the IP input number section are used for calculating ref to obtain the dom node, if the value of ref is key=index 4+subindex+1, the character except for the period of the Chinese character is input if the key is not null, at the moment, the default event e.preventDefault (), the current node is focused and the judgment of the value is selected, so that the punctuation character is not filled in the form domain, and the filling of the index into the form domain indicates that the character is used as input information.
S227, acquiring other characters except for the punctuation characters, which are input by the user in the onKeyDown event and the onKeyPress event, and acquiring a character string input by the user through keys as input information.
The processing cases when the diacritic key and the tab key are triggered have been given in steps S226 and S227, and other characters input through the keys in the key input manner except for the two cases are filled into the form field as input information.
S230, filtering the input information through a regular expression, so that all other characters except the integer characters and the punctuation characters are replaced by null.
In the input information obtained in steps S221-S227, there may be characters that do not conform to the IP address format, so that the characters need to be filtered, and the characters are filtered in a regular preliminary manner by using a getvalue from event callback corresponding to the ant, where the filtering manner is optional to preserve the integer, the punctuation characters and the chinese periods corresponding to the punctuation keys.
In this embodiment, step S130 in the first embodiment, the step S241-S247 is further explained for obtaining the formatted input through the normalization function based on the input information:
s241, judging whether the input information contains dot characters or not.
For determining whether the input information is input by a user paste or by a key.
S242, if yes, taking the character string in the input information as formatting input.
As can be seen from steps S221-S227, when the input information includes dot characters, the input information is specified to be pasted by the user, so that the input information is an IP address with correct format, which has satisfied the format requirement, and is directly used as the formatted input.
S243, if not, judging whether the character string in the input information is greater than or equal to three bits.
As can be seen from steps S221-S227, when the input information includes dot characters, it is explained that the input information is input by the user by pressing a key, and therefore, it is necessary to adjust the character string in the input information to a character string satisfying the format requirement, that is, a numeric character within three digits, and therefore, the character string in the input information is greater than or equal to three digits.
S244, if yes, taking the valid first three bits in the character string in the input information as formatting input.
Step S244 is configured to take, when the character string in the input information is greater than or equal to three digits, valid three digits in the character string in the input information as formatting input for entry, and specifically, the step of taking the first valid three digits in the character string in the input information as formatting input includes: taking the effective first three bits in the character string in the input information as the formatting input of the currently selected sub-input box; and finding a new sub-input box as a selected sub-input box by adjusting the IP line number and the input box index number. This is because one sub-input box can only accept filling in three-bit characters, and when the input number characters exceed three bits, the first three bits need to be filled in the current sub-input box and then the next sub-input box is selected to continue the IP address input.
Specific: for the case of transition to bit 3 on the basis of original 2 bits, jumping to the next input node and returning to the current value; for the case of inputting bit 4 again on the basis of 3 bits originally, jump to the next input node and return to the original prevue, i.e. 3-bit value.
S245, if not, judging whether the input information comprises period characters or not.
When the input information contains period characters (i.e., chinese forms of punctuation characters), the effect to be achieved is also to jump to the next sub-input box.
S246, if yes, the character string before the period character in the input information is used as formatting input, a new sub-input box is found out to be used as a selected sub-input box through adjusting the IP line number and the input box index number, and the original character string in the selected sub-input box is reserved.
Specifically, the current value= = ='. ' returning to the original preValue, which is the case when a period is entered and filled in to input, is emptied.
And S247, if not, taking the character string in the input information as formatting input.
If there is no period character in the input information, only standard number characters are used, and less than three digits are used as formatting input to fill the input box.
S250, judging whether dot characters are contained in the formatted input.
The step is used for identifying whether the formatted input obtained in the steps S241-S247 corresponds to a paste input or a key input, so that the corresponding processing realizes filling the formatted input into a corresponding sub-input box to complete IP address input.
And S260, if so, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking dot characters as intervals.
The IP address with correct format obtained by pasting is a character string containing dot characters, the character string can be divided into four digital character strings at intervals, the four digital character strings are respectively filled into four sub-input boxes, and the four sub-input boxes are four sub-input boxes which are calculated from the selected sub-input boxes and included in the selected sub-input boxes.
S270, if not, filling the formatted input into the corresponding sub-input box.
The non-pasted formatted input is directly modified to the corresponding sub-input box.
The IP address entry method provided in this embodiment further provides more functions on the basis of the first embodiment, implements switching of IP line numbers in onKeyDown event, implements backward selection of sub-input boxes in onKeyPress event, and retains valid digital characters in input information of key input, and integrally implements: inputting full three-digit numerical value and automatically jumping to the next sub-input box; entering punctuation characters and period characters and jumping to the next input box; pressing tab key to automatically switch to the next row of IP input frame; the IP address in the correct format can be entered by copying. The use requirement of the user is met through more functions, and the use experience of the user is improved.
Example III
Fig. 3 is an IP address entry apparatus 300 provided in a fifth embodiment of the present invention, which specifically includes the following modules:
the display module 310 is configured to display an IP input box for inputting an IP address according to an IP address configuration requirement, where the IP input box includes a plurality of sub-input boxes.
The input information obtaining module 320 is configured to obtain input information of the user based on the currently selected sub-input box, where the input information does not include dot characters input through keys.
Specifically, the input information module 320 includes:
a paste input unit for acquiring a character string in a text pasted by a user as input information;
and a key input unit for acquiring a character string input by a user through a key as input information.
Specifically, the paste input unit includes:
a pasting subunit, configured to obtain a user pasting text through an e.clipboard data.getdata instruction;
the effective judging subunit judges whether the character string in the user paste text is an effective IP address or not through a regular expression;
the first input subunit is used for taking the character strings in the user paste text as input information if the user paste text is the input information;
and the prompting subunit is used for prompting that the pasting is wrong and preventing the pasting operation by using an e.preventdefault instruction if the pasting is not wrong.
The key input unit includes:
and the tab key triggering subunit is used for judging whether the key triggered by the user is a tab key or not through an e.key instruction in the onKeyDown event, and if so, finding a new sub-input box to be used as a selected sub-input box through adjusting the IP line number and the input box index number.
And the click character key triggering subunit is used for judging whether the key triggered by the user is a key corresponding to the click character through an e.char code= =46 instruction in the onkey Press event, and if so, finding a new sub-input frame to be used as a selected sub-input frame through adjusting the IP line number and the input frame index number.
The second input subunit is used for acquiring other characters except the punctuation characters, which are input by the user in the onKeyDown event and the onKeyPress event, and obtaining a character string which is input by the user through keys as input information.
A first processing module 330 is configured to obtain a formatted input through a normalization function based on the input information.
Specifically, the first processing module 330 includes:
and the character-of-dot recognition subunit is used for judging whether the input information contains character-of-dot.
And the first formatting input subunit is used for taking the character string in the input information as formatting input if the character string is used for formatting input.
And the digit judging subunit is used for judging whether the character string in the input information is greater than or equal to three digits if not.
And the second formatting input subunit is used for taking the valid first three bits in the character string in the input information as formatting input if the character string is valid. The method specifically comprises the following steps: taking the effective first three bits in the character string in the input information as the formatting input of the currently selected sub-input box; and finding a new sub-input box as a selected sub-input box by adjusting the IP line number and the input box index number.
And the period character recognition subunit is used for judging whether the input information comprises period characters or not if not.
And the third formatting input subunit is configured to take a character string before a period character in the input information as formatting input, find a new sub-input box as a selected sub-input box by adjusting an IP line number and an input box index number, and reserve an original character string in the selected sub-input box.
And the fourth formatting input subunit is used for taking the character string in the input information as formatting input if the character string is not the formatting input.
A judging module 340, configured to judge whether the formatted input includes dot characters.
The first input module 350 is configured to, if yes, fill the formatted input partitions into a plurality of corresponding sub-input boxes at intervals of dot characters.
And a second input module 360, configured to fill the formatted input into the corresponding sub-input box if not.
In some embodiments, the IP address entry apparatus 300 further comprises: and the filtering module is used for filtering the input information of the user through a regular expression after the input information of the user is acquired, so that other characters except the integer characters and the punctuation characters are replaced by null.
According to the IP address input device provided by the embodiment, the switching of the IP line number is realized in the onKey Down event, the backward selection of the sub-input box is realized in the onKey Press event, and the effective digital characters in the input information input by the keys are reserved, so that the whole realization is realized: inputting full three-digit numerical value and automatically jumping to the next sub-input box; entering punctuation characters and period characters and jumping to the next input box; pressing tab key to automatically switch to the next row of IP input frame; the IP address in the correct format can be entered by copying. The use requirement of the user is met through more functions, and the use experience of the user is improved.
Example IV
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention, and as shown in fig. 4, the server includes a processor 40, a memory 41, an input device 42 and an output device 43; the number of processors 40 in the server may be one or more, one processor 40 being shown as an example; the processor 40, memory 41, input means 42 and output means 43 in the device/terminal/server may be connected by a bus or other means, in fig. 4 by way of example.
The memory 41 is used as a computer readable storage medium, and may be used to store software programs, computer executable programs, and modules, such as program instructions/modules (e.g., the display module 310, the input information acquisition module 320, the first processing module 330, the judgment module 340, the first entry module 350, the second entry module 440, etc. in the IP address entry device) corresponding to the theme update method in the embodiment of the present invention. The processor 40 executes various functional applications of the device/terminal/server and data processing, i.e., implements the above-described IP address entry method, by running software programs, instructions, and modules stored in the memory 41.
The memory 41 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 41 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 41 may further include memory located remotely from processor 40, which may be connected to the device/terminal/server via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 42 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings of the device/terminal/server and function control. The output means 43 may comprise a display device such as a display screen.
The server can execute the IP address input method provided by any embodiment of the invention, and has the functional energy module and the beneficial effects corresponding to the execution method.
Example five
The fifth embodiment of the present invention further provides a computer readable storage medium having a computer program stored thereon, where the program when executed by a processor implements an IP address entry method as provided in any embodiment of the present invention, the method may include:
displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes;
acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys;
obtaining formatted input through a normalization function based on the input information;
judging whether the formatted input contains dot characters or not;
if yes, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking dot characters as intervals;
if not, filling the formatted input into the corresponding sub-input box.
The computer-readable storage media of embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
According to the embodiment, the IP address input is completed in a form component based on the reaction+ant-design in a mode of supporting the copying of the IP address and the key input, so that more client requirements are met, and the use experience of a user is improved.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. An IP address entry method, comprising:
displaying an IP input box for inputting an IP address, wherein the IP input box comprises a plurality of sub-input boxes;
acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys;
obtaining formatted input through a normalization function based on the input information;
judging whether the formatted input contains dot characters or not;
if yes, filling the formatted input separation into a plurality of corresponding sub-input boxes respectively by taking dot characters as intervals;
if not, filling the formatted input into a corresponding sub-input box;
the obtaining the input information of the user comprises the following steps:
acquiring a character string in a text pasted by a user as input information;
or, acquiring a character string input by a user through keys as input information;
the obtaining the character string input by the user through the keys as the input information comprises the following steps:
in the onKey Down event, judging whether a key triggered by a user is a tab key through an e.key instruction, if so, finding a new sub-input box as a selected sub-input box through adjusting an IP line number and an input box index number;
in the onKey Press event, judging whether a key triggered by a user is a key corresponding to a punctuation mark or not through an e.char code= 46 instruction, if so, finding a new sub-input frame to be used as a selected sub-input frame through adjusting an IP line number and an input frame index number;
and acquiring other characters except the punctuation characters, which are input by the user in the onKeyDown event and the onKeyPress event, and acquiring a character string input by the user through keys as input information.
2. The method of claim 1, further comprising, after the obtaining the input information of the user:
filtering the input information through a regular expression so that other characters except the integer characters and the punctuation characters are replaced by null.
3. The method according to claim 1, wherein the acquiring the character string in the text pasted by the user as the input information includes:
acquiring a user paste text through an e.clipboard data.getdata instruction;
judging whether the character string in the user paste text is an effective IP address or not through a regular expression;
if yes, taking the character string in the user paste text as input information;
if not, a paste error is prompted and the paste operation is blocked using the e.preventdefaults instruction.
4. The method of claim 1, wherein the obtaining a formatted input by a normalization function based on the input information comprises:
judging whether the input information contains dot characters or not;
if yes, taking the character string in the input information as formatting input;
if not, judging whether the character string in the input information is greater than or equal to three bits;
if yes, taking the effective first three bits in the character string in the input information as formatting input;
if not, judging whether the input information comprises period characters or not;
if yes, the character string in front of the period character in the input information is used as formatting input, a new sub-input box is found out as a selected sub-input box through adjusting the IP line number and the input box index number, and the original character string in the selected sub-input box is reserved;
if not, the character string in the input information is used as formatting input.
5. The method of claim 4, wherein the formatting input with valid first three bits of the string of characters in the input information comprises:
taking the effective first three bits in the character string in the input information as the formatting input of the currently selected sub-input box;
and finding a new sub-input box as a selected sub-input box by adjusting the IP line number and the input box index number.
6. An IP address entry apparatus, comprising:
the display module is used for displaying an IP input box for inputting the IP address according to the IP address configuration requirement, and the IP input box comprises a plurality of sub-input boxes;
the input information acquisition module is used for acquiring input information of a user based on a currently selected sub-input box, wherein the input information does not contain dot characters input through keys;
the first processing module is used for obtaining formatted input through a normalization function based on the input information;
the judging module is used for judging whether the formatted input contains dot characters or not;
the first input module is used for dividing the formatted input into a plurality of corresponding sub-input boxes by taking the dot characters as intervals if the formatted input is in the first input module;
the second input module is used for filling the formatted input into the corresponding sub-input box if the formatted input is not the formatted input;
the input information acquisition module includes:
a paste input unit for acquiring a character string in a text pasted by a user as input information;
the key input unit is used for acquiring a character string input by a user through keys as input information;
the key input unit includes:
the tab key triggering subunit is configured to determine, in an onKeyDown event, whether a key triggered by a user is a tab key according to an e.key instruction, and if yes, find a new sub-input box as a selected sub-input box by adjusting an IP line number and an input box index number;
the character-clicking key triggering subunit is configured to determine, in an onKeyPress event, whether a key triggered by a user is a key corresponding to a character by an e.char code= =46 instruction, and if yes, find a new sub-input box as a selected sub-input box by adjusting an IP line number and an input box index number;
the second input subunit is used for acquiring other characters except the punctuation characters, which are input by the user in the onKeyDown event and the onKeyPress event, and obtaining a character string which is input by the user through keys as input information.
7. A server comprising a memory and a processor, the memory having stored thereon a computer program executable by the processor, the processor implementing the IP address entry method of any of claims 1-5 when the computer program is executed.
8. A computer-readable storage medium storing a computer program, which when executed by a processor implements the IP address entry method according to any one of claims 1-5.
CN201911243595.2A 2019-12-06 2019-12-06 IP address input method, device, server and storage medium Active CN111026283B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911243595.2A CN111026283B (en) 2019-12-06 2019-12-06 IP address input method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911243595.2A CN111026283B (en) 2019-12-06 2019-12-06 IP address input method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN111026283A CN111026283A (en) 2020-04-17
CN111026283B true CN111026283B (en) 2023-06-06

Family

ID=70204609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911243595.2A Active CN111026283B (en) 2019-12-06 2019-12-06 IP address input method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN111026283B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1652110A (en) * 2004-01-14 2005-08-10 诺基亚公司 Fast rule lookup with arbitrary IP range configurations
CN110399232A (en) * 2019-06-21 2019-11-01 平安普惠企业管理有限公司 Paste processing method, device, equipment and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1652110A (en) * 2004-01-14 2005-08-10 诺基亚公司 Fast rule lookup with arbitrary IP range configurations
CN110399232A (en) * 2019-06-21 2019-11-01 平安普惠企业管理有限公司 Paste processing method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111026283A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
KR101999409B1 (en) Formatting data by example
KR20210042864A (en) Table recognition method, device, equipment, medium and computer program
KR20150013294A (en) Mechanism, System and Method for synchronising devices
CN106354483B (en) Data processing method and device and electronic equipment
KR20170013884A (en) Voice displaying
CN108399072A (en) Five application page update method and device
EP3080722B1 (en) Web page rendering on wireless devices
CN106557452A (en) For the display packing of numeric character or character string, device, equipment and system
CN111026283B (en) IP address input method, device, server and storage medium
CN114125050A (en) Message scheduling method, device, equipment and storage medium
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN103970773A (en) Page updating method and device for web page
CN111611364A (en) Intelligent response method, device, equipment and storage medium
CN110932966A (en) Message processing method and device, computer storage medium and electronic equipment
CN115048177B (en) Dynamic configuration method for completing business scene based on custom container
CN111553130A (en) Chapter title style conversion method and device, electronic equipment and storage medium
CN114924937A (en) Batch task processing method and device, electronic equipment and computer readable medium
CN113377473A (en) Task creation method and device, electronic equipment and computer readable storage medium
CN109857811B (en) Block chain data management method and device
CN110472113B (en) Intelligent interaction engine optimization method, device and equipment
CN111222146B (en) Authority checking method, authority checking device, storage medium and electronic equipment
CN107967269A (en) The method and terminal of a kind of edit page
CN117591487B (en) Financial document sharing method and related device
CN111428456A (en) Method and device for filling form
CN107977389A (en) Method for processing report data based on browser

Legal Events

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