Invention content
In view of this, this application provides a kind of data processing method and device, to reduce for exploitation for certain number
According to the exploitation duration of the software project of process demand, the efficiency of the data processing for certain data processing needs is improved.
To achieve the above object, on the one hand, this application provides a kind of data processing methods, including:
From preset at least one function choosing-item, the objective function option for the execution that is currently triggered is determined, wherein different
Function choosing-item for triggering different types of data processing, and the function choosing-item is to first pass through the configuration interface of application in advance to match
It sets;
User is obtained for the data screening item set by the corresponding pending data object of the objective function option
Part set, the object filtering set of circumstances include at least one data screening condition;
From the sentence create-rule of storage, call and the associated sentence create-rule of the objective function option;
According to the sentence create-rule and at least one data screening condition, generate for database execution
Target executable statement;
The target executable statement is sent to database to execute, with the data pair stored from the database
The target data set for meeting at least one data screening condition is extracted as in.
Preferably, the sentence create-rule includes:Query statement template and template fill rule, the query statement
Template includes at least one screening conditions sentence template, has at least one filler, institute in the screening conditions sentence template
Filler is stated for filling the parameter value in data screening conditions;
It is described according to the sentence create-rule and at least one data screening condition, generation is held for database
Capable target executable statement, including:
According to the template fill rule, the corresponding mesh of data screening condition is determined from the query statement template
Screening conditions sentence template is marked, and the parameter value in data screening condition is filled into the object filtering conditional statement template
Filler in, obtain target executable statement.
Preferably, the corresponding pass between the objective function option and the data object and screening conditions sentence template
System builds in the following way:
Obtain user by configure interface configuration for meeting a kind of objective function option of data processing needs;
User is received by configuring the data object being screened for that interface is the objective function option configuration;
Receive at least one screening dimension screened of the user by the configuration interface for data object configuration;
At least one screening conditions sentence template and template fill rule that user is data object configuration are obtained,
In, each screening conditions sentence template includes the corresponding Filter sentence of at least one screening dimension, and the Filter sentence is set
It is equipped with the filler for filling the corresponding parameter value of the screening dimension;
The data object, screening dimension and screening conditions sentence template are associated with the objective function option and are deposited
Storage.
Preferably, described from preset at least one function choosing-item, determine the objective function choosing for the execution that is currently triggered
, including:
Show function selection interface, the function selection interface includes at least one function choosing-item;
Receive the objective function option that user selects from the function selection interface;
It is described to obtain user for the data sieve set by the corresponding pending data object of the objective function option
Set of circumstances is selected, including:
Show the corresponding at least one screening dimension of the objective function option;
It is the parameter value set by the screening dimension to obtain user, obtains at least one data screening condition, each
Data screening condition includes the corresponding parameter value of at least one screening dimension.
Preferably, it is extracted in the pending object stored from the database and meets at least one number
After the target data set of screening conditions, further include:
Obtain the associated target image ways of presentation of the objective function option;
According to the target image ways of presentation, the target data set is shown.
Another aspect, present invention also provides a kind of data processing equipments, including:
Option trigger element, the target for from preset at least one function choosing-item, determining the execution that is currently triggered
Function choosing-item, wherein different function choosing-items is for triggering different types of data processing, and the function choosing-item is logical in advance
Cross the configuration interface configuration of application;
Condition acquiring unit is directed to the corresponding pending data object institute of the objective function option for obtaining user
The data screening set of circumstances of setting, the object filtering set of circumstances include at least one data screening condition;
Rule invocation unit, for from the sentence create-rule of storage, calling associated with the objective function option
Sentence create-rule;
Sentence generation unit, for according to the sentence create-rule and at least one data screening condition, life
At the target executable statement executed for database;
Data extracting unit is executed for the target executable statement to be sent to database, with from the database
The target data set for meeting at least one data screening condition is extracted in the data object of middle storage.
Preferably, the sentence create-rule of the rule invocation cell call includes:Query statement template and mould
Plate fill rule, the query statement template include at least one screening conditions sentence template, the screening conditions sentence template
In there is at least one filler, the filler to be used to fill parameter value in data screening conditions;
The sentence generation unit, including:
Sentence generates subelement, for according to the template fill rule, this to be determined from the query statement template
The corresponding object filtering conditional statement template of data screening condition, and the parameter value in data screening condition is filled into described
In the filler of object filtering conditional statement template, target executable statement is obtained.
Preferably, further include:
Function choosing-item construction unit, for build in the following way the objective function option and the data object with
And the correspondence between screening conditions sentence template:
Obtain user by configure interface configuration meet a kind of objective function option of data processing needs;
User is received by configuring the data object being screened for that interface is the objective function option configuration;
Receive at least one screening dimension screened of the user by the configuration interface for data object configuration;
The template fill rule and at least one screening conditions sentence template that user is data object configuration are obtained,
Wherein, each screening conditions sentence template includes the corresponding Filter sentence of at least one screening dimension, and the Filter sentence
It is provided with the filler for filling the corresponding parameter value of the screening dimension;
The data object, screening dimension and screening conditions sentence template are associated with the objective function option and are deposited
Storage.
Preferably, the option trigger element, including:
Displaying interface subelement, for showing function selection interface, the function selection interface includes at least one function
Option;
Option selects subelement, the objective function option selected from the function selection interface for receiving user;
The condition acquiring unit, including:
Dimension shows subelement, for showing the corresponding at least one screening dimension of the objective function option;
Condition obtains subelement, is the parameter value set by the screening dimension for obtaining user, obtains at least one
A data screening conditions, each data screening condition include the corresponding parameter value of at least one screening dimension.
Preferably, further include:
Show form acquiring unit, meets at least one data screening for being extracted in the data extracting unit
After the target data set of condition, the associated target image ways of presentation of the objective function option is obtained;
Data exhibiting unit, for according to the target image ways of presentation, showing the target data set.
In this application, it can be selected by the function for the configuration interface configuration triggering different types of data processing that application provides
, in this way, the work(for completing different data processing can be configured by the configuration interface according to the different demands of data processing
Energy option, moreover, after the function choosing-item of configuration is triggered, computer equipment can obtain user and be directed to the objective function option
At least one data screening condition set by corresponding pending data object, in this way, according to the data screening condition, with
And with the associated sentence create-rule of objective function option, the target executed for database can be generated in real time and can perform language
Sentence can extract required target data set to execute the target executable statement by database.As it can be seen that passing through
The scheme of the application may be implemented to increase the function choosing-item for realizing certain data processing needs newly in original software project, and
The target executable statement for completing the data processing needs is automatically generated, so as to avoid in newly-increased data processing needs, is weighed
A set of software project newly developed, so be conducive to quickly, easily meet the newly-increased data processing needs.
Specific implementation mode
The data processing method of the application can be adapted for into the software program for realizing certain data processing needs
Newly-increased data processing needs, under the premise of not developing software program again, to increase at the data that software program is met by
The type of reason demand.
Such as, for realizing certain software program audited, if it is desired to newly-increased audited metrics, and be not intended to wait for longer
Development cycle, the then scheme that the application may be used realize the function choosing-item increased into software program for the audited metrics,
To be realized for the corresponding data query of newly-increased audited metrics based on the newly-increased function choosing-item.
It is introduced below in conjunction with the accompanying drawings.
Referring to Fig. 1, it illustrates a kind of flow diagram of data processing method one embodiment of the application, the present embodiment
Method be applied to have the computer equipment of data processing function, this method may include:
S101 determines the objective function option for the execution that is currently triggered from preset at least one function choosing-item.
Wherein, preset function choosing-item is function choosing-item preset in application, which can be understood as having at data
The software project of reason ability.
Wherein, different function choosing-items is for triggering different types of data processing.And due to needed for different data processing
The data object of processing is possible to different, and therefore, each function choosing-item is each corresponding to pending data object.Wherein, should
Data object can be tables of data, data file etc..
Wherein, which is to first pass through the configuration interface of application in advance to configure.
In the embodiment of the present application, in the function of the software program (i.e. above-mentioned application) for realizing data processing
In selection interface, function choosing-item has been increased newly, according to user to the different demands of data processing, preset can have been realized not for triggering
The function choosing-item of same type data processing.Wherein, each function choosing-item is associated with the data characterized for realizing the function choosing-item
The data processing rule of processing function, the data processing rule can pass through program setting.
Optionally, the objective function option that user selects from the selection interface can be received, it is determined that go out and currently wait for
Be triggered the objective function option of execution.
In a kind of possible realization method, in practical applications, it is contemplated that the number handled needed for different data process demand
It will be different according to object, therefore, may include in each associated data processing rule of function choosing-item:Data object positioning strip
Part, the data object location condition are used to determine the data object handled needed for the data processing needs of function choosing-item characterization.
Such as, data object location condition can set at least one database table of the associated available processing of the function choosing-item.Example
Such as, it is assumed that function choosing-item characterization can be at least one be related to for statistics of getting a profit, the then associated database table of the function choosing-item
The database table for data of getting a profit.
S102 obtains data screening condition set of the user for the data object setting corresponding to the objective function option
It closes.
Wherein, the data screening set of circumstances includes at least one data screening condition.
Wherein, data screening condition meets item for being filtered out from the data object corresponding to the objective function option
The target data set of part.That is, the data screening condition for being directed to the objective function option is actually to complete this
The corresponding data processing needs of objective function option, and need to the data in the corresponding data object of the data processing needs
Screening conditions.
Wherein, when object filtering condition includes multiple data screening conditions, multiple data screening condition can be from difference
Screening conditions of the dimension to the data object.For example, data screening condition can be for time, geographic area and different words
The screening conditions of multiple dimensions such as section.
For example, still by taking profit counts this function choosing-item as an example, when carrying out profit statistics, user can be according to need
Which select that region or the profit situation in the time counted, it is assumed that user needs to count profit of the North China in 2017
Situation, then user can input screening conditions and be:Area is North China;Time is 2017.
It is understood that by data processing that each function choosing-item is triggered be it is fixed, each function choosing
The dimension for the data screening condition that item may relate to is also fixed, in this way, can be in the target for determining user's selection
After function choosing-item, the corresponding multiple parameters of screening conditions shown for each dimension of the objective function option take
Value.
For example, still by taking screening conditions above-mentioned include time and regional two dimensions as an example, when the triggering target work(
After energy option, time parameter selection frame corresponding with regional two dimensions can be shown, wherein the parameter selection frame of time
In can have multiple alternative time values;Correspondingly, can also have in the parameter selection frame in area multiple available
Regional value.In this way, user can distinguish the sieve of access time and the two regional dimensions directly in parameter selection frame
Select the parameter value of condition.
S103 is called and the associated sentence create-rule of the objective function option from the data processing rule of storage.
Wherein, the create-rule of the executable action statement of database is generated defined in sentence create-rule.Such as, the language
According to data screening condition, generating structure query language (Structured Query defined in sentence create-rule
Language, SQL) sentence create-rule.
S104, according at least one data screening condition that the sentence create-rule and object filtering condition include,
Generate target executable statement.
Wherein, which is the query sentence of database for including at least one data screening condition.Phase
It answers, database meets the number of at least one data screening condition by executing the target executable statement and can inquire
According to.
It is understood that the sentence that sentence create-rule can be directed to a variety of disparate databases operating languages generates rule
Then, there are many type of the database manipulation language corresponding to corresponding target executable statement can also be understood.Such as, while statement is given birth to
When making a living into the rule of SQL statement at rule, then the target executable statement generated is the SQL statement for operating database.
In one possible implementation, may include in sentence create-rule:Query statement template and template are filled out
Fill rule, wherein the query statement template includes at least one screening conditions sentence template, each screening conditions sentence template
In there is at least one filler, the parameter that the filler in screening conditions sentence template is used to fill data screening conditions takes
Value.Correspondingly, the template fill rule defines the fill rule according to data screening condition filling screening conditions sentence template,
In this way, according to template fill rule, the corresponding object filtering of data screening condition can be determined from query statement template
Conditional statement template, and the parameter value in data screening condition is filled into the filling of the object filtering conditional statement template
In.
Specifically, the template fill rule defines data screening condition and the screening conditions sentence in query statement template
Between filler in correspondence and data screening condition between template in parameter value and screening conditions sentence template
Incidence relation.Wherein, the correspondence between data screening condition and screening conditions sentence template is:Data screening condition institute
Include the filler at least one dimension screened needed for the data screening condition in corresponding screening conditions sentence template,
In, dimension is known as screening dimension in the embodiment of the present application.In this way, it is directed to each data screening condition, it can be according to the mould
Correspondence in plate fill rule between data screening condition and screening conditions sentence template is determined from query statement template
Go out the corresponding object filtering conditional statement of the data screening condition, then, according to parameter value in data screening condition and screening
Parameter value in data screening condition is filled into target sieve by the incidence relation between filler in conditional statement template
It selects in the filler of conditional statement.
Particularly, in query statement template, it is preset special that the filler in each screening conditions sentence could be provided as
Placeholder, in this way, after determining the parameter value of the corresponding data screening condition of the screening conditions sentence, it can be by the ginseng
Number value replaces the placeholder of the screening conditions sentence, is filled in complete sentence.
For example, to arrive the screening conditions sentence for the two dimensions of time and unit involved in query statement template
For template, it is assumed that screening conditions sentence template is " select*fromtmp where orgNO=@unit@anddatetime
=@time@".Wherein, " orgNO=units " indicates the screening conditions of the data screening condition of corresponding " unit " this dimension
Sentence, wherein the placeholder of the corresponding specific value of "@units@" representative " unit ", it is assumed that get in data screening condition and wrap
The screening for the two conditions of time and unit is included, then illustrates that the data inquired corresponding to the data screening condition need to utilize
The screening conditions sentence template.Correspondingly, assuming that data screening condition is to choose the first son public affairs that the value of unit is company A
Department, then can replace with placeholder "@units@" in " orgNO=@units@" " the first subsidiary of company A ".
The target executable statement is sent to database and executed by S105, with stored from database this is pending right
The target data set for meeting at least one data screening condition is extracted as in.
Such as, when which is SQL statement, then can SQL statement be executed by database, to inquire this
Target data set.
S106 shows the target data set according to the associated target image ways of presentation of objective function option.
Such as, the associated picture showing mode of the objective function option is obtained, and shows the picture showing mode and exports the mesh
Mark data acquisition system.
Wherein, which can be set as needed, which can be column
Figure can also be the picture showing mode of other forms.
It is understood that in practical applications, after getting the target data set, can also directly export the mesh
Mark data acquisition system, you can not execute step S106.
As it can be seen that in the embodiment of the present application, different types of data can be triggered by the configuration interface configuration that application provides
The function choosing-item of processing, in this way, can be configured by the configuration interface according to the different demands of data processing and complete difference
The function choosing-item of data processing, to realize the corresponding function choosing-item of Configuration Online different data demand.Moreover, in configuration
After function choosing-item is triggered, computer equipment can obtain user and be directed to the corresponding pending data pair of the objective function option
As set at least one data screening condition, in this way, being associated with according to the data screening condition, and with objective function option
Sentence create-rule, the target executable statement executed for database can be generated in real time, to being held by database
The row target executable statement can extract required target data set.As it can be seen that by the scheme of the application, Ke Yishi
The function choosing-item for realizing certain data processing needs is increased newly in present original software project, and is automatically generated and completed at the data
The target executable statement of reason demand develops a set of software project again so as to avoid in newly-increased data processing needs, into
And be conducive to quickly, easily meet the newly-increased data processing needs, meet requirement of the client for timeliness.
It is understood that in order to make the application in computer equipment have at least one function choosing-item,
In practical application, it is also necessary to be application configuration function choosing-item in advance, wherein the application can be understood as a having data processing
The software project of function.
In order to make it easy to understand, the process of configuration feature option in the embodiment of the present application is introduced below, referring to Fig. 2,
It illustrates a kind of implementation process schematic diagram of configuration feature option in the embodiment of the present application, which may include:
S201 obtains user and is used to meet a kind of function choosing of data processing needs by what the configuration interface of application configured
.
Such as, developer can be provided according to user for the demand of data processing to the corresponding application of software project
Interface in configuration meet the function choosing-items of the data processing needs, to realized on software project it is online increase it is new for meeting
The function choosing-item of the data processing needs of increasing.
Wherein, configuration interface is the interface for increasing or changing data relevant configuration newly using the receivable user provided.
It is understood that when data processing needs difference, the function choosing-item of generation also can be different.
S202 receives user by configuring the data object being screened for that interface is function choosing-item configuration.
As before, which can be data file or tables of data etc..
It is understood that the data object involved by different data process demand would also vary from, therefore, it is necessary to
Configure the associated data object of the function choosing-item, subsequent user trigger the data screening operation that the function choosing-item is carried out all be
The operation carried out in the data object.
S203 receives user and is tieed up by least one screening screened that the configuration interface is data object configuration
Degree.
It is understood that when being screened to the data in tables of data or data file, it can be from different dimensions
Degree is screened, and the dimension is known as screening dimension by the application, e.g., the unit belonging to generated time of tables of data, tables of data,
Each field can be used as screening dimension in tables of data.
For example, when needing from 1 and 2017 year the two dimensions progress data screening in area, then it includes area to screen dimension
With the time the two.For another example, when need from involved in tables of data to the length of service and name the two fields carry out data screening when,
It includes the length of service and name the two screening dimensions then to screen dimension.
Wherein, the effect one for configuring at least one screening dimension is to generate screening item according to screening dimension in order to follow-up
Part sentence template, and another main effect is:It, can be with after user selects the corresponding data processing function of the configuration item
The screening dimension for showing the optional screening involved by the function choosing-item, in order to which data are arranged according to screening dimension in user
Screening conditions.
Correspondingly, obtaining user for the data sieve set by the corresponding pending data object of objective function option
When selecting set of circumstances, it is specifically as follows:The corresponding at least one screening dimension of the objective function option is shown, e.g., in the work(
The upper layer of energy selection interface shows a window, and at least one screening dimension can be showed in the window, wherein each
Screening dimension corresponds to the parameter value of plurality of optional.Correspondingly, user can be arranged as required to one or more screening dimensions
The corresponding parameter value of degree, and it is the parameter value screened set by dimension to get user, actually just obtains at least one
A data screening conditions, each data screening condition include the corresponding parameter value of at least one screening dimension.
Optionally, the application can include the ginseng of all screening dimensions set by user by a data screening conditions
Number value.
S204 obtains template fill rule and at least one screening conditions sentence mould that user is data object configuration
Plate.
Wherein, each screening conditions sentence template includes the corresponding Filter sentence of at least one screening dimension, and is screened
Sentence is provided with the filler for filling the corresponding parameter value of screening dimension.
The concrete form of the screening conditions sentence template may refer to the related introduction of preceding embodiment, no longer superfluous herein
It states.
Wherein, template fill rule defines, the parameter corresponding to some screening dimension that data screening condition includes
Value needs to be filled into the filler in screening conditions sentence template corresponding to the screening dimension.
It is understood that the template fill rule and at least one screening conditions sentence template may be constructed the function
The corresponding sentence create-rule of option.
The data object, screening dimension and screening conditions sentence template and the function choosing-item are associated and are deposited by S205
Storage.
Data object, at least one screening dimension and at least one screening conditions sentence template are associated with function choosing-item
After storage, when the subsequent triggers function choosing-item, the corresponding data object of the function choosing-item, screening dimension can be determined successively
And screening conditions sentence template, to generate corresponding target executable statement and to execute data query.
A kind of data processing method of corresponding the application, present invention also provides a kind of data processing equipments.Such as, referring to figure
3, it illustrates a kind of composed structure schematic diagram of data processing equipment one embodiment of the application, the device of the present embodiment can be with
Including:
Option trigger element 301, the mesh for from preset at least one function choosing-item, determining the execution that is currently triggered
Mark function choosing-item, wherein different function choosing-items is for triggering different types of data processing, and the function choosing-item is advance
It is configured by the configuration interface of application;
Condition acquiring unit 302 is directed to the corresponding pending data pair of the objective function option for obtaining user
As set data screening set of circumstances, the object filtering set of circumstances includes at least one data screening condition;
Rule invocation unit 303, for from the sentence create-rule of storage, calling to be associated with the objective function option
Sentence create-rule;
Sentence generation unit 304 is used for according to the sentence create-rule and at least one data screening condition,
Generate the target executable statement executed for database;
Data extracting unit 305 is executed for the target executable statement to be sent to database, with from the data
The target data set for meeting at least one data screening condition is extracted in the data object stored in library.
In one implementation, the sentence create-rule of the rule invocation cell call includes:Query statement
Template and template fill rule, the query statement template include at least one screening conditions sentence template, the screening item
There is at least one filler, the filler to be used to fill the parameter value in data screening conditions in part sentence template;
The sentence generation unit, including:
Sentence generates subelement, for according to the template fill rule, this to be determined from the query statement template
The corresponding object filtering conditional statement template of data screening condition, and the parameter value in data screening condition is filled into described
In the filler of object filtering conditional statement template, target executable statement is obtained.
In one possible implementation, described device further includes:
Function choosing-item construction unit, for build in the following way the objective function option and the data object with
And the correspondence between screening conditions sentence template:
Obtain user by configure interface configuration meet a kind of objective function option of data processing needs;
User is received by configuring the data object being screened for that interface is the objective function option configuration;
Receive at least one screening dimension screened of the user by the configuration interface for data object configuration;
The template fill rule and at least one screening conditions sentence template that user is data object configuration are obtained,
Wherein, each screening conditions sentence template includes the corresponding Filter sentence of at least one screening dimension, and the Filter sentence
It is provided with the filler for filling the corresponding parameter value of the screening dimension;
The data object, screening dimension and screening conditions sentence template and the function choosing-item are associated storage.
In one implementation, the option trigger element, including:
Displaying interface subelement, for showing function selection interface, the function selection interface includes at least one function
Option;
Option selects subelement, the objective function option selected from the function selection interface for receiving user;
The condition acquiring unit, including:
Dimension shows subelement, for showing the corresponding at least one screening dimension of the objective function option;
Condition obtains subelement, is the parameter value set by the screening dimension for obtaining user, obtains at least one
A data screening conditions, each data screening condition include the corresponding parameter value of at least one screening dimension.
Optionally, in the embodiment of one device of any of the above, which can also include:
Show form acquiring unit, meets at least one data screening for being extracted in the data extracting unit
After the target data set of condition, the associated target image ways of presentation of the objective function option is obtained;
Data exhibiting unit, for according to the target image ways of presentation, showing the target data set.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight
Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other.
For device class embodiment, since it is basically similar to the method embodiment, so fairly simple, the related place ginseng of description
See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that
A little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or equipment including element.
The foregoing description of the disclosed embodiments enables those skilled in the art to realize or use the present invention.To this
A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can
Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited
It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest
Range.
It the above is only the preferred embodiment of the present invention, it is noted that those skilled in the art are come
It says, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should be regarded as
Protection scope of the present invention.