Parameter verification method, apparatus, computer storage medium and embedded device
Technical field
The present invention relates to database technical field more particularly to a kind of parameter verification method, apparatus, computer storage medium
And embedded device.
Background technique
In present communication equipment, as business becomes increasingly complex, the data volume for needing to save in equipment is more and more huger
Greatly, the data scene to be adapted to also becomes increasingly complex, and existing data check mode is subsystems (such as web, network management)
It is each responsible for the verification for itself submitting data.When data are more and more, subsystems can can't bear the heavy load to verify data,
Not only increase the data process method of subsystem, and the data check mode of subsystems may disunity cause it is not simultaneous
Hold and data check malfunctions.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State parameter verification method, apparatus, computer storage medium and the embedded device of problem.
One aspect of the present invention provides a kind of parameter verification method, comprising:
Receive the configuration parameter that interactive subsystem is submitted;
Data check is carried out to the configuration parameter according to the configuration parameter corresponding data check rule;
When the configuration parameter passes through data check, by the configuration parameter write device database, and back-checking
Success message.
Optionally, data are carried out to the configuration parameter according to the corresponding data check rule of the configuration parameter described
Before verification, the method also includes:
The device databases field information is searched according to the identification information of the configuration parameter, to obtain the configuration ginseng
The corresponding check field of number, the check field are to be arranged in device databases for recording the corresponding data school of configuration parameter
Test the field of rule;
Obtain the data check rule recorded in the check field found.
Optionally, the data check rule includes data validation verification rule and data validation rule;
Data check is carried out to the configuration parameter according to the configuration parameter corresponding data check rule, comprising:
Legitimacy verifies are carried out according to data type of the data validation verification rule to the configuration parameter;
When the configuration parameter passes through legitimacy verifies, according to data validation rule to the configuration parameter
Parameter value carries out validity check.
Optionally, the data validation verification rule is for limiting the data type of configuration parameter;
The data validation rule includes data value range, value set, regular expression and/or verification letter
Number, for limiting the parameter value value range of configuration parameter.
Optionally, the method also includes:
The corresponding data check rule of each configuration parameter is generated according to the data characteristics of each configuration parameter of current device,
And the check field for recording the corresponding data check rule of configuration parameter is set in the device databases.
Another aspect of the present invention provides a kind of parameter calibrator, comprising:
Receiving module, for receiving the configuration parameter of interactive subsystem submission;
Data check module, for being carried out according to the corresponding data check rule of the configuration parameter to the configuration parameter
Data check;
Data processing module, for when the configuration parameter passes through data check, by the configuration parameter write device
Database, and back-checking success message.
Optionally, the data check module is also used to right according to the corresponding data check rule of the configuration parameter
Before the configuration parameter carries out data check, the device databases field is searched according to the identification information of the configuration parameter
Information, to obtain the corresponding check field of the configuration parameter, the check field is to be arranged in device databases for remembering
Record the field of the corresponding data check rule of configuration parameter;Obtain the data check rule recorded in the check field found.
Optionally, the data check rule includes data validation verification rule and data validation rule;Institute
State data check module, comprising:
First verification unit, for according to data validation verification rule to the data type of the configuration parameter into
Row legitimacy verifies;
Second verification unit, for being advised according to data validation when the configuration parameter passes through legitimacy verifies
Validity check then is carried out to the parameter value of the configuration parameter.
In addition, it is stored thereon with computer program the present invention also provides a kind of computer readable storage medium, the program
The step of method as described above is realized when being executed by processor.
In addition, the present invention also provides a kind of embedded device, including memory, processor and storage are on a memory simultaneously
The step of computer program that can be run on a processor, the processor realizes method as described above when executing described program.
Parameter verification method, apparatus, computer storage medium and embedded device provided in an embodiment of the present invention, when each
It, can be by unified data check rule to the son received when interactive subsystem carries out write operation to the configuration parameter in equipment
The configuration parameter that system is submitted carries out data check processing, and then reduces the complicated journey of the processing logic of each interactive subsystem
Degree avoids asking for incompatible as caused by the data check mode disunity of each interactive subsystem and data check error
Topic.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is the flow diagram of parameter verification method provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides parameter verification method flow diagram;
Fig. 3 is the structural schematic diagram of parameter calibrator provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of embedded device provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific term), there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art
The consistent meaning of meaning, and unless otherwise will not be explained in an idealized or overly formal meaning by specific definitions.
The present invention is responsible for submitting each interactive subsystem (such as web, network management etc.) by unified data check module
Configuration parameter verification, interactive subsystem each in this way in equipment data carry out write operation, that is, modify some parameter
When value, the numerical value thing that data check module receives interactive subsystem can be processed uniformly, whether legal carry out data
Verification, subsystems are only responsible for submitting the not responsible data check of data, reduce the processing logic complexity journey of subsystem
Degree also avoids the error of incompatible as caused by the data check mode disunity of each interactive subsystem and data check
Problem.
Fig. 1 is the flow chart of the parameter verification method of one embodiment of the invention.Referring to Fig.1, the ginseng of the embodiment of the present invention
Number methods of calibration specifically includes the following steps:
S11, the configuration parameter that interactive subsystem is submitted is received.
In the present embodiment, when each interactive subsystem carries out write operation to the configuration parameter in equipment, equipment, which receives, to be handed over
The configuration parameter that mutual subsystem is submitted.
Wherein, interactive subsystem is primarily used to interact with embedded device, accessible by interactive subsystem
With operation equipment.It is configured specifically, interactive subsystem can be convenient operator with equipment.In a specific embodiment
In, interactive subsystem includes Web page face system, terminal command line subsystem and NM server interface subsystem.Web page
Subsystem is mainly used to equipment installation personnel, and terminal command line subsystem is used mainly for research staff, NM server
Interface subsystem mainly gives later maintenance personnel to use.Such as operator can be ordered by Web page face system or terminal
Enable row subsystem or NM server interface operation equipment.
S12, data check is carried out to the configuration parameter according to the corresponding data check rule of the configuration parameter.
In the present embodiment, each configuration parameter is corresponding with unified data check rule, when each interactive subsystem is to setting
When configuration parameter in standby carries out write operation, the configuration that the subsystem received can be submitted by unified data check rule
Parameter carries out data check processing.
S13, when the configuration parameter passes through data check, by the configuration parameter write device database, and return
Verify success message.
Further, it when the configuration parameter can not pass through data check, i.e., when verification rule verifies data invalid, returns
The data invalid that multiple subsystem is submitted.
In parameter verification method provided in an embodiment of the present invention, when each interactive subsystem to the configuration parameter in equipment into
When row write operates, data check can be carried out to the configuration parameter that the subsystem received is submitted by unified data check rule
Processing, and then the complexity of the processing logic of each interactive subsystem is reduced, avoid the data due to each interactive subsystem
Caused by verification mode disunity the problem of the error of incompatible and data check.
In the embodiment of the present invention, it is described according to the corresponding data check rule of the configuration parameter to the configuration parameter
Before carrying out data check, the method also includes following steps: setting according to the lookup of the identification information of the configuration parameter
Standby Database field information, to obtain the corresponding check field of the configuration parameter, the check field is in device databases
What is be arranged is used to record the field of the corresponding data check rule of configuration parameter;Obtain the number recorded in the check field found
According to verification rule.
Further, in this embodiment equipment needs the data characteristics previously according to each configuration parameter of current device raw
At the corresponding data check rule of each configuration parameter, and setting is corresponding for recording configuration parameter in the device databases
The check field of data check rule.
The present invention is based on the field in database, customized one for recording the corresponding data check rule of configuration parameter
Check field, for store corresponding configuration parameter data type and data validation rule, for interactive subsystem
The legitimacy verifies of the advanced row data type of the data of submission, by carrying out validity check after legitimacy verifies again.
Specifically, data check rule includes data validation verification rule and data validation rule.
Wherein, data validation verification rule includes data type, then for limiting the data type of configuration parameter.One
It, can be several below dtd--data type definition in a specific example: basic data type: Boolean type, shaping (including 8,16
With 32 signed and unsigned shapings) and character string type, these types of type illustrates the maximum and most of digital value
Small value range, what it is more than corresponding range is illegal value.The data that subsystem is submitted are verified by data validation
And then carry out data validation.
Wherein, data validation rule includes data value range, value set, regular expression and/or verification letter
Number, for limiting the parameter value value range of configuration parameter.In a specific example, respectively defining following several data has
The verification rule of effect property.
1, verification type is N, indicates the value range of a certain value, such as the value range in time is 1-12, is more than this model
What is enclosed is illegal value.This value range can also be made of multiple value ranges, such as 5-100,500-1000, may be used also
It is incremented by with constraining with a certain step-length, such as it is 1,3,6,9 that 1-9, which is the incremental i.e. value of step-length with 3,
2, verification type is E, and verification expression formula content is the combination of enumerated value, is separated between enumerated value with comma, such as
The value of some value is only 1,3,7,12
3, verification type is R, and the first letter of regex is taken to indicate, verification expression formula is the standard in computer science
Regular expression, such as standard regular expression: ^ d { 6,21 } indicates that the digit of a numerical value is 6 to 21.
4, verification type is F, and verification expression formula content enters one of parameter as verification function.
One verification expression formula Regex uniquely corresponds to a function, and function return type is bool type, totally 2 characters
String type enters ginseng, and the 1st is parameter value, and the 2nd is verification expression formula, verifies and successfully returns to true, verification unsuccessfully returns
false。
Registration when function is run by projects, when Platform Designing, need to support member's letter of C language function or C++ class simultaneously
Number, specifically registers which kind of type of functions is decided in its sole discretion by projects user, will be supported.
If not verifying the corresponding registration function of expression formula, the data value of this member is not verified, is directly returned
true。
Further, recorded in step S12 according to the corresponding data check rule of the configuration parameter to the configuration
Parameter carries out data check, specifically includes the following steps: according to data validation verification rule to the configuration parameter
Data type carries out legitimacy verifies;When the configuration parameter passes through legitimacy verifies, according to data validation rule
Validity check is carried out to the parameter value of the configuration parameter.
Specifically, when interactive subsystem submits configuration parameter to be transferred to equipment progress database write operations, data check
Module obtains the corresponding data type of configuration parameter that interactive subsystem is submitted, and data check module is according to the correspondence number got
According to data type configuration parameter that interactive subsystem is submitted carry out the legitimacy verifies of data, when data module verify it is obstructed
It is out-of-date, it is illegal to reply the data that subsystem is submitted.When the configuration parameter that interactive subsystem is submitted passes through legitimacy verifies, number
The data validation rule that this data is obtained according to correction verification module, according to one of above several data validation rules into
The validity check of row data replys the data invalid that subsystem is submitted, if subsystem when verification rule verification data invalid
When the data that system is submitted are verified successfully by data check module, the data check success that subsystem is submitted is replied.Data check
When module is verified successfully, transfer to database module that database is written the legal and effective data that interactive subsystem is submitted.Tool
Body implementation process is as shown in Figure 2.
In the prior art, due to each interactive subsystem verification mode disunity, caused by some subsystem can pass through
Verification another subsystem can not by verification, lead to the confusion of operator's configuration data, operator can not be true
The verification of that fixed subsystem is correct, it is possible to invalid data influence equipment is configured with by some subsystem
Energy.Parameter verification method provided in an embodiment of the present invention submits the subsystem received by unified data check rule
Configuration parameter carry out data check processing, and then reduce the complexity of the processing logic of each interactive subsystem, effectively
The problem of avoiding the error of incompatible as caused by the data check mode disunity of each interactive subsystem and data check.
For embodiment of the method, for simple description, therefore, it is stated as a series of action combinations, but this field
Technical staff should be aware of, and embodiment of that present invention are not limited by the describe sequence of actions, because implementing according to the present invention
Example, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know that, specification
Described in embodiment belong to preferred embodiment, the actions involved are not necessarily necessary for embodiments of the present invention.
Fig. 3 diagrammatically illustrates the structural schematic diagram of the parameter calibrator of one embodiment of the invention.Referring to Fig. 3, originally
The parameter calibrator of inventive embodiments specifically includes receiving module 301, data check module 302 and data processing module
303, in which:
Receiving module 301, for receiving the configuration parameter of interactive subsystem submission;
Data check module 302, the corresponding data check of configuration parameter for being received according to the receiving module 301
Rule carries out data check to the configuration parameter;
Data processing module 303, for when the configuration parameter passes through data check, configuration parameter write-in to be set
Standby database, and back-checking success message.
In parameter calibrator provided in an embodiment of the present invention, receiving module 301 receives matching for interactive subsystem submission
The data check module 302 that parameter is transmitted to equipment later is set, unified data check is passed through by data check module 302
Rule carries out data check processing to the configuration parameter that the subsystem received is submitted, and then reduces the place of each interactive subsystem
The complexity for managing logic, avoids the incompatible and data as caused by the data check mode disunity of each interactive subsystem
The problem of verification error.
In embodiments of the present invention, the data check module 302 is also used to according to the corresponding data school of configuration parameter
Before rule is tested to configuration parameter progress data check, the number of devices is searched according to the identification information of the configuration parameter
According to library field information, to obtain the corresponding check field of the configuration parameter, the check field is to be arranged in device databases
For recording the field of the corresponding data check rule of configuration parameter;Obtain the data school recorded in the check field found
Test rule.
In the embodiment of the present invention, the data check rule includes data validation verification rule and data validation
Rule, wherein data validation verification rule is for limiting the data type of configuration parameter;Data validation rule includes
Data value range, value set, regular expression and/or verification function, for limiting the parameter value value model of configuration parameter
It encloses.
Further, data check module specifically includes the first verification unit and the second verification unit, in which:
First verification unit, for according to data validation verification rule to the data type of the configuration parameter into
Row legitimacy verifies;
Second verification unit, for being advised according to data validation when the configuration parameter passes through legitimacy verifies
Validity check then is carried out to the parameter value of the configuration parameter.
In embodiments of the present invention, described device further includes attached configuration module not shown in the figure, which is used for
The corresponding data check rule of each configuration parameter is generated according to the data characteristics of each configuration parameter of current device, and described
Check field for recording the corresponding data check rule of configuration parameter is set in device databases.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Parameter verification method, apparatus provided in an embodiment of the present invention, when each interactive subsystem joins the configuration in equipment
When number carries out write operation, data can be carried out to the configuration parameter that the subsystem received is submitted by unified data check rule
Checking treatment, and then the complexity of the processing logic of each interactive subsystem is reduced, it avoids due to each interactive subsystem
Caused by data check mode disunity the problem of the error of incompatible and data check.
In addition, it is stored thereon with computer program the embodiment of the invention also provides a kind of computer readable storage medium,
The step of program realizes method as described above when being executed by processor.
In the present embodiment, if module/unit that the parameter calibrator integrates is real in the form of SFU software functional unit
Now and when sold or used as an independent product, it can store in a computer readable storage medium.Based in this way
Understanding, the present invention realize above-described embodiment method in all or part of the process, can also be instructed by computer program
Relevant hardware is completed, and the computer program can be stored in a computer readable storage medium, the computer program
When being executed by processor, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer
Program code, the computer program code can be source code form, object identification code form, executable file or certain centres
Form etc..The computer-readable medium may include: can carry the computer program code any entity or device,
Recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software
Distribution medium etc..It should be noted that the content that the computer-readable medium includes can be according to making laws in jurisdiction
Requirement with patent practice carries out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent practice, computer
Readable medium does not include electric carrier signal and telecommunication signal.
Fig. 4 is the schematic diagram of embedded device provided in an embodiment of the present invention.Equipment provided in an embodiment of the present invention, including
Memory 401, processor 402 and it is stored in the computer program that can be run on memory 401 and on the processor 402, it is described
Processor 402 realizes the step in above-mentioned parameters method of calibration embodiment, such as Fig. 1 institute when executing the computer program
The configuration parameter that S11, the reception interactive subsystem shown is submitted;It is S12, right according to the corresponding data check rule of the configuration parameter
The configuration parameter carries out data check;S13, when the configuration parameter passes through data check, the configuration parameter is written
Device databases, and back-checking success message.Alternatively, the processor 402 realized when executing the computer program it is above-mentioned
The function of each module/unit in each parameter calibrator embodiment, such as receiving module shown in Fig. 3 301, data check module
302 and data processing module 303.
Illustratively, the computer program can be divided into one or more module/units, one or more
A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more
A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute
State implementation procedure of the computer program in the parameter calibrator.It is connect for example, the computer program can be divided into
By module 301, data check module 302 and data processing module 303.
The embedded device may include, but be not limited only to, processor, memory.It will be understood by those skilled in the art that
The schematic diagram 4 is only the example of the equipment, does not constitute the restriction to equipment, may include more more or less than illustrating
Component, perhaps combine certain components or different components, such as the equipment can also include input-output equipment, net
Network access device, bus etc..
The processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng the processor is the control centre of the equipment, utilizes the various pieces of various interfaces and connection whole equipment.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of equipment.The memory can mainly include storing program area and storage data area, wherein storing program area can deposit
Application program (such as sound-playing function, image player function etc.) needed for storing up operating system, at least one function etc.;Storage
Data field, which can be stored, uses created data (such as audio data, phone directory etc.) etc. according to mobile phone.In addition, memory can
It can also include nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligence to include high-speed random access memory
Energy storage card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash
Card), at least one disk memory, flush memory device or other volatile solid-state parts.
In embodiments of the present invention, it should be understood that disclosed device and method, it can be real by another way
It is existing.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit or unit, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of equipment or unit
It connects, can be electrical or other forms.
It will be appreciated by those of skill in the art that although some embodiments in this include included in other embodiments
Certain features rather than other feature, but the combination of the feature of different embodiments means to be within the scope of the present invention simultaneously
And form different embodiments.For example, in the following claims, the one of any of embodiment claimed all may be used
Come in a manner of in any combination using.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.