CN102393868B - Method for implementing index computation model for solving complex computing relationship - Google Patents

Method for implementing index computation model for solving complex computing relationship Download PDF

Info

Publication number
CN102393868B
CN102393868B CN 201110322515 CN201110322515A CN102393868B CN 102393868 B CN102393868 B CN 102393868B CN 201110322515 CN201110322515 CN 201110322515 CN 201110322515 A CN201110322515 A CN 201110322515A CN 102393868 B CN102393868 B CN 102393868B
Authority
CN
China
Prior art keywords
index
function
computation model
file
user
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.)
Active
Application number
CN 201110322515
Other languages
Chinese (zh)
Other versions
CN102393868A (en
Inventor
李伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Red software Limited by Share Ltd
Original Assignee
KARAMAY HONGYOU SOFTWARE CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KARAMAY HONGYOU SOFTWARE CO Ltd filed Critical KARAMAY HONGYOU SOFTWARE CO Ltd
Priority to CN 201110322515 priority Critical patent/CN102393868B/en
Publication of CN102393868A publication Critical patent/CN102393868A/en
Application granted granted Critical
Publication of CN102393868B publication Critical patent/CN102393868B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method for implementing an index computation model for solving complex compution relationship, which comprises the following steps: establishing an index computation model according to tree structure computation relationship, thereby obtaining a user-defined index computation model; saving the user-defined index computation model in a mode of saving a tree structure among indexes by a gigabase object oriented database, thereby obtaining the user-defined index computation model; compiling the user-defined index computation relationship, which is compiled with C Language by the user, into a DLL (dynamic link library) file by using a TinyC compiler, and saving the DLL file, thereby obtaining the data information file with computation function relationship; and resolving to obtain the user-defined index computation model, and computing the indexes, thereby obtaining the index values. The method can provide the user with a simple and fast computation model to solve the complex computation relationship.

Description

A kind of method that realizes solving the index computation model with complicated calculations relation
Technical field
The present invention relates to computer realm, particularly relate to a kind of method that realizes solving the index computation model with complicated calculations relation.
Background technology
At present, have in the computation model that has complicated calculations relation between many indexes similar calculating free cash flow is following, usually have a lot of defectives.
Wherein, many indexes, specific as follows described:
Computing formula:
Free cash flow=cash inflow-cash outflow
Cash inflow=sales revenue+recovery capital assets residual value+recovery circulating capital
Cash outflow=construction investment+circulating capital+operating cost+sales tax+income tax
Sales revenue=product quantity * product price
Circulating capital=operating cost * circulating capital accounts for the operating cost ratio
Operating cost=total cost-depreciation loss-financial expense
Total cost=production cost+period expense
Production cost=running cost+depreciation loss
Depreciation loss=initial asset value * (1-salvage value rate)/period of depreciation
Period expense=managerial cost+financial expense+operation cost
Sales tax=urban maintenance and construction tax+educational duty adds+tax on the use of natural resources
The above has just enumerated calculating free cash flow part formula, and whole computing formula has more than 200.What this problem need to solve is a lot of input pointers to be arranged such as salvage value rate, the period of depreciation, and product price etc., output-index is to have adopted various algorithms to calculate by a plurality of other indexs (comprising input pointer or other output-index) to get.Such as production cost, sales tax, depreciation loss etc.All be that the calculated relationship between this index is solidificated in the program at present.
Be solidificated in the program for the calculated relationship between index, shortcoming clearly adds an index or revises an index calculated relationship, and master routine need to be revised recompility, and the execute file after the compiling is issued the user again.The dirigibility of the program that relates in the method for the realization computation model that brings like this is very poor.
Thereby, need at present the urgent technical matters that solves of those skilled in the art to be exactly: how to find a kind of novel method that realizes solving simply, fast the computation model with complicated calculations relation.
Summary of the invention
A technical matters to be solved by this invention provides a kind of method that realizes solving the index computation model with complicated calculations relation, and the method can provide one simply, computation model solves complicated calculated relationship fast to the user.
In order to address the above problem, the invention discloses a kind of method that realizes solving the index computation model with complicated calculations relation, comprising:
Adopt the mode by the tree structure calculated relationship, set up index computation model, obtain user-defined index computation model;
Adopt the mode of preserving the tree structure between index by the gigabase object-oriented database, user-defined index computation model is preserved, obtain user-defined index computation model;
By the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file is preserved, obtain to preserve the data message file of the funtcional relationship of computing function;
Resolve the user-defined index computation model that obtains and calculate indices, obtain the numerical value of indices.
Preferably, described employing is set up index computation model by the mode of tree structure calculated relationship, obtains the step of user-defined index computation model, comprising:
Adopt the mode by the tree structure calculated relationship, set up the data dictionary of the index in the index computation model, and indices is edited, obtain the indices data in the index computation model; Wherein, described indices data are the type of each index and the title of each index;
Receive the reading out data instruction, begin to carry out the operation of the indices data of reading in the index computation model;
The user carries out the operation of setting up the index root node, obtains user-defined index computation model.
Preferably, described user carries out the operation of setting up the index root node, obtains the step of user-defined index computation model, comprising:
Set up the index root node, obtain the index root node;
If the index root node needs to calculate, then set up the corresponding index child node of index root node, obtain the corresponding index child node of index root node;
Write the function of the computing function of root node needs and realize body, obtain the funtcional relationship of computing function;
Execute aforesaid operations, obtain the funtcional relationship of index root node, the corresponding index child node of index root node and computing function, then obtain user-defined index computation model.
Preferably, the mode of the tree structure between index is preserved in described employing by the gigabase object-oriented database, user-defined index computation model is preserved, and obtains the step of user-defined index computation model, comprising:
The index root node that obtains is preserved, and the file of the data message of index root node is preserved in acquisition;
Adopt recursive fashion, for the index root node, preserve successively corresponding each the index child node of index root node, the file of the data message of index child node is preserved in acquisition;
Funtcional relationship to the computing function that obtains is preserved, and obtains to preserve the file of data message of the funtcional relationship of computing function;
Wherein, the data message of described index node is that the calculating of classification, C function name, user's input of title, the index root/child node of index root/child node realizes C function that the C code consists of and the ID of all index child node objects.
Preferably, described by the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file is preserved, the step of data message file of the funtcional relationship of computing function is preserved in acquisition, comprising:
The calculating of all user input is realized that the C code constructs becomes corresponding C function, obtain to realize accordingly C function one by one of C code for calculating;
Input is C function one by one accordingly, generates a C function source files of program;
Adopt the TinyC compiler, C function source files of program is compiled, obtain the dynamic library file of C function source files of program;
Described dynamic library file is saved in the table in the index computation model file as a binary field, obtains to preserve the data message file of the funtcional relationship of computing function.
Preferably, the user-defined index computation model that described parsing obtains also calculates indices, obtains the step of the numerical value of indices, comprising:
Read the index computation model file, obtain the numerical value of indices;
Adopt the method for recursive call, calculate the numerical value of indices;
The mode of the GetNode function by calling the index container is imported index name into for user's input pointer, obtains the index object;
The mode of the SetValue function by calling the index object arranges the index object that obtains, and obtains the result value of index object;
By calling the mode of Eval function, resolve for root node, obtain the numerical value of indices.
Preferably, the described index computation model file that reads, the step of the numerical value of acquisition indices comprises:
Reading and saving has the file of the data message of index root/child node, obtains the data message of index root/child node;
Reading and saving has the file of data message of the funtcional relationship of computing function, obtains the data message of the funtcional relationship of computing function.
Preferably, described reading and saving has the file of the data message of index root/child node, obtains the step of the data message of index root/child node, comprising:
Be the corresponding object instance of each Index Establishment, obtain the object instance of each index;
Set up corresponding subobject example for the subobject of each index, obtain the subobject example of each index;
The subobject example of the object instance of each index and some subobjects of each object thereof consists of the object system of tree structure;
Set up the object container object, obtain object container;
Each index object is joined in the object container;
Adopt the storage mode of hash_map, set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If in object container, import the title of index object into, the address of object container fast return index object then;
Finish above-mentioned steps, finish the file that reading and saving has the data message of index root/child node, obtain the overall process of the data message of index root/child node.
Preferably, described reading and saving has the file of data message of the funtcional relationship of computing function, obtains the step of data message of the funtcional relationship of computing function, comprising:
Read in computing method in the binary field from the file of the data message of the funtcional relationship of computing function;
Computing method are written in the dynamic library file;
Adopt the storage mode of hash_map, set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If import the title of index object in object container, the address of object container fast return index object then;
By calling the mode of Eval function, for last column code of index object, call the funtcional relationship of computing function, obtain the data message of the funtcional relationship of computing function.
Preferably, describedly resolve for root node by calling the mode of Eval function, obtain the step of the numerical value of indices, comprising:
By calling the mode of Eval function, carry out Analysis of recursive transfer for a root node, obtain the numerical value of each root node index;
By calling the mode of Eval function, all the other root nodes corresponding for each root node carry out Analysis of recursive transfer, obtain the numerical value of all the other corresponding root node indexs of each root node;
Numerical value to all the other corresponding root node indexs of the numerical value of above-mentioned each root node index and above-mentioned each root node gathers, and obtains the numerical value of indices.
Remarkable advantage of the present invention is:
1, sets up computation model tree-shaped between a kind of index, a graphics edition interface is provided, has allowed the user come calculated relationship between self-defined various indexs, in program, automatically resolved this calculated relationship, the input pointer data are provided, utilize computation model to calculate all output-indexes.
2, allow the final user can easily define the calculated relationship of index.
3, provide a not only open but also simple calculated relationship configuration tool to the user.
4, have powerful extendability, dirigibility.
5, set up the computation model of tree structure, the user can oneself define easily; Adopt in addition the TinyC compiler of increasing income that user-defined computing method direct compilation has been become the machine code that can carry out, do not adopted Formula Solution parser or script so that travelling speed has identical speed with the programming mode that algorithm is cured in the program; The development platform of a Simple fast is provided to the user.
In a word, the invention provides a kind of method that realizes solving the index computation model with complicated calculations relation, the method can provide one simply, computation model solves complicated calculated relationship fast to the user.
Description of drawings
Fig. 1 is the flow chart of steps of the embodiment of a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention;
Fig. 2 is the schematic flow sheet of the computation model editor in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention;
Fig. 3 is the schematic flow sheet that the computation model in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention is preserved;
Fig. 4 is the schematic flow sheet that the computation model in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention is resolved;
Fig. 5 is the schematic flow sheet of the Eval method in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
One of core concept of the present invention has provided a kind of method that realizes solving the index computation model with complicated calculations relation, comprise: adopt the mode by the tree structure calculated relationship, set up index computation model, obtain user-defined index computation model; Adopt the mode of preserving the tree structure between index by the gigabase object-oriented database, user-defined index computation model is preserved, obtain user-defined index computation model; By the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file is preserved, obtain to preserve the data message file of the funtcional relationship of computing function; Resolve the user-defined index computation model that obtains and calculate indices, obtain the numerical value of indices; The method can provide one simply, computation model solves complicated calculated relationship fast to the user.
With reference to Fig. 1, show the flow chart of steps of the embodiment of a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention, the calculating of the free cash flow that lift the front just adopts the present invention to solve, and specifically can comprise:
The mode of tree structure calculated relationship is passed through in step 101, employing, sets up index computation model, obtains user-defined index computation model.
In order to make those skilled in the art understand better the present invention, in a preferred embodiment of the invention, described step 101 specifically can comprise:
The mode of tree structure calculated relationship is passed through in substep A1, employing, sets up the data dictionary of the index in the index computation model, and indices is edited, and obtains the indices data in the index computation model; Wherein, described indices data are the type of each index and the title of each index.
Substep A2, the instruction of reception reading out data begin to carry out the operation of the indices data of reading in the index computation model.
Substep A3, user carry out the operation of setting up the index root node, obtain user-defined index computation model.
Wherein, described substep A3 specifically can comprise:
Substep B1, set up the index root node, obtain the index root node.
If substep B2 index root node needs to calculate, then set up the corresponding index child node of index root node, obtain the corresponding index child node of index root node.
Substep B3, the function of writing the computing function that root node needs are realized body, obtain the funtcional relationship of computing function.
Substep B4, execute aforesaid operations, obtain the funtcional relationship of index root node, the corresponding index child node of index root node and computing function, then obtain user-defined index computation model.
Wherein,
The user defines computation model, adds an index node in model, if this node needs to calculate, adds child node, writes the function of the computing function of these node needs and realizes body, and function name produces automatically, and function definition is as described below:
double?CalFun(double*pSubNodeValue);
The user only need to write function body when definition, by the calculating of multiplying each other by two child nodes, can write as follows function body such as index so.
return?pSubNodeValue[0]*pSubNodeValue[1];
In the end during generation model, can automatically generate a function name such as Cal_Acdf, automatically add " { ", " } " symbol that the C function needs.Last this function is as follows:
Figure GSB00000982635700071
The user only need to write the code return pSubNodeValue[0 that realizes calculating] * pSubNodeValue[1]; Other parts of computing function are generated automatically by system.
With reference to Fig. 2, show the schematic flow sheet of the computation model editor in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention, specific as follows described:
1) reads in the achievement data dictionary;
2) set up the index root node;
3) set up child node;
4) if also have child node, continue to set up child node, finish to all setting up to all child nodes;
5) write calculated relationship C code;
6) preserve.
The mode of the tree structure between index is preserved in step 102, employing by the gigabase object-oriented database, user-defined index computation model is preserved, and obtains user-defined index computation model.Wherein, described gigabase object-oriented database is a kind ofly to write the object database of increasing income with the C++ programming language.
In order to make those skilled in the art understand better the present invention, in another preferred embodiment of the present invention, described step 102 specifically can comprise:
Substep C1, the index root node that obtains is preserved, obtained to preserve the file of the data message of index root node.
Substep C2, employing recursive fashion for the index root node, are preserved corresponding each the index child node of index root node successively, and the file of the data message of index child node is preserved in acquisition.
Substep C3, the funtcional relationship of the computing function that obtains is preserved, obtain to preserve the file of data message of the funtcional relationship of computing function;
Wherein, the data message of described index node is that the calculating of classification, C function name, user's input of title, the index root/child node of index root/child node realizes C function that the C code consists of and the ID of all index child node objects.
Wherein, described C code is the program source code with the C language compilation; Described C function is the function with the C language compilation; Described C function name is the function name with the C language compilation, adopts random fashion automatically to generate the C function name; The ID of described index child node object is the sign of index child node object.
Step 103, by the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file preserved, obtain to preserve the data message file of the funtcional relationship of computing function.Wherein, described TinyC compiler is the compiler of increasing income of compiling C language; Described C language is a kind of computer programming language; The library file of described dll file for being performed.
Utilize small and exquisite TinyC compiler (compiler of increasing income of compiling C language), the user utilizes TinyC to be compiled into dll file with the calculated relationship of the self-defining index of C language compilation.Because be machine code during operation, computing velocity is fast, has again the dirigibility of script simultaneously.
In order to make those skilled in the art understand better the present invention, in another preferred embodiment of the present invention, described step 103 specifically can comprise:
Substep D1, the calculating of all user input is realized that the C code constructs becomes corresponding C function, obtain to realize accordingly C function one by one of C code for calculating.
Substep D2, input be C function one by one accordingly, generates a C function source files of program.
Substep D3, employing TinyC compiler compile C function source files of program, obtain the dynamic library file of C function source files of program.
Substep D4, described dynamic library file is saved in the table in the index computation model file as a binary field, obtains to preserve the data message file of the funtcional relationship of computing function.
Wherein, the user is saved in the computation model that edits in the file.Software is preserved first root node in this operation of user, then adopt recursion method, preserves successively each child node.Wherein, each nodal information comprises index name, the index classification, and the C function name, the calculating of user's input realizes C code, the ID of all child node objects.. also need in addition the calculating of all user's inputs is realized that the C code constructs becomes C function one by one, generate a C function source files of program, automatically adopt the TinyC compiler to be compiled into a dynamic library file, this dynamic library file is saved in the table in the model file as a binary field.
With reference to Fig. 3, show the schematic flow sheet that the computation model in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention is preserved, specific as follows described:
1) preserves child node;
2) preserve father node;
3) automatically generate the function name of computing method;
4) all computing method functions are formed a C file;
5) form a dll file with TinyC compiling C language source code file;
6) binary field of dll file as model database deposited in.
The user-defined index computation model that step 104, parsing obtain also calculates indices, obtains the numerical value of indices.
With reference to Fig. 4, show the schematic flow sheet that the computation model in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention is resolved, specific as follows described:
1) reads in the computation model file;
2) read in root node;
3) read in the title of computing function;
4) read in child node;
5) if also have child node, continue to read in child node, extremely to reading all child nodes, finish the overall process of reading in child node;
6) read in the DLL of calculated relationship, and be written in the dll file; Wherein, the library file of described dll file for being performed;
7) name according to computing function is called the address that each node obtains computing function;
8) read in the input pointer data;
9) call the Eval method of root node; Wherein, the described Eval method functional based method that is the value of parameter.
In order to make those skilled in the art understand better the present invention, in another preferred embodiment of the present invention, described step 104 specifically can comprise:
Substep E1, read the index computation model file, obtain the numerical value of indices.
Wherein, described substep E1 specifically can comprise:
Substep F1, reading and saving have the file of the data message of index root/child node, obtain the data message of index root/child node.
Wherein, described substep F1 specifically can comprise:
Substep G1, be the corresponding object instance of each Index Establishment, obtain the object instance of each index.
Substep G2, set up corresponding subobject example for the subobject of each index, obtain the subobject example of each index.
The subobject example of the object instance of substep G3, each index and some subobjects of each object thereof consists of the object system of tree structure.
Substep G4, set up the object container object, obtain object container.
Substep G5, each index object is joined in the object container.
The storage mode of substep G6, employing hash_map is set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If in object container, import the title of index object into, the address of object container fast return index object then;
Wherein, the storage mode of described hash_map is a kind of storage mode of depositing the data structure of object identity and object.
Substep G7, finish above-mentioned steps, finish the file that reading and saving has the data message of index root/child node, obtain the overall process of the data message of index root/child node.
Substep F2, reading and saving have the file of data message of the funtcional relationship of computing function, obtain the data message of the funtcional relationship of computing function.
Wherein, described substep F2 specifically can comprise:
Read in computing method in substep H1, the binary field from the file of the data message of the funtcional relationship of computing function.
Substep H2, computing method are written in the dynamic library file.
The storage mode of substep H3, employing hash_map is set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If in object container, import the title of index object into, the address of object container fast return index object then; Wherein, the storage mode of described hash_map is a kind of storage mode of depositing the data structure of object identity and object.
Substep H4, by calling the mode of Eval function, for last column code of index object, call the funtcional relationship of computing function, obtain the data message of the funtcional relationship of computing function; Wherein, the described Eval function function that is the value of parameter.
With reference to Fig. 5, show the schematic flow sheet of the Eval method in a kind of method that realizes solving the index computation model with complicated calculations relation of the present invention, specific as follows described:
1) finds root node;
2) the Eval method of calling root node begins to calculate;
3) if value has been arranged, then finish;
Following two kinds of the situation that value wherein, is arranged:
A. just there is original input value in the raw data base, then directly reads, do not need computing;
B. finished computation process, and result of calculation has been carried out mark.
4) if there is not the ready-made value that can call, then call first the Eval method of first child node; If also have all the other child nodes, call the Eval method of all the other child nodes, to the Eval method of finishing all and calling child node, obtain the numerical value of all child nodes; Wherein, adopt the mode of recursive call to come child node is called;
5) call the computing function of node, the mark of the value of being provided with;
6) finish.
Wherein, read in the computation model file, be an object instance of each Index Establishment (CComputeNode), each object has some subobjects, in internal memory, set up like this object system of a tree structure, then set up an object container object CComputeNodeManage, each index object is added in container, adopt hash_map that the title of index object and index object address are set up mapping relations in the container object, can one function G etNode just be arranged container object like this, this function can import index name into just can fast return index object address.Read in computing method in the binary field of another one from model file, and be written in the dynamic library file, each index object individual computing function address arranged, function prototype is double Cal (double*pSubNodeValue).Function name computing function address according to node.Last column code at the EVal of index object need to call this function, to obtain to refer to target value; Wherein, the described Eval function function that is the value of parameter; Described Eval method is to call the method for Eval function; The storage mode of described hash_map is a kind of storage mode of depositing the data structure of object identity and object; Described GetNode function is for obtaining the function of node.
Substep E2, adopt the method for recursive call, calculate the numerical value of indices.
Wherein,
There is not all the index object (root node) of father node to be put in the array, when calculating, only call like this computing method of these root node index objects, and in the computing method Eval of index object, call first the EVal function of child node, a kind of like this recursive call mode will calculate all finger target values; Wherein, the described Eval function function that is the value of parameter; Described Eval method is to call the method for Eval function.
The mode of substep E3, the GetNode function by calling the index container is imported index name into for user's input pointer, obtains the index object; Wherein, described GetNode function is for obtaining the function of node.
The mode of substep E4, the SetValue function by calling the index object arranges the index object that obtains, and obtains the result value of index object; Wherein, the described SetValue function function that is the value of setting target.
Wherein, the index of all inputs of user, the mode of the GetNode function by calling the index container is imported index name into, obtains the index object, and then the mode of the SetValue function by calling index object CComputeNode sets the finger target value.
Substep E5, by calling the mode of Eval function, resolve for root node, obtain the numerical value of indices; Wherein, the mode of described Eval function is to call the mode of Eval function.
Wherein, described substep E5 specifically can comprise:
Substep I1, by calling the mode of Eval function, carry out Analysis of recursive transfer for a root node, obtain the numerical value of each root node index.
Substep I2, by calling the mode of Eval function, remaining root node corresponding for each root node carries out Analysis of recursive transfer, obtains the numerical value of all the other corresponding root node indexs of each root node.
Substep I3, the numerical value of all the other corresponding root node indexs of the numerical value of above-mentioned each root node index and above-mentioned each root node is gathered, obtain the numerical value of indices.
The calculating of the free cash flow that lift the front just adopts the present invention to solve.
In a word, the invention provides a kind of method that realizes solving the index computation model with complicated calculations relation, the method can provide one simply, computation model solves complicated calculated relationship fast to the user.
Above a kind of method that realizes solving the index computation model with complicated calculations relation provided by the present invention is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (9)

1. a method that realizes solving the index computation model with complicated calculations relation is characterized in that, comprising:
Adopt the mode by the tree structure calculated relationship, set up index computation model, obtain user-defined index computation model;
Adopt the mode of preserving the tree structure between index by the gigabase object-oriented database, user-defined index computation model is preserved, obtain user-defined index computation model;
By the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file is preserved, obtain to preserve the data message file of the funtcional relationship of computing function;
Resolve the user-defined index computation model that obtains and calculate indices, obtain the numerical value of indices;
Described employing is set up index computation model by the mode of tree structure calculated relationship, obtains the step of user-defined index computation model, comprising:
Adopt the mode by the tree structure calculated relationship, set up the data dictionary of the index in the index computation model, and indices is edited, obtain the indices data in the index computation model; Wherein, described indices data are the type of each index and the title of each index;
Receive the reading out data instruction, begin to carry out the operation of the indices data of reading in the index computation model;
The user carries out the operation of setting up the index root node, obtains user-defined index computation model.
2. method according to claim 1 is characterized in that, described user carries out the operation of setting up the index root node, obtains the step of user-defined index computation model, comprising:
Set up the index root node, obtain the index root node;
If the index root node needs to calculate, then set up the corresponding index child node of index root node, obtain the corresponding index child node of index root node;
Write the function of the computing function of root node needs and realize body, obtain the funtcional relationship of computing function;
Execute aforesaid operations, obtain the funtcional relationship of index root node, the corresponding index child node of index root node and computing function, then obtain user-defined index computation model.
3. method according to claim 1, it is characterized in that, the mode of the tree structure between index is preserved in described employing by the gigabase object-oriented database, user-defined index computation model is preserved, obtain the step of user-defined index computation model, comprising:
The index root node that obtains is preserved, and the file of the data message of index root node is preserved in acquisition;
Adopt recursive fashion, for the index root node, preserve successively corresponding each the index child node of index root node, the file of the data message of index child node is preserved in acquisition;
Funtcional relationship to the computing function that obtains is preserved, and obtains to preserve the file of data message of the funtcional relationship of computing function;
Wherein, the data message of described index node is that the calculating of classification, C function name, user's input of title, the index root/child node of index root/child node realizes C function that the C code consists of and the ID of all index child node objects.
4. method according to claim 1, it is characterized in that, described by the TinyC compiler, with the calculated relationship of user with the self-defining index of C language compilation, be compiled into dll file and described dll file is preserved, the step of data message file of the funtcional relationship of computing function is preserved in acquisition, comprising:
The calculating of all user input is realized that the C code constructs becomes corresponding C function, obtain to realize accordingly C function one by one of C code for calculating;
Input is C function one by one accordingly, generates a C function source files of program;
Adopt the TinyC compiler, C function source files of program is compiled, obtain the dynamic library file of C function source files of program;
Described dynamic library file is saved in the table in the index computation model file as a binary field, obtains to preserve the data message file of the funtcional relationship of computing function.
5. method according to claim 1 is characterized in that, the user-defined index computation model that described parsing obtains also calculates indices, obtains the step of the numerical value of indices, comprising:
Read the index computation model file, obtain the numerical value of indices;
Adopt the method for recursive call, calculate the numerical value of indices;
The mode of the GetNode function by calling the index container is imported index name into for user's input pointer, obtains the index object;
The mode of the SetValue function by calling the index object arranges the index object that obtains, and obtains the result value of index object;
By calling the mode of Eval function, resolve for root node, obtain the numerical value of indices.
6. method according to claim 5 is characterized in that, the described index computation model file that reads, and the step of the numerical value of acquisition indices comprises:
Reading and saving has the file of the data message of index root/child node, obtains the data message of index root/child node;
Reading and saving has the file of data message of the funtcional relationship of computing function, obtains the data message of the funtcional relationship of computing function.
7. method according to claim 6 is characterized in that, described reading and saving has the file of the data message of index root/child node, obtains the step of the data message of index root/child node, comprising:
Be the corresponding object instance of each Index Establishment, obtain the object instance of each index;
Set up corresponding subobject example for the subobject of each index, obtain the subobject example of each index;
The subobject example of the object instance of each index and some subobjects of each object thereof consists of the object system of tree structure;
Set up the object container object, obtain object container;
Each index object is joined in the object container;
Adopt the storage mode of hash_map, set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If in object container, import the title of index object into, the address of object container fast return index object then;
Finish above-mentioned steps, finish the file that reading and saving has the data message of index root/child node, obtain the overall process of the data message of index root/child node.
8. method according to claim 6 is characterized in that, described reading and saving has the file of data message of the funtcional relationship of computing function, obtains the step of data message of the funtcional relationship of computing function, comprising:
Read in computing method in the binary field from the file of the data message of the funtcional relationship of computing function;
Computing method are written in the dynamic library file;
Adopt the storage mode of hash_map, set up the title of index object and the mapping relations of index object address, the mapping relations of the title of acquisition index object and the address of index object; If import the title of index object in object container, the address of object container fast return index object then;
By calling the mode of Eval function, for last column code of index object, call the funtcional relationship of computing function, obtain the data message of the funtcional relationship of computing function.
9. method according to claim 5 is characterized in that, describedly resolves for root node by calling the mode of Eval function, obtains the step of the numerical value of indices, comprising:
By calling the mode of Eval function, carry out Analysis of recursive transfer for a root node, obtain the numerical value of each root node index;
By calling the mode of Eval function, all the other root nodes corresponding for each root node carry out Analysis of recursive transfer, obtain the numerical value of all the other corresponding root node indexs of each root node;
Numerical value to all the other corresponding root node indexs of the numerical value of above-mentioned each root node index and above-mentioned each root node gathers, and obtains the numerical value of indices.
CN 201110322515 2011-10-21 2011-10-21 Method for implementing index computation model for solving complex computing relationship Active CN102393868B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110322515 CN102393868B (en) 2011-10-21 2011-10-21 Method for implementing index computation model for solving complex computing relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110322515 CN102393868B (en) 2011-10-21 2011-10-21 Method for implementing index computation model for solving complex computing relationship

Publications (2)

Publication Number Publication Date
CN102393868A CN102393868A (en) 2012-03-28
CN102393868B true CN102393868B (en) 2013-04-03

Family

ID=45861191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110322515 Active CN102393868B (en) 2011-10-21 2011-10-21 Method for implementing index computation model for solving complex computing relationship

Country Status (1)

Country Link
CN (1) CN102393868B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468248B (en) * 2021-09-06 2021-12-21 天津中新智冠信息技术有限公司 Data statistical method, device, equipment and storage medium
CN117154780A (en) * 2023-10-27 2023-12-01 深圳库博能源股份有限公司 Distributed collaborative energy storage control method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334486A (en) * 2007-06-25 2008-12-31 中国科学院广州能源研究所 Gas hydrate lowest economic reserve measuring and calculating method
CN101345654A (en) * 2008-08-30 2009-01-14 华为技术有限公司 Index computing method and apparatus
CN102034176A (en) * 2011-01-17 2011-04-27 北京理工大学 General comprehensive evaluation system adopting multiple evaluation methods

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7792817B2 (en) * 2005-04-19 2010-09-07 International Business Machines Corporation System and method for managing complex relationships over distributed heterogeneous data sources

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334486A (en) * 2007-06-25 2008-12-31 中国科学院广州能源研究所 Gas hydrate lowest economic reserve measuring and calculating method
CN101345654A (en) * 2008-08-30 2009-01-14 华为技术有限公司 Index computing method and apparatus
CN102034176A (en) * 2011-01-17 2011-04-27 北京理工大学 General comprehensive evaluation system adopting multiple evaluation methods

Also Published As

Publication number Publication date
CN102393868A (en) 2012-03-28

Similar Documents

Publication Publication Date Title
CN112100054B (en) Data management and control oriented program static analysis method and system
CN103631632B (en) Implantation method and source-to-source compiler
CN106897322B (en) A kind of access method and device of database and file system
CN102609255B (en) A kind of generation method of Spring IOC configuration file
CN102043657A (en) File serialization method of model library of physical modeling language Modelica
CN102033748A (en) Method for generating data processing flow codes
CN101604241A (en) A kind of code generating method of embedded system
CN108766507B (en) CQL and standard information model openEHR-based clinical quality index calculation method
CN110955714A (en) Method and device for converting unstructured text into structured text
CN107330014A (en) The creation method and equipment of a kind of tables of data
CN107103035A (en) This earth's surface data-updating method and device
CN102393868B (en) Method for implementing index computation model for solving complex computing relationship
CN106445645A (en) Method and device for executing distributed computation tasks
CN102929853B (en) Based on DCS project data generation system and the method for the association of Excel list
CN105404611A (en) Matrix model based multi-calculation-engine automatic selection method
CN115905630A (en) Graph database query method, device, equipment and storage medium
CN106126564A (en) A kind of method rendered based on dynamic template language
CN105867886B (en) Method and device for writing table
US8914782B2 (en) Optimization of declarative queries
CN104281604B (en) Method and system for generating Target Link data dictionary hierarchical tree
CN112651226A (en) Knowledge analysis system and method based on dependency syntax tree
Sherrington Mastering Julia
Ali et al. Parallelizing user-defined functions in the ETL workflow using orchestration style sheets
CN111581047B (en) Supervision method for intelligent contract behavior
Aladjev et al. Extension of Mathematica system functionality

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 834000 Karamay Road, the Xinjiang Uygur Autonomous Region, No. 22

Patentee after: Red software Limited by Share Ltd

Address before: 834000 Karamay Road, the Xinjiang Uygur Autonomous Region, No. 22

Patentee before: Karamay Hongyou Software Co., Ltd.