Product sampling method and device, electronic equipment and storage medium
By reasonably allocating product sampling values, the problem of unreasonable sampling numbers in large enterprises due to order splitting is solved, the quality inspection process is optimized, efficiency is improved and resources are saved.
Patent Information
- Application Number
- CN202510976656.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-08-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the global production business process of large enterprises, product sampling and quality inspection are inefficient, resulting in waste of human and material resources.
By obtaining the total production value of the product and the sub-production value of each factory, calculate the initial sub-sampling value, rounding up the non-integer, adjusting the sub-sampling value, making its sum equal to the total sampling value, reasonably allocating the sampling quantity, and optimizing the sampling process.
On the basis of following sampling standards, reduce unnecessary sampling quality inspection, improve quality inspection efficiency, and save human and material resources.
Smart Images

Figure CN120494298A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a product sampling method, device, electronic device, and storage medium. Background Art
[0002] In the globalized production processes of large enterprises, line sales orders require the use of the Advanced Planner and Optimizer (APO) system to split them into multiple production orders based on the material availability of each factory, and then distribute production to different factories for execution.
[0003] Furthermore, each factory produces products according to its own corresponding production order. When conducting independent sampling with reference to the general inspection level II in the official standard GB / T2828.1-2012 "Sampling procedures for inspection by attributes Part 1: Sampling plans for batch inspection based on acceptance quality limit (AQL)", the sampling corresponding to the general inspection level II is divided according to the product quantity range, such as if the product quantity is 1, the sampling quantity is 1; if it is between 2-8, the sampling quantity is 2; if the product quantity is between 9-15, the sampling quantity is 3; if the product quantity is between 16-25, the sampling quantity is 5, etc.; then, when conducting independent sampling for each factory according to the above method, since the production order value after splitting is far less than the total production value of the original line item sales order, the total sampling value far exceeds the total sampling value corresponding to the total production value, and thus it is necessary to undertake additional quality inspection of a large number of unnecessary sampled products, resulting in a large amount of ineffective consumption of manpower and material resources, which conflicts with the company's demand for cost reduction and efficiency improvement.
[0004] Therefore, how to improve the efficiency of product sampling and quality inspection has become an urgent problem to be solved. Summary of the Invention
[0005] The present application provides a product sampling method, device, electronic device and storage medium to at least solve the problem of low efficiency in product sampling quality inspection in related technologies.
[0006] This application provides a product sampling method, including: Obtaining a total production value of a product and sub-production values corresponding to multiple factories; the total production value is equal to the sum of the multiple sub-production values; Obtaining a total sampling value corresponding to the total production value, and calculating an initial sub-sampling value of each factory based on the total sampling value, the total production value, and a plurality of the sub-production values; Rounding up non-integer values in the plurality of the initial sub-sampling values to obtain a first sub-sampling value for each of the factories, and determining whether a sum of the plurality of the first sub-sampling values is equal to the total sampling value; If yes, then taking the first sub-sampling value of each factory as the target sub-sampling value of each factory; If not, the first sub-sampling value of at least one of the factories is adjusted to obtain the second sub-sampling value of each factory; until the sum of the second sub-sampling values of each factory is equal to the total sampling value, the second sub-sampling value of each factory is used as the target sub-sampling value of each factory.
[0007] The present application also provides a product sampling device, comprising: An acquisition unit, configured to acquire a total production value of a product and sub-production values corresponding to a plurality of factories; the total production value is equal to the sum of the plurality of sub-production values; a calculation unit, configured to obtain a total sampling value corresponding to the total production value, and calculate an initial sub-sampling value of each factory based on the total sampling value, the total production value, and a plurality of the sub-production values; a determination unit, configured to round up non-integer values in the plurality of the initial sub-sampling values to obtain a first sub-sampling value for each of the factories, and determine whether a sum of the plurality of the first sub-sampling values is equal to the total sampling value; a processing unit, configured to use the first sub-sampling value of each factory as a target sub-sampling value of each factory when the sum of the plurality of first sub-sampling values is equal to the total sampling value; An adjustment unit is used to adjust the first sub-sampling value of at least one of the factories when the sum of the multiple first sub-sampling values is not equal to the total sampling value, so as to obtain the second sub-sampling value of each of the factories; until the sum of the second sub-sampling values of each of the factories is equal to the total sampling value, the second sub-sampling value of each of the factories is used as the target sub-sampling value of each of the factories.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned product sampling methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned product sampling methods are implemented.
[0010] The present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned product sampling methods when executed by a processor.
[0011] The present application determines the total sampling value of the product and the initial sub-sampling values corresponding to the multiple factories through the total production value of the product and the sub-production values corresponding to the multiple factories, and further rounds up the non-integer in the calculated initial sub-sampling values to obtain the first sub-sampling value. If the sum of the multiple first sub-sampling values is not equal to the total sampling value, the first sub-sampling value is adjusted to obtain the second sub-sampling value, so that the sum of the adjusted second sub-sampling values is exactly equal to the total sampling value, and then the second sub-sampling value is used as the target sub-sampling value. Furthermore, through the above method, on the basis of complying with the sampling standards, by reasonably allocating sub-sampling values, the problem of unreasonable sampling number caused by order splitting when the original factories independently sampled is solved, which not only complies with the specifications, but also optimizes the sampling process, reduces the quality inspection of unnecessary sampled products, improves the efficiency of product sampling quality inspection, and saves manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 One of the flow charts of a product sampling method provided in an embodiment of the present application; Figure 2 The second flowchart of a product sampling method provided in an embodiment of the present application; Figure 3 The third flow chart of a product sampling method provided in an embodiment of the present application; Figure 4 This is one of the schematic diagrams of the calculation process of a product sampling method provided in an embodiment of the present application; Figure 5 This is a second schematic diagram of the calculation process of a product sampling method provided in an embodiment of the present application; Figure 6 A schematic structural diagram of a product sampling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0015] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0017] The embodiment of the present application provides a product sampling method, referring to Figure 1 As shown, the specific steps include: S11. Obtain the total production value of the product and the sub-production values corresponding to multiple factories.
[0018] Among them, the total production value is equal to the sum of multiple sub-production values.
[0019] At present, large manufacturing companies often set up multiple factories based on supply chain, production capacity, cost, market and other aspects. Then, when the company receives a line sales order for a certain product, it will split the current line sales order into multiple production orders based on factors such as each factory's material inventory and complete data, production capacity load, etc., and assign them to the corresponding factories for production.
[0020] In an embodiment of the present application, the total production value of a product can be obtained from a line item sales order, and then based on the total production value, the sub-production values corresponding to multiple factories can be further obtained. Specifically, the method of obtaining the total production value of a product and the sub-production values corresponding to multiple factories can refer to the following steps 1 and 2: Step 1: Obtain the total production value of the product and the complete set of material data corresponding to multiple factories.
[0021] Among them, the material set data is used to indicate the value of the corresponding factory supporting the production of products.
[0022] Specifically, the total production value for a product can be directly read from the sales order line item, denoted as M. The company's Advanced Planning and Optimization (APO) system or the Manufacturing Execution System (MES) interface within the inventory management system is used to obtain the material completeness data currently supported by each factory (i.e., the number of products that can be produced using the materials available at each factory). This data is denoted as (S1, S2, ..., Si), where Si represents the material completeness production capacity of factory i.
[0023] Among them, the production execution system is an intermediate system connecting the enterprise planning layer and the production control layer. It is used to monitor the production process and manage production data in real time. Then, through the MES interface, it can read the complete material data of each factory under the enterprise in real time.
[0024] Step 2: Based on the complete set of data of multiple materials and the total production value, generate sub-production values corresponding to multiple factories.
[0025] Furthermore, the sub-production values corresponding to multiple factories are calculated in real time based on the material set data, production line status and other data of each factory. For example, based on the material set data of each factory, the total production value M is split into the sub-production values corresponding to each factory. 、 、…… ; 、 、…… The sum of is equal to M.
[0026] The embodiment of the present application splits the total production value of the sales order through the material set data of each factory, allowing each factory to jointly complete the sales order and achieve optimal allocation of production resources. At the same time, the total production value is split according to the material set data of each factory, which can ensure that the subsequent distribution of sub-production values is in line with the actual production capacity of each factory, avoiding the inability to execute the production plan due to material shortages.
[0027] S12. Obtain a total sampling value corresponding to the total production value, and calculate an initial sub-sampling value of each factory based on the total sampling value, the total production value, and multiple sub-production values.
[0028] In some embodiments, the total sampling value corresponding to the total production value can be determined according to the general inspection level II in the official standard GB / T2828.1-2012 "Sampling inspection procedures by attributes Part 1: Sampling plans for batch inspection based on acceptance quality limits (AQL)"; wherein, the general inspection level II is a more commonly used inspection level, and level II can better balance the inspection cost (sample size) and quality risk (possibility of missed judgment or misjudgment). It has a slightly larger sample size and stricter inspection than level I, and a smaller sample size and is more economical than level III. Therefore, in the embodiment of the present application, when determining the total sampling value corresponding to the total production value, the total sampling value is determined by the general inspection level II. Specifically, the batch range and corresponding sample size of the total production value of the general inspection level II are shown in Table 1 below: Table 1
[0029] For example, referring to the table above, when the total production value M is 100, the corresponding sample size, that is, the total sampling value N is 20.
[0030] Furthermore, the initial sub-sampling value of each factory is calculated based on the total sampling value, total production value, and multiple sub-production values. The specific steps are as follows: Step 1: For any factory among the factories, multiply the sub-production value by the total sampling value to obtain a second value.
[0031] For example, a company has five factories. After receiving a line-item sales order for product A, the company obtains a total production value M of product A of 100 and a total sampling value N of 20. After splitting the total production value M according to the complete material data corresponding to the five factories, the sub-production values N corresponding to the five factories are 20, 35, 17, 15, and 13.
[0032] Then, for any of the factories, multiply the sub-production value by the total sampling value to obtain the second value, that is, the second values corresponding to each factory are: 400, 700, 340, 300, 260.
[0033] Step 2: Obtain a ratio of the second value to the total production value to generate initial sub-sampling values corresponding to the plurality of factories.
[0034] Combined with the embodiment of step 1 above, the ratio of the second value to the total production value is obtained. This ratio is the initial sub-sampling value corresponding to each of the multiple factories. : 4, 7, 3.4, 3, 2.6.
[0035] Specifically, the calculation process of the initial sub-sampling values corresponding to multiple factories in steps 1 and 2 above can refer to the following formula: .
[0036] S13. Round up non-integer values in the multiple initial sub-sampling values to obtain the first sub-sampling value of each factory, and determine whether the sum of the multiple first sub-sampling values is equal to the total sampling value.
[0037] In an embodiment of the present application, after obtaining the initial sub-sampling values corresponding to multiple factories, it is necessary to round up the non-integer values in the multiple initial sub-sampling values. This is because in the sampling inspection, the sampling quantity must be an integer, and the sampling quantity of non-integer cannot be executed. Therefore, the calculated non-integer initial sampling value is adjusted to an integer to ensure that the subsequent spot check operation can be executed. At the same time, the rounding-up method can make the sampling quantity more sufficient, minimize the risk of missed inspections, and avoid situations such as: when the initial sub-sampling value of a factory is a non-integer less than 0.5, other rounding methods may be used to round 0.5 and get 0, so the quality inspection of the products produced by the factory is ignored; the occurrence of this situation; Therefore, by rounding up the non-integer values in the multiple initial sub-sampling values, the reliability of the inspection is enhanced to a certain extent.
[0038] Combined with the embodiment in S12 above, the initial sub-sampling values corresponding to the multiple factories are The first sub-sampling values corresponding to multiple factories are: 4, 7, 3.4, 3, 2.6. The non-integer values are rounded up to get the first sub-sampling values corresponding to multiple factories The sum of the multiple first sub-sampling values is 4, 7, 4, 3, 3, and then the sum of the multiple first sub-sampling values is 21. Then the multiple first sub-sampling values are used to determine whether they are equal to the total sampling value. Obviously, the sum of the multiple first sub-sampling values in the current embodiment is larger than the total sampling value, and further adjustment is needed.
[0039] By judging whether the sum of the first sub-sampling values of each factory is equal to the total sampling value, when the sum of the first sub-sampling values of each factory is equal to the total sampling value, no adjustment is made, and the multiple first sub-sampling values corresponding to each factory are directly used as the target sub-sampling values to perform subsequent sampling operations; when the sum of the first sub-sampling values of each factory is not equal to the total sampling value, the first sub-sampling values of each factory are continued to be adjusted until the sub-sampling value of each factory is equal to the total sampling value.
[0040] It should be noted that since the initial sub-sampling values are rounded up, each non-integer value is adjusted upward. Therefore, it is impossible for the sum of multiple first sub-sampling values to be less than the total sampling value. Therefore, when the sum of multiple first sub-sampling values is not equal to the total sampling value, it means that the sum of multiple first sub-sampling values is greater than the total sampling value.
[0041] The verification and adjustment of the above process will help eliminate the problem of total sampling redundancy in the traditional model, reduce manpower and material resources, and achieve the goal of reducing costs and increasing efficiency for enterprises.
[0042] Specifically, after the above S13 (determining whether the sum of the multiple first sub-sample values is equal to the total sample value) is executed, if the sum of the multiple first sub-sample values is equal to the total sample value, the following S14 is executed; if the sum of the multiple first sub-sample values is not equal to the total sample value, the following S15 is executed: S14. Using the first sub-sampling value of each factory as the target sub-sampling value of each factory.
[0043] Specifically, when the first sub-sampling value of each factory in step S13 When the sum is exactly equal to the total sampling value N, directly use the first sub-sampling value of each factory As the target subsampling value , so that each factory can conduct subsequent sampling quality inspection according to the target sub-sampling value, ensuring that the sampling quantity of each factory is equal to the total sampling value, saving manpower and material resources as much as possible and avoiding waste of resources.
[0044] S15. Adjust the first sub-sampling value of at least one factory to obtain the second sub-sampling value of each factory; until the sum of the second sub-sampling values of each factory is equal to the total sampling value, use the second sub-sampling value of each factory as the target sub-sampling value of each factory.
[0045] When the first sub-sampling value of each factory in step S13 The sum is greater than the total sampling value N. In order to ensure that the sum of the sub-sampling values of each factory is equal to the total sampling value and to improve the efficiency of quality inspection, it is necessary to adjust the first sub-sampling value so that the second sub-sampling value of each factory is equal to The sum of the total sampling value is equal to the second sub-sampling value of each factory. As target sub-sampling values for each factory , when sampling at each factory in the future, according to the second sub-sampling value Conduct sampling quality inspection.
[0046] The present application determines the total sampling value of the product and the initial sub-sampling values corresponding to the multiple factories through the total production value of the product and the sub-production values corresponding to the multiple factories, and further rounds up the non-integer in the calculated initial sub-sampling values to obtain the first sub-sampling value. If the sum of the multiple first sub-sampling values is not equal to the total sampling value, the first sub-sampling value is adjusted to obtain the second sub-sampling value, so that the sum of the adjusted second sub-sampling values is exactly equal to the total sampling value, and then the second sub-sampling value is used as the target sub-sampling value. Furthermore, through the above method, on the basis of complying with the sampling standards, by reasonably allocating sub-sampling values, the problem of unreasonable sampling number caused by order splitting when the original factories independently sampled is solved, which not only complies with the specifications, but also optimizes the sampling process, reduces the quality inspection of unnecessary sampled products, improves the efficiency of product sampling quality inspection, and saves manpower and material resources.
[0047] Specifically, refer to Figure 2 As shown, the specific steps of adjusting the first sub-sampling value of at least one factory in S15 and obtaining the second sub-sampling value of each factory include the following: S151. Filter non-integer initial sub-sampling values from the initial sub-sampling values of each factory to generate a set to be adjusted.
[0048] The set to be adjusted includes at least one factory and the initial sub-sampling value corresponding to the factory.
[0049] In combination with the embodiment in the above S13, the initial sub-sampling values corresponding to multiple factories are: 4, 7, 3.4, 3, 2.6, and the sum of multiple first sub-sampling values obtained by rounding up non-integers is 21. At this time, the first sub-sampling values corresponding to the above 5 factories need to be adjusted.
[0050] First, non-integer initial subsampling values, namely 3.4 and 2.6, are selected from the initial subsampling values of the above-mentioned factories. Based on these two non-integer values, a set to be adjusted is generated, and then the objects that may be adjusted later are identified, including the factories corresponding to these two non-integer values and their corresponding first sampling sub-quantities 4 and 3.
[0051] S152: Obtain a first difference between the sum of the multiple first sub-sample values and the total sample value.
[0052] Furthermore, it is necessary to calculate the first difference between the sum of the first sub-sampling values and the total sampling value, so as to further determine the number of factories to be adjusted based on the size of the first difference; for example, when the first difference is 1, the first sub-sampling quantity corresponding to 1 factory in the set to be adjusted needs to be adjusted; for example, when the first difference is 2, the first sub-sampling quantities corresponding to 2 factories in the set to be adjusted need to be adjusted.
[0053] In conjunction with the embodiment of S151 above, if the first difference between the sum of the first sub-sample values and the total sample value is 1, it can be determined that the first sub-sample value corresponding to one of the plants in the set to be adjusted needs to be adjusted. At the same time, the magnitude of the first difference clearly identifies the amount to be reduced from the total sample size, providing a precise target for subsequent adjustments.
[0054] S153 . Sort the decimal parts of the initial sub-sample values in the set to be adjusted in ascending order to obtain a sorting result.
[0055] In an embodiment of the present application, the decimal parts of the initial sub-sample values are sorted in ascending order. For example, the first sub-sample values 3.4 and 2.6 in the set to be adjusted are sorted in ascending order to obtain the sorting results 3.4 and 2.6. Then, according to the sorting results, it is convenient to prioritize the subsequent adjustment of the values with smaller decimal parts.
[0056] S154: Determine a target adjustment factory from the set to be adjusted based on the sorting result and the first difference.
[0057] According to the sorting result obtained in S153 above, the first sub-sampling value of the factory with the smaller decimal part is adjusted first according to the size of the first difference. This is because when rounding up, the deviation of the increment after rounding the smaller decimal part relative to the increment after rounding the larger decimal part is larger. The value with the smaller decimal part is adjusted first so that the deviation between the adjusted second sub-sampling value and the initial sub-sampling number is within an acceptable range. Therefore, the first sampling value of the factory with the smaller decimal part is adjusted first.
[0058] For example, after obtaining the sorting results of 3.4 and 2.6, based on the size of the first difference, it is known that the first self-sampling quantity corresponding to one factory needs to be adjusted. Then, based on the sorting results, the value with a smaller decimal part is adjusted first, that is, the first sub-sampling value of the factory corresponding to 3.4.
[0059] S155. Subtract one from the first sub-sampling value corresponding to the target adjustment plant to generate a second sub-sampling value for each plant.
[0060] For example, according to the above S154, it is determined that the first sub-sampling value of the factory corresponding to 3.4 needs to be adjusted, and its first sub-sampling value 4 is subtracted by one to obtain the adjusted second sub-sampling value 3.
[0061] Based on the adjusted subsampling values, combined with the corresponding first subsampling values of other plants, a second subsampling value is generated for each plant. This is 4, 7, 3, 3, 3. Furthermore, the sum of the second subsampling values is verified to be 20, which satisfies the condition of being equal to the total subsampling value. The second subsampling value for each plant is then used as the target subsampling value for that plant.
[0062] The embodiment of the present application generates a set to be adjusted by screening non-integer initial sub-sampling values, then calculates the difference between the sum of the first sub-sampling numbers and the total sampling number, sorts the decimal part, sorts the decimal part of the initial sub-sampling number in ascending order, gives priority to adjusting the factory with a small decimal part, and then determines the target adjustment factory and reduces its first sub-sampling number by one to accurately control the sub-sampling number of each factory; finally, the sum of the second sub-sampling numbers of multiple factories is strictly equal to the total sampling number, making the adjustment process more scientific and controllable; under the premise of ensuring the accuracy of the total sampling number, it reduces invalid quality inspections caused by unreasonable adjustments and improves sampling efficiency.
[0063] As an extension and refinement of the above embodiment, this application also provides a method for product sampling, referring to Figure 3 As shown, the specific steps include: S31. For any factory among the multiple factories, a target sub-sampling value of products is sampled from the products produced by the factory to generate an initial sampling object set corresponding to the factory.
[0064] Among them, the initial sampling object set includes product serial numbers corresponding to the target sub-sampling value products.
[0065] For any one of the multiple factories, according to its target sub-sampling value, products corresponding to the target sub-sampling value are sampled from the products produced by the factory to generate an initial sampling object set containing the corresponding product serial numbers.
[0066] It should be noted that after determining the target sub-sampling value corresponding to the factory, that is, how many products should be sampled from the products produced by this factory.
[0067] The system then identifies all products produced by the factory. Based on each product's unique serial number (SN), the system employs stratified random sampling, stratified by the time the product SN was generated to ensure a representative sample across time. When the number of SNs sampled reaches the target subsampling value, sampling ceases, generating an initial sampling set for the factory.
[0068] S32. Obtain the abnormal product set corresponding to the factory.
[0069] Among them, abnormal products include products with abnormal test results during the phased performance testing of products under assembly.
[0070] In some embodiments, to ensure the functionality of the product, the factory will periodically conduct stage tests on the product being assembled (such as function and performance testing). If a problem is found during the testing process, a component may be replaced, repaired, or adjusted (such as a motherboard, sensor, or other component). The product will be considered an abnormal product, and the product serial number of the product will be added to the abnormal product set.
[0071] Specifically, the implementation method of obtaining the abnormal product set corresponding to the factory can be refined into the following steps A and B: Step A: Get the product file corresponding to each product in the product set corresponding to the factory.
[0072] The product archive includes information on the product production process associated with the product serial number.
[0073] In an embodiment of the present application, before producing each product, the factory generates a product serial number corresponding to each product and creates a product file associated with the product serial number for each product.
[0074] Furthermore, when a product is undergoing phased testing, production line workers or testing equipment will promptly debug and repair the product when they discover an abnormal problem with the product, and then put the repaired product into the subsequent production process; in the above process, it is necessary to generate an abnormal record based on the abnormal situation of the product and upload it to the production management system, so that the abnormal record corresponding to the product can be entered and saved through the production management system; wherein, the abnormal record may include: abnormal type (such as device replacement, device repair, system debugging, etc.), abnormal device (such as hard disk, sensor), repair time, test results before and after repair and other information, and updated in the product file of the current product; at the same time, based on the above-mentioned products that have had problems, the product file of the product can also be marked with a corresponding target tag, and the target tag is used to indicate that the product has had an abnormality and has been repaired; further, the target tag can be used to quickly screen out products with abnormalities from each corresponding product file.
[0075] Step B: Based on the product file, obtain the target product serial number corresponding to the product carrying the target tag, and generate an abnormal product set based on the target product serial number.
[0076] Among them, the target label is used to identify the abnormal products that have been repaired.
[0077] Specifically, the product files of each product are read to check whether they are marked with the target label, and then the products marked with the target label are filtered out to generate an abnormal product set.
[0078] S33. Generate a target sampling object set based on the abnormal product set and the initial sampling object set.
[0079] In some embodiments, the initial sampling object set is generated through stratified random sampling. Although it can represent the overall quality of production, it may miss high-risk products, such as abnormal products that have undergone device repairs or abnormal products that have undergone device replacements. This is because the products in the abnormal product set have been repaired due to various abnormalities during testing and have higher quality risks. The release of such products into the market may affect user use and the company's reputation. In order to further improve product quality, the embodiment of the present application generates a target sampling object set based on the abnormal product set and the initial sampling object set. This can not only retain the randomness of sampling, but also forcibly include high-risk products in the abnormal product set, achieving the dual goals of scientific sampling and risk control.
[0080] Specifically, based on the abnormal product set and the initial sampling object set, the detailed steps for generating the target sampling object set are as follows: Step a: Count the product values in the abnormal product set to generate a first value.
[0081] By counting the product values in the abnormal product set, the number of products with abnormalities during the phased testing of the products can be obtained.
[0082] Step b: Based on the size relationship between the first value, the target sub-sampling value and the sub-production value, the target sampling object set is generated by combining the initial sampling object set and the abnormal product set.
[0083] Based on the relationship between the first value, the target sub-sampling value, and the sub-production value in step b, the target sampling object set is generated by combining the initial sampling object set and the abnormal product set. Specifically, it can be divided into the following three cases, where J represents the initial sampling object set, Q represents the abnormal product set, and G represents the target sampling object set: (1) When the first value is equal to 0, the initial sampling object set is used as the target sampling object set.
[0084] Specifically, when the first value (i.e., the number of products in the abnormal product set) equals 0, it indicates that the factory detected no abnormal products during the phased testing process, and therefore no products with high-quality risks exist. In this case, the initial sampling set, through stratified random sampling, ensures both randomness and representativeness, effectively reflecting the overall quality level of the factory's products. Therefore, the initial sampling set J can be directly used as the target sampling set G, ensuring the scientific nature of the sampling while improving sampling efficiency and avoiding unnecessary waste of resources.
[0085] The initial sampling object set J corresponding to a factory can be obtained by referring to the following set operation formula:
[0086] in, Indicates that a factory is going to produce The product serial number set of products, stratified random sampling (SN generation time, ) means produced in a certain factory Among the products, stratified random sampling is performed based on the generation time of SN products, and obtain the initial sampling object set J.
[0087] According to the above set operation formula, the element SN of J must come from the set F; and it is a stratified random sampling of the SN in the set F. The SN of the product.
[0088] Furthermore, in case (1) of the embodiment of the present application, that is, when D=0, the initial sampling object set J is directly used as the target sampling object set G, that is, G=J.
[0089] (2) When the first value is greater than or equal to 1 and less than or equal to the target sub-sampling value, a target sampling object set is generated based on the abnormal product set and the initial sampling object set.
[0090] Because the products in the abnormal product set are all products that were detected as abnormal during staged testing and have a higher risk of failure, it is necessary to generate a target sampling set based on the abnormal product set and the initial sampling set. Then, re-inspect the products in the abnormal product set to prevent high-risk products in the abnormal product set from entering the market and improve product quality before leaving the factory.
[0091] Furthermore, in this embodiment of the present application, if there are abnormal products in the abnormal product set, but their number does not exceed the target subsampling value, the first number of products in the initial sampling object set can be randomly replaced with products in the abnormal product set to generate the target sampling object set. In other words, the products in the abnormal product set replace the same number of products in the initial sampling object set, thereby ensuring that all products in the abnormal product set will undergo quality inspection. At the same time, the randomness of the initial sampling object set is retained, maintaining the representativeness of the sample and the scientific value of random sampling.
[0092] You can refer to the following set operation formula to obtain the abnormal product set Q corresponding to a factory:
[0093] in, Indicates the existence of a certain product's SN. This SN must be filtered out based on both the "associated product profile" and "target label" conditions. The SNs of products in F that have the target label in their associated product profiles are selected. Since the target label is used to identify a product as an abnormal product that has been repaired, the resulting Q set is the abnormal products in F.
[0094] Furthermore, in case (2) of the embodiment of the present application, a target sampling object set is generated based on the abnormal product set Q and the initial sampling object set J.
[0095] For example, refer to Figure 4 As shown in the figure, when the target subsampling value of a factory is 10, the initial sampling object set J obtained after sampling includes the product serial numbers of 10 products, namely: SN7, SN11, SN15, SN19, SN23, SN28, SN30, SN32, SN37, and SN42; the abnormal product set Q includes the product serial numbers corresponding to 3 products: SN9, SN22, and SN47; in this case, the first value is 3, and the 3 products in the initial sampling object set need to be randomly replaced with the products in the abnormal product set to generate the target sampling object set. As shown in the figure, the product serial numbers of 10 products in the initial sampling object set J, namely SN23, SN30, and SN37, are replaced with SN9, SN22, and SN47 in the abnormal product set Q to generate the final target sampling object set G: SN7, SN11, SN15, SN19, SN22, SN28, SN9, SN47, SN32, and SN42.
[0096] It should be noted that when randomly sampling to generate the initial sampling object set, it is possible to directly extract products from the abnormal product set. Therefore, when randomly replacing products in the initial sampling object set with products in the abnormal product set, the abnormal products in the initial sampling object set can be retained and then replaced with other products in the abnormal product set.
[0097] For example, refer to Figure 5 As shown in the figure, when the target subsampling value of a factory is 10, the initial sampling object set J obtained after sampling includes the product serial numbers of 10 products, namely: SN7, SN11, SN15, SN19, SN23, SN28, SN30, SN34, SN37, SN42; the abnormal product set Q includes the product serial numbers corresponding to 4 products: SN9, SN30, SN32, SN34; in this case, the first value is 4; at the same time, it is also found that the initial sampling object set J and the abnormal product set Q have an intersection Z, including: SN30, SN 34. At this time, retain SN30 and SN34 in the initial sampling object set J, and use the product serial numbers of the abnormal product set Q except the intersection Z to randomly replace any two products in the initial sampling object set J except the intersection Z. As shown in the figure, use SN9 and SN32 in the abnormal product set Q to replace SN15 and SN28 in the initial sampling object set J. Finally, generate product serial numbers including 10 products to obtain the target sampling object set G: SN7, SN11, SN9, SN19, SN32, SN23, SN34, SN30, SN37, SN42S.
[0098] In case (2), that is, when You can also refer to: , obtain the target sampling object set G.
[0099] For example, refer to Figure 4 Figure 5 As shown, is 10, Taking 4 as an example, when there is no intersection Z, , first randomly select 6 SNs from J, and then merge them with the 4 SNs in Q to obtain the target sampling object set G.
[0100] When there is an intersection Z, , first obtain the intersection of the initial sampling object set J 8 SNs other than the SNs, and randomly select 6 SNs from these 8 SNs, and then compare these 6 SNs with The four SNs in the SN are merged to obtain the target sampling object set G, which is the same as the above Figure 5 The difference between the corresponding embodiments is that the formula retains the SNs in the abnormal product set Q, but the purpose is the same, which is to retain the SNs in the intersection Z and then replace the products in the initial sampling object set J with the products in the abnormal product set Q to maintain the number of products in the target sampling object set G at .
[0101] (3) When the first value is greater than the target sub-sampling value and less than or equal to the sub-production value, the abnormal product set is used as the target sampling object set.
[0102] Specifically, if the number of products in the abnormal product set exceeds the corresponding target sub-sampling value, it indicates that there may be significant quality risks in the product production process (such as component defects in a batch or production line process anomalies). In this case, the abnormal product set is used as the target sampling object set, and all sampled products are high-risk products. This maximizes risk coverage within the limited sampling volume. Further quality inspections are then carried out on products in the component replacement set to reduce the risk of quality complaints from the market.
[0103] In case (3), that is, Directly use the abnormal product set Q as the target sampling object set G, that is, G=Q.
[0104] It should be noted that in case (2), when randomly replacing the first product in the initial sampling object set with a product in the abnormal product set, the status of the product to be replaced must also be verified. The specific steps include the following: Step 1: Determine the first number of products to be replaced in the initial sampling object set, and read the phased test status of the first number of products to be replaced.
[0105] In an embodiment of the present application, the initial sampling object set may include serial numbers corresponding to products that have not completed phase tests. For example, a newly assembled product has not yet completed the last phase test. If the product happens to be after the last phase test, a component replacement is required; before this, if the product is directly sampled, it has not yet been included in the abnormal product set, which may easily lead to missed detection of the high-risk product. Therefore, by reading the phase test status of the product to be replaced, the integrity of the abnormal product set is ensured, and any high-risk product is avoided from being missed, thereby improving the quality of the product.
[0106] Step 2: When the phased test status of the first number of products to be replaced is all tested, randomly replace the first number of products in the initial sampling object set with products in the abnormal product set to generate a target sampling object set.
[0107] By identifying the phased test status of the first number of products to be replaced, replacement is performed when the phased test status of the first number of products to be replaced is that all tests are completed, ensuring that all abnormal products are tested, avoiding missing any abnormal products, and improving the effectiveness of quality supervision of the entire production process.
[0108] It should be noted that, in the embodiment of the present application, the product serial number of each product in the target sampling object set is also marked with a quality inspection mark to remind the tester to conduct testing after the production of the products in the target sampling object set is completed.
[0109] Specifically, the product serial number SN of each product in the target sampling object set is marked with a "quality inspection" logo. When the product production is completed, the system automatically triggers the quality inspection task of the quality inspector through this logo to avoid missing the sampled products. At the same time, the target sampling object set may also include abnormal products. Since the product serial number SN in the product file of the abnormal product is associated with the target label, the quality inspector can use the target label to clearly determine whether the inspected product is a high-risk product during the quality inspection. Furthermore, the quality inspector can focus on the high-risk quality control points according to the product file of the product to improve the targeted inspection.
[0110] The embodiment of the present application avoids manual omissions by setting corresponding quality inspection marks. At the same time, it ensures that abnormal products must be inspected to improve the quality of products leaving the factory. It can also obtain data on the entire process of product production, sampling, and inspection through product archives to support subsequent tracing of quality problems (for example, the test results of a certain SN can be traced back to whether it is an abnormal product, abnormal information of stage tests, etc.).
[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0112] The embodiments of the present application also provide a product sampling device, which corresponds one-to-one with the method claims. Figure 6 A schematic diagram of another product sampling device 600 provided in the present disclosure, as shown in FIG. Figure 6 As shown, the apparatus 600 of this embodiment includes: An acquisition unit 61 is configured to acquire a total production value of a product and sub-production values corresponding to a plurality of factories; the total production value is equal to the sum of the plurality of sub-production values; a calculation unit 62 configured to obtain a total sampling value corresponding to the total production value, and calculate an initial sub-sampling value of each factory based on the total sampling value, the total production value, and a plurality of the sub-production values; a determination unit 63 configured to round up non-integer values in the plurality of initial sub-sampling values to obtain a first sub-sampling value for each of the plants, and determine whether a sum of the plurality of first sub-sampling values is equal to the total sampling value; The processing unit 64 is configured to use the first sub-sampling value of each plant as a target sub-sampling value of each plant when the sum of the plurality of first sub-sampling values is equal to the total sampling value; The adjustment unit 65 is used to adjust the first sub-sampling value of at least one of the factories when the sum of the multiple first sub-sampling values is not equal to the total sampling value, and obtain the second sub-sampling value of each factory; until the sum of the second sub-sampling values of each factory is equal to the total sampling value, the second sub-sampling value of each factory is used as the target sub-sampling value of each factory.
[0113] As an optional implementation of the embodiment of the present application, the adjustment unit 65 is specifically configured to: Non-integer initial sub-sampling values are filtered out from the initial sub-sampling values of the various factories to generate a set to be adjusted; the set to be adjusted includes at least one factory and the initial sub-sampling value corresponding to the factory; a first difference between the sum of multiple first sub-sampling values and the total sampling value is obtained; the decimal parts of the initial sub-sampling values in the set to be adjusted are sorted in ascending order to obtain a sorting result; based on the sorting result and the first difference, a target adjustment factory is determined from the set to be adjusted; the first sub-sampling value corresponding to the target adjustment factory is subtracted by one to generate a second sub-sampling value for each factory.
[0114] As an optional implementation of an embodiment of the present application, the acquisition unit 61 is specifically used to obtain the total production value of the product and the material set data corresponding to multiple factories; the material set data is used to indicate the value supported by the corresponding factory in producing the product; based on the multiple material set data and the total production values, sub-production values corresponding to the multiple factories are generated.
[0115] As an optional implementation of an embodiment of the present application, the calculation unit 62 is specifically used to multiply the sub-production value by the total sampling value for any factory among the factories to obtain a second value; obtain the ratio of the second value to the total production value to generate the initial sub-sampling values corresponding to the multiple factories respectively.
[0116] As an optional implementation of the embodiment of the present application, the product sampling device also includes a sampling unit for extracting the target sub-sampling value products from the products produced by any factory among the multiple factories to generate an initial sampling object set corresponding to the factory; the initial sampling object set includes product serial numbers corresponding to the target sub-sampling value products; obtains an abnormal product set corresponding to the factory; the abnormal product set includes products with abnormal test results when performing phased performance tests on products under assembly; and generates a target sampling object set based on the abnormal product set and the initial sampling object set.
[0117] As an optional implementation of an embodiment of the present application, the sampling unit is used to count the product values in the abnormal product set to generate a first value; based on the size relationship between the first value, the target sub-sampling value and the sub-production value, the target sampling object set is generated in combination with the initial sampling object set and the abnormal product set.
[0118] As an optional implementation of an embodiment of the present application, the sampling unit is used to obtain a product file corresponding to each product in the product set corresponding to the factory; based on the product file, the product file includes information on the product production process associated with the product serial number of the product; obtain the target product serial number corresponding to the product carrying the target tag, and generate the abnormal product set based on the target product serial number; the target tag is used to identify the repaired abnormal product.
[0119] As an optional implementation of an embodiment of the present application, the sampling unit is used to use the initial sampling object set as the target sampling object set when the first value is equal to 0; when the first value is greater than or equal to 1 and less than or equal to the target sub-sampling value, generate the target sampling object set based on the abnormal product set and the initial sampling object set; when the first value is greater than the target sub-sampling value and less than or equal to the sub-production value, use the abnormal product set as the target sampling object set.
[0120] As an optional implementation of the embodiment of the present application, the sampling unit is used to randomly replace the first number of products in the initial sampling object set with products in the abnormal product set to generate the target sampling object set.
[0121] As an optional implementation of an embodiment of the present application, the sampling unit is used to determine the first numerical value of products to be replaced in the initial sampling object set, and read the phased test status of the first numerical value of products to be replaced; when the phased test status of the first numerical value of products to be replaced is a state where all tests are completed, the first numerical value of products in the initial sampling object set are randomly replaced with products in the abnormal product set to generate the target sampling object set.
[0122] As an optional implementation of the embodiment of the present application, the sampling unit is also used to mark the product serial number of each product in the target sampling object set with a quality inspection mark to remind testers to conduct testing after the production of the products in the target sampling object set is completed.
[0123] For the description of the features in the embodiment corresponding to the product sampling device, please refer to the relevant description of the embodiment corresponding to the product sampling method, and will not be repeated here.
[0124] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above product sampling method embodiments.
[0125] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned product sampling method embodiments when running.
[0126] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0127] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above product sampling method embodiments are implemented.
[0128] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned product sampling method embodiments are implemented.
[0129] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0130] The above is a detailed introduction to a product sampling method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A product sampling method, characterized in that: include: Get the total production value of the product and the sub-production values corresponding to multiple factories; The total production value is equal to the sum of the multiple sub-production values; Obtaining a total sampling value corresponding to the total production value, and calculating an initial sub-sampling value of each factory based on the total sampling value, the total production value, and a plurality of the sub-production values; Rounding up non-integer values in the plurality of the initial sub-sampling values to obtain a first sub-sampling value for each of the factories, and determining whether a sum of the plurality of the first sub-sampling values is equal to the total sampling value; If yes, then taking the first sub-sampling value of each factory as the target sub-sampling value of each factory; If not, the first sub-sampling value of at least one of the factories is adjusted to obtain the second sub-sampling value of each factory; until the sum of the second sub-sampling values of each factory is equal to the total sampling value, the second sub-sampling value of each factory is used as the target sub-sampling value of each factory.
2. The product sampling method according to claim 1, characterized in that: The adjusting the first sub-sampling value of at least one of the factories to obtain the second sub-sampling value of each of the factories includes: Screening non-integer initial sub-sampling values from the initial sub-sampling values of each factory to generate a set to be adjusted; the set to be adjusted includes at least one factory and the initial sub-sampling value corresponding to the factory; Obtaining a first difference between a sum of the plurality of first sub-sample values and the total sample value; Sorting the decimal parts of the initial sub-sample values in the set to be adjusted in ascending order to obtain a sorting result; Determining a target adjustment plant from the set to be adjusted based on the sorting result and the first difference; The first sub-sampling value corresponding to the target adjustment plant is subtracted by one to generate a second sub-sampling value for each plant.
3. The product sampling method according to claim 1, characterized in that: The total production value of the product and the sub-production values corresponding to multiple factories are obtained, including: Obtain the total production value of the product and the material completeness data corresponding to multiple factories; the material completeness data is used to indicate the value of the corresponding factory supporting the production of the product; Based on the plurality of material set data and the total production value, sub-production values corresponding to the plurality of factories are generated.
4. The product sampling method according to claim 1, characterized in that: The calculating of the initial sub-sampling value of each factory based on the total sampling value, the total production value, and the plurality of sub-production values comprises: For any factory among the factories, multiply the sub-production value by the total sampling value to obtain a second value; A ratio of the second value to the total production value is obtained to generate the initial sub-sampling values corresponding to the plurality of factories respectively.
5. The product sampling method according to claim 1, characterized in that: The method further comprises: For any factory among the plurality of factories, extract the target sub-sampling value of products from the products produced by the factory to generate an initial sampling object set corresponding to the factory; the initial sampling object set includes product serial numbers corresponding to the target sub-sampling value of products; Obtaining an abnormal product set corresponding to the factory; the abnormal product set includes products with abnormal test results when performing phased performance tests on products under assembly; A target sampling object set is generated based on the abnormal product set and the initial sampling object set.
6. The product sampling method according to claim 5, characterized in that: The generating of a target sampling object set based on the abnormal product set and the initial sampling object set includes: Counting product values in the abnormal product set to generate a first value; Based on the size relationship between the first value, the target sub-sampling value and the sub-production value, the target sampling object set is generated in combination with the initial sampling object set and the abnormal product set.
7. The product sampling method according to claim 5, characterized in that: The obtaining of the abnormal product set corresponding to the factory includes: Obtaining a product file corresponding to each product in the product set corresponding to the factory; the product file includes information about the product production process associated with the product serial number; Based on the product file, a target product serial number corresponding to the product carrying the target tag is obtained, and the abnormal product set is generated based on the target product serial number; the target tag is used to identify the repaired abnormal product.
8. The product sampling method according to claim 6, characterized in that: The generating the target sampling object set based on the magnitude relationship among the first value, the target sub-sampling value, and the sub-production value, in combination with the initial sampling object set and the abnormal product set, includes: When the first value is equal to 0, the initial sampling object set is used as the target sampling object set; When the first value is greater than or equal to 1 and less than or equal to the sub-sampling value, generating the target sampling object set based on the abnormal product set and the initial sampling object set; When the first value is greater than the target sub-sampling value and less than or equal to the sub-production value, the abnormal product set is used as the target sampling object set.
9. The product sampling method according to claim 8, characterized in that: Generating the target sampling object set based on the abnormal product set and the initial sampling object set includes: The first number of products in the initial sampling object set is randomly replaced by products in the abnormal product set to generate the target sampling object set.
10. The product sampling method according to claim 9, characterized in that: The step of randomly replacing the first number of products in the initial sampling object set with products in the abnormal product set to generate the target sampling object set includes: Determining the first number of products to be replaced in the initial sampling object set, and reading the phased test status of the first number of products to be replaced; When the phased test status of the first number of products to be replaced is a state of complete testing, the first number of products in the initial sampling object set are randomly replaced with products in the abnormal product set to generate the target sampling object set.
11. The product sampling method according to claim 5, characterized in that: The method further comprises: The product serial number of each product in the target sampling object set is marked with a quality inspection mark to remind testers to conduct testing after the production of the products in the target sampling object set is completed.
12. A product sampling device, characterized in that: include: The acquisition unit is used to obtain the total production value of the product and the sub-production values corresponding to multiple factories; The total production value is equal to the sum of the multiple sub-production values; a calculation unit, configured to obtain a total sampling value corresponding to the total production value, and calculate an initial sub-sampling value of each factory based on the total sampling value, the total production value, and a plurality of the sub-production values; a determination unit, configured to round up non-integer values in the plurality of the initial sub-sampling values to obtain a first sub-sampling value for each of the factories, and determine whether a sum of the plurality of the first sub-sampling values is equal to the total sampling value; a processing unit, configured to use the first sub-sampling value of each factory as a target sub-sampling value of each factory when the sum of the plurality of first sub-sampling values is equal to the total sampling value; An adjustment unit is used to adjust the first sub-sampling value of at least one of the factories when the sum of the multiple first sub-sampling values is not equal to the total sampling value, so as to obtain the second sub-sampling value of each of the factories; until the sum of the second sub-sampling values of each of the factories is equal to the total sampling value, the second sub-sampling value of each of the factories is used as the target sub-sampling value of each of the factories.
13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the product sampling method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the product sampling method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the product sampling method according to any one of claims 1 to 11 are implemented.