Rule configuration method suitable for various scenes
Technical Field
The invention belongs to the technical field of network taxi appointment services, and particularly relates to a rule configuration method applicable to various scenes.
Background
In the prior art, for some configuration rules, a relevant data table is established, relevant parameters are recorded, and a query interface is provided for data query. Each rule needs to repeat the same workload, increases, modifies, queries, deletes and the corresponding rule query interface, and has redundant codes and complex maintenance. Even if compatible configuration rules can be carried out, the support types are limited, parameter verification rules cannot be supported, and special scenes cannot be covered.
The method takes a network appointment system as an example, sets a unique identifier for a newly added rule, and associates the identifier with the parameter name of the current rule and the parameter value of the rule. And a uniform interface is provided to adapt to all rule queries. Meanwhile, the rule parameter values support various types including input boxes, single selection, multiple selection and the like, and support the verification of filling rules including whether the rules need to be filled, a limit value and a numerical value type. Customized policy configuration is supported for some special scenarios, such as setting configuration with dimensions of city, vehicle type, and service type.
The coverage scenes in the prior art are limited, and special scene configuration cannot be supported. The supported parameter type is single, and the parameter rule verification is not supported. The reusability is poor, and a large number of redundant codes are not beneficial to development and maintenance. And a large number of rule configuration tables of the database are complex to maintain. The problem of troubleshooting is complex.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a rule configuration method suitable for various scenes.
In order to achieve the purpose, the invention adopts the following technical scheme:
a rule configuration method applicable to multiple scenes comprises the following steps:
acquiring a plurality of scenes of the online taxi appointment, parameters contained in the scenes and data types of the parameters;
determining a setting rule according to parameters contained in the scene and the data types of the parameters;
filling values according to different parameters in the setting rule and storing the filling values to obtain a filling parameter value rule;
and inquiring the configuration meeting the requirements in the filling rule content according to the filling parameter value rule.
Optionally, the determining a setting rule according to the parameters included in the scene and the data types of the parameters specifically includes:
setting corresponding rule names according to various scenes for obtaining corresponding unique rule identifications;
setting a parameter name and a parameter value type in association according to the unique rule identifier, and representing specific affairs and types of corresponding scenes;
setting parameter dimensions according to contents contained in the plurality of scenes, and performing customization processing to obtain customized scenes;
and setting a verification rule of the parameters according to the customized scene, wherein the verification rule is used for verifying the mandatory property, the uniqueness and the boundary value of the current parameters.
Optionally, the filling values according to different parameters in the setting rule and storing the filling values, and the obtaining the filling parameter value rule specifically includes:
acquiring the configuration corresponding to the scene;
filling in the value of the corresponding configuration parameter according to the configuration;
checking the dimensionality corresponding to the configuration parameters, and selecting configuration meeting conditions in configuration query;
and verifying whether the value of the parameter of the configuration meets the requirement according to the requirement when the rule is set.
Optionally, the querying, according to the filling parameter value rule, the configuration meeting the requirement in the filling rule content specifically includes:
receiving parameters for verifying the rule identification;
according to the rule identification query information, verifying whether the configuration is carried out;
setting corresponding reference identifiers according to multiple dimensions, and storing the reference identifiers;
and D, data which accord with dimensionality when being filled according to the input parameter storage value screening rule.
In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that: the invention discloses a rule configuration method applicable to various scenes, which comprises the following steps: acquiring a plurality of scenes of the online taxi appointment, parameters contained in the scenes and data types of the parameters; determining a setting rule according to parameters contained in the scene and the data types of the parameters; filling values according to different parameters in the setting rule and storing the filling values to obtain a filling parameter value rule; and inquiring the configuration meeting the requirements in the filling rule content according to the filling parameter value rule. The rule configuration of special scenes can be supported, the supported rule parameter types are rich, the configuration of various scenes is met, the rule verification is supported, the setting accuracy is ensured, the operation is simple, the method is suitable for various scenes, and the redevelopment is not needed.
Drawings
FIG. 1 is a flow chart of a rule configuration method applicable to various scenarios according to the present invention;
fig. 2 is a flowchart for determining a setting rule according to a parameter included in the scene and a data type of the parameter in an embodiment of the present invention;
fig. 3 is a flowchart of a rule for filling parameter values according to different parameters in the setting rule and saving the filling values to obtain the filling parameter values in the embodiment of the present invention;
fig. 4 is a flowchart of querying a configuration meeting requirements in the content of the filling rule according to the filling parameter value rule in an embodiment of the present invention.
Detailed Description
The following further describes a specific embodiment of a rule configuration method applicable to various scenarios according to the present invention with reference to fig. 1. The rule configuration method applicable to various scenarios of the present invention is not limited to the description of the following embodiments.
As shown in fig. 1, a rule configuration method applicable to multiple scenarios includes:
step 100: and acquiring various scenes of the networked appointment vehicle, parameters contained in the scenes and data types of the parameters.
Step 200: and determining a setting rule according to the parameters contained in the scene and the data types of the parameters.
Step 300: and filling values according to different parameters in the setting rule and storing to obtain a filling parameter value rule.
Step 400: and inquiring the configuration meeting the requirements in the filling rule content according to the filling parameter value rule.
As shown in fig. 2, determining a setting rule according to a parameter included in a scene and a data type of the parameter specifically includes:
setting corresponding rule names according to various scenes for obtaining corresponding unique rule identifications; adding a rule name, and generating a unique rule identifier: the generation of the rule name and the unique identifier determines a scene for the current rule, namely the scene corresponds to the code, and the settings of different parameters and dimensions in the scene are all related around the code.
Setting parameter names and parameter value types in association according to the unique rule identification, and representing specific affairs and types of corresponding scenes;
setting parameter dimensions according to contents contained in various scenes, and performing customization processing to obtain customized scenes; whether the parameters need to be set in (city, vehicle type, service type) dimension: the parameter dimension (city, vehicle type, service type) is customized for the content that most scenes may contain, so as to achieve the effect of what dimension is needed to take what to use.
And setting a verification rule of the parameters according to the customized scene, wherein the verification rule is used for verifying the mandatory property, the uniqueness and the boundary value of the current parameters. Setting a verification rule of the parameters: the parameter rule is set for verifying the necessity, uniqueness, boundary value and the like of the current parameter.
Storing the setting rule: and after all the settings are finished and stored, the scene can be configured.
As shown in fig. 3, the filling values are stored according to different parameters in the setting rule, and the obtaining the filling parameter value rule specifically includes:
acquiring configuration corresponding to a scene; selecting a rule: there may be multiple configurations for a scene, and one configuration needs to be selected for operation.
Filling the corresponding values of the configuration parameters according to the configuration; filling parameter contents: all parameters and types under the scene are confirmed when the rule is set, and the value corresponding to the configuration parameter needs to be filled in aiming at the configuration of the operation.
Whether dimension (city, service type, vehicle type) is included, the corresponding data is selected: the checking of the parameters corresponding to the dimensions is to select the configuration which meets the conditions (corresponding to cities, service types and vehicle types) when the configuration query is carried out. Checking the dimensionality corresponding to the configuration parameters, and selecting the configuration meeting the conditions during configuration query;
and verifying whether the value of the parameter of the configuration meets the requirement according to the requirement when the rule is set. And (4) verifying the rule: and verifying whether the values of the parameters of the configuration meet requirements (uniqueness, mandatory items and boundary values) according to the requirements when the rules are set. And (4) storing the rule content: and if the current configuration is stored, a configuration for the scene is added or modified.
As shown in fig. 4, the querying the configuration meeting the requirement in the filling rule content according to the filling parameter value rule specifically includes:
receiving parameters for verifying the rule identification;
inquiring information according to the rule identifier, and verifying whether the configuration is carried out;
setting corresponding parameter identification according to multiple dimensions, and storing the parameter identification;
and screening data which accord with dimensionality when being filled according to the input parameter storage value screening rule.
Receiving parameters, verifying rule identification (rule identification must be transmitted): the rule identification is the only standard for confirming the scene and must be transmitted.
The rule identification inquires about the information, verify whether dispose: different entry identifiers are set for different dimensions, and if the entry values are stored, the data which are in line with the dimensions when the rules are filled in are screened according to the entry parameters.
Verify the presence of the query field (rule parameters) and return: and returning according to the result after the screening query.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.