CN109871214A - Program code generation method, device, computer equipment and storage medium - Google Patents
Program code generation method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109871214A CN109871214A CN201910083568.7A CN201910083568A CN109871214A CN 109871214 A CN109871214 A CN 109871214A CN 201910083568 A CN201910083568 A CN 201910083568A CN 109871214 A CN109871214 A CN 109871214A
- Authority
- CN
- China
- Prior art keywords
- target
- item
- target data
- data item
- chosen
- 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.)
- Granted
Links
Abstract
This application involves a kind of program code generation method, device, computer equipment and storage mediums.The described method includes: obtaining the target data item chosen from collection of data items, target computational item is generated according to target data item, wherein the corresponding identifier of each target computational item;Obtain and identify the expression formula formula of input, wherein expression formula formula includes the corresponding identifier of each target computational item;Identifier in expression formula formula is replaced with into corresponding target computational item, program code is generated according to replaced expression formula formula.Above procedure code generating method, device, computer equipment and storage medium can be improved the accuracy of the program code of generation.
Description
Technical field
This application involves field of computer technology, set more particularly to a kind of program code generation method, device, computer
Standby and storage medium.
Background technique
With the development of computer technology, there are various programming languages, more and more people become programmer, from
The related work of thing editor's application program.Traditional application program edit methods, are all that programmer inputs code one by one, thus
Generate the program code of application program.
However, when code or programmed statements are very more and extremely complex, using traditional program code generation side
Method, the process error-prone of editor, has that accuracy is lower.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of program code generation side that can be improved accuracy
Method, device, computer equipment and storage medium.
A kind of program code generation method, which comprises
The target data item chosen from collection of data items is obtained, target computational item is generated according to the target data item,
Wherein, the corresponding identifier of each described target computational item;
Obtain and identify the expression formula formula of input, wherein the expression formula formula includes each target computational item
Corresponding identifier;
Identifier in the expression formula formula is replaced with into corresponding target computational item, it is public according to replaced expression formula
Formula generates program code.
It is described in one of the embodiments, to obtain the target data item chosen from collection of data items, according to the mesh
It marks data item and generates target computational item, comprising:
The target data item chosen from collection of data items is obtained, is obtained from the corresponding intermediate filtered of the target data item
The goal filtering label chosen in tag set, and obtain the objective function chosen from function set, wherein the number of targets
According to item for obtaining target data from database, the goal filtering label is for screening the target data, mesh
Scalar functions are for calculating the target data after the goal filtering label filtration;
Target computational item is generated according to the target data item, goal filtering label and objective function.
The acquisition is selected from the corresponding intermediate filtered tag set of the target data item in one of the embodiments,
In goal filtering label, comprising:
Obtain the target labels name chosen from the corresponding intermediate label name set of the target data item;
Obtain the target labels value chosen from the corresponding intermediate label value set of the target labels name, and from matching symbol
The object matching symbol chosen is obtained in set;
It is accorded with according to the target labels name, target labels value and object matching and generates goal filtering label.
The acquisition is after the objective function chosen in function set in one of the embodiments, further includes:
When the objective function belongs to the function of time, the time parameter inputted according to the objective function is obtained;
It is described that target computational item is generated according to the target data item, goal filtering label and objective function, comprising:
According to the target data item, goal filtering label, objective function and the corresponding time parameter of the objective function
Generate target computational item.
In one of the embodiments, it is described according to the target data item, goal filtering label, object time function and
The corresponding time parameter of the object time function generates target computational item, comprising:
It is corresponding according to the target data item, goal filtering label, object time function and the object time function
Time parameter generates aiming symbol;
It is put in order according to preset, by the target data item, goal filtering label, object time function, the mesh
It marks the corresponding time parameter of the function of time and the aiming symbol generates target computational item.
In one of the embodiments, after the expression formula formula for obtaining and identifying input, further includes:
When expression formula formula identifier match corresponding with each target computational item, execute the expression
Identifier in formula formula replaces with corresponding target computational item, generates program code step according to replaced expression formula formula
Suddenly;
When expression formula formula identifier corresponding with each target computational item mismatches, prompt letter is generated
Breath.
It is described in one of the embodiments, to obtain the target data item chosen from collection of data items, according to the mesh
It marks data item and generates target computational item, comprising:
When detecting to when choosing instruction of collection of data items shown in the corresponding combobox of the first input frame, institute is obtained
The target data item for choosing instruction to choose from the collection of data items is stated, and the target data item is shown described first
In input frame, target computational item is generated according to the target data item;
The method also includes:
When detect show the target data item in first input frame when, the mesh is shown in the second input frame
Mark computational item.
A kind of program code generating means, described device include:
Target computational item generation module, for obtaining the target data item chosen from collection of data items, according to the mesh
It marks data item and generates target computational item, wherein the corresponding identifier of each described target computational item;
Expression formula formulas solutions module, for obtaining and identifying the expression formula formula of input, wherein the expression formula formula
Including the corresponding identifier of each target computational item;
Program code generation module is calculated for the identifier in the expression formula formula to be replaced with corresponding target
, program code is generated according to replaced expression formula formula.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing
The step of device realizes above procedure code generating method when executing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
The step of above procedure code generating method is realized when row.
Above procedure code generating method, device, computer equipment and storage medium are chosen in advance from collection of data items
The target computational item editted, it is not easy to make mistakes, and input the expression formula formula including identifier, that is, the program generation produced
Code, the expression formula formula of input is generated by simple identifier, also not easy to make mistakes, improves the accuracy for generating program code.
Detailed description of the invention
Fig. 1 is the applied environment figure of program code generating method in one embodiment;
Fig. 2 is the flow diagram of program code generating method in one embodiment;
Fig. 3 is the flow diagram of program code building step in another embodiment;
Fig. 4 is the flow diagram of program code building step in another embodiment;
Fig. 5 is the schematic diagram of the edit page of program code generating method in one embodiment;
Fig. 6 is the structural block diagram of program code generating unit in one embodiment;
Fig. 7 is the structural block diagram of program code generating unit in another embodiment;
Fig. 8 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
Program code generation method provided by the embodiments of the present application, can be applied in application environment as shown in Figure 1.Its
In, terminal 102 is communicated by network with server 104.Terminal 102 obtains the data of storage in the server by network
Item set, obtains the target data item chosen from collection of data items, generates target computational item according to target data item, wherein
Each target data item corresponds to an identifier;Obtain and identify the expression formula formula of input, wherein expression formula formula includes
The corresponding identifier of each target computational item;Identifier in expression formula formula is replaced with into corresponding target computational item, according to
Replaced expression formula formula generates program code.Wherein, terminal 102 can be, but not limited to be various personal computers, notes
This computer, smart phone, tablet computer and portable wearable device, server 104 can be with independent servers either
The server cluster of multiple servers composition is realized.
In one embodiment, as shown in Fig. 2, providing a kind of program code generation method, comprising the following steps:
Step 202, the target data item chosen from collection of data items is obtained, target is generated according to target data item and is calculated
, wherein the corresponding identifier of each target computational item.
Data item refers to the metadata for indicating a kind of data, such as " http_requests_total ", " net_
Conntrack_dialer_conn_established_total " etc..Collection of data items is referred to comprising at least one data item
Set, target data item refers to the data item chosen from collection of data items.Each identifier should for unique identification
The corresponding target computational item of identifier.
It is obtaining before the target data item chosen in collection of data items, is presetting target data item and generate target meter
Calculate the algorithm of item.When obtaining the target data item chosen from collection of data items, mesh can be generated according to the target data item
Target data item is generated target computational item by the algorithm for marking computational item.In a target computational item, it may include multiple targets
Data item, the corresponding one group of target data of a target data item.
It is understood that program code is often very more and complicated, many target computational items are needed.Therefore, it uses
Family can click " newly-increased computational item " button on edit page, by obtaining the target data chosen from collection of data items
, to generate newly-increased target computational item according to target data item.For it is some application or the higher sentence of frequency of use,
It is chosen by clicking, efficiency can be improved.
Step 204, obtain and identify the expression formula formula of input, wherein expression formula formula includes each target computational item
Corresponding identifier.
Expression formula formula refer to include the corresponding identifier of each target computational item formula.It obtains and identifies that user is defeated
The expression formula formula entered can identify each identifier in expression formula formula.
Step 206, the identifier in expression formula formula is replaced with into corresponding target computational item, according to replaced expression
Formula formula generates program code.
After identifying each identifier in expression formula formula, when detecting that program code generates instruction, by each
The corresponding target computational item of identifier replaces the identifier, available program code.Refer to when detecting that expression formula formula is deleted
When enabling, which is deleted.
When program code is less, " being manually entered " button can be clicked, user can directly input input program code.
Above procedure code generating method can be applied to PromQL language, generate PromQL program code.
In the present embodiment, the target computational item editted in advance is chosen from collection of data items, it is not easy to make mistakes and defeated
Enter the expression formula formula including identifier, i.e. producible program code, the expression formula formula of input is given birth to by simple identifier
At, it is also not easy to make mistakes, improve the accuracy for generating program code.
In one embodiment, the target data item chosen from collection of data items is obtained, is generated according to target data item
Target computational item, comprising: obtain the target data item chosen from collection of data items, obtain from the corresponding centre of target data item
The goal filtering label chosen in filter label set, and obtain the objective function chosen from function set, wherein number of targets
According to item for obtaining target data from database, goal filtering label for screening to target data, use by objective function
It is calculated in the target data after goal filtering label filtration;According to target data item, goal filtering label and target letter
Number generates target computational item.
Filter label refers to the label for being screened to data, for example, filter label can be job="
Apiserver ", method!=" GET " etc..Intermediate filtered tag set is referred to comprising at least one intermediate filtered label
Set, goal filtering label refer to the intermediate filtered label chosen from intermediate filter label set.
Function set refers to the set comprising at least one function.What objective function referred to choosing from function set
Function.Objective function may include that target calculates function and target polymerization function.Target calculates function and refers to one group of target
The function that data are calculated, such as can be and be rounded, calculate the function of absolute value.Target polymerization function is referred to multiple groups
The function that target data is calculated, such as sum to multiple groups target data, maximizing or minimum value include polymerization meaning
Function.
The corresponding relationship of each data item Yu filter label set is pre-established, and then establishes data item and corresponding mistake
Filter the corresponding relationship of each of tag set filter label.Target is chosen from least one data item of collection of data items
What data item, the corresponding intermediate filtered tag set of acquisition target data item, and acquisition were chosen from intermediate filter label set
Goal filtering label.The objective function obtained from function set is obtained, may include that target calculates function and target polymerization letter
Number.Target computational item is generated according to target data item, goal filtering label and objective function.
When target computational item is more complex, after the completion of to target computational item editor, " the folding on edit page can be clicked
It is folded " button, target computational item is folded up, the editor space of edit page is increased.Correspondingly, when needing to folding up
The expansion of target computational item, can click " expansion " button on edit page.It, can when needing to be deleted target computational item
With click " deletion " button.
In the present embodiment, the target data item chosen from collection of data items is obtained, is obtained corresponding from target data item
Intermediate filtered tag set in the goal filtering label chosen, and obtain the objective function chosen from function set, according to
Target data item, goal filtering label and the objective function chosen generate target computational item, for some more complex target meters
Item is calculated, user only needs to carry out selection operation and produces target computational item, improves the accuracy for generating target computational item.
In one embodiment, the goal filtering chosen from the corresponding intermediate filtered tag set of target data item is obtained
Label, comprising:
Step 302, the target labels name chosen from the corresponding intermediate label name set of target data item is obtained.
Tag name refers to the title of filter label, such as " job ", " method ".Pre-establish each data item with
The corresponding relationship of corresponding tag name set.Target data item is chosen from least one data item of collection of data items, is obtained
The corresponding intermediate label name set of target data item, and obtain the target labels name chosen from intermediate tag name set.
Step 304, obtain the target labels value chosen from the corresponding intermediate label value set of target labels name, and from
It is accorded with the object matching chosen is obtained in symbol set.
It include tag name, label value and matching symbol in filter label.Target labels value refer to goal filtering label into
The particular content of row screening, such as " apiserver ", " GET ".Object matching symbol refers to target labels name and target labels value
Matching relationship, such as "=", "!=" etc..
Correspondingly, the corresponding relationship of each tag name with corresponding intermediate label value set is pre-established.It is marked from centre
Target labels name is chosen at least one tag name of signature set, obtains the corresponding intermediate label value set of target labels name,
And obtain the target labels value chosen from intermediate label value set.
Step 306, it is accorded with according to target labels name, target labels value and object matching and generates goal filtering label.
In the present embodiment, the target labels name chosen from the corresponding intermediate label name set of target data item is obtained,
The target labels value chosen from the corresponding intermediate label value set of target labels name is obtained, and obtains choosing from matching symbol set
In object matching symbol, according to target labels name, target labels value and object matching accord with generate goal filtering label.Target labels
Name it is corresponding with target data item, target labels value is corresponding with the target labels name, and target labels name, target labels value and
Object matching symbol is selection operation, and the accuracy of the goal filtering label of generation can be improved.
In one embodiment, it obtains after the objective function chosen in function set, further includes: when objective function category
When the function of time, the time parameter inputted according to objective function is obtained.According to target data item, goal filtering label and target
Function generates target computational item, comprising: corresponding according to target data item, goal filtering label, objective function and objective function
Time parameter generates target computational item.
It is understood that the function of time is the function with time correlation when objective function belongs to the function of time, such as increase
Long rate function.The time parameter inputted according to the function of time is obtained, according to target data item, goal filtering label, objective function
Time parameter corresponding with objective function generates target computational item.
In the present embodiment, when objective function belongs to the function of time, acquisition time parameter, and according to target data item,
Goal filtering label, objective function and the corresponding time parameter of objective function generate target computational item, improve target computational item
Accuracy.
In one embodiment, according to target data item, goal filtering label, object time function and object time function
Corresponding time parameter generates target computational item, comprising: according to target data item, goal filtering label, object time function and
The corresponding time parameter of object time function generates aiming symbol;It is put in order according to preset, by target data item, target mistake
It filters label, object time function, the corresponding time parameter of object time function and aiming symbol and generates target computational item.
It is understood that being easy when target computational item content is extremely complex by the target data in target computational item
Item, goal filtering label, object time function and the corresponding time parameter of object time function mix as an entirety, and terminal can not
Detect specific target data item, goal filtering label, object time function and the corresponding time parameter of object time function,
There is a problem of that accuracy is lower.
It therefore, can be corresponding according to target data item, goal filtering label, object time function and object time function
Time parameter generate aiming symbol, aiming symbol can be branch ";", double quotation marks " 〝 〞 ", braces " { } ", round bracket " () "
Deng without being limited thereto.
For example, [] indicates the aiming symbol of object time parameter, { } indicates the aiming symbol of goal filtering label, () table
Show the aiming symbol of target data item.Therefore, the target computational item format of generation are as follows: object time function (target data item { mesh
Mark filter label 1, goal filtering label 2 } [object time parameter]).
It is understood that in more complicated program code editing process, using above procedure code generating method,
It only needs to select sentence by the sentence needed for clicking, final program code, use process ease for use can be obtained
It is higher, and the time is saved, improve efficiency.
It can detecte out corresponding target data item, goal filtering label, object time function and mesh according to aiming symbol
It marks the corresponding time parameter of the function of time and generates aiming symbol, improve the accuracy for generating target computational item.
In one embodiment, after the expression formula formula for obtaining and identifying input, further includes: when expression formula formula and respectively
When the corresponding identifier match of a target computational item, executes and the identifier in expression formula formula is replaced with into corresponding target calculate
, program code steps are generated according to replaced expression formula formula;When expression formula formula is corresponding with each target computational item
When identifier mismatches, prompt information is generated.
After obtaining and identifying the expression formula formula of input, when the expression formula formula and target computational item pair of identification input
When the identifier match answered, then executes and the identifier in expression formula formula is replaced with into corresponding target computational item, according to replacement
Expression formula formula afterwards generates program code steps.When expression formula formula identifier corresponding with each target computational item mismatches
When, if expression formula formula is " a+2b*3c ", but the corresponding identifier of target computational item only has a and b, then expression formula formula with
The corresponding identifier of each target computational item mismatches, and generates prompt information so that user input correct expression formula formula or
Person inputs correct target computational item, improves the accuracy of the program code of generation.
In one embodiment, the target data item chosen from collection of data items is obtained, is generated according to target data item
Target computational item, comprising:
Step 402, instruction is chosen to collection of data items shown in the corresponding combobox of the first input frame when detecting
When, the target data item for choosing instruction to choose from collection of data items is obtained, and target data item is shown in the first input frame
In, target computational item is generated according to target data item.
In the corresponding combobox of the first input frame, each of display data item set data item, when detecting pair
When choosing instruction of collection of data items in combobox will choose the corresponding data item of instruction as target data item, and by mesh
It marks data item to show in the first input frame, target computational item is generated according to target data item.
Further, when detecting the choosing to intermediate filtered tag set shown in the corresponding combobox of third input frame
It when middle instruction, obtains and chooses the goal filtering label chosen from intermediate filter label set of instruction, and by goal filtering label
It shows in third input frame.
When detecting that, to when choosing instruction of function set shown in the corresponding combobox of the 4th input frame, acquisition is chosen
The objective function chosen from function set is instructed, and objective function is shown in the 4th input frame.
Target computational item is generated according to target data item, goal filtering label and objective function.
Above procedure code generating method further include:
Step 404, when detecting displaying target data item in the first input frame, target meter is shown in the second input frame
Calculate item.
Further, target data item is shown in the first input frame when detecting, target mistake shown in third input frame
Label is filtered, in the 4th input frame when at least one in objective function, is shown in the second input frame and calculates the target of generation
?.
In the present embodiment, finger is chosen by collection of data items shown in the corresponding combobox of the first input frame of detection
When enabling, the target data item chosen is shown in the first input frame and generates target computational item, when detecting the first input frame
It is middle to prick that when being target data item, target computational item is shown in the second input frame, it can be in real-time exhibition target computational item
Hold.
It during above procedure Code Edit, can be operated on an electronic device by network, not need to build
Editing environment has saved resource.
It should be understood that although each step in the flow chart of Fig. 2-4 is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-4
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively
It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately
It executes.
PromQL is Prometheus (the primary monitoring system of cloud of new generation) customized a set of powerful data query
Language such as can very easily be inquired data, filtered, polymerize and be calculated at the operation.
The editor of traditional PromQL program code is concentrated mainly on uniline, simply direct manual editing's input mode.
In face of editor's complexity, the PromQL program code of various dimensions label, a variety of polymerization methods, manual editing's input mode just compares
" awkward " tends to the difficulty that malfunctions and debug, and is difficult test these complicated PromQL program codes
Card.
In one embodiment, above procedure code generating method can be applied to PromQL program code editing process
In.For example, PromQL program code: sum (rate (net__conntrack_dialer_conn_established_total
{ dialer_name=〝 alertmanager 〞, dialer_name!=〝 alertmanager 〞 } [3m]))+100*http_
request_duration_microseconds。
In the PromQL program code, by sum (rate (net__conntrack_dialer_conn_
Established_total { dialer_name=〝 alertmanager 〞, dialer_name!=〝 alertmanager 〞 }
[3m])) it is used as target computational item an a, http_request_duration_microseconds as another target
Computational item b.
In target computational item a, using sum as target polymerization function, rate calculates function, net__ as target
Conntrack_dialer_conn_established_total is as target data item, dialer_name=〝
Alertmanager 〞 is as goal filtering label, dialer_name!=〝 alertmanager 〞 is as another goal filtering
Label, 3m are object time parameter.Wherein, dialer_name is target labels name ,=and!=accorded with for object matching, 〝
Alertmanager 〞 is target labels value.
In target computational item b, http_request_duration_microseconds is as target data item.
By choosing above-mentioned target data item, target calculates function, target polymerization function, goal filtering label and can be generated
Target computational item generates PromQL program code, Ke Yiti so that target computational item is replaced the identifier in expression formula formula
Height generates the accuracy of program code.
In one embodiment, as shown in figure 5,502 be the rectangle frame for generating program code.In 502,504 be program
The edit box of code.In edit box 504,506 be the particular content of target computational item a, and 508 be the mark of target computational item a
It according with " a ", target computational item a is in folded state, can click " expansion " button and carry out expansion editor to target computational item a,
" deletion " button can be clicked to delete target computational item a.510 be the particular content of target computational item b, and 512 be target
The identifier " b " of computational item b, target computational item b are in unfolded state, can click " folding " button to target computational item a into
Row folds, and can also click " deletion " button and delete target computational item b.
In target computational item b, 514 select frame for data item, frame can be selected by 514 data item of click, under expansion
Frame is selected in drawing, and drop-down is chosen to select the data item in frame as target data item.516 be the choosing for the tag name for including in filter label
Frame, 518 for the matching symbol that includes in filter label the frame that selects, 520 select frame for the label value that includes in filter label.Pass through choosing
Middle target labels name, object matching symbol and target labels value, can be generated goal filtering label.Optionally, goal filtering label
In target labels name, object matching symbol and target labels value " can also be manually entered " button by click, carry out defeated manually
Enter.It may include multiple goal filtering labels in a target computational item, pass through click " newly-increased goal filtering label " button
Newly-increased goal filtering label.522 calculate the frame that selects of function for target, and 524 select frame for target polymerization function.
When needing to increase new target computational item, " newly-increased target computational item " button can be clicked and be added.526 are
The edit box of expression formula formula, user can input the expression formula formula including the corresponding identifier of target computational item.Work as editor
When completion, program code 528 can be produced by click " ← " button.When needing to delete expression formula formula,
Delete button can be clicked.When program code is fairly simple, " being manually entered " button can be clicked, is manually entered.
In one embodiment, as shown in fig. 6, providing a kind of program code generating means, comprising: target computational item is raw
At module 602, expression formula formulas solutions module 604 and program code generation module 606, in which:
Target computational item generation module 602, for obtaining the target data item chosen from collection of data items, according to target
Data item generates target computational item, wherein the corresponding identifier of each target computational item.
Expression formula formulas solutions module 604, for obtaining and identifying the expression formula formula of input, wherein expression formula formula
Including the corresponding identifier of each target computational item.
Program code generation module 606, for the identifier in expression formula formula to be replaced with corresponding target computational item,
Program code is generated according to replaced expression formula formula.
Above procedure code generating unit is chosen the target computational item editted in advance from collection of data items, is not easy out
Mistake, and input the expression formula formula including identifier, that is, the program code produced, the expression formula formula of input is by simple
Identifier generates, also not easy to make mistakes, improves the accuracy for generating program code.
In one embodiment, as shown in fig. 7, providing a kind of program code generating means, comprising: target computational item is raw
It is raw at module 702, target computational item display module 704, expression formula formulas solutions module 706, matching module 708 and program code
At module 710, in which:
Target computational item generation module 702, for obtaining the target data item chosen from collection of data items, according to target
Data item generates target computational item, wherein the corresponding identifier of each target computational item.
Target computational item display module 704, for when detect in the first input frame show target data item when, second
Target computational item is shown in input frame.
Expression formula formulas solutions module 706, for obtaining and identifying the expression formula formula of input, wherein expression formula formula
Including the corresponding identifier of each target computational item.
Matching module 708, for when expression formula formula identifier match corresponding with each target computational item, execute general
Identifier in expression formula formula replaces with corresponding target computational item, generates program code according to replaced expression formula formula
Step;When expression formula formula identifier corresponding with each target computational item mismatches, prompt information is generated.
Program code generation module 710, for the identifier in expression formula formula to be replaced with corresponding target computational item,
Program code is generated according to replaced expression formula formula.
Above procedure code generating unit is chosen the target computational item editted in advance from collection of data items, is not easy out
Mistake, and the expression formula formula including identifier is inputted, when expression formula formula identifier corresponding with each target computational item
Timing, i.e. producible program code, the expression formula formula of input is generated by simple identifier, also not easy to make mistakes, works as expression
When formula formula identifier corresponding with each target computational item mismatches, prompt information is generated, generation program can be more improved
The accuracy of code.
In one embodiment, above-mentioned target computational item generation module 702 is also used to obtain and choose from collection of data items
Target data item, obtain the goal filtering label chosen from the corresponding intermediate filtered tag set of target data item, and obtain
Take the objective function chosen from function set, wherein target data item from database for obtaining target data, target mistake
Filter label is for screening target data, and objective function is based on carrying out the target data after goal filtering label filtration
It calculates;Target computational item is generated according to target data item, goal filtering label and objective function.
In one embodiment, above-mentioned target computational item generation module 702 is also used to obtain corresponding from target data item
The target labels name chosen in intermediate label name set;What acquisition was chosen from the corresponding intermediate label value set of target labels name
Target labels value, and the object matching symbol chosen is obtained from matching symbol set;According to target labels name, target labels value and mesh
It marks matching symbol and generates goal filtering label.
In one embodiment, above-mentioned target computational item generation module 702 is also used to belong to the function of time when objective function
When, obtain the time parameter inputted according to objective function.Mesh is generated according to target data item, goal filtering label and objective function
Mark computational item, comprising: raw according to target data item, goal filtering label, objective function and the corresponding time parameter of objective function
At target computational item.
In one embodiment, above-mentioned target computational item generation module 702 is also used to according to target data item, goal filtering
Label, object time function and the corresponding time parameter of object time function generate aiming symbol;It is put in order according to preset,
Target data item, goal filtering label, object time function, the corresponding time parameter of object time function and aiming symbol is raw
At target computational item.
In one embodiment, above-mentioned target computational item generation module 702 is also used to work as and detect to the first input frame pair
When choosing instruction of collection of data items shown in the combobox answered obtains the target for choosing instruction to choose from collection of data items
Data item, and target data item is shown in the first input frame, target computational item is generated according to target data item.
Specific about program code generating means limits the limit that may refer to above for program code generation method
Fixed, details are not described herein.Modules in above procedure code generating unit can fully or partially through software, hardware and its
Combination is to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with
It is stored in the memory in computer equipment in a software form, in order to which processor calls the above modules of execution corresponding
Operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure
Figure can be as shown in Figure 8.The computer equipment includes processor, the memory, network interface, display connected by system bus
Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited
Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey
Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating
The network interface of machine equipment is used to communicate with external terminal by network connection.When the computer program is executed by processor with
Realize a kind of program code generation method.The display screen of the computer equipment can be liquid crystal display or electric ink is shown
Screen, the input unit of the computer equipment can be the touch layer covered on display screen, be also possible on computer equipment shell
Key, trace ball or the Trackpad of setting can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 8, only part relevant to application scheme is tied
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory
Computer program, the processor perform the steps of the target for obtaining and choosing from collection of data items when executing computer program
Data item generates target computational item according to target data item, wherein the corresponding identifier of each target computational item;It obtains
And identify the expression formula formula of input, wherein expression formula formula includes the corresponding identifier of each target computational item;By expression formula
Identifier in formula replaces with corresponding target computational item, generates program code according to replaced expression formula formula.
In one embodiment, acquisition is also performed the steps of when processor executes computer program from collection of data items
In the target data item chosen, obtain the goal filtering mark chosen from the corresponding intermediate filtered tag set of target data item
Label, and obtain the objective function chosen from function set, wherein target data item from database for obtaining number of targets
According to for screening to target data, objective function is used for the target after goal filtering label filtration goal filtering label
Data are calculated;Target computational item is generated according to target data item, goal filtering label and objective function.
In one embodiment, acquisition is also performed the steps of when processor executes computer program from target data item
The target labels name chosen in corresponding intermediate label name set;It obtains from the corresponding intermediate label value set of target labels name
The target labels value chosen, and the object matching symbol chosen is obtained from matching symbol set;According to target labels name, target labels
Value and object matching symbol generate goal filtering label.
In one embodiment, it also performs the steps of when processor executes computer program when objective function belongs to
Between function when, obtain the time parameter that inputs according to objective function.According to target data item, goal filtering label and objective function
Generate target computational item, comprising: according to target data item, goal filtering label, objective function and objective function corresponding time
Parameter generates target computational item.
In one embodiment, it also performs the steps of when processor executes computer program according to target data item, mesh
It marks filter label, object time function and the corresponding time parameter of object time function and generates aiming symbol;According to preset row
Column sequence, by target data item, goal filtering label, object time function, the corresponding time parameter of object time function and mesh
Reference symbol number generates target computational item.
In one embodiment, it is also performed the steps of when processor executes computer program when expression formula formula and each
When the corresponding identifier match of a target computational item, executes and the identifier in expression formula formula is replaced with into corresponding target calculate
, program code steps are generated according to replaced expression formula formula;When expression formula formula is corresponding with each target computational item
When identifier mismatches, prompt information is generated.
In one embodiment, it is also performed the steps of when processor executes computer program defeated to first when detecting
Enter when choosing instruction of collection of data items shown in the corresponding combobox of frame, acquisition chooses instruction to choose from collection of data items
Target data item, and by target data item show in the first input frame, according to target data item generate target computational item.On
State program code generation method further include: when detecting displaying target data item in the first input frame, in the second input frame
Show target computational item.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of the target data item for obtaining and choosing from collection of data items when being executed by processor, according to target
Data item generates target computational item, wherein the corresponding identifier of each target computational item;Obtain and identify the expression of input
Formula formula, wherein expression formula formula includes the corresponding identifier of each target computational item;Identifier in expression formula formula is replaced
It is changed to corresponding target computational item, program code is generated according to replaced expression formula formula.
In one embodiment, acquisition is also performed the steps of when computer program is executed by processor from item set
The target data item chosen in conjunction obtains the goal filtering mark chosen from the corresponding intermediate filtered tag set of target data item
Label, and obtain the objective function chosen from function set, wherein target data item from database for obtaining number of targets
According to for screening to target data, objective function is used for the target after goal filtering label filtration goal filtering label
Data are calculated;Target computational item is generated according to target data item, goal filtering label and objective function.
In one embodiment, acquisition is also performed the steps of when computer program is executed by processor from target data
The target labels name chosen in the corresponding intermediate label name set of item;It obtains from the corresponding intermediate label value set of target labels name
In the target labels value chosen, and the object matching symbol chosen is obtained from matching symbol set;According to target labels name, target mark
Label value and object matching symbol generate goal filtering label.
In one embodiment, it is also performed the steps of when computer program is executed by processor when objective function belongs to
When the function of time, the time parameter inputted according to objective function is obtained.According to target data item, goal filtering label and target letter
Number generates target computational item, comprising: when according to target data item, goal filtering label, objective function and corresponding objective function
Between parameter generate target computational item.
In one embodiment, also performed the steps of when computer program is executed by processor according to target data item,
Goal filtering label, object time function and the corresponding time parameter of object time function generate aiming symbol;According to preset
Put in order, by target data item, goal filtering label, object time function, the corresponding time parameter of object time function and
Aiming symbol generates target computational item.
In one embodiment, also performed the steps of when computer program is executed by processor when expression formula formula with
When the corresponding identifier match of each target computational item, executes and the identifier in expression formula formula is replaced with into corresponding target meter
Item is calculated, program code steps are generated according to replaced expression formula formula;When expression formula formula is corresponding with each target computational item
Identifier mismatch when, generate prompt information.
In one embodiment, it also performs the steps of to work as when computer program is executed by processor and detect to first
When choosing instruction of collection of data items shown in the corresponding combobox of input frame, acquisition choose instruction to select from collection of data items
In target data item, and by target data item show in the first input frame, according to target data item generate target computational item.
Above procedure code generating method further include: when detecting displaying target data item in the first input frame, in the second input frame
Middle displaying target computational item.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein,
To any reference of memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.
Claims (10)
1. a kind of program code generation method, which comprises
The target data item chosen from collection of data items is obtained, target computational item is generated according to the target data item, wherein
The corresponding identifier of each described target computational item;
Obtain and identify the expression formula formula of input, wherein the expression formula formula includes that each target computational item is corresponding
Identifier;
Identifier in the expression formula formula is replaced with into corresponding target computational item, it is raw according to replaced expression formula formula
At program code.
2. the method according to claim 1, wherein described obtain the target data chosen from collection of data items
, target computational item is generated according to the target data item, comprising:
The target data item chosen from collection of data items is obtained, is obtained from the corresponding intermediate filtered label of the target data item
The goal filtering label chosen in set, and obtain the objective function chosen from function set, wherein the target data item
For obtaining target data from database, the goal filtering label is for screening the target data, target letter
Number is for calculating the target data after the goal filtering label filtration;
Target computational item is generated according to the target data item, goal filtering label and objective function.
3. according to the method described in claim 2, it is characterized in that, described obtain from the corresponding intermediate mistake of the target data item
The goal filtering label chosen in filter tag set, comprising:
Obtain the target labels name chosen from the corresponding intermediate label name set of the target data item;
Obtain the target labels value chosen from the corresponding intermediate label value set of the target labels name, and from matching symbol set
It is middle to obtain the object matching symbol chosen;
It is accorded with according to the target labels name, target labels value and object matching and generates goal filtering label.
4. according to the method described in claim 2, it is characterized in that, it is described obtain the objective function chosen from function set it
Afterwards, further includes:
When the objective function belongs to the function of time, the time parameter inputted according to the objective function is obtained;
It is described that target computational item is generated according to the target data item, goal filtering label and objective function, comprising:
It is generated according to the target data item, goal filtering label, objective function and the corresponding time parameter of the objective function
Target computational item.
5. according to the method described in claim 4, it is characterized in that, it is described according to the target data item, goal filtering label,
Object time function and the corresponding time parameter of the object time function generate target computational item, comprising:
According to the target data item, goal filtering label, object time function and the object time function corresponding time
Parameter generates aiming symbol;
It is put in order according to preset, when by the target data item, goal filtering label, object time function, the target
Between the corresponding time parameter of function and the aiming symbol generate target computational item.
6. the method according to claim 1, wherein the acquisition and after identifying the expression formula formula of input,
Further include:
When expression formula formula identifier match corresponding with each target computational item, execute the expression formula is public
Identifier in formula replaces with corresponding target computational item, generates program code steps according to replaced expression formula formula;
When expression formula formula identifier corresponding with each target computational item mismatches, prompt information is generated.
7. method according to claim 1 to 6, which is characterized in that the acquisition is chosen from collection of data items
Target data item, according to the target data item generate target computational item, comprising:
When detecting to when choosing instruction of collection of data items shown in the corresponding combobox of the first input frame, the choosing is obtained
It is middle to instruct the target data item chosen from the collection of data items, and the target data item is shown in first input
In frame, target computational item is generated according to the target data item;
The method also includes:
When detect show the target data item in first input frame when, the target meter is shown in the second input frame
Calculate item.
8. a kind of program code generating means, which is characterized in that described device includes:
Target computational item generation module, for obtaining the target data item chosen from collection of data items, according to the number of targets
Target computational item is generated according to item, wherein the corresponding identifier of each described target computational item;
Expression formula formulas solutions module, for obtaining and identifying the expression formula formula of input, wherein the expression formula formula includes
The corresponding identifier of each target computational item;
Program code generation module, for the identifier in the expression formula formula to be replaced with corresponding target computational item, root
Program code is generated according to replaced expression formula formula.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists
In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910083568.7A CN109871214B (en) | 2019-01-29 | 2019-01-29 | Program code generation method, program code generation device, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910083568.7A CN109871214B (en) | 2019-01-29 | 2019-01-29 | Program code generation method, program code generation device, computer device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109871214A true CN109871214A (en) | 2019-06-11 |
CN109871214B CN109871214B (en) | 2022-04-12 |
Family
ID=66918152
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910083568.7A Active CN109871214B (en) | 2019-01-29 | 2019-01-29 | Program code generation method, program code generation device, computer device, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109871214B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078026A (en) * | 2019-11-15 | 2020-04-28 | 北京乐我无限科技有限责任公司 | Input prompting method and device, electronic equipment and readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1226527A1 (en) * | 1999-08-13 | 2002-07-31 | MPower.com, Inc. | A system, method, and computer program product for handling deferred expressions in an object oriented stochastic simulation model |
CN101034349A (en) * | 2007-04-06 | 2007-09-12 | 西安万年科技实业有限公司 | Data base application system development platform based on functional design |
CN107506442A (en) * | 2017-08-24 | 2017-12-22 | 中国银行股份有限公司 | The modeling method and device of a kind of model |
-
2019
- 2019-01-29 CN CN201910083568.7A patent/CN109871214B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1226527A1 (en) * | 1999-08-13 | 2002-07-31 | MPower.com, Inc. | A system, method, and computer program product for handling deferred expressions in an object oriented stochastic simulation model |
CN101034349A (en) * | 2007-04-06 | 2007-09-12 | 西安万年科技实业有限公司 | Data base application system development platform based on functional design |
CN107506442A (en) * | 2017-08-24 | 2017-12-22 | 中国银行股份有限公司 | The modeling method and device of a kind of model |
Non-Patent Citations (1)
Title |
---|
GEEKXUSHUO: ""prometheus监控系列之prometheus server和监控linux系统"", 《HTTPS://BLOG.CSDN.NET/QQ_25934401/ARTICLE/DETAILS/81391598》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078026A (en) * | 2019-11-15 | 2020-04-28 | 北京乐我无限科技有限责任公司 | Input prompting method and device, electronic equipment and readable storage medium |
CN111078026B (en) * | 2019-11-15 | 2023-10-03 | 北京乐我无限科技有限责任公司 | Input prompting method, device, electronic equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109871214B (en) | 2022-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106155686B (en) | Interface generation method, device and system | |
CN105487864B (en) | The method and apparatus of Code automatic build | |
CN107438814A (en) | Entity action suggestion on mobile device | |
KR101950126B1 (en) | Mathematical formula processing method, device, apparatus and computer storage medium | |
CN109358841A (en) | Web application develops Compilation Method, device and storage equipment, computer equipment | |
CN109388376A (en) | Risk of software development appraisal procedure, device, equipment and readable storage medium storing program for executing | |
EP2869195B1 (en) | Application coordination system, application coordination method, and application coordination program | |
CN108027721A (en) | For configuring the technology of general program using control | |
CN106503224A (en) | A kind of method and device for recommending application according to keyword | |
CN106951254B (en) | Method and device for multiplexing similar service function modules in payment system | |
CN109101293A (en) | Theme configuration method and device, electronic equipment, computer readable storage medium | |
CN109597979A (en) | Inventory table generation method, device, computer equipment and storage medium | |
CN109634579A (en) | Code generating method, device, computer installation and storage medium | |
CN108345658B (en) | Decomposition processing method of algorithm calculation track, server and storage medium | |
Abas et al. | Attendance Management System (AMS) with fast track analysis | |
CN111881042A (en) | Automatic test script generation method and device and electronic equipment | |
CN111563366A (en) | Document processing method and device and electronic equipment | |
CN113342249B (en) | Content management method, device, equipment and storage medium capable of previewing in real time | |
CN110688115A (en) | Method and device for generating interface | |
CN114741360A (en) | Automobile part file reconstruction method and device, terminal equipment and storage medium | |
CN109871214A (en) | Program code generation method, device, computer equipment and storage medium | |
CN107316185B (en) | Method and system for establishing detection process in LIMS (laser induced mechanical breakdown spectroscopy) system | |
CN108268206B (en) | Method and device for adjusting display result of object in interface and mobile equipment | |
CN108287707A (en) | JSX document generating methods, device, storage medium and computer equipment | |
CN110780970A (en) | Data screening method, device, equipment and computer readable 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |