CN111144810A - Data processing method and device and related equipment - Google Patents

Data processing method and device and related equipment Download PDF

Info

Publication number
CN111144810A
CN111144810A CN201911351189.8A CN201911351189A CN111144810A CN 111144810 A CN111144810 A CN 111144810A CN 201911351189 A CN201911351189 A CN 201911351189A CN 111144810 A CN111144810 A CN 111144810A
Authority
CN
China
Prior art keywords
subentry
value
subentries
current
distributed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911351189.8A
Other languages
Chinese (zh)
Other versions
CN111144810B (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.)
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 CN201911351189.8A priority Critical patent/CN111144810B/en
Publication of CN111144810A publication Critical patent/CN111144810A/en
Application granted granted Critical
Publication of CN111144810B publication Critical patent/CN111144810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Business, Economics & Management (AREA)
  • Economics (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Quality & Reliability (AREA)
  • Finance (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Accounting & Taxation (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a data processing method, a data processing device and related equipment, which are used for improving the numerical value distribution precision in an ERP system and saving human and material resources. The method provided by the embodiment of the invention comprises the following steps: receiving external data, wherein the external data comprises the number of subentries, original weight values of the subentries and values to be distributed; calculating a residual value S to be distributed; if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated by the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry; and if the current subentry is the last subentry, taking the remaining value S to be distributed as the distribution value of the current subentry.

Description

Data processing method and device and related equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method, an apparatus, and a related device.
Background
The existing ERP (enterprise resource planning) software provides a function of weighted average calculation of inventory warehouse-out cost, and the weighted average unit price is calculated by one-time division according to all warehouse-in cost and warehouse-in quantity of the current accounting dimension and is used as a unit price source of a warehouse-out sequence.
In existing implementations, truncation or carry processing is performed for precision reasons. When the ex-warehouse sequence carries out cost calculation, the ex-warehouse sequence cost is calculated by adopting the quantity of ex-warehouse and the weighted average unit price of the current accounting dimensionality, and abnormal balance is often formed. For example: and (3) performing current accounting dimensionality, namely warehousing at 3732PCS, warehousing amount of 3676.12 yuan, ex-warehouse at 3732PCS, ex-warehouse unit price of 0.99 yuan (ex-warehouse amount 3694.68), and difference between the ex-warehouse amount and the warehousing amount of-18.56 yuan, so that an abnormal balance is formed.
In the existing scheme, the weighted average unit price is calculated by one-time division, truncation or carry processing is carried out due to precision, and abnormal balance is formed by later-stage cost calculation. The financial staff needs to perform abnormal balance ordering operation aiming at the abnormal balance, and the expenses of the database and the CPU of the application server are increased. Meanwhile, related personnel are required to analyze and correct data of abnormal balances, so that waste of human resources is caused.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device and related equipment, which are used for improving weight distribution precision and saving resources.
A first aspect of an embodiment of the present invention provides a data processing method, which may include:
receiving external data, wherein the external data comprises the number of subentries, original weight values of the subentries and values to be distributed;
calculating a residual value S to be distributed;
if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated by the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and if the current subentry is the last subentry, taking the remaining value S to be distributed as the distribution value of the current subentry.
Optionally, as a possible implementation manner, the data processing method in the embodiment of the present invention may further include:
if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation, sorting all the subentries which are not finished with the distribution value calculation to respectively form a positive-order set and a reverse-order set, wherein the original weight values of the subentries in the positive-order set are sequentially increased, and the original weight values of the subentries in the reverse-order set are sequentially decreased;
if the residual value S to be distributed is a negative number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the reverse order set;
and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the positive sequence set.
Optionally, as a possible implementation manner, in an embodiment of the present invention, the performing precision adjustment on the product N × S/M to obtain an assigned value corresponding to the current sub-entry includes:
and rounding, truncating or carrying out adjustment on the value of N (S/M) to obtain the distribution value of the preset digit.
Optionally, as a possible implementation manner, the data processing method in the embodiment of the present invention may further include:
and executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
A second aspect of an embodiment of the present invention provides a data processing apparatus, which may include:
the receiving module is used for receiving external data, the number of the subentries, the original weight values of the subentries and the values to be distributed;
the first calculation module is used for calculating a residual value S to be distributed;
the second calculation module is used for calculating the sum M of original weight values of all the subentries which do not finish the calculation of the distribution value at present if the current subentry is not the last subentry, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed average weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and the third calculation module is used for taking the residual value S to be distributed as the distribution value of the current subentry if the current subentry is the last subentry.
Optionally, as a possible implementation manner, the data processing apparatus in the embodiment of the present invention further includes:
the sorting module sorts all the subentries which are not finished with the distribution value calculation if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation at the same time, and respectively forms a positive order set and a reverse order set, wherein the original weight values of the subentries in the positive order set are sequentially increased, and the original weight values of the subentries in the reverse order set are sequentially decreased;
the processing module is used for sequentially calculating the distribution values of the corresponding subentries according to the sorting of the subentries in the reverse order set if the residual value S to be distributed is a negative number; and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the positive sequence set.
Optionally, as a possible implementation manner, the second calculating module in the embodiment of the present invention may include:
and the calculating unit is used for rounding, truncating or carrying out carry regulation on the value of N x (S/M) to obtain the distribution value of the preset digit.
Optionally, as a possible implementation manner, the data processing apparatus in the embodiment of the present invention may further include:
and the execution module is used for executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
A third aspect of an embodiment of the present invention provides a computer device, where the computer device includes a processor, and the processor is configured to implement the steps in any one of the possible implementations of the first aspect and the first aspect when executing a computer program stored in a memory.
A fourth aspect of embodiments of the present invention provides a computer storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the steps in any one of the possible implementations of the first aspect and the first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the present invention, after receiving the external data, the current remaining value S to be allocated may be calculated, and then each subentry allocation value is calculated in sequence. Specifically, if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which do not finish the calculation of the distribution value currently, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and performing precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry; and if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry. Compared with the prior art, the allocation value of the next subentry can be dynamically adjusted according to the sum of the currently allocated allocation values, the allocation precision of the allocation value is improved, meanwhile, the remaining value S to be allocated is used as the allocation value of the last subentry, abnormal balance cannot be formed, extra proofreading processing is not needed to be carried out on the abnormal balance, and manpower and material resources are saved.
Drawings
FIG. 1 is a diagram of an embodiment of a data processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an embodiment of a data processing method according to the present invention;
FIG. 3 is a diagram of an embodiment of a data processing apparatus according to the invention;
FIG. 4 is a diagram of an embodiment of a computer device in an embodiment of the invention;
fig. 5 is a schematic diagram of an embodiment of a weight assignment application system according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a data processing method, a data processing device and related equipment, which are used for improving the numerical value distribution precision in an ERP system and saving human and material resources.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In actual application, except for the weight distribution scenario of each module inside the ERP product system exemplified in the background art, the method can be popularized and applied to all application scenarios in which new distribution values (money amount and quantity) are distributed to a plurality of objects according to a given original weight. For example: 1. logic that allocates a cost or cost of shared materials to the work order; 2. distributing the cost of the work order to the logic of the corresponding production warehousing order; 3. calculating reduction coefficient logic by using the cost reduction comparison analysis table; 4. including but not limited to other scenarios where it is desirable to handle the allocation of amounts, quantities, and/or sums according to a given weight. The value to be allocated may be an amount of money, etc., such as a cost amount, a profit, a unit price, etc. The specific application scenario is not limited.
For convenience of understanding, a specific flow in the embodiment of the present invention is described below, and referring to fig. 1, an embodiment of a data processing method in the embodiment of the present invention may include:
101. receiving external data, wherein the external data comprises the number of the subentries, the original weight values of the subentries and the values to be distributed;
in practical applications, when the value to be assigned is assigned among a certain number of the partial terms, the proportion of the total weight occupied by each partial term is not necessarily the same. For this reason, before the weight assignment, it is necessary to obtain specified external data, which includes the number of the items, the original weight values of the items, and the value P to be assigned.
102. Calculating a residual value S to be distributed;
if the current item is the first item, the remaining values to be assigned are the values to be assigned S ═ P in the acquired external data, and if the current item is not the first item, the assigned values of the respective items may be calculated according to the subsequent steps, and then the sum P of the assigned values is counted1Then S ═ P-P1
103. If the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated according to the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
after the remaining to-be-distributed value S is calculated, before the distributed value calculation is performed on each subentry, in order to improve the distribution accuracy, the sum M of the original weight values of all subentries not completed with the distributed value calculation needs to be calculated, and then the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed average weight (S/M) can be used as the distributed value of the current subentry.
In practice, N × M (S/M) often contains an infinite number of bits or a number of bits exceeding the number of bits that can be processed by the ERP system, and therefore, precision processing is required.
Optionally, the precision adjustment of the value of N × S/M may include: and rounding, truncating or carrying out adjustment on the value of N (S/M) to obtain the distribution value of the preset digit. For example, for the numerical value 11.11, the rounding may be 11, the rounding may also be 11.1, or the remainder carry that is not zero may also be 12, and the specific precision adjustment logic may be reasonably set according to the requirement of the user, which is not limited herein.
104. And if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry.
If the current subentry is the last subentry, the remaining value S to be distributed is used as the distribution value of the last subentry, and abnormal balance is completely eradicated.
In the embodiment of the present invention, after receiving the external data, the current remaining value S to be allocated may be calculated, and then each subentry allocation value is calculated in sequence. Specifically, if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which do not finish the calculation of the distribution value currently, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and performing precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry; and if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry. Compared with the prior art, the allocation value of the next subentry can be dynamically adjusted according to the sum of the currently allocated allocation values, the allocation precision of the allocation value is improved, meanwhile, the remaining value S to be allocated is used as the allocation value of the last subentry, abnormal balance cannot be formed, extra proofreading processing is not needed to be carried out on the abnormal balance, and manpower and material resources are saved.
On the basis of the embodiment shown in fig. 1, in practical applications, negative numbers may occur in the original weight values of the sub-items for which the distribution value calculation is not completed. When a positive number and a negative number exist in a set formed by original weight values of the subentries for which the assignment value calculation is not completed, a situation that the remaining value S to be assigned is zero may occur, so that the weights of the remaining subentries are always zero and cannot be assigned, and therefore, it is necessary to further improve the above embodiment.
Optionally, as a possible implementation manner, if a positive number and a negative number exist in a set formed by original weight values of the subentries not subjected to the distribution value calculation at the same time, sorting all the subentries not subjected to the distribution value calculation to respectively form a positive-order set and a reverse-order set, wherein the original weight values of the subentries in the positive-order set are sequentially increased, and the original weight values of the subentries in the reverse-order set are sequentially decreased; if the residual value S to be distributed is a negative number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the reverse order set; and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the positive sequence set.
Illustratively, if all the scores for which the assignment value calculation is not complete have original weight values of-4, -3, 1, 3, and the sum is-3, the precision adjustment logic is rounded to a fraction of one. The positive order of the original weight values is: -4, -3, 1, 3; the reverse order is: 3,1, -3, -4. The ranking of the corresponding subentries may be determined in accordance with the ranking of the original weight values. If the remaining value S to be assigned is-20, then assignment is performed in reverse order, and the current first item (i.e., the item with the original weight value of 3) assignment value calculation process is: the accuracy was adjusted to-6.7 (-20/3), and the assigned value was-6.7 x 3-20.1.
Optionally, as a possible implementation manner, on the basis of the foregoing embodiment, in order to avoid that the user performs a secondary cycle by using the assigned assignment value (in the original scheme, after obtaining the assignment result, the user needs to traverse the assignment result again for verification), in the embodiment of the present invention, the service logic corresponding to the assignment value of each subentry may be executed according to a preset mapping relationship. The specific service logic can be reasonably set according to the requirements of the user, and is not limited in detail at this time. For example, when the allocation value is a cost value, the cost values of the respective sub-items may be directly output and displayed.
For convenience of understanding, the data processing method in the embodiment of the present invention will be described below with reference to a specific application example.
Referring to fig. 2, the image processing apparatus includes 3732 sub-items, each of which has an original weight value of 1 (in practical applications, the original weight values of the sub-items may be different), and the total weight is 3732. The remaining value S to be assigned of the first subentry is 3676.12, the sum of the original weight values (total weight) is 3732, and each weight standard assignment value is substantially 0.98502679528, but because of the limitation of the precision of the assigned money, 2 decimal places need to be reserved, after rounding (not limited to the current precision and the current rounding mode, the user may also define other precision processing modes), the actual assignment value is 0.99, and if the actual assignment value is fixed to 0.99 according to the existing mode, as shown in the column of "original subentry assignment value" in fig. 2. In the prior art such a first weight is actually assigned 0.00497320472 more, resulting in an exceptional balance of-18.56. Through the improvement of the embodiment of the invention, the residual value to be distributed S is recalculated before each weight distribution, and the more distributed values flow into the residual value to be distributed, so that the residual value to be distributed and the distributed value of each residual item are influenced. After the influence is accumulated for multiple times, until the 22 nd weight distribution is performed, the actual distribution value is only 0.98 after the same rounding, and the distribution reduces the influence of the distribution values which are distributed more previously on the residual value to be distributed, so that the actual distribution value swings up and down on the standard distribution value, the accuracy of the distribution value is maintained, and finally the distribution value of the last item is the residual value to be distributed. And adopting a new distribution logic, commonly bearing tail differences caused by the weight distributed in the front by all values to be distributed in the back until the last item directly takes the residual value S to be distributed as the distribution value of the current subentry, so that tail difference adjustment is not needed, the weighted average cost calculation of each item can be ensured to be completed by one-time distribution, the balanced distribution according to the weight is realized, and no abnormal balance exists.
Referring to fig. 3, an embodiment of the present invention further provides a data processing apparatus, which may include:
a receiving module 301, configured to receive external data, the number of items, the original weight value of each item, and a value to be assigned;
a first calculating module 302, configured to calculate a remaining value S to be allocated;
the second calculating module 303, if the current subentry is not the last subentry, calculates a sum M of original weight values of all subentries not currently finished with the calculation of the distribution value, calculates a product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and performs precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
the third calculating module 304, if the current sub-entry is the last sub-entry, takes the remaining value S to be allocated as the allocation value of the current sub-entry.
In the embodiment of the present invention, after receiving the external data, the current remaining value S to be allocated may be calculated, and then each subentry allocation value is calculated in sequence. Specifically, if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which do not finish the calculation of the distribution value currently, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and performing precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry; and if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry. Compared with the prior art, the allocation value of the next subentry can be dynamically adjusted according to the sum of the currently allocated allocation values, the allocation precision of the allocation value is improved, meanwhile, the remaining value S to be allocated is used as the allocation value of the last subentry, abnormal balance cannot be formed, extra proofreading processing is not needed to be carried out on the abnormal balance, and manpower and material resources are saved.
Optionally, as a possible implementation manner, the data processing apparatus in the embodiment of the present invention further includes:
the sorting module sorts all the subentries which are not finished with the distribution value calculation if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation at the same time, and respectively forms a positive-order set and a reverse-order set, wherein the original weight values of the subentries in the positive-order set are sequentially increased, and the original weight values of the subentries in the reverse-order set are sequentially decreased;
the processing module is used for sequentially calculating the distribution values of the corresponding subentries according to the sorting of the subentries in the reverse order set if the residual value S to be distributed is a negative number; and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the positive sequence set.
Optionally, as a possible implementation manner, the second calculating module in the embodiment of the present invention includes:
and the calculating unit is used for rounding, truncating or carrying out carry regulation on the value of N x (S/M) to obtain the distribution value of the preset digit.
Optionally, as a possible implementation manner, the data processing apparatus in the embodiment of the present invention
And the execution module is used for executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiment of the present application further provides a computer device, as shown in fig. 4, for convenience of description, only a portion related to the embodiment of the present application is shown, and details of the specific technology are not disclosed, please refer to the method portion of the embodiment of the present application. Referring to fig. 4, the computer device 4 includes: memory 410, processor 420, wired or wireless network module 430, and computer programs stored in the memory and executable on the processor. The processor, when executing the computer program, implements the steps in the various data processing method embodiments described above, such as steps 101 to 104 shown in fig. 1. Alternatively, the processor, when executing the computer program, implements the functions of each module or unit in the above-described device embodiments.
In some of the embodiments of the application, the processor, when executing the computer program stored in the memory, implements the steps of:
receiving external data, wherein the external data comprises the number of the subentries, the original weight values of the subentries and the values to be distributed;
calculating a residual value S to be distributed;
if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated according to the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation, sequencing all the subentries which are not finished with the distribution value calculation to respectively form a positive sequence set and a reverse sequence set, wherein the original weight values of the subentries in the positive sequence set are sequentially increased, and the original weight values of the subentries in the reverse sequence set are sequentially decreased;
if the residual value S to be distributed is a negative number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the reverse order set;
and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the positive sequence set.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and rounding, truncating or carrying out adjustment on the value of N (S/M) to obtain the distribution value of the preset digit.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
Those skilled in the art will appreciate that the architecture shown in fig. 4 does not constitute a limitation of a computer device, and that computer device 4 may include more or fewer components than shown, or some components may be combined, or a different arrangement of components, such as input-output devices, buses, etc.
The Processor may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The present application further provides a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, can implement the steps of:
receiving external data, wherein the external data comprises the number of the subentries, the original weight values of the subentries and the values to be distributed;
calculating a residual value S to be distributed;
if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated according to the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and if the current subentry is the last subentry, taking the residual value S to be distributed as the distribution value of the current subentry.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation, sequencing all the subentries which are not finished with the distribution value calculation to respectively form a positive sequence set and a reverse sequence set, wherein the original weight values of the subentries in the positive sequence set are sequentially increased, and the original weight values of the subentries in the reverse sequence set are sequentially decreased;
if the residual value S to be distributed is a negative number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the reverse order set;
and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding sub-items according to the sorting of the sub-items in the positive sequence set.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and rounding, truncating or carrying out adjustment on the value of N (S/M) to obtain the distribution value of the preset digit.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
Referring to fig. 5, an embodiment of the present invention further provides a weight distribution application system, which includes: the computer device and the application module shown in fig. 4 implement the steps in the data processing method shown in fig. 1 when the application module calls the computer device. By adopting the system architecture shown in fig. 5, the application module provides an external calling interface, so that a plurality of application systems can use the same computer device, thereby realizing the reuse of the computer device and saving the system resources. For example, the weight distribution application system in the embodiment of the present invention may be specifically applied to an ERP system, and when the ERP system calls an application module, the application module may call a computer device, run a logic in a corresponding data processing method to perform weight distribution, and return corresponding processing results or function results one by one.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a weight-assignment readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a weight distribution apparatus (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A data processing method, comprising:
receiving external data, wherein the external data comprises the number of subentries, original weight values of the subentries and values to be distributed;
calculating a residual value S to be distributed;
if the current subentry is not the last subentry, calculating the sum M of original weight values of all subentries which are not calculated by the current distribution value, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed mean weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and if the current subentry is the last subentry, taking the remaining value S to be distributed as the distribution value of the current subentry.
2. The method of claim 1, further comprising:
if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation, sorting all the subentries which are not finished with the distribution value calculation to respectively form a positive-order set and a reverse-order set, wherein the original weight values of the subentries in the positive-order set are sequentially increased, and the original weight values of the subentries in the reverse-order set are sequentially decreased;
if the residual value S to be distributed is a negative number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the reverse order set;
and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the positive sequence set.
3. The method according to claim 1 or 2, wherein the performing precision adjustment on the product N x (S/M) to obtain an assigned value corresponding to a current sub-term comprises:
and rounding, truncating or carrying out adjustment on the value of N (S/M) to obtain the distribution value of the preset digit.
4. The method of claim 1 or 2, further comprising:
and executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
5. A data processing apparatus, comprising:
the receiving module is used for receiving external data, the number of the subentries, the original weight values of the subentries and the values to be distributed;
the first calculation module is used for calculating a residual value S to be distributed;
the second calculation module is used for calculating the sum M of original weight values of all the subentries which do not finish the calculation of the distribution value at present if the current subentry is not the last subentry, calculating the product N (S/M) of the original weight value N corresponding to the current subentry and the distributed average weight (S/M), and carrying out precision adjustment on the product N (S/M) to obtain the distribution value corresponding to the current subentry;
and the third calculation module is used for taking the residual value S to be distributed as the distribution value of the current subentry if the current subentry is the last subentry.
6. The apparatus of claim 5, further comprising:
the sorting module sorts all the subentries which are not finished with the distribution value calculation if a positive number and a negative number exist in a set formed by original weight values of the subentries which are not finished with the distribution value calculation at the same time, and respectively forms a positive order set and a reverse order set, wherein the original weight values of the subentries in the positive order set are sequentially increased, and the original weight values of the subentries in the reverse order set are sequentially decreased;
the processing module is used for sequentially calculating the distribution values of the corresponding subentries according to the sorting of the subentries in the reverse order set if the residual value S to be distributed is a negative number; and if the residual value S to be distributed is a positive number, sequentially calculating the distribution values of the corresponding items according to the sorting of the items in the positive sequence set.
7. The apparatus of claim 5 or 6, wherein the second computing module comprises:
and the calculating unit is used for rounding, truncating or carrying out carry regulation on the value of N x (S/M) to obtain the distribution value of the preset digit.
8. The apparatus of claim 5 or 6, further comprising:
and the execution module is used for executing the business logic corresponding to the distribution value of each subentry according to the preset mapping relation.
9. A computer device, characterized in that it comprises a processor for implementing the steps of weight assignment according to any one of claims 1 to 4 when executing a computer program stored in a memory.
10. A computer storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps in the data processing method according to any one of claims 1 to 4.
CN201911351189.8A 2019-12-24 2019-12-24 Data processing method and device and related equipment Active CN111144810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911351189.8A CN111144810B (en) 2019-12-24 2019-12-24 Data processing method and device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911351189.8A CN111144810B (en) 2019-12-24 2019-12-24 Data processing method and device and related equipment

Publications (2)

Publication Number Publication Date
CN111144810A true CN111144810A (en) 2020-05-12
CN111144810B CN111144810B (en) 2023-03-17

Family

ID=70519880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911351189.8A Active CN111144810B (en) 2019-12-24 2019-12-24 Data processing method and device and related equipment

Country Status (1)

Country Link
CN (1) CN111144810B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201636910A (en) * 2015-04-14 2016-10-16 Chunghwa Telecom Co Ltd Two-dimensional difference apportioning balance module
US20180121819A1 (en) * 2016-10-31 2018-05-03 Salesforce.Com, Inc. Jaccard similarity estimation of weighted samples: circular smearing with scaling and randomized rounding sample selection
CN109587220A (en) * 2018-11-09 2019-04-05 金蝶软件(中国)有限公司 Load-balancing method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201636910A (en) * 2015-04-14 2016-10-16 Chunghwa Telecom Co Ltd Two-dimensional difference apportioning balance module
US20180121819A1 (en) * 2016-10-31 2018-05-03 Salesforce.Com, Inc. Jaccard similarity estimation of weighted samples: circular smearing with scaling and randomized rounding sample selection
CN109587220A (en) * 2018-11-09 2019-04-05 金蝶软件(中国)有限公司 Load-balancing method, device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘达枚等: "基于ERP系统定制薪资核算规则的探讨", 《电力信息化》 *
吕世鑫等: "基于项目排序和权值矩阵的关联规则挖掘算法", 《信息工程大学学报》 *
王尔祺等: "精度分配的传递系数权重法探讨", 《仪器仪表学报》 *

Also Published As

Publication number Publication date
CN111144810B (en) 2023-03-17

Similar Documents

Publication Publication Date Title
CN109345108A (en) Method for allocating tasks, device, equipment and storage medium
CN107392645A (en) Usage mining method, apparatus and its equipment
CN109996202B (en) Flow charging method and device
CN109767070A (en) Case distribution method, device, computer equipment and storage medium
CN107656955B (en) Repayment data batch reporting method and device
CN108108933B (en) Storage position distribution method and device
CN106919957A (en) The method and device of processing data
EP3961384A1 (en) Automatic derivation of software engineering artifact attributes from product or service development concepts
CN111340323B (en) Automatic dispatch method and system for complaint service request
CN111709777A (en) Payment mode recommendation method, system, terminal device and storage medium
CN110852559A (en) Resource allocation method and device, storage medium and electronic device
CN108920183B (en) Service decision method, device and equipment
CN110019774B (en) Label distribution method, device, storage medium and electronic device
CN102222285A (en) Multi-dimensional data linkage computing device and multi-dimensional data linkage computing method
CN113515544B (en) Data attribute query method and data attribute query device
CN113037510A (en) Charging method, charging device and computer readable storage medium
CN107688959B (en) Breakpoint list processing method, storage medium and server
CN106157138A (en) Group belonging to a kind of bank transaction data determines method and device
US20160078545A1 (en) Methods and systems for calculation of insurance related fees for an insurance product
CN111144810B (en) Data processing method and device and related equipment
CN108830663B (en) Electric power customer value evaluation method and system and terminal equipment
CN110662188B (en) Charging method and system
EP2693378A1 (en) Risk-management device
CN112836971A (en) Quota resource determination method and device, electronic equipment and storage medium
CN108346080B (en) Flow package combination optimization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant