CN101271550A - Data distribution method and device in application system - Google Patents

Data distribution method and device in application system Download PDF

Info

Publication number
CN101271550A
CN101271550A CNA2008100972968A CN200810097296A CN101271550A CN 101271550 A CN101271550 A CN 101271550A CN A2008100972968 A CNA2008100972968 A CN A2008100972968A CN 200810097296 A CN200810097296 A CN 200810097296A CN 101271550 A CN101271550 A CN 101271550A
Authority
CN
China
Prior art keywords
data
rule
allocation
distribution
allocation criterion
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.)
Pending
Application number
CNA2008100972968A
Other languages
Chinese (zh)
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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CNA2008100972968A priority Critical patent/CN101271550A/en
Publication of CN101271550A publication Critical patent/CN101271550A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a data distribution method used in an application system, which includes: a data distribution rule is defined which includes the position information of source data; the source data is extracted according to the position information to explain and execute the data distribution rule and acquire distribution standard parameters; distribution coefficients are calculated according to the distribution standard parameters; the distribution of target data is implemented according to the distribution coefficients. The data distribution method used in the application system of the invention results in that a user can configure different distribution standards according to practical conditions, thus satisfying a plurality of demands of the user and improving the generality and the expansibility of the distribution standards.

Description

Data distributing method in a kind of application system and device
Technical field
The present invention relates to the data processing field in the application system, particularly relate to data distributing method and data distribution device in a kind of application system.
Background technology
Data allocations is according to predefined certain rule of user, a kind of method that data to be allocated are rearranged or integrate.Data are divided many types, so the method for data allocations also has nothing in common with each other according to different situations.With the example that is assigned as of cost of products, the calculating of cost of products is the core content of cost accounting, and its computation process is exactly in fact the partition process of various expense boundaries.In order to draw a clear various expense boundaries, guarantee the correctness that cost of products is calculated, should when taking place, directly belong to corresponding cost objective, and a large amount of expenses that counts indirectly needs then to select rational allocation criterion to distribute to the expense that directly counts.Because the allocation criterion difference of selecting, distribution result also is different, so the selection of allocation criterion, and correctness, the rationality of allocation result played a decisive role.
The method that prior art has two kinds of cost of products to distribute, first method is the unified product dispensation standard of customization, the unified product dispensation standard of customization is to develop according to user's initial requirement to finish, and satisfies user's requirement for allocation criterion at the beginning of product development.Because the client of different industries has the allocation criterion of different qualities, so after enterprise development, require just need develop the higher analytic angle that new allocation criterion adapts to cost of products again when higher for the analytic angle of cost of products.
Therefore as can be seen, it is exactly that versatility is not strong that there is significant disadvantages in this method.Initial in enterprise development, usually the realization that comes requirement software according to manual custom, at this moment allocation criterion can only replace hand computation, along with management development, enterprise is more and more stronger to the requirement meeting of the analysis dynamics of cost of products, the workload of original hand computation cost is transferred to the workload of cost analysis, original allocation criterion will not satisfy the requirement of the promptness or the accuracy of cost accounting, at this moment if use new allocation criterion, just need customized development again, again drop into cost of development again, this is a process that circulation drops into for enterprise not only, and for the software developer, each customer requirement all needs to develop again, so the circulation of the duplication of labour has just expended a large amount of development cost of enterprise.
Second method is exactly to utilize common product dispensation standard, and promptly being provides the allocation criterion that can get data in several commonly used, existing software systems easily to different users.Equally, also there is following shortcoming in this method: extendability is bad, and its characteristic difference of the enterprise of different industries is also different for the mode of public share the expenses, but these enterprises can only select in limited several allocation criterions, so this method can not well satisfy the multiple demand of enterprise.By way of example, if, can satisfy the demands well for discrete type enterprise, because can come out more accurately the man-hour of a part processing by allocated product cost actual hours; But just the requirement of its allocation criterion can not have been satisfied for flow type enterprise, because being repetition and continous way in enormous quantities, flow type enterprise produces, calculate actual hours so can not from certain process, block, so actual hours, this standard was nonsensical for flow type enterprise.
In a word, need the urgent technical matters that solves of those skilled in the art to be exactly at present: how can propose the data distributing method in a kind of application system, in order to improve the versatility and the extendability of cost of products allocation criterion.
Summary of the invention
Technical matters to be solved by this invention provides the data distributing method in a kind of application system, in order to improve the versatility and the extendability of cost of products allocation criterion.
Another object of the present invention is that above-mentioned design is applied to provide the data distribution device in a kind of application system in the concrete applied environment, thereby guarantees the realization and the application of this method.
For solving the problems of the technologies described above, the embodiment of the invention provides the data distributing method in a kind of application system, comprising:
The definition of data allocation rule comprises the positional information of source data in the described rule;
According to described positional information extraction source data, carry out described data allocations rule to explain, and obtain the allocation criterion parameter;
According to described allocation criterion calculation of parameter partition factor;
Carry out the distribution of target data according to described partition factor.
Preferably, also comprise:
According to the described target data apportioning cost of described allocation criterion parameter adjustment.
Preferably, described data allocations rule comprises single computation rule or compound computation rule.
Preferably, described source bit of data is in the tables of data of described application system.
Preferably, described source data is imported acquisition for receiving the user.
Preferably, described application system is an ERP system.
The embodiment of the invention also provides the data distribution device in a kind of application system, comprising:
Definition module is used for the definition of data allocation rule, comprises the positional information of source data in the described rule;
Parsing module is used for according to described positional information extraction source data, carries out described data allocations rule to explain, and obtains the allocation criterion parameter;
Computing module is used for the allocation criterion calculation of parameter partition factor that obtains according to described parsing module;
Distribution module is used for carrying out the distribution of target data according to described partition factor.
Preferably, also comprise:
Adjusting module is used for according to the described target data apportioning cost of described allocation criterion parameter adjustment.
Preferably, described data allocations rule comprises single computation rule or compound computation rule.
Preferably, described source bit of data is in the tables of data of described application system.
Compared with prior art, the present invention has the following advantages:
The present invention is by the definition of data allocation rule, the positional information that comprises source data in the described rule, according to described positional information extraction source data, carry out described data allocations rule to explain, and acquisition allocation criterion parameter, simultaneously according to described allocation criterion calculation of parameter partition factor, the described partition factor of last foundation carries out the distribution of target data, make the user to dispose different allocation criterions according to actual conditions, promptly satisfy user's multiple demand, improved the versatility and the extendability of allocation criterion again.
Description of drawings
Fig. 1 is the process flow diagram of a kind of data distributing method embodiment of the present invention;
Fig. 2 is the synoptic diagram one of a kind of data distributing method embodiment of the present invention;
Fig. 3 is the synoptic diagram two of a kind of data distributing method embodiment of the present invention;
Fig. 4 is the synoptic diagram three of a kind of data distributing method embodiment of the present invention;
Fig. 5 is the synoptic diagram four of a kind of data distributing method embodiment of the present invention;
Fig. 6 is the arithmetic analysis process flow diagram of a kind of data distributing method embodiment of the present invention;
Fig. 7 is the structured flowchart of a kind of data distribution device embodiment of the present invention;
Fig. 8 uses the process flow diagram that preferred embodiment shown in Figure 7 carries out data allocations.
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.
The present invention can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, comprise distributed computing environment of above any system or equipment or the like.
The present invention can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment, put into practice the present invention, in these distributed computing environment, by by communication network connected teleprocessing equipment execute the task.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
With reference to figure 1, show the process flow diagram of a kind of data distributing method embodiment of the present invention, can may further comprise the steps:
Step 101, definition of data allocation rule comprise the positional information of source data in the described rule;
Step 102, the described positional information extraction source data of foundation are carried out described data allocations rule to explain, and are obtained the allocation criterion parameter;
Step 103, the described allocation criterion calculation of parameter partition factor of foundation;
Step 104, the described partition factor of foundation carry out the distribution of target data.
Preferably, present embodiment can also comprise step:
According to the described target data apportioning cost of described allocation criterion parameter adjustment.
In practice, application system of the present invention can be the EPR system, described source data can be obtained from the tables of data of described application system, and application system of the present invention can provide special platform for the user, is used for definition of data allocation rule (being allocation criterion); Need to prove, data allocations rule of the present invention can comprise single computation rule (being the allocation criterion unit) or compound computation rule (being compound allocation criterion), usually, single computation rule can comprise the rule and the user-defined rule of systemic presupposition, be understandable that, for the rule of systemic presupposition, to fixing statistical rules and resolution rules should be arranged; For user-defined rule, the invention provides the interface for users typing of man-machine interaction; Equally, compound computation rule also can comprise the rule and the user-defined rule of systemic presupposition, for the rule of systemic presupposition, to fixing peek logic, statistical rules and resolution rules should be arranged; For user-defined rule, corresponding statistics and resolution rules can be got by self-defining rule by system.
The example that is assigned as with actual common cost, if the user wishes data allocations rule=[finished production in current period] * [product coefficient], " [product coefficient] " is self-defined single computation rule, the user imports the coefficient of each product at human-computer interaction interface, " [finished production in current period] " is the single computation rule of systemic presupposition, the source data of the product warehousing list of current period warehousing module is got by system, carrying out the branch product gathers, when this allocation criterion is quoted in expense allocation, obtain corresponding numerical value according to two single computation rules earlier during system analysis, promptly the positional information according to source data extracts source data to resolve the described single computation rule of execution, calculate the partition factor of each product again according to operation rule, distribute common cost according to this partition factor then.
Perhaps, when described data allocations rule is compound computation rule, at first carry out the distribution of data by the content that defines compound computation rule, specifically can be referring to Fig. 2 and Fig. 3, standard in the allocation criterion unit all is the standard of systemic presupposition, when the user chooses " compound standard ", show that then the standard that the user sets is compound standard:
For example, [compound standard]=[current period is dropped into output] * [working as coefficient approximately],, then [current period is dropped into output] gets the current period data from workshop module " dropping into the yield data table ", and [working as coefficient approximately] gets custom data;
When the user had chosen [compound standard], system automatically peeked from " drop into yield data table " and in the custom data respectively, and carries out multiplying, can be referring to shown in Figure 4, thus draw the allocation criterion value (allocation criterion parameter) of product; As the A product is 100, and the B product is 150, and the C product is 175, and the D product is 200;
Calculate after the allocation criterion parameter, can utilize described allocation criterion calculation of parameter to go out the partition coefficient of corresponding product, it promptly is partition factor, concrete computation process is: A product dispensation rate=100/ (100+150+175+200)=0.16, in like manner, the B product be 0.24, the C product be 0.28, the D product be 0.32;
Need to prove, the institute's documentary of just wanting cost of distribution and certain operations button that the user sees, program is carried out in the backstage;
Calculate after the partition factor, can utilize described partition factor to carry out the distribution of target data; For example, supposing to have a common cost is 100 yuan, it be multiply by the partition coefficient of each product respectively, drawing the expense of sharing each product is: the A product is 16.00 yuan, the B product is 24.00 yuan, the C product is 28.00 yuan, and the D product is 32.00 yuan, and the expense of last described each product that calculates is exactly the distribute data that the user needs; Can be referring to shown in Figure 5, the distribution of described target data is presented to the user by the expense detail list;
Be understandable that if there is not the said system process of operation automatically, the user will finish everything by hand; The present invention is alleviating the workload that the cost accounting personnel calculated and adjusted data the end of month, make when cost accounting checkout day shifts to an earlier date greatly, make that also the pricing result is accurate, also provide cost savings simultaneously accountant's accounting energy, make the accountant that the time and efforts of more cost analysis, decision-making be arranged, promoted the cost analysis ability of enterprise; Secondly, data distributing method of the present invention can be reused, and when enterprise constantly develops, can support enterprise to change the requirement of allocation criterion, and additionally do not increase development cost, at last, the algorithm of data allocations of the present invention is simple and clear, does not need software vendor to teach separately, can additionally not increase implementation cost yet, also having preset some simultaneously has general character, represents the allocation criterion of most of enterprise general requirment, and enterprise can directly use initial go-live period.
Below further specify data allocation process of the present invention by an object lesson.
Enterprise need distribute according to allocation criterion expending altogether in carrying out the cost accounting process.The different reasons with the expense generation of enterprise's production technology are different, just cause the allocation criterion of cost of products also will change thereupon, therefore, when product is carried out expense allocation, only provide standards such as dropping into output, completion output, actual hours can not satisfy the distribution needs, at this moment just need provide a kind of can be as the case may be by the data distributing method of User Defined allocation criterion.
Need to prove that when data allocations, business demand should cooperate existing analysis of system performance, can be divided into following three kinds the mode of allocation criterion:
(1) general allocation scheme.
For example, the allocation criterion of systemic presupposition is carried out cost of products according to standards such as " input output ", " completion output ", " actual hours ", " equivalent production units " and is distributed;
(2) self-defined allocation scheme.
Based on different distribution requirements, and do not satisfy the self-defining allocation scheme of user to user when the allocation criterion of systemic presupposition, in this case, the allocation criterion parameter is derived from the self-defining data of user's input;
(3) compound formula mode.
On the basis of aforementioned two kinds of allocation scheme, satisfy higher, the more complicated distribution degree of accuracy demand of customer requirements by defining compound formula.
Below introduce Structured Query Language (SQL) (Structured Query Language, SQL) the parsing implementation of " single computation rule " (allocation criterion unit) and " compound computation rule " (compound computation rule) respectively.The allocation criterion unit has comprised the data allocations rule of systemic presupposition, for example " current period drop into output ", " user-defined allocation criterion unit " etc., the following stated is the example of User Defined allocation criterion unit, and the similar algorithm of the data allocations rule of systemic presupposition does not repeat them here.
With the product expense allocation is example, be the process of the expense allocation of same entity cost center to each cost objective, wherein application scenarios one is " an allocation criterion unit mode ", wherein, User Defined allocation criterion unit " the self-defined unit of ZDYDY ", distribute to be provided with or to select this self-defined allocation criterion to distribute during expense allocation;
Application scenarios two has been User Defined compound allocation criterion " the compound standard of FHBZ ", and formula is " compound standard=current period is dropped into output * self-defined unit ", selects this compound standard to distribute when distributing setting or expense allocation.
Wherein, the parsing activity step of described two application scenarioss specifically can may further comprise the steps as shown in Figure 6:
S1: carry out the branch timing to expending altogether, obtain the object range of expense allocation;
S2: the selected described allocation rule that expends usefulness altogether, when described allocation rule is single computation rule, enter step S3, when described allocation criterion is compound computation rule, enter step S4;
S3: if the rule that described single computation rule is a systemic presupposition then enters substep S31; If the User Defined rule then enters substep S32;
S31: be obtained from definition rule data (source data of from rule, extracting), enter step S9;
S32: obtain business rule (source data of from rule, extracting), enter step S9;
S4: compound computation rule is resolved to a plurality of single computation rules, and described single rule is carried out in circulation;
S5: judge whether described single rule finishes circulation,, then enter step S8 if finish circulation; Then do not enter step S6 if finish;
S6: judge that next rule is a still User Defined rule of systemic presupposition rule, enter substep S61 during for the systemic presupposition rule, during for the User Defined rule, enter substep S62;
S61: be obtained from definition normal data (source data of from rule, extracting), enter step S7;
S62: obtain business datum (source data of from rule, extracting), enter step S7;
S7: calculate the allocation criterion value (being the allocation criterion parameter) of single computation rule, enter step S5;
S8: calculate the allocation criterion value of compound rule, enter step S9;
S9: calculate the partition factor that respectively distributes object according to described allocation criterion value;
S10: data to be distributed is distributed according to described partition factor;
S11: allocation result is write the allocation result table present to the user;
Preferably, can also comprise step between step S10 and the S11:
According to the described target data apportioning cost of described allocation criterion parameter adjustment, promptly the tail difference in the reality is handled.
Use in the application scenarios one data distributing method of the present invention carry out data allocation process can be shown in following code:
IF?OBJECT_ID(′T_CM_DistributeStandardUnit′)<>0
DROP?TABLE?T_CM_DistributeStandardUnit
IF?OBJECT_ID(′T_CM_DistributeStandard′)<>0
DROP?TABLE?T_CM_DistributeStandard
-----------------------------------------------------------------------------
--tables of data
--the allocation criterion cell list
CREATE?TABLE?T_CM_DistributeStandardUnit(
FID INT NOT NULL,--ISN
FNumber NVARCHAR (80) NOT NULL,--coding
FName NVARCHAR (255) NULL,--title
FDispStdID VARCHAR (44) NULL--allocation criterion ISN
)
--the allocation criterion table
CREATE?TABLE?T_CM_DistributeStandard(
FID INT NOT NULL,--ISN
FNumber NVARCHAR (80) NOT NULL,--coding
FName NVARCHAR (255) NULL,--title
FIsComplex INT NOT NULL DEFAULT (0),--compound standard whether
FFormula NVARCHAR (255) NOT NULL DEFAULT (")--calculate public
Formula
)
--tables of data
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--test data
--the allocation criterion unit
--FID FNumber FName FDispStdID
----------------------------------------------------------------------
--1 ' TRCL ' ' current period is dropped into output ' 0
--the self-defined unit of 2 ' ZDYDY ' ' ' 13
INSERTINTO?T_CM_DistributeStandardUnit(FID,FNumber,FName,
FDispStdID)
VALUES (1, ' TRCL ', ' current period input output ', 0)
INSERT?INTO?T_CM_DistributeStandardUnit(FID,FNumber,FName,
FDispStdID)
VALUES (2, ' ZDYDY ', ' self-defined unit ', 13)
--the allocation criterion table
--FID?FNumber FNameFIsComplex FFormula
--the self-defined unit of 13 ' ZDYDY ' ' ' 0 "
--14 ' FHBZ " compound standard ' 1 '~the compound standard~@=of #~# current period drops into output
Self-defined unit~the @ ' of~@*~#
INSERT?INTO?T_CM_DistributeStandard(FID,FNumber,FName,
FIsComplex,FFormula)
VALUES (13, ' ZDYDY ', ' self-defined unit ', 0, ")
INSERT?INTO?T_CM_DistributeStandard(FID,FNumber,FName,
FIsComplex,FFormula)
VALUES (14, ' FHBZ ', ' compound standard ', 1, '~the compound standard~@=of #~# current period
Drop into the self-defined unit~@ ' of output~@*~#)
--the typing of self-defined allocation criterion data
IF?OBJECT_ID(′dbtemp..#UserData′)<>0
DROP?TABLE#UserData
CREATE?TABLE#UserData(
FDeptID int,--department's ISN
FCostObjID int,--the object ISN
FStandardID int,--the allocation criterion ISN
FQty Decimal (23,10) Not Null Default (0)--typing
Numerical value
)
--logging data
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,11,13,20)
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,12,13,30)
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,13,13,50)
--test data
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--distribute
--01, select allocation criterion (when selecting " self-defined unit " allocation criterion)
SELECT?FID,FNumber,FName,FIsComplex,FFormula
FROM?T_CM_DistributeStandard?WHERE?FID=13
--FID FNumber FName FIsComplex FFormula
---------------------------------------------------------------------
--the self-defined unit of 13 ' ZDYDY ' ' ' 0 "
--02, obtain the apportioning cost object range
IF?OBJECT_ID(′dbtemp..#CostObj′)<>0
DROP?TABLE#CostObj
CREATE?TABLE#CostObj(
FDeptID int,--department's ISN
FCostObjID int,--the object ISN
FQty Decimal (23,10) Not Null Default (0),--standard value
FQuotiety Decimal (23,10) Not Null Default (0)--divide
Distribution coefficient
)
--insert the cost objective that the current period participates in calculating
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,11)
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,12)
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,13)
--03, (annotate: FIsComplex=0 is self-defined to obtain " standard value " according to the allocation criterion of selecting
The allocation units standard)
UpDate?t1?SET?t1.FQty=t2.FQty
FROM#CostObj t1
INNER?JOIN#UserData?t2
ON ( t1.FDeptID=t2.FDeptID AND
t2.FCostObjID=t1.FCostObjID)
WHERE?t2.FStandardID=13
--04, the partition factor of calculation
DECLARE@SumQty?DECIMAL(23,10)
SELECT@SumQty=ISNULL(SUM(FQty),0)FROM#CostObj
IF@SumQty<>0
UPDATE#CostObj?SET?FQuotiety=FQty/@SumQty
--05, the amount of money to be allocated, by top calculate " the dividing of " partition factor " each cost objective of calculating
Join value "
--06, the tail difference is handled (being transferred to " standard value " maximum that pen)
--distribute
-----------------------------------------------------------------------------
Use in the application scenarios two data processing method of the present invention carry out the process of data allocations can be shown in following code:
IF?OBJECT_ID(′T_CM_DistributeStandardUnit′)<>0
DROP?TABLE?T_CM_DistributeStandardUnit
IF?OBJECT_ID(′T_CM_DistributeStandard′)<>0
DROP?TABLE?T_CM_DistributeStandard
-----------------------------------------------------------------------------
--tables of data
--the allocation criterion cell list
CREATE?TABLE?T_CM_DistributeStandardUnit(
FID INT NOT NULL,--ISN
FNumber NVARCHAR (80) NOT NULL,--coding
FName NVARCHAR (255) NULL,--title
FDispStdID VARCHAR (44) NULL--allocation criterion ISN
)
--the allocation criterion table
CREATE?TABLE?T_CM_DistributeStandard(
FID INT NOT NULL,--ISN
FNumber NVARCHAR (80) NOT NULL,--coding
FName NVARCHAR (255) NULL,--title
FIsComplex INT NOT NULL DEFAULT (0),--compound standard whether
FFormula NVARCHAR (255) NOT NULL DEFAULT (")--calculate public
Formula
)
--tables of data
---------------------------------------------------------------------
---------------------------------------------------------------------
--test data
--the allocation criterion unit
--FID FNumber FName FDispStdID
-------------------------------------------------------------------
--1 ' TRCL ' ' current period is dropped into output ' 0
--the self-defined unit of 2 ' ZDYDY ' ' ' 13
INSERT?INTO?T_CM_DistributeStandardUnit(FID,FNumber,FName,
FDispStdID)
VALUES (1, ' TRCL ', ' current period input output ', 0)
INSERT?INTO?T_CM_DistributeStandardUnit(FID,FNumber,FName,
FDispStdID)
VALUES (2, ' ZDYDY ', ' self-defined unit ', 13)
--the allocation criterion table
--FID?FNumber?FNameFIsComplex?FFormula
--the self-defined unit of 13 ' ZDYDY ' ' ' 0 "
--14 ' FHBZ " compound standard ' 1 '~the compound standard~@=of #~# current period drops into output
Self-defined unit~the @ ' of~@*~#
INSERT?INTO?T_CM_DistributeStandard(FID,FNumber,FName,
FIsComplex,FFormula)
VALUES (13, ' ZDYDY ', ' self-defined unit ', 0, ")
INSERT?INTO?T_CM_DistributeStandard(FID,FNumber,FName,
FIsComplex,FFormula)
VALUES (14, ' FHBZ ', ' compound standard ', 1, '~the compound standard~@=of #~# current period
Drop into the self-defined unit~@ ' of output~@*~#)
--the typing of self-defined allocation criterion data
IF?OBJECT_ID(′dbtemp..#UserData′)<>0
DROP?TABLE#UserData
CREATE?TABLE#UserData(
FDeptID int,--department's ISN
FCostObjID int,--the object ISN
FStandardID int,--the allocation criterion ISN
FQty Decimal (23,10) Not Null Default (0)--typing
Numerical value
)
--logging data
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,11,13,20)
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,12,13,30)
INSERT?INTO#UserData(FDeptID,FCostObjID,FStandardID,FQty)
VALUES(1,13,13,50)
--the current period is dropped into output
IF?OBJECT_ID(′dbtemp..#InputData′)<>0
DROP?TABLE#InputData
CREATE?TABLE#InputData(
FDeptID int,--department's ISN
FCostObjID int,--the object ISN
FQty Decimal (23,10) Not Null Default (0)--output
)
--yield data
INSERT?INTO#InputData (FDeptID,FCostObjID,FQty)VALUES
(1,11,100)
INSERT?INTO#InputData (FDeptID,FCostObjID,FQty)VALUES
(1,12,200)
INSERT?INTO#InputData (FDeptID,FCostObjID,FQty)VALUES
(1,13,300)
--test data
------------------------------------------------------------------------
------------------------------------------------------------------------
--distribute
--01, select allocation criterion (when selecting " compound standard " allocation criterion)
SELECT?FID,FNumber,FName,FIsComplex,FFormula
FROM?T_CM_DistributeStandard?WHERE?FID=14
--FID?FNumber?FNameFIsComplex?FFormula
-----------------------------------------------------------------------
--14 ' FHBZ " compound standard ' 1 '~the compound standard~@=of #~# current period drops into output
Self-defined unit~the @ ' of~@*~#
--decompose compound standard (IfFIsComplex=1 Then)
SELECT?FID,FNumber,FName,FDispStdID
FROM?T_CM_DistributeStandardUnit
WHERE '~# current period is dropped into the self-defined unit~@ ' like of output~@*~#
′%~#′+FName+′~@%′
--FID FNumber FName FDispStdID
-----------------------------------------------------
--1 TRCL current period was dropped into output 0
--the self-defined unit 13 of 2 ZDYDY
--02, the apportioning cost object range
IF?OBJECT_ID(′dbtemp..#CostObj′)<>0
DROP?TABLE#CostObj
CREATE?TABLE#CostObj(
FDeptID int,--department's ISN
FCostObjID int,--the object ISN
--according to the result set dynamic creation row (suffix is the unit ISN) that decompose above
[FQty_1] Decimal(23,10)Not?Null?Default(0),
--according to the result set dynamic creation row (suffix is the unit ISN) that decompose above
[FQty_2] Decimal(23,10)Not?Null?Default(0),
FQty Decimal(23,10)Not?Null?Default(0),--
Standard value
FQuotiety Decimal(23,10)Not?Null?Default(0)
--partition factor
)
--insert the cost objective that the current period participates in calculating
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,11)
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,12)
INSERT?INTO#CostObj (FDeptID,FCostObjID)VALUES(1,13)
--03, each allocation criterion unit that circulation is decomposed obtains correspondence " standard value "
--" current period is dropped into output "
UPDATE?t1?SET t1.FQty_1=t2.FQty
FROM#CostObjt1
INNER?JOIN (
SELECT FDeptID,FCostObjID,SUM(FQty)as?FQty
FROM#InputData
GROUP?BY?FDeptID,FCostObjID
) t2 ON ( t1.FDeptID=t2.FDeptID AND
t1.FCostObjID=t2.FCostObjID)
--" self-defined unit "
UPDATE?t1?SET t1.FQty_2=t2.FQty
FROM#CostObj?t1
INNER?JOIN #UserData?t2?ON(t1.FDeptID=t2.FDeptID?AND
t2.FCostObjID=t1.FCostObjID)
WHERE t2.FStandardID=13--(13 FDispStdID) from the decomposition result collection
--04, computing formula ('~the # current period drops into the self-defined unit~@ ' of output~@*~# and replaces to
′FQty_1*FQty_2′)
UPDATE #CostObj?SET?FQty=FQty_1*FQty_2
--05, the partition factor of calculation
DECLARE@SumQty?DECIMAL(23,10)
SELECT@SumQty=ISNULL(SUM(FQty),0)FROM#CostObj
IF@SumQty<>0
UPDATE#CostObj?SET?FQuotiety=FQty/@SumQty
--05, the amount of money to be allocated, by top calculate " the dividing of " partition factor " each cost objective of calculating
Join value "
--06, the tail difference is handled (being transferred to " standard value " maximum that pen)
--distribute
-------------------------------------------------------------
Need to prove, for aforesaid method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to figure 7, show the structured flowchart of the data distribution device embodiment in a kind of application system of the present invention, can comprise with lower module:
Definition module 701 is used for the definition of data allocation rule, comprises the positional information of source data in the described rule;
Parsing module 702 is used for according to described positional information extraction source data, carries out described data allocations rule to explain, and obtains the allocation criterion parameter;
Computing module 703 is used for the allocation criterion calculation of parameter partition factor that obtains according to described parsing module;
Distribution module 704 is used for carrying out the distribution of target data according to described partition factor.
Preferably, described device can also comprise:
Adjusting module is used for according to the described target data apportioning cost of described allocation criterion parameter adjustment.
With reference to figure 8, show and use the process flow diagram that preferred embodiment shown in Figure 7 carries out data allocations, can may further comprise the steps:
Step 801: definition module definition of data allocation rule comprises the positional information of source data in the described rule;
Step 802: parsing module is carried out described data allocations rule to explain, and is obtained the allocation criterion parameter according to described positional information extraction source data;
Step 803: the allocation criterion calculation of parameter partition factor that computing module obtains according to described parsing wooden unit;
Step 804: distribution module is carried out the distribution of target data according to the partition factor that described computing module calculates.
Step 805: adjusting module is according to the described target data apportioning cost of described allocation criterion parameter adjustment.
Preferably, described data allocations rule comprises single computation rule or compound computation rule.
Preferably, described source bit of data is in the tables of data of described application system.
For device embodiment, because it is substantially corresponding to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than data distributing method and data distribution device in a kind of application system provided by the present invention are 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, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1, the data distributing method in a kind of application system is characterized in that, comprising:
The definition of data allocation rule comprises the positional information of source data in the described rule;
According to described positional information extraction source data, carry out described data allocations rule to explain, and obtain the allocation criterion parameter;
According to described allocation criterion calculation of parameter partition factor;
Carry out the distribution of target data according to described partition factor.
2, the method for claim 1 is characterized in that, also comprises:
According to the described target data apportioning cost of described allocation criterion parameter adjustment.
3, method as claimed in claim 1 or 2 is characterized in that, described data allocations rule comprises single computation rule or compound computation rule.
4, method as claimed in claim 3 is characterized in that, described source bit of data is in the tables of data of described application system.
5, method as claimed in claim 3 is characterized in that, described source data is imported acquisition for receiving the user.
6, the method for claim 1 is characterized in that, described application system is an ERP system.
7, the data distribution device in a kind of application system is characterized in that, comprising:
Definition module is used for the definition of data allocation rule, comprises the positional information of source data in the described rule;
Parsing module is used for according to described positional information extraction source data, carries out described data allocations rule to explain, and obtains the allocation criterion parameter;
Computing module is used for the allocation criterion calculation of parameter partition factor that obtains according to described parsing module;
Distribution module is used for carrying out the distribution of target data according to described partition factor.
8, device as claimed in claim 7 is characterized in that, also comprises:
Adjusting module is used for according to the described target data apportioning cost of described allocation criterion parameter adjustment.
As claim 7 or 8 described devices, it is characterized in that 9, described data allocations rule comprises single computation rule or compound computation rule.
10, device as claimed in claim 9 is characterized in that, described source bit of data is in the tables of data of described application system.
CNA2008100972968A 2008-05-09 2008-05-09 Data distribution method and device in application system Pending CN101271550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100972968A CN101271550A (en) 2008-05-09 2008-05-09 Data distribution method and device in application system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100972968A CN101271550A (en) 2008-05-09 2008-05-09 Data distribution method and device in application system

Publications (1)

Publication Number Publication Date
CN101271550A true CN101271550A (en) 2008-09-24

Family

ID=40005503

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100972968A Pending CN101271550A (en) 2008-05-09 2008-05-09 Data distribution method and device in application system

Country Status (1)

Country Link
CN (1) CN101271550A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426677A (en) * 2015-11-19 2016-03-23 中国人民解放军第306医院 HRP data centre and data quality assurance system design method thereof
CN108132777A (en) * 2016-11-30 2018-06-08 上海驭创信息科技有限公司 Across the table exploitation system and method for one kind
CN110033154A (en) * 2018-12-12 2019-07-19 阿里巴巴集团控股有限公司 Resource allocation method, device and equipment
CN111275284A (en) * 2019-12-26 2020-06-12 用友网络科技股份有限公司 Cost allocation device and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426677A (en) * 2015-11-19 2016-03-23 中国人民解放军第306医院 HRP data centre and data quality assurance system design method thereof
CN108132777A (en) * 2016-11-30 2018-06-08 上海驭创信息科技有限公司 Across the table exploitation system and method for one kind
CN110033154A (en) * 2018-12-12 2019-07-19 阿里巴巴集团控股有限公司 Resource allocation method, device and equipment
CN110033154B (en) * 2018-12-12 2023-10-20 创新先进技术有限公司 Resource allocation method, device and equipment
CN111275284A (en) * 2019-12-26 2020-06-12 用友网络科技股份有限公司 Cost allocation device and method

Similar Documents

Publication Publication Date Title
CN111241185B (en) Data processing method and device
CN102117306A (en) Method and system for monitoring ETL (extract-transform-load) data processing process
CN103605662A (en) Distributed computation frame parameter optimizing method, device and system
CN103116827A (en) Rural power grid engineering control system
CN103019728A (en) Effective complex report parsing engine and parsing method thereof
CN104090901A (en) Method, device and server for processing data
CN109324905A (en) Database operation method, device, electronic equipment and storage medium
CN114416855A (en) Visualization platform and method based on electric power big data
CN112464632B (en) Dynamic storage and conversion method for table style under excel report
US9298686B2 (en) System and method for simulating discrete financial forecast calculations
Zijm et al. Capacitated two-indenture models for repairable item systems
CN101271550A (en) Data distribution method and device in application system
CN115358204A (en) Report generation method and device, electronic equipment and storage medium
CN103473305A (en) Method and system for performing decision-making process show in statistic analysis
CN107102995A (en) A kind of determination method and device of SQL executive plans
CN116611788A (en) Science and technology project management method and system
CN103870342B (en) Task core value calculating method based on node attribute function in cloud computing environment
CN103345485B (en) A kind of mainframe platform dynamic statement automatic generation method and system
CN115599771A (en) Pre-calculation model generation method, device and system
CN110275798A (en) Block chain data processing method, device, server and storage medium
CN112559603B (en) Feature extraction method, device, equipment and computer-readable storage medium
CN114860759A (en) Data processing method, device and equipment and readable storage medium
Duan Analysis of ERP Enterprise Management Information System based on Cloud Computing Mode
CN114022188A (en) Target crowd circling method, device, equipment and storage medium
CN113743791A (en) Business evaluation method and device for business work order, electronic equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20080924