Material sampling inspection method based on queue layering processing mechanismTechnical Field
The invention relates to a method for performing spot check on electric power materials, in particular to a material spot check method based on a queue layering processing mechanism.
Technical Field
The supplies purchased by the electric power supply department relate to thousands of supplies, and quality spot check of the supplies is a necessary process. Due to the fact that the types of the spot checks are multiple and the process is complicated, when the spot checks are conducted in a large-scale supply and concentration mode, great pressure is brought to an inspection unit under the condition, work accumulation in the spot check process is difficult to avoid due to lack of human resources, even if the conventional information system is used for processing, many manual operations are needed, and even errors occur in the process.
Disclosure of Invention
The invention aims to provide a material spot check method based on a queue layering processing mechanism, which opens an independent channel for each layer to process respectively, thereby improving the efficiency and accuracy of material spot check.
The purpose of the invention is realized by the following technical scheme:
a material sampling method based on a queue layering processing mechanism is characterized by comprising the following steps:
1) based on a queue hierarchical processing mechanism, batch sampling inspection plan data of a plurality of batches needing to be processed are processed hierarchically, and processing rules comprise the following 5 large balance rules: new supplier balancing rules, old supplier balancing rules, rebalancing for non-cancelled supplies, city company level balancing, province company level balancing;
2) Carrying out hierarchical screening processing and identification around a 5-large balance rule, classifying batch sampling inspection data according to different identifications, finally generating a sampling inspection task from the data meeting the condition of generating the sampling inspection task, and storing the batch data in a cache;
3) the hierarchical classification is processed through independent channels, each hierarchical level relates to a thread pool (Theadpool) and a plurality of independent Queue (Queue) channels for processing and distributing data, the data are automatically classified and respectively thrown into corresponding queues through automatic timing trigger, the thread acquisition Queue data in the thread pool automatically carries out logic calculation digestion or enters the next hierarchical level for processing digestion again, the interaction with a database is reduced, and the data transfer speed is improved.
Further, the method comprises the following specific steps:
the method comprises the following steps: performing one-layer classification processing on new and old suppliers according to a model algorithm
The method comprises the following steps of establishing a classification model according to dimensions of bidding batches, suppliers and product names, and judging new and old suppliers according to the number of sampling checks calculated and output by the model, wherein the rules are as follows:
model calculation output > =2, old supplier; model calculation output <2, new supplier;
step two: two-layer rebalance treatment
Rebalancing treatment, namely judging whether the material is not cancelled, and if the material is '01-application deletion' or '02-application deletion', cancelling the plan;
And judging whether the materials are not cancelled, if the materials are in a non-reserved state, judging whether the materials exist in the sampling batch of the previous 3 months to be grabbed, and if the materials exist, cancelling the plan. If not, detecting whether the materials exist in the 'detection-free material list', and if so, canceling the plan. If the situation that the detection material table is not available does not exist, judging whether the situation is 'cable material', if so, judging whether the length is less than 1KM or 100m, and if so, canceling the plan;
step three: utilizing threads to do three-layer processing to market level
Utilizing threads to carry out three-layer processing on municipal goods and materials, firstly judging whether the condition that a plurality of products of the same city and the same supplier exist or not, and if not, entering a fourth step;
judging whether a data source of a plan entry of the same city, the same supplier and the same product name is a 'local city company distribution supply plan', comparing the purchase quantity of the materials in the same city, the same supplier and the same product name, and if the purchase quantity is different, reserving the material entry with the maximum purchase quantity;
if the purchase quantity is the same, comparing the predicted implementation time, if the implementation time is different, taking the latest implementation time, if the implementation time is the same, randomly reserving one implementation time, if the implementation time is the same, comparing the purchase quantity in the same product name, and if the purchase quantity is different, reserving the material item with the largest purchase quantity; if the purchase quantity is the same, comparing the expected implementation time, if the implementation time is different, taking the latest implementation time, and if the implementation time is the same, randomly reserving one implementation time;
Step four: utilizing queues for final processing
Judging the condition of the same product name of the same supplier in the whole province range, if not, reserving all materials under the product, and performing 'remark' field on the materials for 03-application reservation;
if yes, reserving the 'remark' field of the material for 04-application;
step five: generating a spot check task
Recording all data as reserved, 03-applying for reservation, remark description as unfinished plan in the previous month, continuing to execute in the current month, and 04-applying for reservation, remark description as other, performing classified counting statistics on the data according to records of local market, supplier and product name, and entering the following judgment:
judging the statistical number of the same city, the same supplier and the same product name, taking the least city, and generating a corresponding plan into a task if the least city is unique; if not, selecting the place with the most corresponding purchase quantity from the least places, if the place with the most purchase quantity is not unique, randomly reserving one place, and canceling all other plans; if the place with the largest purchase quantity is unique, all materials under the same product name of a supplier under the place are reserved, and a corresponding plan is generated into a task;
And canceling the data which do not accord with the conditions for generating the spot check task in all plans by the cancellation reason of 'finally eliminating the data'.
The invention has the following beneficial effects:
carry out high-efficient management to the material selective examination based on queue layering processing mechanism, open independent passageway to every level and handle respectively to reduce the interaction with the database, improve the speed of data circulation, and then promote the wholeness ability, increase the efficiency of flow, thereby promote the efficiency and the rate of accuracy of material selective examination.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
A material sampling method based on a queue hierarchical processing mechanism is characterized in that batch sampling plan data of a plurality of batches to be processed are processed hierarchically based on the queue hierarchical processing mechanism, and processing rules comprise the following 5 large balance rules: new supplier balancing rules, old supplier balancing rules, rebalancing for non-cancelled supplies, city company level balancing, province company level balancing; carrying out hierarchical screening processing and identification around a 5-large balance rule, classifying batch sampling inspection data according to different identifications, finally generating a sampling inspection task from the data meeting the condition of generating the sampling inspection task, and storing the batch data in a cache; the hierarchical classification is processed through independent channels, each hierarchical level relates to a thread pool (Theadpool) and a plurality of independent Queue (Queue) channels for processing and distributing data, the data are automatically classified and respectively thrown into corresponding queues through automatic timing trigger, the thread acquisition Queue data in the thread pool automatically carries out logic calculation digestion or enters the next hierarchical level for processing digestion again, the interaction with a database is reduced, and the data transfer speed is improved.
The system automatically loads the checked plan for temporary cache, and then carries out classification according to balance rules and identification processing by channels; and finally, generating a sampling inspection task for the specific identification data.
The method comprises the following steps: performing one-layer classification processing on new and old suppliers according to a model algorithm
And (3) establishing a classification model according to the dimensions of the bidding batch, the supplier and the product name, wherein the model calculation rule is as follows:
the new supplier: if the cable is the cable type and the length is less than 1KM or 1000M, recording the material as 02-application deletion (for other reasons, see remark explanation) and canceling the plan. Otherwise, the processes and digestions are sequentially carried out according to 5 rules of unique material description of the same product name of the same supplier, whether only one material exists in the same material product of the same supplier, whether the material description in the same product of the same supplier is less than or equal to 3, the purchase quantity of different materials in the same product of the same supplier and the predicted implementation time.
Old suppliers: if the cable is the cable type and the length is less than 1KM or 1000M, recording the material as 02-application deletion (for other reasons, see remark explanation) and canceling the plan. Otherwise, sequentially digesting the 4 types of rules of judging whether the batch in the previous 3 months is unqualified or not, inquiring whether the historical random inspection batch has an unqualified random inspection result or not according to the name of the supplier and the product and the material number, judging whether the type of the historical unqualified material (the same name of the supplier and the product) is more than 3 and judging the description quantity of the unqualified material (the same name of the supplier and the same name of the product).
And calculating the output sampling inspection times according to the model to be used as a basis for judging the old and new suppliers, wherein the rule is as follows.
Model calculation output > =2, old supplier; model calculation output <2, New supplier
Step two: two-layer rebalance treatment
And (4) rebalancing treatment, namely judging whether the material is not cancelled, and if the material is '01-application deletion (for reporting a plan)' or '02-application deletion (for other reasons, see remark explanation)', cancelling the plan.
And judging whether the materials are not cancelled, if the materials are in a non-reserved state (the remark field is empty), judging whether the materials exist in the sampling batch of the previous 3 months (according to the supplier, the product name and the material number) for grabbing, and if the materials exist, cancelling the plan. If not, detecting whether the materials exist in the 'detection-free material list', and if so, canceling the plan. If the situation that the detection material table is not available does not exist, judging whether the situation is 'cable material', if so, judging whether the length is less than 1KM or 100m, and if so, cancelling the plan.
Step three: utilizing threads to do three-layer processing to market level
And (4) utilizing the thread to carry out three-layer processing on the municipal goods and materials, firstly judging whether the condition that a plurality of products of the same city and the same supplier exist or not, and if not, entering the step four.
Judging whether a data source of a plan entry of the same city, the same supplier and the same product name is a 'local city company distribution supply plan', comparing the purchase quantity of the materials in the same city, the same supplier and the same product name, and if the purchase quantity is different, reserving the material entry with the maximum purchase quantity;
if the purchase quantity is the same, comparing the predicted implementation time, if the implementation time is different, taking the latest implementation time, if the implementation time is the same, randomly reserving one implementation time, if the implementation time is the same, comparing the purchase quantity in the same product name, and if the purchase quantity is different, reserving the material item with the largest purchase quantity; if the purchase quantity is the same, comparing the predicted implementation time, if the implementation time is different, taking the latest implementation time, and if the implementation time is the same, randomly reserving one implementation time
Step four: utilizing queues for final processing
And judging the condition of the same product name of the same supplier in the whole province, if the condition does not exist, reserving all materials under the product, and carrying out 'remark' field on the materials for 03-application reservation (other).
If present, and the "remark" field for supplies is reserved for 04-applications (others).
Step five: generating a spot check task
All data are recorded as reserved (03-application reservation (plan is not completed in the previous month, and execution continues in the current month) and 04-application reservation (other)) data are classified and counted according to records of local market (regional attribution), suppliers and product names, and the following judgment is carried out:
judging the statistical number of the same city, the same supplier and the same product name, taking the least city, and generating a corresponding plan into a task if the least city is unique; if not, selecting the place with the most purchasing quantity (classified and counted by product as dimension) from the least places, if the place with the most purchasing quantity is not unique, randomly reserving one place, and canceling the plan for all others. If the place with the largest purchase quantity is unique, all materials under the same product name of a supplier under the place are reserved, and a corresponding plan is generated into a task;
and canceling the data which do not accord with the conditions for generating the spot check task in all plans by the cancellation reason of 'finally eliminating the data'.