Brief Introduction to the prerequisites for Efficient Calculation of ERP forms

Source: Internet
Author: User
What am I talking about?

In the ERP form, when you type a value, the software needs to interact with it. For example, when you enter the "as001" material, we need to retrieve the materials of this number from the database and fill in the data such as name and unit price to the required fields. This is also true for selecting materials in the selection dialog box. The "computing task" referred to in this Article refers to all the operations performed after the user enters "as0001 ".Code.

These computing tasks are composed of many small computing tasks. You can think of them as writing many methods to complete different functions. This article describes how to improve the execution efficiency of these computing tasks, that is, the prerequisite for the Efficient Calculation of ERP forms.

One-time derivation of computing tasks to be executed

When an event occurs, including attribute change events, insertion, deletion, and so on, if you can deduce the number of computing tasks to be executed at one time, you will have the opportunity to complete all subsequent optimizations, it is a prerequisite for completing all the following optimizations.

Suppose there are formulas c = a * B, and D = C + E. When a is changed, we need to deduce that both formulas need to be executed, rather than just Formula 1.

All computing tasks can be pushed and exported sequentially.

In fact, this article is closely related to the first one. To accomplish this feature, you need to declare its dependencies and impact items for the computing task. For example, formula C = A * B, its a and B dependencies, and C are the impact items. After a changes, you will know that this formula needs to be executed. This is not enough. If there is another formula D = A + C, then after a changes, both formulas need to be executed, however, if you first execute the following formula, the first one needs to be executed twice. With the influence item, you can deduce that the influence item of Formula 1 is also dependent on formula 2, so Formula 1 is executed first.

With the dependency and impact items, we can actually look back at the first point. With the dependency items, we can export the computing tasks to be executed at the first layer based on the events, if there are any impact items, we can continue to export more computing tasks.

Currently, dependency items and impact items form a directed acyclic graph. If a ring exists, it will cause problems, such as the amount = unit price * quantity. Another formula: quantity = Amount of RMB unit price, which is not supported currently.

Computing tasks should be in batches

If you use the dialog box, select a large number of materials at a time. If your computing tasks do not support batch execution, you will execute a lot of SQL statements on the server. The good way is to obtain all materials at a time, this will greatly improve the execution efficiency.

For a single input, the computing task is equivalent to executing only one batch of records.Program.

Computing tasks support data preparation.

Imagine that if a user enters a material, a calculation task needs to obtain the name of the material for display, and another calculation task requires the price of the material for calculating the amount, A well-designed computing task should be able to obtain material information in a unified manner, reducing the load on the database. I call this function as data preparation.

That is to say, we can use the first point to export all computing tasks, then derive the post-occurrence sequence, and all the tasks that can be executed at the first layer, and summarize these tasks to obtain their data preparation requests, in this way, server requests can be uniformly executed.

Computing tasks support parallel computing

This is not necessary at present, because the data preparation support has greatly reduced the execution time, the rest of the operations are in the local memory, and through sequential derivation, we will not have repeated executions.

However, we can also do this if we need to support parallel computing, such as formula C = a * B and formula D = e + F, because they have no successive problems, allows two computing tasks to run in parallel without conflicting values.

However, in my opinion, although the theory is feasible, these computing tasks are already computed in local memory and executed on a single client, with little effect in parallel, even because the new thread is enabled and the task volume is too small, the performance is degraded.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.