CN109271152A - A kind of method of calibration, device, storage medium and the terminal of input frame content - Google Patents

A kind of method of calibration, device, storage medium and the terminal of input frame content Download PDF

Info

Publication number
CN109271152A
CN109271152A CN201810940566.0A CN201810940566A CN109271152A CN 109271152 A CN109271152 A CN 109271152A CN 201810940566 A CN201810940566 A CN 201810940566A CN 109271152 A CN109271152 A CN 109271152A
Authority
CN
China
Prior art keywords
input frame
input
content
class
verification
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.)
Pending
Application number
CN201810940566.0A
Other languages
Chinese (zh)
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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201810940566.0A priority Critical patent/CN109271152A/en
Publication of CN109271152A publication Critical patent/CN109271152A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses method of calibration, device, storage medium and the terminals of a kind of input frame content, this method comprises: receiving the input content in default input frame;In the tactful pond in backstage, the default corresponding specific strategy class of input frame is called, input content is verified.The present invention is after the input content in the default input frame for receiving current page, only need to call the default corresponding specific strategy class of input frame in the tactful pond in backstage, the specific method that can be realized according to the specific strategy class, input content is verified, separate the input frame of current page with the method for calibration in the tactful pond in backstage, each input frame only needs to call its corresponding specific strategy class, keep check logic simple, it is easy to extend and safeguard, it solves in the presence of multiple input frames, check logic is complicated, it is unfavorable for the problem of extending and safeguarding.

Description

A kind of method of calibration, device, storage medium and the terminal of input frame content
Technical field
The present invention relates to verification field, more particularly to a kind of method of calibration of input frame content, device, storage medium and Terminal.
Background technique
With the rapid development of mobile Internet, mobile terminal increasingly becomes the main platform of human-computer interaction, in service interaction When, the demand for needing to limit text input is often encountered, for example number can only be inputted, cannot be inputted after space, decimal point most More two prices inputs etc., need to be arranged at this time method of calibration and verify to the content of input frame.
In the prior art, usually by the addition of content authentication algorithm in the Proxy Method of input frame control, in current page There are in the case where multiple input frames in face, a large amount of check codes can be write in current class by the above method, cause to verify Logic is complicated, is unfavorable for extending, and needs to clear all logical relations in maintenance, not only increases maintenance cost, but easily occur compared with High error rate.
Summary of the invention
The present invention provides method of calibration, device, storage medium and the terminal of a kind of input frame content, to solve existing skill Art adds content authentication algorithm in the Proxy Method of input frame control, in the presence of multiple input frames, check logic Complexity is unfavorable for the problem of extending and safeguarding.
In order to solve the above technical problems, on the one hand, the present invention provides a kind of method of calibration of input frame content, comprising: connect Receive the input content in default input frame;In the tactful pond in backstage, the corresponding specific strategy class of the default input frame, school are called Test the input content.
Further, before the input content received in default input frame, further includes: creation includes verification interface method Input policing class;The specific strategy class of the verification interface method is realized in creation, and the specific strategy class is saved To in backstage strategy pond;Create the default input frame, wherein the default input frame is the instance objects for encapsulating class; The default input frame and the specific strategy class are packaged.
Further, described to call the corresponding specific strategy class of the default input frame, verify the input content, comprising: The verification interface method is realized according to the specific strategy class;The input content is verified by the verification interface method.
Further, after the verification input content, further includes: the verification knot of input content described in output verification Fruit.
On the other hand, the present invention also provides a kind of calibration equipments of input frame content, comprising: receiving module, for receiving Input content in default input frame;Correction verification module, for calling the corresponding tool of the default input frame in the tactful pond in backstage Body policy class verifies the input content.
Further, further includes: first establishes module, for creating the input policing class comprising verification interface method;Second Module is established, is saved for creating the specific strategy class for realizing the verification interface method, and by the specific strategy class To in backstage strategy pond;Input frame establishes module, for creating the default input frame, wherein the default input frame For the instance objects for encapsulating class;Package module, for the default input frame and the specific strategy class to be packaged.
Further, the correction verification module, is specifically used for: realizing the verification interface method according to the specific strategy class; The input content is verified by the verification interface method.
Further, further includes: output module, the check results for input content described in output verification.
On the other hand, the present invention also provides a kind of storage medium, it is stored with computer program, which is characterized in that computer The step of method of calibration of above-mentioned input frame content is realized when program is executed by processor.
On the other hand, the present invention also provides a kind of terminals, include at least memory, processor, are stored with meter on memory Calculation machine program, processor realize the step of the method for calibration of above-mentioned input frame content when executing the computer program on memory Suddenly.
The present invention is receiving after the input content in the default input frame of current page, it is only necessary to the strategy on backstage The default corresponding specific strategy class of input frame, the specific method that can be realized according to the specific strategy class, to defeated are called in pond Enter content to be verified, separates the input frame in current page with the method for calibration that backstage saves, each input frame only needs Its corresponding specific strategy class is called, keeps check logic simple, is easy to extend and safeguard, solves and deposited in multiple input frames In case, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
Detailed description of the invention
Fig. 1 is the flow chart of the method for calibration of input frame content in first embodiment of the invention;
Fig. 2 is the flow chart of the method for calibration of input frame content in second embodiment of the invention;
Fig. 3 is the flow chart of the method for calibration of input frame content in third embodiment of the invention;
Fig. 4 is the structural schematic diagram of the calibration equipment of input frame content in fourth embodiment of the invention;
Fig. 5 is the structural schematic diagram of the calibration equipment of input frame content in fifth embodiment of the invention;
Fig. 6 is the structural schematic diagram of the calibration equipment of input frame content in sixth embodiment of the invention.
Specific embodiment
In order to solve the prior art by the addition of content authentication algorithm in the Proxy Method of input frame control, multiple input frames In the presence of, check logic is complicated, is unfavorable for the problem of extending and safeguarding, the present invention provides a kind of input frame contents Method of calibration, device, storage medium and terminal carry out further specifically the present invention below in conjunction with attached drawing and embodiment It is bright.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, the present invention is not limited.
The first embodiment of the present invention provides a kind of method of calibration of input frame content, and flow chart is as shown in Figure 1, main To include step S101 and S102:
S101 receives the input content in default input frame.
S102 calls the default corresponding specific strategy class ConcreteStrategy of input frame, school in the tactful pond in backstage Test input content.
User, in order to carry out information exchange, is needed in the defeated of corresponding page when using such as mobile phone, tablet computer terminal Enter and input various information in frame, to complete information exchange.In order to promote accuracy, readability or uniformity to interactive information, The information content inputted in input frame is usually required by content authentication, when meeting its corresponding verification rule, in input frame The information content of input can just carry out information exchange or display in next step by verification, if user is when inputting the age, only Positive integer can be inputted;When inputting mailbox message, certain specific characters etc. cannot be inputted.If existing in the same page Multiple input frames need user to fill in, then corresponding check logic all concentrates in the Proxy Method of input frame control, make school Logic complexity is tested, later maintenance and extension are unfavorable for.
To solve the above-mentioned problems, the present embodiment is obtained in current page first and is preset in input to be verified in input frame Hold, then pass through the default corresponding specific strategy class ConcreteStrategy of input frame being invoked in the tactful pond in backstage, Carry out the verification of input content.Specifically, the input content in input frame is preset, can be moved for user hand in default input frame The content of input, or the content that other programs or algorithm generate after being finished is input in default input frame.Specifically Policy class is under strategy pattern, includes the role of specific algorithm or behavior, is provided when realizing by abstract tactful role Interface algorithm realizes the algorithm in specific strategy class, in the present embodiment, verification input frame content is included in specific strategy class Checking algorithm, and according to the difference of verification content, the content of checking algorithm is different, at this point, specific strategy class can be correspondingly arranged Title such as number input validation class NumberInputStrategy or alphabetical input validation class LetterInputStrategy. The tactful pond in backstage, actually independently of other pages of the current page where default input frame or position, specific strategy class It is stored in the tactful pond in backstage, is not programmed in directly in the page where default input frame, calls directly strategy when calling Specific strategy class corresponding with input frame in pond, while also facilitating newly-increased specific strategy class, it prevents due to input frame The problem of excessively writing excessive checking algorithm in current page, being unfavorable for later maintenance.
Due to having in the tactful pond in backstage and only one specific strategy class be corresponding for an input frame, For realizing the verification to the particular content inputted in input frame.For example, if there is an input frame A, the content for corresponding to input is The phone number of active user, and limit it and can only input 11 numbers, at this point, specific strategy class ConcreteStrategy It can be specifically set as numeral input verification class NumberInputStrategy, position is carried out to the content inputted in input frame Several and character types verifications.After user inputs a string of characters in input frame A, the character string of user's input is received, and is passed through NumberInputStrategy verify the character string whether the number for being 11.
If, all can be defeated by this after user inputs in an input frame there are multiple input frames in current page Enter the corresponding specific strategy class of frame specifically to carry out the verification of the input frame input content, the verification between multiple input frames will not It interacts, reduces the complexity of check logic, and in later maintenance, can quickly be looked for according to the input frame to go wrong It modifies and can adjust to corresponding specific strategy class, and in newly addition input frame, it is only necessary to create corresponding tool Body policy class.
The present embodiment is receiving after the input content in the default input frame of current page, it is only necessary to call backstage plan The slightly default corresponding specific strategy class of input frame of this in pond, the specific method that can be realized according to the specific strategy class, to input Content is verified, and separates the input frame of current page with the method for calibration in the tactful pond in backstage, each input frame only needs Its corresponding specific strategy class is called, keeps check logic simple, is easy to extend and safeguard, solves and deposited in multiple input frames In case, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
The second embodiment of the present invention provides a kind of method of calibration of input frame content, and flow chart is as shown in Fig. 2, main To include step S201 to S207:
S201, creation include the input policing class InputStrategy of verification interface method inputTextField ().
Before the verification for carrying out input frame input content, first have to construct one kind can be carried out according to input frame difference it is specific The strategy pattern of policy class free switching, it is necessary first to create one and the input policing class of interface check method is externally provided InputStrategy adds external verification interface as the abstract tactful role of strategy pattern in InputStrategy Method inputTextField (), this method provides specific strategy classes to realize necessary method and attribute, and tactful mould The external interface of formula.
The ConcreteStrategy class of inputTextField () is realized in S202, creation, and will ConcreteStrategy class is saved into the tactful pond in backstage.
Specific strategy class ConcreteStrategy is the class specifically verified in strategy pattern, and realizes verification interface Method inputTextField (), main function are the algorithm for realizing content authentication, and when calling, according to input frame The corresponding specific checking algorithm of specific strategy class, makes external verification interface method execute different check logics, reaches pair The purpose that the input frame content is verified is saved after the creation of ConcreteStrategy class into the tactful pond in backstage, and default The page where input frame is independent mutually, is carried out by the page where the verification interface method of strategy pattern and default input frame Communication.
It will be appreciated that specific strategy class ConcreteStrategy can have multiple simultaneously, that is, correspond to multiple defeated Enter frame, and the content that can specifically verify according to it, it is named respectively, whether legal such as verifies letter input LetterInputStrategy, check digit input whether legal NumberInputStrategy class etc., above two tool Body policy class realizes inputTextField (), when calling LetterInputStrategy class, InputTextField () execute verification letter input whether legal logic, when calling NumberInputStrategy, InputTextField () execute check digit input whether legal logic.
S203 creates default input frame.
Default input frame and ConcreteStrategy class are packaged by S204.
Default input frame is actually the instance objects for encapsulating class CustomTextField, and each input frame corresponds to one Instance objects under a CustomTextField class.Purpose must be set according to each input frame, by the input frame and realize its school The specific strategy class of proved recipe method carries out unified encapsulation, is actually the process for being associated the two, after encapsulation input frame or Other programs can not get the check logic in ConcreteStrategy, can only be real by external verification interface method Check logic in existing ConcreteStrategy, to complete the verification of input content.
When being extended, the corresponding specific strategy class ConcreteStrategy of added new input frame only needs Realize verification interface method inputTextField (), and be packaged can have in input in newly added input frame Rong Shi verifies it using newly added specific strategy class ConcreteStrategy.
S205 receives the input content in default input frame.
S206 realizes inputTextField () according to ConcreteStrategy class.
S207 verifies input content by inputTextField ().
After obtaining input content to be verified in default input frame, according to the corresponding specific strategy class of the input frame ConcreteStrategy realizes external verification interface method inputTextField (), then passes through InputTextField () verifies the input content in input frame, and the above process is actually to be held by inputTextField () The built-in check logic of row ConcreteStrategy completes the school of input content to realize the corresponding method of calibration of input frame It tests.
After the present embodiment presets the input content in input frame in receiving current page, it is only necessary to call backstage strategy This in pond presets the corresponding specific strategy class of input frame, can be realized external according to the specific checking algorithm of the specific strategy class Verification interface method, carry out the verification of input frame content, separate input frame and method of calibration, each input frame only needs to adjust With its corresponding specific strategy class, keep check logic simple, is easy to extend and safeguard, solves and exist in multiple input frames In the case where, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
The third embodiment of the present invention provides a kind of method of calibration of input frame content, and flow chart is as shown in figure 3, main To include step S301 to S303:
S301 receives the input content in default input frame.
S302 calls the default corresponding specific strategy class ConcreteStrategy of input frame, school in the tactful pond in backstage Test input content.
The present embodiment obtains input content to be verified in default input frame first, then by calling the default input frame Corresponding specific strategy class ConcreteStrategy, carries out the verification of input content.Specifically, the input in input frame is preset Content can move the content inputted in default input frame for user hand, or after other programs or algorithm are finished The content of generation is input in default input frame.
Due to having in the tactful pond in backstage and only one specific strategy class be corresponding for an input frame, For realizing the verification to the particular content inputted in input frame.For example, if there is an input frame A, the content for corresponding to input is The phone number of active user, and limit it and can only input 11 numbers, at this point, specific strategy class ConcreteStrategy It can be specifically set as numeral input verification class NumberInputStrategy, position is carried out to the content inputted in input frame Several and character types verifications.After user inputs a string of characters in input frame A, the character string of user's input is received, and is passed through NumberInputStrategy verify the character string whether the number for being 11.
If, all can be defeated by this after user inputs in an input frame there are multiple input frames in current page Enter the corresponding specific strategy class of frame specifically to carry out the verification of the input frame input content, the verification between multiple input frames will not It interacts, reduces the complexity of check logic, and in later maintenance, can quickly be looked for according to the input frame to go wrong It modifies and can adjust to corresponding specific strategy class, and in newly addition input frame, it is only necessary to create corresponding tool Body policy class.
S303, the check results of output verification input content.
After specific strategy class ConcreteStrategy is verified, the verification of input content in the output verification input frame As a result, the check results export after executing for user to entered by himself interior perhaps other programs to the content in input frame Positive determination is judged that display mode can show for pop-up, or indicates different schools by the background color of setting input frame Test as a result, as background color for green, then prove verification pass through, if red, then prove verification do not pass through, need user to repair Change.
After the present embodiment presets the input content in input frame in receiving current page, it is only necessary to call backstage strategy This in pond presets the corresponding specific strategy class of input frame, the specific method that can be realized according to the specific strategy class, in input Appearance is verified, and output verification is as a result, separate input frame and method of calibration, each input frame only needs to call its corresponding Specific strategy class keeps check logic simple, is easy to extend and safeguard, conveniently checks check results, solve multiple defeated In the presence of entering frame, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
The fourth embodiment of the present invention provides a kind of calibration equipment of input frame content, is mainly installed on computer, hand The terminals such as machine, structural schematic diagram is as shown in figure 4, specifically include that receiving module 10, for receiving the input in default input frame Content;Correction verification module 20 is coupled with receiving module 10, for calling default input frame corresponding specific in the tactful pond in backstage Policy class ConcreteStrategy verifies input content.
User, in order to carry out information exchange, is needed in the defeated of corresponding page when using such as mobile phone, tablet computer terminal Enter and input various information in frame, to complete information exchange.In order to promote accuracy, readability or uniformity to interactive information, The information content inputted in input frame is usually required by content authentication, when meeting its corresponding verification rule, in input frame The information content of input can just carry out information exchange or display in next step by verification, if user is when inputting the age, only Positive integer can be inputted;When inputting mailbox message, certain specific characters etc. cannot be inputted.If existing in the same page Multiple input frames need user to fill in, then corresponding check logic all concentrates in the Proxy Method of input frame control, make school Logic complexity is tested, later maintenance and extension are unfavorable for.
To solve the above-mentioned problems, the present embodiment passes through receiving module 10 first and obtains in current page in default input frame It is corresponding specific then to pass through the default input frame that correction verification module 20 is invoked in the tactful pond in backstage to input content to be verified Policy class ConcreteStrategy carries out the verification of input content.Specifically, the input content in input frame is preset, it can be with The content inputted in default input frame manually for user, or the content that other programs or algorithm generate after being finished It is input in default input frame.The tactful pond in backstage, actually independently of other pages of the current page where default input frame Face or position, specific strategy class are stored in the tactful pond in backstage, are not programmed in directly in the page where default input frame, Specific strategy class corresponding with input frame in tactful pond is called directly when calling, while also facilitating newly-increased specific strategy class, Prevent the problem of excessively writing excessive checking algorithm in current page due to input frame, be unfavorable for later maintenance.
Due to having in the tactful pond in backstage and only one specific strategy class be corresponding for an input frame, For realizing the verification to the particular content inputted in input frame.For example, if there is an input frame A, the content for corresponding to input is The phone number of active user, and limit it and can only input 11 numbers, at this point, specific strategy class ConcreteStrategy It can be specifically set as numeral input verification class NumberInputStrategy, position is carried out to the content inputted in input frame Several and character types verifications.After user inputs a string of characters in input frame A, the character string of user's input is received, and is passed through NumberInputStrategy verify the character string whether the number for being 11.
If, all can be defeated by this after user inputs in an input frame there are multiple input frames in current page Enter the corresponding specific strategy class of frame specifically to carry out the verification of the input frame input content, the verification between multiple input frames will not It interacts, reduces the complexity of check logic, and in later maintenance, can quickly be looked for according to the input frame to go wrong It modifies and can adjust to corresponding specific strategy class, and in newly addition input frame, it is only necessary to create corresponding tool Body policy class.
The present embodiment is receiving after the input content in the default input frame of current page, it is only necessary to call backstage plan The slightly default corresponding specific strategy class of input frame of this in pond, the specific method that can be realized according to the specific strategy class, to input Content is verified, and separates the input frame of current page with method of calibration in the tactful pond in backstage, each input frame only needs to adjust With its corresponding specific strategy class, keep check logic simple, is easy to extend and safeguard, solves and exist in multiple input frames In the case where, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
The fifth embodiment of the present invention provides a kind of calibration equipment of input frame content, is mainly installed on computer, hand The terminals such as machine, structural schematic diagram is as shown in figure 5, specifically include that first establishes module 30, for creating comprising verification interface side The input policing class InputStrategy of method inputTextField ();Second establishes module 40, establishes module 30 with first Coupling, for create the ConcreteStrategy class of realization inputTextField (), and by ConcreteStrategy class It saves into the tactful pond in backstage;Input frame establishes module 50, establishes module 40 with second and couples, for creating default input frame, Wherein, presetting input frame is the instance objects for encapsulating class CustomTextField;Package module 60 establishes module with input frame 50 and second establish 40 couples of module, for default input frame and ConcreteStrategy class to be packaged;It receives Module 10 is coupled with package module 60, for receiving the input content in default input frame;Correction verification module 20, with receiving module 10 couplings pass through inputTextField () school for realizing inputTextField () according to ConcreteStrategy class Test input content.
Before the verification for carrying out input frame input content, first have to construct one kind can be carried out according to input frame difference it is specific The strategy pattern of policy class free switching establishes module 30 by first first and creates an external offer interface check method Input policing class InputStrategy is added external as the abstract tactful role of strategy pattern in InputStrategy Verification interface method inputTextField (), this method provides specific strategy classes to realize necessary method and attribute, It is also the external interface of strategy pattern.
The second specific strategy class ConcreteStrategy for establishing the creation of module 40 is that school is specifically carried out in strategy pattern The class tested, and realize verification interface method inputTextField (), main function is the algorithm for realizing content authentication, and And when calling, according to the corresponding specific checking algorithm of specific strategy class of input frame, execute external verification interface method Different check logics achievees the purpose that verify the input frame content, saves after the creation of ConcreteStrategy class It is independent mutually with the page where default input frame into the tactful pond in backstage, by the verification interface method of strategy pattern and pre- If the page where input frame is communicated.
It will be appreciated that specific strategy class ConcreteStrategy can have multiple simultaneously, that is, correspond to multiple defeated Enter frame, and the content that can specifically verify according to it, it is named respectively, whether legal such as verifies letter input LetterInputStrategy, check digit input whether legal NumberInputStrategy class etc., above two tool Body policy class realizes inputTextField (), when calling LetterInputStrategy class, InputTextField () execute verification letter input whether legal logic, when calling NumberInputStrategy, InputTextField () execute check digit input whether legal logic.
The default input frame that input frame establishes the creation of module 50 is actually the example pair for encapsulating class CustomTextField As, and the instance objects under the corresponding CustomTextField class of each input frame.Then by package module 60 according to each Purpose must be arranged in input frame, by the input frame and realize that the specific strategy class of its method of calibration carries out unified encapsulation, be actually It is to be associated the two, the verification that input frame or other programs can not be got in ConcreteStrategy after encapsulation is patrolled Volume, it can only realize the check logic in ConcreteStrategy, by external verification interface method to complete input content Verification.
When being extended, by second establish module 40 and input frame establish module 50 be respectively created it is new ConcreteStrategy and input frame, added new input frame are specific strategy class ConcreteStrategy corresponding It needs to realize verification interface method inputTextField (), and is packaged by package module 60, it can be newly added When there is input content in input frame, it is verified using newly added specific strategy class ConcreteStrategy.
After receiving module 10 obtains input content to be verified in default input frame, correction verification module 20 is according to the input frame pair The specific strategy class ConcreteStrategy answered realizes external verification interface method inputTextField (), then leads to The input content in inputTextField () verification input frame is crossed, the above process is actually by inputTextField () The built-in check logic for executing ConcreteStrategy completes input content to realize the corresponding method of calibration of input frame Verification.
After the present embodiment presets the input content in input frame in receiving current page, it is only necessary to call backstage strategy This in pond presets the corresponding specific strategy class of input frame, can be realized external according to the specific checking algorithm of the specific strategy class Verification interface method, carry out the verification of input frame content, separate input frame and method of calibration, each input frame only needs to adjust With its corresponding specific strategy class, keep check logic simple, is easy to extend and safeguard, solves and exist in multiple input frames In the case where, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
The sixth embodiment of the present invention provides a kind of calibration equipment of input frame content, is mainly installed on computer, hand The terminals such as machine, structural schematic diagram is as shown in fig. 6, specifically include that receiving module 10, for receiving the input in default input frame Content;Correction verification module 20 is coupled with receiving module 10, for calling the default corresponding specific plan of input frame in the tactful pond in backstage Slightly class ConcreteStrategy verifies input content;Output module 70 is coupled with correction verification module 20, defeated for output verification Enter the check results of content.
The present embodiment passes through receiving module 10 first and obtains input content to be verified in default input frame, then passes through school It tests module 20 and calls the default corresponding specific strategy class ConcreteStrategy of input frame, carry out the verification of input content. Specifically, the input content in input frame is preset, the content inputted in default input frame can be moved for user hand, or The content that other programs or algorithm generate after being finished is input in default input frame.
Due to having in the tactful pond in backstage and only one specific strategy class be corresponding for an input frame, For realizing the verification to the particular content inputted in input frame.If user is one there are multiple input frames in current page In a input frame after input, the input frame input content specifically can be carried out by the corresponding specific strategy class of the input frame It verifies, the verification between multiple input frames will not interact, and reduce the complexity of check logic, and in later maintenance When, it can be quickly found out corresponding specific strategy class according to the input frame to go wrong and modify and can adjust, and added newly When input frame, it is only necessary to create corresponding specific strategy class.
After correction verification module 20 verifies, by the verification knot of input content in 70 output verification of the output module input frame Fruit, the check results are exported to the content in input frame just after executing for user to entered by himself interior perhaps other programs Determination is judged that display mode can show for pop-up, or indicates different verifications by the background color of setting input frame As a result, then proving that verification passes through if background color is green, if red, then proves that verification does not pass through, user is needed to modify.
After the present embodiment presets the input content in input frame in receiving current page, it is only necessary to call backstage strategy This in pond presets the corresponding specific strategy class of input frame, the specific method that can be realized according to the specific strategy class, in input Appearance is verified, and output verification is as a result, separate input frame and method of calibration, each input frame only needs to call its corresponding Specific strategy class keeps check logic simple, is easy to extend and safeguard, conveniently checks check results, solve multiple defeated In the presence of entering frame, check logic is complicated, is unfavorable for the problem of extending and safeguarding.
Seventh embodiment of the invention provides a kind of storage medium, is stored with computer program, and computer program is processed Following steps S11 and S12 are realized when device executes:
S11 receives the input content in default input frame;
S12 calls the default corresponding specific strategy class ConcreteStrategy of input frame, school in the tactful pond in backstage Test input content.
In the present embodiment, storage medium may be mounted in the terminals such as mobile phone or computer.Due in first embodiment In the specific steps of the method for calibration of input frame content are described in detail, it is therefore, no longer superfluous in the present embodiment It states.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or The various media that can store program code such as CD.Optionally, in the present embodiment, processor has been deposited according in storage medium The program code of storage executes the method and step of above-described embodiment record.Optionally, the specific example in the present embodiment can refer to Example described in above-described embodiment and optional embodiment, details are not described herein for the present embodiment.Obviously, the technology of this field Personnel should be understood that each module of the above invention or each step can be realized with general computing device, they can be with It is concentrated on a single computing device, or is distributed over a network of multiple computing devices, optionally, they can be used Computing device executable program code is realized, is held it is thus possible to be stored in storage device by computing device Row, and in some cases, can with the steps shown or described are performed in an order that is different from the one herein, or by they point It is not fabricated to each integrated circuit modules, or makes multiple modules or steps in them to single integrated circuit module It realizes.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The eighth embodiment of the present invention provides a kind of terminal, includes at least memory, processor, is stored on memory Computer program, processor realize following steps S21 and S22 when executing the computer program on memory:
S21 receives the input content in default input frame;
S22 calls the default corresponding specific strategy class ConcreteStrategy of input frame, school in the tactful pond in backstage Test input content.
In the present embodiment, terminal can be the terminals such as mobile phone or computer.Due in the first embodiment to defeated The specific steps for entering the method for calibration of frame content are described in detail, and therefore, repeat no more in the present embodiment.
Although for illustrative purposes, the preferred embodiment of the present invention has been disclosed, those skilled in the art will recognize It is various improve, increase and replace be also it is possible, therefore, the scope of the present invention should be not limited to the above embodiments.

Claims (10)

1. a kind of method of calibration of input frame content characterized by comprising
Receive the input content in default input frame;
In the tactful pond in backstage, the corresponding specific strategy class of the default input frame is called, the input content is verified.
2. method of calibration as described in claim 1, which is characterized in that the input content received in default input frame it Before, further includes:
Creation includes the input policing class of verification interface method;
The specific strategy class of the verification interface method is realized in creation, and the specific strategy class is saved to the backstage In tactful pond;
Create the default input frame, wherein the default input frame is the instance objects for encapsulating class;
The default input frame and the specific strategy class are packaged.
3. method of calibration as claimed in claim 2, which is characterized in that described to call the corresponding specific plan of the default input frame Slightly class, verifies the input content, comprising:
The verification interface method is realized according to the specific strategy class;
The input content is verified by the verification interface method.
4. method of calibration as claimed any one in claims 1 to 3, which is characterized in that the verification input content it Afterwards, further includes:
The check results of input content described in output verification.
5. a kind of calibration equipment of input frame content characterized by comprising
Receiving module, for receiving the input content in default input frame;
Correction verification module, for calling the corresponding specific strategy class of the default input frame, verifying described defeated in the tactful pond in backstage Enter content.
6. calibration equipment as claimed in claim 5, which is characterized in that further include:
First establishes module, for creating the input policing class comprising verification interface method;
Second establishes module, for creating the specific strategy class for realizing the verification interface method, and by the specific plan Slightly class is saved into backstage strategy pond;
Input frame establishes module, for creating the default input frame, wherein the default input frame is the example pair for encapsulating class As;
Package module, for the default input frame and the specific strategy class to be packaged.
7. calibration equipment as claimed in claim 6, which is characterized in that the correction verification module is specifically used for:
The verification interface method is realized according to the specific strategy class;
The input content is verified by the verification interface method.
8. the calibration equipment as described in any one of claim 5 to 7, which is characterized in that further include:
Output module, the check results for input content described in output verification.
9. a kind of storage medium, is stored with computer program, which is characterized in that real when the computer program is executed by processor The step of method of calibration of existing input frame content described in any one of Claims 1-4.
10. a kind of terminal includes at least memory, processor, is stored with computer program on the memory, feature exists In the processor is realized described in any one of Claims 1-4 defeated when executing the computer program on the memory The step of entering the method for calibration of frame content.
CN201810940566.0A 2018-08-17 2018-08-17 A kind of method of calibration, device, storage medium and the terminal of input frame content Pending CN109271152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810940566.0A CN109271152A (en) 2018-08-17 2018-08-17 A kind of method of calibration, device, storage medium and the terminal of input frame content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810940566.0A CN109271152A (en) 2018-08-17 2018-08-17 A kind of method of calibration, device, storage medium and the terminal of input frame content

Publications (1)

Publication Number Publication Date
CN109271152A true CN109271152A (en) 2019-01-25

Family

ID=65153959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810940566.0A Pending CN109271152A (en) 2018-08-17 2018-08-17 A kind of method of calibration, device, storage medium and the terminal of input frame content

Country Status (1)

Country Link
CN (1) CN109271152A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765969A (en) * 2021-01-11 2021-05-07 成都深思科技有限公司 Efficient real-time expression grammar verification method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201009A (en) * 2011-06-21 2011-09-28 深圳市凯立德科技股份有限公司 Form generating method and device
CN103106186A (en) * 2013-01-22 2013-05-15 百度在线网络技术(北京)有限公司 Form verification method and form verification system
CN106713241A (en) * 2015-11-16 2017-05-24 腾讯科技(深圳)有限公司 Identity verification method, device and system
CN106990952A (en) * 2017-02-28 2017-07-28 福建天泉教育科技有限公司 Form validation method and its system based on Vue.js
CN107423056A (en) * 2017-06-30 2017-12-01 北京五八信息技术有限公司 Input content verification method and device
CN108009042A (en) * 2016-10-27 2018-05-08 北京京东尚科信息技术有限公司 The method and device of data check
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201009A (en) * 2011-06-21 2011-09-28 深圳市凯立德科技股份有限公司 Form generating method and device
CN103106186A (en) * 2013-01-22 2013-05-15 百度在线网络技术(北京)有限公司 Form verification method and form verification system
CN106713241A (en) * 2015-11-16 2017-05-24 腾讯科技(深圳)有限公司 Identity verification method, device and system
CN108009042A (en) * 2016-10-27 2018-05-08 北京京东尚科信息技术有限公司 The method and device of data check
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
CN106990952A (en) * 2017-02-28 2017-07-28 福建天泉教育科技有限公司 Form validation method and its system based on Vue.js
CN107423056A (en) * 2017-06-30 2017-12-01 北京五八信息技术有限公司 Input content verification method and device
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765969A (en) * 2021-01-11 2021-05-07 成都深思科技有限公司 Efficient real-time expression grammar verification method and system

Similar Documents

Publication Publication Date Title
CN103345885B (en) The collocation method of casing trace configurations method and device and spliced display screen
CN106648945A (en) Interface data testing method and device and electronic equipment
CN103246533B (en) A kind of method for adding plug-in unit in address list, device and equipment
CN108365961A (en) The response method and server that interface call method and terminal device, interface call
CN109144584A (en) A kind of programmable logic device and its starting method, system and storage medium
CN110096496A (en) A kind of form validation method, relevant apparatus and equipment
CN111506579B (en) Method, program and equipment for generating intelligent contract code
CN104054050A (en) Improved configuration of a user interface for a mobile communications terminal
CN102982272B (en) keyboard layout method and device
CN108876619A (en) Processing method, device, equipment and medium based on block chain intelligence contract
CN106547580A (en) The method and apparatus of hooking function
CN107729063A (en) Call method, device and the terminal of SDK
CN110334303A (en) Form validation method, device, computer equipment and storage medium
CN105279006A (en) Android system based screen capture method and terminal
CN106326062A (en) Method and device for controlling running state of application program
CN102402455A (en) Method and device for calling dynamic link library (DLL)
CN109271152A (en) A kind of method of calibration, device, storage medium and the terminal of input frame content
CN107562428A (en) Rule-based adaptable software quick interface arrangement method and system
CN113448545B (en) Method, apparatus, storage medium and program product for machine learning model servitization
CN110737473A (en) Data processing method and device, terminal and storage medium
CN106528206A (en) Application starting control method and apparatus, and application installation package reinforcement apparatus
CN109783782A (en) Generation method, equipment, storage medium and the device of electronic contract template
CN109522021A (en) Parameter callback processing method and device, electronic equipment and storage medium
CN106293658A (en) A kind of interface assembly generates method and equipment thereof
CN108053034A (en) Model parameter processing method, device, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190125

RJ01 Rejection of invention patent application after publication