CN114997146A - Parameter checking method, device, equipment and storage medium - Google Patents

Parameter checking method, device, equipment and storage medium Download PDF

Info

Publication number
CN114997146A
CN114997146A CN202110226003.7A CN202110226003A CN114997146A CN 114997146 A CN114997146 A CN 114997146A CN 202110226003 A CN202110226003 A CN 202110226003A CN 114997146 A CN114997146 A CN 114997146A
Authority
CN
China
Prior art keywords
parameter
verification
checking
determining
type
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
CN202110226003.7A
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.)
Shenzhen Tencent Information Technology Co Ltd
Original Assignee
Shenzhen Tencent Information 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 Tencent Information Technology Co Ltd filed Critical Shenzhen Tencent Information Technology Co Ltd
Priority to CN202110226003.7A priority Critical patent/CN114997146A/en
Publication of CN114997146A publication Critical patent/CN114997146A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/226Validation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities

Abstract

The invention relates to the technical field of data processing, in particular to a parameter checking method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a target task parameter to be verified, and determining the parameter type of the target task parameter; determining a checking mode set corresponding to the target task parameter according to the parameter type, wherein the checking mode set comprises a plurality of different types of parameter checking modes, and the plurality of different types of parameter checking modes are determined according to the historical input parameter corresponding to the parameter type; checking the target task parameters based on each parameter checking mode respectively to obtain a checking result corresponding to each parameter checking mode; and if the verification results corresponding to the parameter verification modes are all verification passed, judging that the target task parameter verification is passed. The parameter verification method of the invention adopts an independent learning and cross verification mode, and can improve the efficiency and the accuracy of parameter verification.

Description

Parameter checking method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a parameter checking method, apparatus, device, and storage medium.
Background
A task is an ordered set of information system operation steps to achieve a certain operation goal, usually through flow immobilization to achieve the purpose of standard operation. When a task is executed on any computer platform or system, related task parameters are generally required to be filled before the task is started, variable parameters enable one task to flexibly solve a similar problem, and the correctness of parameter filling is crucial to the successful execution and timely completion of the task. However, when filling parameters, we often encounter the situation of parameter misfilling, such as the parameter list prepared in advance is misplaced during filling, or the parameter is understood to be misleading to the preparation of wrong parameter value but not found in time, etc. Therefore, a method for checking the correctness of the parameters is needed.
In the prior art, parameter verification can be divided into two categories: 1) and checking the task parameters of the non-session system platform. This type of verification is usually performed by manually setting parameter rules, and the rule verification is usually implemented by using regular expressions or code logic. However, setting the parameter rules manually is time-consuming and labor-consuming, many users usually manage at least tens of task templates, and creating and maintaining the rules for each parameter of the task templates is troublesome. In addition, because the conception and description of the rule itself have difficulty, firstly, it is difficult to master a complex tool such as a regular expression, and secondly, a parameter pattern such as a similar keyword is also difficult to express, so that the artificially set parameter rule is not necessarily reliable.
2) And checking the task parameters of the session system platform. The verification generally uses a natural language processing algorithm, analyzes input parameters as natural language, and distinguishes the parameters from other inputs in an intention classification mode; or abandoning and distinguishing natural language and parameter input in the parameter input state, and unconditionally accepting the input as the parameter. However, this approach has significant drawbacks: although parameters may mainly consist of natural language words, the parameter text as a whole may not be a natural language at all, and the relationship between text units thereof has no grammatical rules and semantic coherence of the natural language, so that the processing performance of a model trained by using a real natural language on the text is severely limited. Therefore, how to effectively process the parameter input of natural language and non-natural language to understand the user intention becomes an important consideration in parameter verification.
Disclosure of Invention
In view of the foregoing problems in the prior art, an object of the present invention is to provide a method, an apparatus, a device and a storage medium for parameter verification, which can improve the efficiency and accuracy of parameter verification.
In order to solve the above problem, the present invention provides a parameter checking method, including:
acquiring a target task parameter to be verified, and determining the parameter type of the target task parameter;
determining a checking mode set corresponding to the target task parameter according to the parameter type, wherein the checking mode set comprises a plurality of different types of parameter checking modes, and the plurality of different types of parameter checking modes are determined according to the historical input parameter corresponding to the parameter type;
checking the target task parameters based on each parameter checking mode respectively to obtain a checking result corresponding to each parameter checking mode;
and if the verification results corresponding to the parameter verification modes are all verification passed, judging that the target task parameter verification is passed.
Another aspect of the present invention provides a parameter calibration apparatus, including:
the parameter type determining module is used for acquiring a target task parameter to be verified and determining the parameter type of the target task parameter;
the verification mode determining module is used for determining a verification mode set corresponding to the target task parameter according to the parameter type, wherein the verification mode set comprises a plurality of different types of parameter verification modes, and the plurality of different types of parameter verification modes are determined according to the historical input parameter corresponding to the parameter type;
the parameter checking module is used for checking the target task parameters based on each parameter checking mode respectively to obtain a checking result corresponding to each parameter checking mode;
and the verification result determining module is used for judging that the target task parameter passes verification when the verification results corresponding to the parameter verification modes all pass verification.
Another aspect of the present invention provides an electronic device, including a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the parameter checking method as described above.
Another aspect of the present invention provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the parameter checking method as described above.
Another aspect of the invention provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the parameter verification method.
Due to the technical scheme, the invention has the following beneficial effects:
according to the parameter checking method, a complex checking mode set is generated by using a plurality of different types of parameter checking modes determined based on historical input parameters, cross checking is further performed on target task parameters to be checked, rules do not need to be configured for each parameter of each task manually, operation is simple and convenient, the problems of dislocation, format errors, extra characters and the like possibly occurring in the task parameter filling process can be well detected, and a guarantee is added for safe execution of tasks. Meanwhile, the method generates a complex comprehensive verification strategy by combining a plurality of simple and accurate verification rules, can precisely match and verify the parameters, and has the advantages of low calculation complexity, high parameter verification efficiency and accuracy and good practicability.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings used in the embodiment or the description of the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the invention;
FIG. 2 is a flow chart of a parameter checking method provided by an embodiment of the invention;
FIG. 3 is a schematic diagram of a user interface provided by one embodiment of the present invention;
FIG. 4 is a flow chart of a parameter checking method according to another embodiment of the present invention;
FIG. 5 is a flow chart of a parameter checking method according to another embodiment of the present invention;
FIG. 6 is a flow chart of a parameter checking method according to another embodiment of the present invention;
FIG. 7 is a flow chart of a parameter checking method according to another embodiment of the present invention;
FIG. 8 is a flow chart of a parameter checking method according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of a parameter checking apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present invention more clearly understood, the embodiments of the present invention are described in further detail below with reference to the accompanying drawings and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and are not intended to limit the embodiments of the invention. First, the embodiments of the present invention explain the following concepts:
parameter checking rules: a rule describes a format that the parameters need to satisfy.
Rule learning/rule validation: statistical methods are used to determine the prevalence of rules within a parameter value domain. If the generality of the rule for the parameter is established, it is said that the rule verifies, or a rule is learned.
Atomic rule: the method refers to a single indivisible rule, is a unit component of a combination rule of final verification parameters, and is regarded as indivisible in the scheme.
Combination rules: the method is a set of atomic rules which are verified to be established by historical input parameters, and the intersection of legal value ranges of all the atomic rules in the set forms the legal value range of the combined rule.
Parameter checking: an input parameter is verified to be legitimate using established rules.
The heuristic method comprises the following steps: meaning that the method solves the problem by summarizing several rules of thumb based on limited knowledge, the method is usually not an optimal solution, but we can not generally do better than the heuristic method due to lack of knowledge or information.
Enumeration rules: enumeration of a set refers to an ordered traversal of all members of a finite set. The enumeration rule is a rule for verifying input parameters by specifying a value range of parameters with only a limited number of selectable values.
Referring to the specification, fig. 1 is a schematic diagram illustrating an implementation environment provided by an embodiment of the invention, which may include at least a terminal 110 and a server 120, as shown in fig. 1. The terminal 110 and the server 120 may be directly or indirectly connected through wired or wireless communication, which is not limited in this embodiment of the application.
The terminal 110 may include, but is not limited to, a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. The terminal 110 may run one or more clients, which may be web pages provided for the user for the task platform or the system, or applications provided for the user for the task platform or the system.
The server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
In the embodiment of the present invention, the client may obtain the task parameters input by the user through the web page or the application interface, and transmit the task parameters to the server 120 through a HyperText Transfer Protocol (HTTP) or a Transmission Control Protocol/internet Protocol (TCP/IP). The device for implementing the parameter verification method provided by the embodiment of the present invention may be disposed in the server 120. Specifically, after the server 120 receives the task parameter, the task parameter may be subjected to parameter verification processing by the parameter verification method provided in the embodiment of the present invention. If the verification is passed, the task parameters are accepted, and normal input is kept unaffected; and if the verification is not passed, the task parameters are not accepted, the verification result is returned to the client for error prompt, and the option of input confirmation is still reserved, so that the input of the user is prevented from being blocked by misjudgment.
It should be noted that fig. 1 is only an example.
Referring to the specification, fig. 2 shows a flow of a parameter verification method provided by an embodiment of the present invention, which may be applied to the server in fig. 1. The method provided by the embodiment of the invention can be applied to scenes in which the input task parameters need to be checked when the task is executed on any platform or system, and comprises different scenes such as execution of operation and maintenance tasks, test tasks and the like. As shown in fig. 2, the method may include the steps of:
s210: and acquiring a target task parameter to be verified, and determining the parameter type of the target task parameter.
In the embodiment of the present invention, the target task parameter may be one or more parameters input by a user through a web page or an application interface. By way of example, referring to fig. 3 in conjunction with the description, a schematic diagram of a parameter input interface provided by an embodiment of the present invention in a scenario where an Artificial Intelligence for IT Operations (AIOps) robot starts a task is exemplarily shown, and a user may input a target task parameter through an input box of the parameter input interface according to a parameter input prompt of the AIOps robot.
In the embodiment of the present invention, when the target task parameter includes a plurality of parameters, each parameter may be verified by using the parameter verification method provided in the embodiment of the present invention. The one or more target task parameters input by the user may be the same type of parameters, or different types of parameters, and the parameter type of each task parameter may be determined according to the parameter identifier of the target task parameter.
S220: and determining a checking mode set corresponding to the target task parameter according to the parameter type, wherein the checking mode set comprises a plurality of different types of parameter checking modes, and the plurality of different types of parameter checking modes are determined according to the historical input parameter corresponding to the parameter type.
In the embodiment of the invention, each parameter verification mode corresponds to a parameter verification rule, and the parameter verification rule describes a format which the parameter needs to satisfy. The parameter verification modes of different types correspond to different types of parameter verification rules, multiple parameter verification modes corresponding to different parameter types may be the same or different, the number and types of the parameter verification modes in the verification mode set may be determined according to actual conditions, and the embodiment of the present invention is not limited to this.
In the embodiment of the present invention, before determining the check mode set corresponding to the target task parameter according to the parameter type, a plurality of simple parameter check rules (which may be referred to as atomic rules) may be independently learned through historical input parameters corresponding to the parameter type in advance for different parameter types, and a plurality of corresponding parameter check modes may be determined. Specifically, a check mode set composed of the parameter type and the determined multiple parameter check modes may be correspondingly stored in the database, when performing parameter check, the corresponding check mode set may be queried from the database according to the parameter type, and all learned atomic rules are checked simultaneously through the multiple parameter check modes, where an effective value range of a parameter at this time is an intersection of all atomic rules, which is equivalent to a multi-angle complex combination rule.
In a possible embodiment, referring to fig. 4 of the specification in combination, the determining a set of verification manners corresponding to the target task parameter according to the parameter type may include:
s221: and judging whether a check mode set corresponding to the parameter type exists or not.
S222: and if the verification mode set corresponding to the parameter type exists, acquiring the verification mode set corresponding to the parameter type as the verification mode set corresponding to the target task parameter.
In the embodiment of the present invention, the check mode set includes a plurality of different types of parameter check modes, when determining the check mode set corresponding to the target task parameter, it may be determined whether a check mode set corresponding to the parameter type exists in a database, and when determining that the check mode set corresponding to the parameter type exists in the database, the check mode set corresponding to the parameter type may be directly used as the check mode set corresponding to the target task parameter.
S223: and if the verification mode set corresponding to the parameter type does not exist, acquiring the historical input parameter corresponding to the parameter type.
S224: and determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter types.
In the embodiment of the present invention, when it is determined that the check mode set corresponding to the parameter type does not exist in the database, a plurality of different types of parameter check modes may be determined according to the historical input parameter corresponding to the parameter type, so as to generate the check mode set corresponding to the parameter type, and use the generated check mode set as the check mode set corresponding to the target task parameter.
S225: and taking the verification mode set as a verification mode set corresponding to the target task parameter.
In the embodiment of the present invention, the parameter verification manner may include a regular verification manner, a self-learning verification manner, an enumeration verification manner, and the like, and the self-learning verification manner may include a keyword verification manner, a prefix-suffix verification manner, and the like, where the regular verification manner corresponds to a regular rule, the self-learning verification manner corresponds to a self-learning rule, the enumeration verification manner corresponds to an enumeration rule, the keyword verification manner corresponds to a keyword rule, and the prefix-suffix verification manner corresponds to a prefix-suffix rule. It should be noted that, in some possible embodiments, the parameter checking manner may further include other types of checking manners, which is not limited in this embodiment of the present invention.
In one possible embodiment, referring to fig. 5 in conjunction with the description, the parameter verification manner may include a regular verification manner; the determining a plurality of different types of parameter verification methods according to the historical input parameters, and obtaining a verification method set corresponding to the parameter type may include:
s510: and acquiring a plurality of preset candidate regular expressions.
In the embodiment of the present invention, the regular verification manner corresponds to a regular rule, the regular rule is a plurality of rules expressed by using a regular expression, the regular rule can cover many common and general parameter value patterns, and different regular rules can have different accuracies, for example, the value range of the "english or digital" rule is obviously wider than that of the "IP address" rule. The different regular rules can be contained relations, such as English or number contained with number, which can be correctly processed by our verification mechanism, and can form different levels of precision in the same class of features, thus actually increasing the expression capability of the combined rule. In practical application, a plurality of regular expressions can be defined by one regular rule, or one regular expression can be defined by one regular rule, and different regular expressions can be defined by different regular rules.
Specifically, the following regular expressions (which use the format of the Python re library) may be predefined:
the number: ?
Extension number: ? $ h
English or number: Lambda-Za-z 0-9/s, _/\\(); ' \\\\\ \ { } \ - + ═ | is used for the treatment of diabetes! @ # $% &' + $
No blank space: ^ S $
Starting with a non-blank space: ^ S. + $
Ending non-space: ^. + \ S $
IPv4 address: ' (
(Note: for simplicity, assume that the ip mode removes the first character from the beginning and end and is ip _ regex, and the following modes are represented using python formatted strings)
Domain name: ' (? (? $ domain _ regex
(Note: for simplicity, the domain _ regex is given by the above-mentioned domain name schema except the first character at the beginning and end)
A plurality of domain names: '(: [, ] s $'% (domain _ regex, domain _ regex)
Uniform Resource Locator (URL): ' ^% s (? ? $ url _ regex
(Note: for simplicity, the URL pattern is URL _ regex with the first character at the beginning and end removed)
A plurality of URLs: ' (
It should be noted that, in some possible embodiments, other types of regular expressions may also be predefined, and the embodiment of the present invention is not limited to this.
S520: and verifying each candidate regular expression based on the historical input parameters, and taking the verified candidate regular expression as a target regular expression corresponding to the parameter type.
In the embodiment of the invention, after the regular expression is defined in advance, the regular expression can be used as a candidate regular expression, and whether the rule represented by the candidate regular expression is established or not is verified by utilizing the historical input parameters through simple calculation, and the process is also called rule learning. Specifically, two indexes, namely, a pass rate and a support degree, can be used for rule verification, wherein the pass rate refers to the ratio of the historical input parameters meeting the rule in all the historical input parameters, and the support degree refers to the number of the historical input parameters meeting the rule.
Specifically, the total number c of all historical input parameters may be counted first, and then, for each candidate regular expression, a first number a of parameters in the historical input parameters that meet the candidate regular expression (which may be referred to as a support degree of the candidate regular expression) is determined, and a first parameter passing rate f ═ a/c of the regular expression may be calculated according to the first number a and the total number c. After the first number and the first parameter passing rate are obtained, whether the first number is greater than or equal to a first preset number or not may be determined, and whether the first parameter passing rate is greater than or equal to a first preset threshold or not may be determined. When the first number is greater than or equal to a first preset number and the first parameter passing rate is greater than or equal to a first preset threshold, it may be determined that the candidate regular expression passes verification, which indicates that the rule represented by the candidate regular expression is established, and at this time, the candidate regular expression may be used as a target regular expression corresponding to the parameter type, and the rule represented by the candidate expression may be recorded in a parameter rule base. When the first number is smaller than a first preset number, or the first parameter passing rate is smaller than a first preset threshold, it may be determined that the candidate regular expression is not verified, which indicates that the rule represented by the candidate regular expression is not true, and the candidate regular expression is discarded.
In the embodiment of the invention, the problem that the determined regular verification mode is not universal due to the small number of the historical input parameters can be avoided by judging whether the first number is greater than or equal to the first preset number. The first preset number and the first preset threshold may be set according to an actual situation, for example, the first preset number may be set to be 800, and the first preset threshold is 70%, which is not limited in this embodiment of the present invention.
S530: and determining a regular checking mode corresponding to the parameter type according to the target regular expression.
In the embodiment of the present invention, the number of the target regular expressions corresponding to the parameter type may be one or multiple, and after determining one or more target regular expressions corresponding to the parameter type, one or more regular rules corresponding to the parameter type may be determined, so as to determine a regular verification manner corresponding to the parameter type, that is, determine whether the input target task parameter conforms to each of the target regular expressions.
In one possible embodiment, referring to fig. 6 in combination with the description, the parameter checking mode may include a self-learning checking mode, and the self-learning checking mode may include a keyword checking mode; the determining a plurality of different types of parameter verification methods according to the historical input parameters, and obtaining a verification method set corresponding to the parameter type may include:
s610: and performing word segmentation processing on the historical input parameters by using a preset word segmentation method to obtain a candidate keyword set corresponding to the parameter type.
In the embodiment of the invention, the self-learning verification mode corresponds to a self-learning rule, the self-learning rule is a meta-rule, and the meta-rule is a rule for generating the rule. Self-learning rules provide a method for extracting the basis for the decision from the data. The keyword verification means corresponds to a keyword rule, which is a common keyword in the marked historical input parameters, and passes the verification if and only if the newly input parameters contain the keyword. In practical application, a plurality of keywords can be described by one keyword rule, or one keyword can be described by one keyword rule, and different keywords can be described by different keyword rules.
In the embodiment of the present invention, the preset word segmentation method may include Natural Language Processing (NLP) algorithm word segmentation, boundary symbol word segmentation, heuristic word segmentation, and the like, and may perform word segmentation on each parameter in the historical input parameters by using the above several word segmentation methods, to obtain candidate keyword sets corresponding to various methods, and determine the target keyword corresponding to the parameter type based on the obtained candidate keyword sets. The word segmentation results are not comparable due to the difference of the word segmentation methods, so the results of the preset word segmentation methods are separately counted and separately verified.
The NLP algorithm word segmentation is implemented by using the existing lexical analysis algorithm model and taking the historical input parameter values as natural language. The NLP lexical analysis algorithm model receives text input of parameter values and returns a word list as a word segmentation result. The advantage of word segmentation of the NLP algorithm is that in the face of natural language input of a correct language, word boundaries can be well cut by combining semantic knowledge extracted from massive training data, and the method is independent of a parameter format. In practical application, the word segmentation algorithm only can be adopted, and word segmentation of the NLP algorithm is skipped under the condition that the parameter value has no Chinese character.
The boundary symbol word segmentation is to use symbols with word segmentation function, such as spaces, underlines and the like, which are commonly found in character strings, to perform phrase segmentation. In particular, the following regular expressions may be employed for word segmentation: "\ s, ___/\(); ' \\\\\ \ { } \ - + ═ | is used for the treatment of diabetes! @ # $% & + ]. The advantage of boundary symbol segmentation is that the result of the method is usually closest to the user's intent when segmentation symbols are present.
Heuristic segmentation is a method of attempting to extract words from historical input parameter values using several heuristic rules. Heuristic means that the method solves the problem by summarizing several rules of thumb based on limited knowledge, which is usually not an optimal solution, but we cannot do better than heuristic methods due to lack of knowledge or information. The nature of heuristic word segmentation is to find word boundaries, and then word segmentation can be performed after the word boundaries are found. In heuristic segmentation, we mainly look for two features as word boundaries: 1) the capital letter is preceded by a lowercase letter and an English letter sequence with a certain length exists behind the letter; 2) an alphanumeric boundary.
It should be noted that, in some possible embodiments, the historical input parameters may also be subjected to word segmentation processing by using other word segmentation methods or statistical techniques to obtain a candidate keyword set corresponding to the historical input parameters, which is not limited in this embodiment of the present invention.
S620: and verifying each candidate keyword in the candidate keyword set based on the historical input parameters, and taking the verified candidate keyword as a target keyword corresponding to the parameter type.
In the embodiment of the invention, after the candidate keyword set corresponding to each preset word segmentation method is obtained, whether the rule corresponding to the candidate keyword is established or not can be verified by utilizing the historical input parameters through simple calculation, and the process is also called rule learning. Specifically, the rule verification may be performed by using two indexes, namely, a pass rate and a support degree, wherein the pass rate refers to a ratio of the historical input parameters meeting the rule among all the historical input parameters, and the support degree refers to the number of the historical input parameters meeting the rule.
Specifically, the total number c of all historical input parameters may be counted first, then, for each candidate keyword in the candidate keyword set, a second number b of parameters including the candidate keyword in the historical input parameters (which may be referred to as a support degree of the candidate keyword) is determined, and a second parameter passing rate f ═ b/c of the candidate keyword may be calculated according to the second number b and the total number c. After the second number and the second parameter passing rate are obtained, whether the second number is greater than or equal to a second preset number or not can be judged, and whether the second parameter passing rate is greater than or equal to a second preset threshold or not can be judged. When the second number is greater than or equal to a second preset number and the second parameter passing rate is greater than or equal to a second preset threshold, it may be determined that the candidate keyword passes verification, which indicates that the rule corresponding to the candidate keyword is established, and at this time, the candidate keyword may be used as a target keyword corresponding to the parameter type, and the rule corresponding to the keyword is recorded in a parameter rule base. When the second number is smaller than a second preset number or the second parameter passing rate is smaller than a second preset threshold, it may be determined that the candidate keyword is not verified, and if the rule corresponding to the candidate keyword is not satisfied, the candidate keyword is discarded. By judging whether the second number is greater than or equal to the second preset number or not, the problem that the determined keyword checking mode is not universal due to the fact that the number of the historical input parameters is small can be avoided.
The second preset number and the second preset threshold may be set according to an actual situation, the second preset number may be the same as or different from the first preset number, and the second preset threshold may be the same as or different from the first preset threshold, which is not limited in this embodiment of the present invention. For example, the second preset number may be set to 700, and the second preset threshold may be set to 80%.
S630: and determining a keyword checking mode corresponding to the parameter type according to the target keyword.
In the embodiment of the present invention, the number of the target keywords corresponding to the parameter type may be one or multiple, and after determining one or more target keywords corresponding to the parameter type, one or more keyword rules corresponding to the parameter type may be determined, so as to determine a keyword check mode corresponding to the parameter type, that is, determine whether an input target task parameter includes the one or more target keywords.
In a possible embodiment, referring to fig. 7 in combination with the description, the self-learning check mode may further include a prefix-suffix check mode; the determining a plurality of different types of parameter verification methods according to the historical input parameters, and obtaining a verification method set corresponding to the parameter type may further include:
s710: and constructing a prefix dictionary tree and a suffix dictionary tree corresponding to the parameter type based on the historical input parameters.
In the embodiment of the invention, the prefix and suffix verification mode corresponds to prefix and suffix rules, and the prefix and suffix rules are that whether a certain parameter has a prefix or a suffix which is consistent with a historical input parameter is analyzed. When determining whether the rule is applicable based on the historical input parameters, a threshold of the passing rate may be given first, and the longest prefix or longest suffix whose passing rate meets the threshold may be found. In practical applications, the longest prefix and the longest suffix may be defined by one rule, or the longest prefix may be defined by one rule and the longest suffix may be defined by another rule.
In particular, such calculations may be implemented using a modified algorithm based on a dictionary tree (Trie tree).
The following describes a process of constructing a Trie, and the structure of the node of the Trie provided by the embodiment of the present invention is as follows:
the char// str type represents the character corresponding to the node;
prefix/str type, which represents the prefix corresponding to the node;
the count// int type represents the character string count touching the node, namely the parameter passing number corresponding to the node;
next// map type, key: next character, value: a next node;
a type of false// node, representing the last character in the prefix;
and the depth// int type represents the prefix length corresponding to the node, namely the node depth of the node.
The flow of the Trie tree construction algorithm is as follows: firstly, an empty root node is created, and a list max _ node _ by _ depth is created, wherein one item of the list represents a node corresponding to the highest frequency prefix of the node depth corresponding to the subscript of the item (namely, the node with the largest number of parameters passing through). Then traversing the historical input parameters, setting the current node as current for the current parameter value in all the values of the historical input parameters, and circularly executing the following processes to create a Trie tree:
(1) sequentially taking one character char in the value character string and simultaneously obtaining depth;
(2) checking whether the character char is established as the next node of current or not, and if not, establishing the character char as the next node of current; if so, adding 1 to the count;
(3) taking the node corresponding to the character char as the current node;
(4) finding an item corresponding to the current depth in the max _ node _ by _ depth list, comparing the count of the node stored in the item with the count of the current node, and replacing the item with the current node if the current node is larger; if the nodes in the list are larger, no action is taken.
Assuming that M historical input parameter values are provided, and the maximum length of the parameter values is N, the time complexity of the tree construction algorithm is O (MN).
In one possible embodiment, in the process of creating the Trie tree, optimization can be performed in the following two ways to reduce the space consumption for constructing the Trie tree.
(1) And setting an upper limit of the number of the nodes, and if the number of the nodes of the constructed Trie tree reaches the limit, abandoning the verification of the rule.
(2) And calculating prefixes step by step, storing the residual character strings into a list of terminal nodes of the current stage when the current depth reaches the limit of the stage when constructing the trie tree, and calculating and storing the result of the stage. When the next stage triggers the 1 st constraint, the results of the previous stage are used. For example, assuming that the constraint starts from 5 and each stage is increased by 5, the first stage may construct a Trie with a depth of 5, and store the remaining strings into a list of nodes with a depth of 5; in the second stage, a Trie tree with the depth of 10 can be constructed, and the remaining character strings are stored in a list of nodes with the depth of 10; and by analogy, the construction of the Trie tree is finally completed.
In the embodiment of the invention, the Trie tree is constructed from front to back based on the parameter value character string of the historical input parameter, and the prefix dictionary tree corresponding to the parameter type can be obtained; and constructing a Trie tree from back to front based on the parameter value character string of the historical input parameter, so as to obtain a suffix dictionary tree corresponding to the parameter type.
S720: determining the longest prefix meeting a first preset passing rate threshold based on the prefix dictionary tree.
Specifically, the determining, based on the prefix dictionary tree, the longest prefix that satisfies the first preset passing rate threshold may include:
acquiring the total number of the historical input parameters;
calculating the minimum passing number according to the total number and the first preset passing rate threshold value;
respectively determining the node with the maximum passing number of parameters in each node corresponding to the node depth according to each node depth;
judging whether the parameter passing number of the nodes is larger than or equal to the minimum passing number or not;
when the parameter passing number of the node is larger than or equal to the minimum passing number, taking the node as a candidate node;
and acquiring a candidate node with the maximum node depth as a target candidate node, and taking a prefix corresponding to the target candidate node as a longest prefix corresponding to the parameter type.
In the embodiment of the present invention, the longest prefixes meeting the first preset pass rate threshold may be determined based on the prefix dictionary tree, and the longest suffixes meeting the second preset pass rate threshold may be determined based on the suffix dictionary tree. The first preset passing rate threshold and the second preset passing rate threshold may be set according to an actual situation, and the first preset passing rate threshold and the second preset passing rate threshold are usually set to values close to 1, for example, may be set to 95%, 97%, and the like, and the first preset passing rate threshold and the second preset passing rate threshold may be the same or different, which is not limited in this embodiment of the present invention.
Specifically, the longest prefix corresponding to the parameter type may be determined through a longest common prefix algorithm, that is, the total number c of the historical input parameters is counted first, the first preset passing rate threshold is set to be f, and the minimum passing number is a product c of the total number c and the first preset passing rate threshold f min Fc. For each node depth, searching a node i corresponding to the node depth from the max _ node _ by _ depth list, namely, the node with the largest passing number of parameters in each node corresponding to the node depth; if the parameter of the node i passes the number i count Greater than or equal to the minimum number of passes c min And taking the node i as a candidate node. Finally, the prefix corresponding to the candidate node with the largest node depth may be taken as the longest prefix.
Assuming that the maximum length of the historical input parameters is N, the time complexity of the longest common prefix algorithm is o (N). It can be seen that the overall time complexity of the algorithm for determining the longest prefix and suffix is o (mn) + o (n) ═ o (mn), and since the parameter values are usually not long (the parameter values that are too long can be eliminated) and have a certain regularity, the actual time consumption is usually significantly better than the above complexity. By the method, the longest prefix and the longest suffix corresponding to each parameter type can be quickly and conveniently determined, so that the time for parameter verification is shortened, and the efficiency of parameter verification is improved.
S730: determining a longest suffix satisfying a second preset pass rate threshold based on the suffix dictionary tree.
In the embodiment of the present invention, the longest suffix corresponding to the parameter type may be determined through a longest common suffix algorithm, and a method for determining the longest suffix is similar to the method for determining the longest prefix, which is not described in detail herein.
S740: and determining a prefix and prefix check mode corresponding to the parameter type according to the longest prefix and the longest suffix.
In the embodiment of the present invention, after the longest prefix and the longest suffix corresponding to the parameter type are determined, a prefix-prefix rule and a prefix-prefix rule corresponding to the parameter type may be determined, and then a prefix-prefix check mode and a prefix-prefix check mode corresponding to the parameter type may be determined, that is, whether an input target task parameter includes the longest prefix and the longest suffix is determined.
In one possible embodiment, after determining the longest prefix and the longest suffix, a simple calculation can be performed using historical input parameters to verify whether the rule corresponding to the longest prefix and the longest suffix is true, which is also referred to as rule learning. Specifically, the rule verification may be performed by using two indexes, namely, a pass rate and a support degree, wherein the pass rate refers to a ratio of the historical input parameters meeting the rule among all the historical input parameters, and the support degree refers to the number of the historical input parameters meeting the rule.
Specifically, the method for verifying the longest prefix and the longest suffix is similar to the method for verifying the keyword, and details thereof are not repeated in the embodiment of the present invention. Specifically, if the longest prefix and the longest suffix pass the verification, which indicates that the rule corresponding to the longest prefix and the longest suffix is true, at this time, a step of determining a prefix-prefix verification manner corresponding to the parameter type according to the longest prefix and the longest suffix may be performed, and the rule corresponding to the longest prefix and the longest suffix may be recorded in a parameter rule base. If the longest prefix or the longest suffix is not verified and the rule corresponding to the longest prefix or the longest suffix is not established, the longest prefix or the longest suffix is abandoned and the corresponding prefix verification mode or suffix verification mode is not determined any more.
In a possible embodiment, referring to fig. 8 in combination with the description, the parameter checking manner may include an enumeration checking manner; the determining a plurality of different types of parameter verification methods according to the historical input parameters, and obtaining a verification method set corresponding to the parameter type may include:
s810: and judging whether the parameter type is an enumeration type or not according to the historical input parameters.
In this embodiment of the present invention, the enumeration verification manner corresponds to an enumeration rule, and the enumeration rule refers to a rule in which a certain parameter has only a specified limited value range. Whether a parameter is an enumeration type or not can be judged according to the parameter type given by a third-party system or according to the statistical analysis of historical input parameters. Specifically, the parameter type of the task parameter may be pulled from the third-party platform, and if the parameter type is an enumeration type, the corresponding enumeration value is pulled. When the above method is not available, whether a parameter is of an enumerated type can be inferred by the following calculation: assuming that the total number of the historical input parameters is t, a unique historical value is V, and the set of the historical values is V, the historical value number is o ═ V |, and the frequency of a certain historical value V is c v Then:
(1) if o < 2 or o > 5, the parameter type is considered not an enumerated type.
(2) Calculating frequency of each historical value, i.e. pair
Figure BDA0002956170600000161
Calculating c v (ii) a If the frequency of a certain historical value is less than 2 (indicating that the support degree is low), namely
Figure BDA0002956170600000162
c v If < 2, the parameter type is not considered to be an enumerated type.
(3) If it is not
Figure BDA0002956170600000163
(indicating low support), the parameter type is considered not to be an enumerated type.
(4) When in use
Figure BDA0002956170600000164
Figure BDA0002956170600000165
And in the process, considering that various values are unbalanced, wherein the parameter type is not an enumeration type.
If none of the above conditions are met, the parameter type may be presumed to be an enumerated type.
It should be noted that, in some possible embodiments, other existing methods may also be used to determine whether the parameter type is an enumerated type, which is not limited in this embodiment of the present invention.
S820: and when the parameter type is an enumeration type, performing deduplication processing on the set formed by the historical input parameters to obtain an enumeration value set corresponding to the parameter type.
In the embodiment of the present invention, when the enumeration type is assumed, a set of historical values may be recorded as an enumeration value set, or a set composed of the historical input parameters may be subjected to deduplication processing to obtain an enumeration value set corresponding to the parameter type.
S830: and determining an enumeration check mode corresponding to the parameter type according to the enumeration value set.
In this embodiment of the present invention, after the enumeration value set is determined, an enumeration rule corresponding to the parameter type may be determined, and then an enumeration check mode corresponding to the parameter type is determined, that is, it is determined whether the input target task parameter is included in the enumeration value set.
In one possible embodiment, after determining the enumerated value set, it may be verified whether a rule corresponding to the enumerated value set is established through simple calculation using a history input parameter, and this process is also referred to as rule learning. Specifically, the rule verification may be performed by using two indexes, namely, a pass rate and a support degree, wherein the pass rate refers to a ratio of the historical input parameters meeting the rule among all the historical input parameters, and the support degree refers to the number of the historical input parameters meeting the rule.
Specifically, the total number c of all the historical input parameters may be counted, then a third number d of parameters included in the enumerated value set in the historical input parameters (which may be referred to as a support degree of the enumerated value set) is determined, and a third parameter passing rate f ═ d/c of the enumerated value set may be calculated according to the third number d and the total number c.
After the third number and the third parameter passing rate are obtained, it may be determined whether the third number is greater than or equal to a third preset number, and whether the third parameter passing rate is greater than or equal to a third preset threshold. When the third number is greater than or equal to a third preset number and the third parameter passing rate is greater than or equal to a third preset threshold, it may be determined that the enumerated value set is verified, which indicates that a rule corresponding to the enumerated value set is established, at this time, a step of determining an enumeration check mode corresponding to the parameter type according to the enumerated value set may be performed, and the rule corresponding to the enumerated value set is recorded in a parameter rule base. And when the third quantity is smaller than a third preset quantity or the third parameter passing rate is smaller than a third preset threshold value, which indicates that the rule corresponding to the enumeration value set is not established, discarding the enumeration value set and not determining the corresponding enumeration check mode. By judging whether the third number is greater than or equal to the third preset number, the problem that the determined enumeration verification mode is not universal due to the fact that the number of historical input parameters is small can be avoided.
The third preset number and the third preset threshold may be set according to an actual situation, the third preset number may be the same as or different from the first preset number or the second preset number, and the third preset threshold may be the same as or different from the first preset threshold or the second preset threshold, which is not limited in this embodiment of the present invention. For example, the third preset number may be set to 700, and the third preset threshold may be set to 80%.
In the embodiment of the invention, when the parameter verification rules and the method are designed from different angles, the relation among the rules does not need to be considered, namely, the design and the verification of the rules are mutually independent, as long as the rules are not equivalent, the expression capacity can be increased by newly added effective rules, and the invalid rules can not generate negative influence on the verification. By automatically learning the parameter verification rules from historical input parameters, the trouble of manually configuring the rules for each parameter of each task is avoided, and the quality of the generated verification rules is higher than that of the manually configured rules.
In a specific embodiment, after determining each parameter verification manner corresponding to the parameter type, the parameter verification rule corresponding to the parameter verification manner may be stored in a parameter rule base, where the parameter rule base uses a storage manner of a montogdb document, and the document fields are as follows:
param _ name: parameter name
update _ time: rule update time
task _ id: identification of the task to which the parameter belongs (Identification, id)
param _ type: and the parameter rule type indicates whether the parameter establishes a rule or not. 0 is not established, 1 is established
And (4) Result: a map with established rules, a key-value pair form, a key with established rule name, a value with rule details, and a map object
The fields for the rule details are as follows:
confidence: historical parameter passing rate of the rule
support: support of the rule
data: data of the rule. The static rules such as regular rules and the like have no data, the self-learning rules store data defining the rules, and for example, the field of the keyword rule stores keywords.
Illustratively, the following json object represents an example of a record parameter rule in a database (since the database of the present scheme is stored using a MongoDB document, the records of the database can be represented approximately using the json object.
Figure BDA0002956170600000181
Figure BDA0002956170600000191
As can be seen from the above example, the parameter { filename } is composed of english letters, numerals, and special characters (english _ numerals _ FORMAT, ENG _ NUM _ FORMAT), with KEYWORDs "×", Game "," Alpha ", and" Build "(HEURISTIC _ KEYWORD _ FORMAT, conditional _ KEYWORD _ FORMAT), followed by". tar.gz "(SUFFIX _ FORMAT ). It can be seen that this rule has reflected very precisely the characteristics of the parameters.
S230: and respectively carrying out verification processing on the target task parameters based on each parameter verification mode to obtain verification results corresponding to each parameter verification mode.
In the embodiment of the present invention, after determining the set of verification manners corresponding to the target task parameter, each parameter verification manner may be used to perform verification processing on the target task parameter, so as to obtain a corresponding verification result. Specifically, the performing the verification processing on the target task parameter based on each parameter verification manner respectively to obtain the verification result corresponding to each parameter verification manner may include:
the target task parameter is checked based on a regular verification mode, and the checking process comprises the following steps: and acquiring one or more regular expressions corresponding to the regular verification mode, respectively judging whether the target task parameters conform to each regular expression, and if the target task parameters conform to all the regular expressions, judging that the verification result corresponding to the regular verification mode is verification passing.
The target task parameter is checked based on a keyword checking mode, and the checking process comprises the following steps: performing word segmentation processing on the target task parameter by using a preset word segmentation method to obtain a word set corresponding to the target task parameter; acquiring one or more keywords corresponding to the keyword verification mode; for each keyword, judging whether the keyword is contained in the word set; and if all the keywords are contained in the word set, judging that the verification result corresponding to the keyword verification mode is verification pass. The preset word segmentation method may include NLP algorithm word segmentation, boundary symbol word segmentation, heuristic word segmentation, and the like, and may perform word segmentation on the target task parameter by using the word segmentation methods, respectively, to obtain a word set corresponding to the target task parameter.
The target task parameter is checked based on a prefix and suffix checking mode, and the method comprises the following steps: acquiring a longest prefix and a longest suffix corresponding to the prefix-prefix check mode and the prefix-suffix check mode; judging whether the target task parameters comprise the longest prefix and the longest suffix; and if the target task parameter comprises the longest prefix and the longest suffix, judging that a verification result corresponding to the prefix-suffix verification mode is verification passing.
The target task parameter is checked based on an enumeration checking mode, and the checking process comprises the following steps: acquiring an enumeration value set corresponding to the enumeration verification mode; matching the target task parameter with each enumeration value in the enumeration value set respectively; and if at least one enumeration value is successfully matched with the target task parameter, judging that a verification result corresponding to the enumeration verification mode is verification passing.
S240: and if the verification results corresponding to the parameter verification modes are all verification passed, judging that the target task parameter verification is passed.
In the embodiment of the invention, cross check is carried out by utilizing a plurality of established parameter check modes, and only if all the parameter check modes pass the check, the whole check passes, which can be called as the cross check of the atomic rule.
In a specific embodiment, the parameter verification method may be applied to a scenario in which an AIOps operation and maintenance robot starts a task, in this scenario, as shown in fig. 3, parameter filling is performed in a session, and a user may input the target task parameter through an input box of the parameter input interface according to a parameter input prompt of the AIOps operation and maintenance robot. When the user inputs the parameters, the parameters can be used as the target task parameters to be detected, the parameter verification method provided by the embodiment of the invention is used for verification, and if the verification is passed, the normal input is not influenced. If the verification is not passed, an error is prompted and the parameters are not accepted by default, but the option of confirming the input is still reserved, so that the user is prevented from being blocked by misjudgment. Under the scene, the parameter verification method provided by the embodiment of the invention can correctly distinguish the user chat and the parameter input, simultaneously well solves the problems of difficult classification input and parameter rejection caused by incapability of well processing the non-natural language input during task parameter filling, and avoids the disorder of conversation with the robot.
In summary, the parameter verification method of the present invention generates a complex verification manner set by using a plurality of different types of parameter verification manners determined based on the historical input parameters through an independent learning and cross-checking mode, and then cross-checks the target task parameters to be verified, without manually configuring rules for each parameter of each task, so that the operation is simple, the problems of misalignment, format errors, extra characters, and the like, which may occur in the task parameter filling process, can be well detected, and a guarantee is added for the safe execution of the task. Meanwhile, the method generates a complex comprehensive verification strategy by combining a plurality of simple and accurate verification rules, can precisely match and verify the parameters, and has the advantages of low calculation complexity, high parameter verification efficiency and accuracy and good practicability.
Referring to the specification and fig. 9, a structure of a parameter checking apparatus 900 according to an embodiment of the present invention is shown. As shown in fig. 9, the apparatus 900 may include:
a parameter type determining module 910, configured to obtain a target task parameter to be verified, and determine a parameter type of the target task parameter;
a checking mode determining module 920, configured to determine, according to the parameter type, a checking mode set corresponding to the target task parameter, where the checking mode set includes a plurality of different types of parameter checking modes, and the plurality of different types of parameter checking modes are determined according to a historical input parameter corresponding to the parameter type;
a parameter checking module 930, configured to perform checking processing on the target task parameter based on each parameter checking manner, respectively, to obtain a checking result corresponding to each parameter checking manner;
and a verification result determining module 940, configured to determine that the target task parameter passes verification when all verification results corresponding to the parameter verification manners pass verification.
In a possible embodiment, the checking method determining module 920 may include:
the judging unit is used for judging whether a checking mode set corresponding to the parameter type exists or not;
a first obtaining unit, configured to obtain, when a check mode set corresponding to the parameter type exists, a check mode set corresponding to the parameter type as a check mode set corresponding to the target task parameter;
the second acquisition unit is used for acquiring the historical input parameters corresponding to the parameter types when the verification mode set corresponding to the parameter types does not exist;
the determining unit is used for determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter types; and taking the verification mode set as a verification mode set corresponding to the target task parameter.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, the division of each functional module is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus provided in the above embodiments and the corresponding method embodiments belong to the same concept, and specific implementation processes thereof are detailed in the corresponding method embodiments and are not described herein again.
An embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the parameter verification method provided in the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory 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 volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided by the embodiments of the present invention may be executed in a terminal, a server, or a similar computing device, that is, the electronic device may include a terminal, a server, or a similar computing device. Taking the operation on the server as an example, as shown in fig. 10, it illustrates a schematic structural diagram of the server of the operation parameter verification method provided in the embodiment of the present invention. The server 1000 may vary significantly due to configuration or performance, and may include one or more Central Processing Units (CPUs) 1010 (e.g., one or more processors) and memory 1030, one or more storage media 1020 (e.g., one or more mass storage devices) storing applications 1023 or data 1022. Memory 1030 and storage media 1020 may be, among other things, transient or persistent storage. The program stored in the storage medium 1020 may include one or more modules, each of which may include a series of instruction operations for a server. Still further, the central processor 1010 may be configured to communicate with the storage medium 1020 and execute a series of instruction operations in the storage medium 1020 on the server 1000. The server 1000 may also include one or more power supplies 1060, one or more wired or wireless network interfaces 1050, one or more input-output interfaces 1040, and/or one or more operating systems 1021, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
Input-output interface 1040 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 1000. In one example, i/o Interface 1040 includes a Network adapter (NIC) that may be coupled to other Network devices via a base station to communicate with the internet. In one example, the input/output interface 1040 may be a Radio Frequency (RF) module for communicating with the internet in a wireless manner, and the wireless communication may use any communication standard or protocol, including but not limited to Global System for mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 10 is merely illustrative and that the server 1000 may include more or fewer components than shown in fig. 10 or have a different configuration than shown in fig. 10.
An embodiment of the present invention further provides a computer-readable storage medium, which may be disposed in an electronic device to store at least one instruction or at least one program for implementing a parameter checking method, where the at least one instruction or the at least one program is loaded and executed by the processor to implement the parameter checking method provided in the foregoing method embodiment.
Optionally, in an embodiment of the present invention, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
An embodiment of the invention also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the parameter verification method provided in the various alternative embodiments described above.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for parameter verification, comprising:
acquiring a target task parameter to be verified, and determining the parameter type of the target task parameter;
determining a checking mode set corresponding to the target task parameter according to the parameter type, wherein the checking mode set comprises a plurality of different types of parameter checking modes, and the plurality of different types of parameter checking modes are determined according to the historical input parameter corresponding to the parameter type;
checking the target task parameters based on each parameter checking mode respectively to obtain checking results corresponding to each parameter checking mode;
and if the verification results corresponding to the parameter verification modes are all verification passed, judging that the target task parameter verification is passed.
2. The method according to claim 1, wherein the determining the set of verification modes corresponding to the target task parameter according to the parameter type includes:
judging whether a check mode set corresponding to the parameter type exists or not;
if the verification mode set corresponding to the parameter type exists, acquiring the verification mode set corresponding to the parameter type as the verification mode set corresponding to the target task parameter;
if the verification mode set corresponding to the parameter type does not exist, acquiring a historical input parameter corresponding to the parameter type;
determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter types;
and taking the verification mode set as a verification mode set corresponding to the target task parameter.
3. The method of claim 2, wherein the parameter verification means comprises a regular verification means;
the determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter type includes:
acquiring a plurality of preset candidate regular expressions;
verifying each candidate regular expression based on the historical input parameters, and taking the verified candidate regular expression as a target regular expression corresponding to the parameter type;
and determining a regular checking mode corresponding to the parameter type according to the target regular expression.
4. The method according to claim 2 or 3, wherein the parameter checking means comprises a self-learning checking means, and the self-learning checking means comprises a keyword checking means;
the determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter type includes:
performing word segmentation processing on the historical input parameters by using a preset word segmentation method to obtain a candidate keyword set corresponding to the parameter type;
verifying each candidate keyword in the candidate keyword set based on the historical input parameters, and taking the verified candidate keywords as target keywords corresponding to the parameter types;
and determining a keyword checking mode corresponding to the parameter type according to the target keyword.
5. The method of claim 4, wherein the self-learning check mode further comprises a prefix-suffix check mode;
the determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter type includes:
constructing a prefix dictionary tree and a suffix dictionary tree corresponding to the parameter type based on the historical input parameters;
determining the longest prefix meeting a first preset passing rate threshold value based on the prefix dictionary tree;
determining a longest suffix satisfying a second preset pass rate threshold based on the suffix dictionary tree;
and determining a prefix and prefix check mode corresponding to the parameter type according to the longest prefix and the longest suffix.
6. The method of claim 5, wherein determining the longest prefix that satisfies a first preset pass rate threshold based on the prefix dictionary tree comprises:
acquiring the total number of the historical input parameters;
calculating the minimum passing number according to the total number and the first preset passing rate threshold value;
respectively determining the node with the maximum passing number of parameters in each node corresponding to the node depth according to each node depth;
judging whether the parameter passing number of the nodes is larger than or equal to the minimum passing number or not;
when the parameter passing number of the node is larger than or equal to the minimum passing number, taking the node as a candidate node;
and acquiring a candidate node with the maximum node depth as a target candidate node, and taking a prefix corresponding to the target candidate node as a longest prefix corresponding to the parameter type.
7. The method according to claim 2 or 3, wherein the parameter checking mode comprises an enumeration checking mode;
the determining a plurality of different types of parameter verification modes according to the historical input parameters to obtain a verification mode set corresponding to the parameter type includes:
judging whether the parameter type is an enumeration type or not according to the historical input parameters;
when the parameter type is an enumeration type, performing deduplication processing on a set formed by the historical input parameters to obtain an enumeration value set corresponding to the parameter type;
and determining an enumeration check mode corresponding to the parameter type according to the enumeration value set.
8. A parameter checking apparatus, comprising:
the parameter type determining module is used for acquiring a target task parameter to be verified and determining the parameter type of the target task parameter;
the verification mode determining module is used for determining a verification mode set corresponding to the target task parameter according to the parameter type, wherein the verification mode set comprises a plurality of different types of parameter verification modes, and the plurality of different types of parameter verification modes are determined according to the historical input parameter corresponding to the parameter type;
the parameter checking module is used for checking the target task parameters based on each parameter checking mode respectively to obtain a checking result corresponding to each parameter checking mode;
and the verification result determining module is used for judging that the target task parameter passes verification when the verification results corresponding to the parameter verification modes all pass verification.
9. An electronic device, comprising a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded by the processor and executed to implement the parameter verification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which at least one instruction or at least one program is stored, the at least one instruction or the at least one program being loaded and executed by a processor to implement the parameter verification method according to any one of claims 1 to 7.
CN202110226003.7A 2021-03-01 2021-03-01 Parameter checking method, device, equipment and storage medium Pending CN114997146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110226003.7A CN114997146A (en) 2021-03-01 2021-03-01 Parameter checking method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110226003.7A CN114997146A (en) 2021-03-01 2021-03-01 Parameter checking method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114997146A true CN114997146A (en) 2022-09-02

Family

ID=83018130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110226003.7A Pending CN114997146A (en) 2021-03-01 2021-03-01 Parameter checking method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114997146A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707653A (en) * 2024-02-06 2024-03-15 天津医康互联科技有限公司 Parameter monitoring method, device, electronic equipment and computer readable storage medium
CN117707653B (en) * 2024-02-06 2024-05-10 天津医康互联科技有限公司 Parameter monitoring method, device, electronic equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707653A (en) * 2024-02-06 2024-03-15 天津医康互联科技有限公司 Parameter monitoring method, device, electronic equipment and computer readable storage medium
CN117707653B (en) * 2024-02-06 2024-05-10 天津医康互联科技有限公司 Parameter monitoring method, device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11544459B2 (en) Method and apparatus for determining feature words and server
US11301637B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
CN106874441B (en) Intelligent question-answering method and device
CN106776544B (en) Character relation recognition method and device and word segmentation method
CN109670163B (en) Information identification method, information recommendation method, template construction method and computing device
CN107301170B (en) Method and device for segmenting sentences based on artificial intelligence
WO2018200135A1 (en) Intent-based organisation of apis
US20240078168A1 (en) Test Case Generation Method and Apparatus and Device
US11017002B2 (en) Description matching for application program interface mashup generation
CN112115232A (en) Data error correction method and device and server
CN112749543B (en) Matching method, device, equipment and storage medium for information analysis process
US20220058349A1 (en) Data processing method, device, and storage medium
US20210334314A1 (en) Sibling search queries
CN111324705A (en) System and method for adaptively adjusting related search terms
CN106407332B (en) Search method and device based on artificial intelligence
CN110705258A (en) Text entity identification method and device
CN116383234A (en) Search statement generation method and device, computer equipment and storage medium
CN114997146A (en) Parameter checking method, device, equipment and storage medium
CN112087473A (en) Document downloading method and device, computer readable storage medium and computer equipment
CN113627201B (en) Information extraction method and device, electronic equipment and storage medium
CN115129976A (en) Resource recall method, device, equipment and storage medium
CN113939812A (en) Generating queries using natural language input
CN112035623B (en) Intelligent question-answering method and device, electronic equipment and storage medium
CN116757203B (en) Natural language matching method, device, computer equipment and storage medium
CN111476037B (en) Text processing method and device, computer 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