A nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration

By calculating the delay risk and safe circulation coefficient of the traceability node, the computing resources of the cloud-edge collaboration system are dynamically allocated, which solves the local optimal problem of the cloud-edge collaboration system in the processing of multi-batch nutrition traceability data, and achieves real-time tracking of traceability data. Updates and accuracy, optimized system performance.

CN118365345BActive Publication Date: 2024-09-13国品优选(北京)品牌管理有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410788309.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-13
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

The cloud-edge collaboration system has a local optimal problem in the processing of multi-batch nutrition traceability data and cannot effectively deal with unknown load risks, resulting in uneven distribution of computing resources and affecting the real-time and accuracy of data updates.

Method used

By obtaining the historical data and geographical coordinate information of each traceability node, the delay risk and safe circulation coefficient are calculated, and combined with edge device data, computing resources are dynamically allocated to achieve optimal allocation and ensure real-time updates and accuracy of traceability data.

Benefits of technology

It realizes dynamic computing resource allocation for continuously updated traceability data, ensures the real-time and accuracy of traceability data to the greatest extent, optimizes system performance and response speed, and avoids local optimal problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365345B
    Figure CN118365345B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically to a nutritional product anti-counterfeiting traceability method based on cloud-edge collaboration. The following steps are included: obtaining traceability data and time interval data, edge side device data, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node; obtaining the delay risk based on the historical traceability data and the historical time interval data; obtaining the safety circulation coefficient based on the geographic coordinates and time interval data of all traceability nodes that have been updated; obtaining the allocation factor based on the delay risk, the safety circulation coefficient and the data of all edge side devices; obtaining the optimal allocation result of the latest traceability data computing resources based on the allocation factor. The purpose of the present invention is to solve the technical problem that there is a local optimum in the dynamic scheduling of computing resources when the cloud-edge collaborative system generates traceability data for multiple batches of nutritional products at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration. Background Art

[0002] Counterfeit and inferior nutritional products not only harm consumers' health, but also seriously affect the brand's reputation and market trust. Therefore, it is very necessary to authenticate nutritional products and set up anti-counterfeiting measures. In the current application of commodity anti-counterfeiting and traceability, cloud-edge collaboration combines the powerful back-end support of cloud computing and the front-end intelligence of edge computing, making the entire traceability process more efficient and transparent. Brand companies generally establish their own anti-counterfeiting and traceability systems, but in most cases, the computing resources of the enterprise cloud may be limited. The large amount of data generated during the production and circulation of nutritional products will face greater bandwidth pressure when directly uploaded to the cloud.

[0003] The edge computing method used by the cloud-edge collaborative system can process data immediately close to the data source, such as sensor data inside the factory during the production process, or circulation data during the logistics process, which helps to immediately identify possible problems and respond quickly. However, during the production and circulation of multiple consecutive batches of nutritional products, the update nodes and geographical distribution of the traceability data source are random, which will cause large changes in the real-time load of edge devices. Although conventional cloud-edge collaborative systems can balance the load by dynamically scheduling computing resources, they are essentially real-time feedback adjustments, which have local optimal problems and cannot cope with unknown load risks. Summary of the invention

[0004] In order to solve the technical problem that there is a local optimum in the dynamic scheduling of computing resources when cloud-edge collaboration simultaneously generates traceability data for multiple batches of nutritional products, the purpose of the present invention is to provide a nutritional product anti-counterfeiting and traceability method based on a cloud-edge collaboration system. The technical solution adopted is as follows:

[0005] A nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration includes the following steps:

[0006] Obtain the historical traceability data and historical time interval data of all batches of products at each traceability node, the geographic coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products, the data of all edge devices in the cloud-edge collaborative system, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node;

[0007] Obtain the delay risk of each traceability node based on the historical traceability data and historical time interval data of all batches of products at each traceability node;

[0008] According to the geographical coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products, obtain the safety circulation coefficient of each batch of products updated to the latest traceability node;

[0009] According to the delay risk of each traceability node, the safety circulation coefficient of each batch of products updated to the latest traceability node, and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node is obtained;

[0010] Based on the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node, the number of all batches of products in production and circulation when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

[0011] Preferably, the specific steps of obtaining the delay risk of each traceability node according to the historical traceability data and historical time interval data of all batches of products of each traceability node include:

[0012] According to the historical traceability data of all production batches of each traceability node and the historical traceability data of all production batches of the previous traceability node, the degradation transfer factor of each traceability node is obtained;

[0013] According to the variance and average of the historical time interval data of all production batches of each traceability node, the inefficiency of each traceability node is obtained;

[0014] Multiply the degradation transfer factor of each traceability node by the inefficiency level of each traceability node to obtain the delay risk of each traceability node.

[0015] Preferably, the specific steps of obtaining the inefficiency of each traceability node according to the variance and average of the time interval data of all production batches of products at each traceability node include:

[0016] Compare the variance and average of the time interval data of all production batches of each traceability node to obtain a ratio;

[0017] The ratio is normalized using the norm function to obtain the inefficiency level of each traceability node.

[0018] Preferably, the specific steps of obtaining the safe circulation coefficient of each batch of products updated to the latest traceability node according to the geographical coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and the previous batch of products include:

[0019] Based on the geographical coordinates of all traceability nodes that have been updated for the target batch of products and the geographical coordinates of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the Euclidean distance formula is used to obtain the Euclidean distance between the geographical coordinates of the target batch of products and the geographical coordinates of the previous batch of products of the target batch of products;

[0020] Based on the data of the time interval of all traceability nodes that have been updated for the target batch of products and the data of the time interval of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the square difference between the data of the time interval of the target batch of products and the data of the time interval of the previous batch of products is obtained using the square difference formula;

[0021] The safety circulation coefficient of each batch of products updated to the latest traceability node is obtained based on the Euclidean distance between the geographical coordinates of the target batch of products and the geographical coordinates of the previous batch of products of the target batch of products and the square difference between the time interval data of the target batch of products and the time interval data of the previous batch of products.

[0022] Preferably, according to the delay risk of each traceability node, the safety circulation coefficient of each batch of products updated to the latest traceability node, and the data of all edge devices in the cloud-edge collaborative system, the specific steps of obtaining the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node include:

[0023] Compare the delay risk of each traceability node with the safety circulation coefficient of each batch of products updated to the latest traceability node, and obtain the ratio of the delay risk of each traceability node to the safety circulation coefficient of each batch of products updated to the latest traceability node;

[0024] Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained.

[0025] Preferably, the specific steps of obtaining the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system include:

[0026] Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system when the traceability node of the target batch of products is updated, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained.

[0027] Preferably, the specific steps of obtaining the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system when the traceability node of the target batch of products is updated include:

[0028] Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node, as well as the CPU occupancy rate in the data of all edge devices when the traceability node of the target batch of products is updated in the cloud-edge collaborative system and the distance between each batch of products updated to the latest traceability node and each edge device in the data of all edge devices, the allocation factor of the edge devices assigned to each batch of products updated to the latest traceability node is obtained.

[0029] Preferably, the specific steps of obtaining the optimal allocation result of the latest traceability data computing resources according to the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node include:

[0030] Based on the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, and the difference between the number of all batches of products in production and circulation when the traceability node is updated and the number of production batches of products that are synchronously updating the traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

[0031] Preferably, the specific steps of updating each batch of products to the allocation factor of the edge device allocated to the latest traceability node, and the difference between the number of all batches of products in the production and circulation process when the traceability node is updated and the number of production batches of products that are synchronously updating the traceability node, and obtaining the optimal allocation result of the latest traceability data computing resources include:

[0032] According to the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, obtain the tolerance of each edge device for each batch of products updated to the latest traceability node and the allocation constraint value of the production batch products of the traceability node being updated in different allocation schemes;

[0033] Based on the inclusiveness of each edge device for updating each batch of products to the latest traceability node and the allocation constraint values ​​of the production batch products of the traceability node being updated in different allocation schemes, as well as the difference between the number of all batch products in the production circulation process and the number of production batch products of the traceability node being synchronously updated when each batch of products is updated to the latest traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

[0034] Preferably, the specific steps of obtaining the optimal allocation result of the latest traceability data computing resources based on the inclusiveness of each edge-side device for each batch of products updated to the latest traceability node and the allocation constraint value of the production batch products of the traceability node being updated in different allocation schemes, and the difference between the number of all batch products in the production circulation process when each batch of products is updated to the latest traceability node and the number of production batch products of the traceability node being synchronously updated, include:

[0035] When the product of the ratio of the inclusiveness of each edge-side device for each batch of products updated to the latest traceability node and the allocation constraint values ​​of the production batch products of the traceability node being updated in different allocation schemes and the difference between the number of all batch products in the production circulation process and the number of production batch products of the traceability node being synchronously updated when each batch of products is updated to the latest traceability node is minimized, the optimal allocation result of the traceability data of the latest traceability node is obtained.

[0036] The present invention has the following beneficial effects:

[0037] The anti-counterfeiting and traceability method for nutritional products based on cloud-edge collaboration of the present invention obtains the delay risk of each traceability node based on the historical traceability data and historical time interval data of all batches of products of each traceability node, and then obtains the safe circulation coefficient of each batch of products updated to the latest traceability node based on the geographical coordinates and time interval data of all traceability nodes that have been updated by the target batch of products and its previous batch of products. According to the delay risk of each traceability node, the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge-side devices in the cloud-edge collaborative system, the allocation factor of the edge-side device allocated to each batch of products updated to the latest traceability node is obtained. The optimal allocation result of the latest traceability data computing resources is obtained by taking into account the allocation factor of the edge device that has been allocated to the point, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node. When the traceability data of different batches of products are generated or updated, the other production batches that need to be updated synchronously will be included in the calculation. That is, as long as there is any batch of traceability nodes that need to be updated, the allocation plan will be cyclically calculated to obtain a distribution plan, and the dynamic computing resource allocation for the continuously updated traceability data will be completed. The real-time and accuracy of the traceability data update can be guaranteed to the greatest extent, the performance and response speed of the entire system can be optimized, and the uncertain risks can be anticipated to avoid the local optimal problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A flowchart of a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration provided by an embodiment of the present invention.

[0040] Figure 2 A schematic diagram of the traceability sequence of three different batches of products in a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following is a detailed description of the specific implementation method, structure, characteristics and effects of a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0043] The following is a detailed description of a specific scheme of a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration provided by the present invention in conjunction with the accompanying drawings.

[0044] The production and circulation links of the nutritional products in the present invention specifically include: raw material procurement, raw material inspection and receipt, production preparation, production and processing, intermediate product inspection, packaging, final product inspection, storage, logistics, marketing and distribution, etc.

[0045] Any production and circulation link is called a traceability node; all production and circulation links have a sequence, so the traceability node can also generate a traceability sequence according to the order of the production and circulation links.

[0046] Each traceability node collects several different types of data. Each type of data collected under each traceability node is called the traceability data under the traceability node, such as several process data (including sensor data) in the production and processing links; various inspection indicators in the inspection link; various flow locations in the logistics link, as well as transportation methods and time, etc.

[0047] When each traceability data is collected, the collection time and geographic coordinates are recorded simultaneously.

[0048] There are multiple edge devices in the cloud-edge collaborative system, and the multiple edge devices are distributed in different geographical locations.

[0049] See also Figure 1 , which shows a flow chart of a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration provided by an embodiment of the present invention. The nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration provided by the present invention comprises the following steps:

[0050] S100. Obtain the historical traceability data and historical time interval data of all batches of products of each traceability node, the geographic coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products, the data of all edge devices in the cloud-edge collaborative system, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are being synchronously updated at the traceability node.

[0051] S200. Obtain the delay risk of each traceability node based on the historical traceability data and historical time interval data of all batches of products of each traceability node. The purpose of obtaining the delay risk is to anticipate and compensate for the adverse effects that may occur at each traceability node during the production and circulation of the product, so as to have the ability to resist risks when allocating computing resources to edge devices.

[0052] S300. Obtain the safety circulation coefficient of each batch of products updated to the latest traceability node based on the geographic coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products.

[0053] S400. According to the delay risk of each traceability node, the safe circulation coefficient of each batch of products updated to the latest traceability node, and the data of all edge devices in the cloud-edge collaborative system, obtain the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node.

[0054] S500. Obtain the optimal allocation result of the latest traceability data computing resources based on the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node.

[0055] The present invention obtains the delay risk of each traceability node based on the historical traceability data and historical time interval data of all batches of products at each traceability node, and then obtains the safe circulation coefficient of each batch of products updated to the latest traceability node based on the geographical coordinates and time interval data of all traceability nodes that have been updated by the target batch of products and its previous batch of products. According to the delay risk of each traceability node, the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained. The optimal allocation result of the latest traceability data computing resources is obtained by combining the allocation factor, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node. When the traceability data of different batches of products are generated or updated, the other production batches that need to be updated synchronously are also included in the present invention. That is, as long as there is any batch of traceability nodes that need to be updated, a distribution plan will be cyclically calculated to obtain a distribution plan, so as to complete the dynamic computing resource allocation of the continuously updated traceability data, which can maximize the real-time and accuracy of the traceability data update, optimize the performance and response speed of the entire system, and can anticipate uncertain risks to avoid local optimal problems.

[0056] On the basis of the above embodiments, when the traceability node is affected by poor production process or transportation capacity, the efficiency of the traceability node is affected. The higher the delay risk of different traceability nodes, the more likely it is to have an adverse impact on subsequent traceability nodes, and the more likely it is to cause abnormal traceability information for the batch of products in which it is located. Due to the confusion of the traceability information of the real products in this batch, the update and verification process of the real information becomes slow and complicated. As a result, during the production and circulation of this batch of products, once counterfeit products flow into the market at the same time, it is difficult to determine the authenticity of the traceability information forged by the counterfeit products.

[0057] Therefore, the specific steps of S200 include:

[0058] First, obtain the data of the start to end time interval of each traceability node of each production batch in the historical sample data of the product. Then standardize the traceability data of all production batches of products at each traceability node to obtain the historical traceability data of each traceability node.

[0059] In this embodiment, the delay risk formula is used in step S200, which is:

[0060] ;

[0061] Among them, r represents the rth tracing node, represents the delay risk of the rth tracing node, Represents the data set of the time intervals of all production batches of the r-th traceability node, represents the Pearson correlation coefficient, represents the variance of the data set of the time interval of all production batches of the rth traceability node, Represents the average value of the data set of the time intervals of all production batches of products at the rth traceability node; z represents a constant, which is 0.1.

[0062] at the same time, Represents the historical traceability data set of all production batches of products at the rth traceability node, Represents the historical traceability data set of all production batches of the previous traceability node of the rth traceability node, The Pearson correlation coefficient between the historical traceability data set of all production batches of the r-th traceability node and the historical traceability data set of all production batches of the previous traceability node. The larger the absolute value of the Pearson correlation coefficient, the more easily the traceability data quality of the r-th traceability node is affected by the traceability data quality of the previous traceability node, which is called the degradation transfer factor of the r-th traceability node. That is, the degradation transfer factor of each traceability node is obtained based on the historical traceability data of all production batches of each traceability node and the historical traceability data of all production batches of the previous traceability node.

[0063] and, The ratio of the variance to the mean value of the data set representing the historical time intervals of all production batches of the r-th traceability node. The larger the numerator, the more inconsistent the time intervals from the start to the completion of all production batches of the r-th traceability node. The smaller the numerator, the shorter the average completion time of the traceability node, that is, the traceability node is not a relatively time-consuming node in the entire product production and circulation link. The larger the value is, the more unstable the r-th traceability node is and the lower the actual cost is. The production and circulation efficiency of this link is lower. The ratio is normalized using the norm function to obtain the inefficiency of the r-th traceability node. That is, in this embodiment, the inefficiency of each traceability node is obtained based on the variance and average of the time interval data of all production batches of products at each traceability node. Specifically, the variance and average of the time interval data of all production batches of products at each traceability node are compared to obtain a ratio; the ratio is normalized using the norm function to obtain the inefficiency of each traceability node.

[0064] The product of the degradation transfer factor and the inefficiency degree of the traceability node is taken as the delay risk of the rth traceability node That is, the degradation transfer factor of each traceability node is multiplied by the inefficiency of each traceability node to obtain the delay risk of each traceability node.

[0065] Based on the above embodiments, the spatial location of each traceability node in the traceability sequence is different, and the spatial location of all traceability data collected at each traceability node is also different; in addition, the traceability data generated by different batches of nutritional products at the same traceability node may also be different; for example, the supply and inspection of raw materials may come from different suppliers or regions, the processing and packaging steps may vary due to different product formulas or production scales, the transportation and warehousing process may pass through different logistics centers or warehouses, and the distribution channels may also include multiple levels, etc. Please also refer to Figure 2 , Figure 2 The following is a schematic diagram of the traceability sequence of three different batches of products. Different batches of products may flow to different directions at different nodes during the entire process from raw material node A to sales node G. It should be noted that Figure 2 Just for example, in the actual automated production process of nutritional supplements, different batches of products are shipped out of the factory very quickly, so there will be more batches of products in circulation at the same time.

[0066] Therefore, during the production and circulation of multiple batches of goods, the cloud-edge collaborative system needs to dynamically schedule the computing resources of edge devices in real time. If a large amount of data to be processed is accumulated at a traceability node for multiple batches of products at the same time, the computing load on the nearest edge will surge in a short period of time. Therefore, in order to ensure the timely processing and updating of traceability data, it is necessary to analyze the safe circulation of real-time traceability nodes for different batches of products.

[0067] The specific steps of S300 include:

[0068] Based on the geographic coordinates of all traceability nodes that have been updated for the target batch of products and the geographic coordinates of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the Euclidean distance formula is used to obtain the Euclidean distance between the geographic coordinates of the target batch of products and the geographic coordinates of the previous batch of products of the target batch of products.

[0069] Based on the time interval data of all traceability nodes that have been updated for the target batch of products and the time interval data of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the square difference between the time interval data of the target batch of products and the time interval data of the previous batch of products is obtained using the square difference formula.

[0070] The safety circulation coefficient of each batch of products updated to the latest traceability node is obtained based on the Euclidean distance between the geographical coordinates of the target batch of products and the geographical coordinates of the previous batch of products of the target batch of products and the square difference between the time interval data of the target batch of products and the time interval data of the previous batch of products.

[0071] In this embodiment, all updated traceability nodes of the previous batch of products of the target batch are obtained, including the geographical coordinates of the data source of each traceability node and the data of the time interval from the start to the end. Each traceability node updated in real time of the target batch and all traceability nodes updated before the real-time traceability node are obtained, including the geographical coordinates of the data source of each traceability node and the data of the time interval from the start to the end. And the Euclidean distance between the geographical coordinates of the data source of each identical traceability node of the target batch and its previous batch is obtained.

[0072] All the above Euclidean distance and time interval data are standardized and dimensionless, and the following safety circulation coefficient formula is used:

[0073] ;

[0074] in, Represents the safe circulation coefficient when the i-th target batch of products is updated to the M-th traceability node, is a natural constant, r represents the rth traceability node, M represents the traceability node updated to the Mth traceability node during the production and circulation of nutritional products, i represents the i-th target batch of products, Represents the time interval from the start to the completion of the rth traceability node of the i-th target batch of products. Represents the time interval from the start to the completion of the rth traceability node of the i-1th target batch of products. Represents the Euclidean distance between the geographic coordinates generated by the data source of the r-th traceability node of the i-th target batch and the geographic coordinates generated by the data source of the r-th traceability node of the i-1-th target batch.

[0075] at the same time, Represents the square difference of the data from the start to the completion time interval of the rth traceability node of the i-th and i-1-th target batches of products. The smaller the value, the more consistent the production and circulation efficiency of the rth traceability node of the i-th target batch and the adjacent batches of products, that is, the smoother the production and circulation; The denominator in represents the Euclidean distance between the geographic coordinates generated by the data source of the r-th traceability node of the i-th target batch and the geographic coordinates generated by the data source of the r-th traceability node of the i-1-th target batch. The smaller the value, the more overlapped the production and circulation links of the i-th target batch and the i-1-th target batch. The closer the data source collection locations of the two batches are, the more likely they are to be processed on the same edge side. Conversely, the less overlapped the production and circulation links of adjacent batches of products are, the more the load pressure on the edge side for real-time data processing can be reduced.

[0076] therefore The larger the numerator and the smaller the denominator, the lower the safe circulation coefficient of the rth traceability node of the ith target batch. The safe circulation coefficients of all traceability nodes before the ith target batch is updated to the Mth traceability node are averaged, and then normalized inversely using an exponential function with natural numbers as the base, to obtain the safe circulation coefficient of the ith target batch of products at the Mth traceability node.

[0077] Through this embodiment, it can be concluded that the smoother the production and circulation links of adjacent batches of products and the less overlapping the data sources, the higher the safe circulation coefficient, which can correspondingly provide better fault tolerance for the cloud-edge collaborative edge side and reduce the processing pressure of real-time data.

[0078] Based on the above embodiments, since the traceability data of each traceability node includes the geographic coordinates at the time of collection, the specific steps of S400 include:

[0079] The delay risk of each traceability node is compared with the safe circulation coefficient of each batch of products updated to the latest traceability node to obtain the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node.

[0080] Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained.

[0081] Therefore: when obtaining the real-time traceability node update of the target batch of products, the CPU occupancy rate of all edge devices that can be scheduled by the cloud-edge collaboration system at the current moment, as well as the distance between the real-time traceability node of the target batch of products and each edge side. The allocation factor of each batch of products updated to the latest traceability node and the allocated edge device uses the following allocation factor formula:

[0082] ;

[0083] in, Represents the delay risk of the Mth tracing node, Represents the safe circulation coefficient when the i-th target batch of products is updated to the M-th traceability node, It represents the ratio of the two. The larger the numerator and the smaller the denominator, the more likely it is that the M-th traceability node is often adversely affected by uncertain factors, and the production flow process at the M-th traceability node is not smooth. Therefore, in order to avoid the delay and abnormal risks that may occur when the traceability data of the M-th traceability node is diverted to other edge sides, it is necessary to distribute it nearby.

[0084] Represents the CPU usage of the xth edge side, represents the distance between the Mth real-time traceability node and the xth edge side of the i-th batch, and It represents the inverse of the product of the distance between the Mth real-time tracing node of the ith batch and the xth edge side and the CPU usage of the xth edge side. The larger the value, that is, the smaller the denominator, the higher the allocability of the tracing data of the Mth real-time tracing node of the ith batch to the xth edge side.

[0085] Multiplying the two together gives the allocation factor of the real-time traceability data of the Mth real-time traceability node in the i-th batch to the xth edge side. , The larger the value, the higher the allocability of the traceability data of the Mth real-time traceability node of the i-th batch to the x-th edge side.

[0086] Based on the above embodiment, the specific steps of S500 include:

[0087] Based on the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, and the difference between the number of all batches of products in production and circulation when the traceability node is updated and the number of production batches of products that are synchronously updating the traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

[0088] Among them, according to the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, the inclusiveness of each edge device for each batch of products updated to the latest traceability node and the allocation constraint value of the production batch products of the traceability node being updated in different allocation schemes are obtained.

[0089] When the product of the ratio of the inclusiveness of each edge-side device for each batch of products updated to the latest traceability node and the allocation constraint values ​​of the production batch products of the traceability node being updated in different allocation schemes and the difference between the number of all batch products in the production circulation process and the number of production batch products of the traceability node being synchronously updated when each batch of products is updated to the latest traceability node is minimized, the optimal allocation result of the traceability data of the latest traceability node is obtained.

[0090] Specifically, it can be set that at the beginning of each day's production and circulation, all traceability nodes of the first batch of products are allocated according to the existing geographically closest default allocation plan, that is, this embodiment is applied to subsequent batches of products except the first batch of products. When the traceability nodes of subsequent batches of products are updated, dynamic allocation is performed.

[0091] Among them, when the real-time traceability node of the target batch of products is updated, the real-time traceability nodes of other batches of products will also be updated or will be updated. Therefore, when the real-time traceability node update of the target batch is obtained, all batches of products currently in the production and circulation process, that is, all batches of products whose production and circulation links have been started but not completed, a total of Y batches.

[0092] Get the production batches that are updating the traceability nodes synchronously, a total of U, that is, the traceability nodes that have completed the collection of traceability data and are waiting to be assigned to the edge data center for processing; get the next traceability node to be updated for the remaining production batches in Y batches. Get the last updated traceability node of the Y batches of products, and an edge side that has been assigned to the last updated traceability node.

[0093] The production batches of U traceability nodes being updated are matched with all L edge devices in pairs to obtain several allocation results. In each allocation result, the traceability data of each traceability node being updated has a matching edge device. The optimal allocation result is selected using the following objective function:

[0094] ;

[0095] in, represents the output value of the objective function, w represents the wth production batch that has been produced and circulated, with a total of Y batches, and M represents the Mth real-time update node. Represents the allocation factor of the previous traceability node of the w-th production batch that has been produced and circulated, which has been allocated to the x-th edge side. This value is a fixed value that has already occurred; i represents the i-th production batch that is updating the traceability node, a total of U, The allocation factor representing the allocation of the traceability data of the i-th production batch that is updating the traceability node to the q-th edge side. This value changes with different edge sides of the iteration; Represents the allocation factor of an assigned traceability node on the qth edge side.

[0096] at the same time, It represents the average value of the allocation factors that have been allocated to the edge side by the previous traceability node of all production batches that have been produced and circulated. The size of this value represents the quality of the allocation results of computing resources when the traceability nodes of all production batches were updated in the previous round, and represents the tolerance of each edge side to the traceability update nodes in this round.

[0097] and, The absolute value of the difference between the allocation factor that represents the iterative allocation of the traceability data of the i-th production batch that is updating the traceability node to the q-th edge side and the allocation factor of the last traceability node allocated to the q-th edge side. The smaller the value, the more consistent the allocation degree of the q-th edge side for the traceability data allocated to the traceability node in the previous round is with the allocation degree of the traceability data of the traceability node being updated in this round. This is called the allocation constraint value of the q-th edge side.

[0098] in, The allocation constraint values ​​representing all production batches that are updating the traceability nodes in different allocation schemes, that is, the average value of the allocatable factors on the edge side allocated to the U production batches that are updating must be at most equal to or close to the average value of the allocation factors of these edge sides for all production batches in the previous round of updates, in order to reserve allocatable space for subsequent nodes. If we only focus on the U production batches that are updating the traceability nodes, it is easy to fall into the local optimum, resulting in a smaller allocation space for the production batches that are about to update the traceability nodes.

[0099] exist In the above equation, the smaller the numerator is, the larger the allocation space reserved for subsequent traceability node updates is. The larger the denominator is, the better the tolerance of each edge side to the traceability update nodes in this round is. The smaller the fraction is, the more the current allocation plan can guarantee the processing effect of the traceability information being updated in this round, and prevent subsequent load risks.

[0100] in, Represents the difference between the number of all batches of products that have been produced and circulated and the number of traceability nodes that are currently being updated synchronously. The larger the value, the more batches that have not participated in this round of node updates. Therefore, when allocating the traceability nodes that are currently being updated synchronously, it is necessary to reserve allocable space for subsequent nodes. Therefore, it is used as a penalty item and Multiply.

[0101] Therefore, when the output value of the objective function is the minimum, the optimal allocation result screened is the optimal allocation result of the latest traceability data computing resources.

[0102] In this embodiment, when the data sources of different batches of products are generated or updated, they will be included in other production batches that need to be updated synchronously. That is, as long as any batch of traceability nodes needs to be updated, a distribution plan will be obtained through a cyclic calculation to complete the dynamic computing resource allocation for the continuously updated traceability data. This can maximize the real-time and accuracy of traceability data updates, optimize the performance and response speed of the entire system, and anticipate uncertain risks, avoiding local optimal problems.

[0103] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0104] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration, characterized in that: The following steps are involved: Obtain the historical traceability data and historical time interval data of all batches of products at each traceability node, the geographic coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products, the data of all edge devices in the cloud-edge collaborative system, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node; Obtain the delay risk of each traceability node based on the historical traceability data and historical time interval data of all batches of products at each traceability node; According to the geographical coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and its previous batch of products, obtain the safety circulation coefficient of each batch of products updated to the latest traceability node; According to the delay risk of each traceability node, the safety circulation coefficient of each batch of products updated to the latest traceability node, and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node is obtained; The optimal allocation result of the latest traceability data computing resources is obtained according to the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node; According to the historical traceability data and historical time interval data of all batches of products at each traceability node, the specific steps of obtaining the delay risk of each traceability node include: According to the historical traceability data of all production batches of each traceability node and the historical traceability data of all production batches of the previous traceability node, the degradation transfer factor of each traceability node is obtained; According to the variance and average of the historical time interval data of all production batches of each traceability node, the inefficiency of each traceability node is obtained; Multiply the degradation transfer factor of each traceability node by the inefficiency of each traceability node to obtain the delay risk of each traceability node; According to the variance and average of the time interval data of all production batches of each traceability node, the specific steps to obtain the inefficiency of each traceability node include: Compare the variance and average of the time interval data of all production batches of each traceability node to obtain a ratio; The ratio is normalized using the norm function to obtain the inefficiency level of each traceability node; According to the geographical coordinates and time interval data of all traceability nodes that have been updated for the target batch of products and the previous batch of products, the specific steps of obtaining the safe circulation coefficient of each batch of products updated to the latest traceability node include: Based on the geographical coordinates of all traceability nodes that have been updated for the target batch of products and the geographical coordinates of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the Euclidean distance formula is used to obtain the Euclidean distance between the geographical coordinates of the target batch of products and the geographical coordinates of the previous batch of products of the target batch of products; Based on the data of the time interval of all traceability nodes that have been updated for the target batch of products and the data of the time interval of all traceability nodes that have been updated for the previous batch of products of the target batch of products, the square difference between the data of the time interval of the target batch of products and the data of the time interval of the previous batch of products is obtained using the square difference formula; The safety circulation coefficient of each batch of products updated to the latest traceability node is obtained based on the Euclidean distance between the geographical coordinates of the target batch of products and the geographical coordinates of the previous batch of products of the target batch of products and the square difference between the time interval data of the target batch of products and the time interval data of the previous batch of products.

2. According to claim 1, a nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration is characterized in that: According to the delay risk of each traceability node, the safety circulation coefficient of each batch of products updated to the latest traceability node, and the data of all edge devices in the cloud-edge collaborative system, the specific steps of obtaining the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node include: Compare the delay risk of each traceability node with the safety circulation coefficient of each batch of products updated to the latest traceability node, and obtain the ratio of the delay risk of each traceability node to the safety circulation coefficient of each batch of products updated to the latest traceability node; Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained.

3. The nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration according to claim 2 is characterized in that: The specific steps of obtaining the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system include: Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system when the traceability node of the target batch of products is updated, the allocation factor of the edge devices allocated to each batch of products updated to the latest traceability node is obtained.

4. The method for tracing nutritional products based on cloud-edge collaboration according to claim 3 is characterized in that: The specific steps of obtaining the allocation factor of the edge devices that have been allocated to each batch of products updated to the latest traceability node based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node and the data of all edge devices in the cloud-edge collaborative system when the traceability node of the target batch of products is updated include: Based on the ratio of the delay risk of each traceability node to the safe circulation coefficient of each batch of products updated to the latest traceability node, as well as the CPU occupancy rate in the data of all edge devices when the traceability node of the target batch of products is updated in the cloud-edge collaborative system and the distance between each batch of products updated to the latest traceability node and each edge device in the data of all edge devices, the allocation factor of the edge devices assigned to each batch of products updated to the latest traceability node is obtained.

5. A nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration according to any one of claims 1 to 4, characterized in that: The specific steps of obtaining the optimal allocation result of the latest traceability data computing resources according to the allocation factor of the edge device allocated to each batch of products updated to the latest traceability node, the number of all batches of products in the production and circulation process when the traceability node is updated, and the number of production batches of products that are synchronously updating the traceability node include: Based on the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, and the difference between the number of all batches of products in production and circulation when the traceability node is updated and the number of production batches of products that are synchronously updating the traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

6. The nutritional product anti-counterfeiting and traceability method based on cloud-edge collaboration according to claim 5 is characterized in that: Based on the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, and the difference between the number of all batches of products in the production and circulation process when the traceability node is updated and the number of production batches of products that are synchronously updating the traceability node, the specific steps of obtaining the optimal allocation result of the latest traceability data computing resources include: According to the allocation factor of the edge device that has been allocated to each batch of products updated to the latest traceability node, obtain the tolerance of each edge device for each batch of products updated to the latest traceability node and the allocation constraint value of the production batch products of the traceability node being updated in different allocation schemes; Based on the inclusiveness of each edge device for updating each batch of products to the latest traceability node and the allocation constraint values ​​of the production batch products of the traceability node being updated in different allocation schemes, as well as the difference between the number of all batch products in the production circulation process and the number of production batch products of the traceability node being synchronously updated when each batch of products is updated to the latest traceability node, the optimal allocation result of the latest traceability data computing resources is obtained.

7. The method for tracing nutritional products based on cloud-edge collaboration according to claim 6 is characterized in that: The specific steps of obtaining the optimal allocation result of the latest traceability data computing resources based on the inclusiveness of each edge device for each batch of products updated to the latest traceability node and the allocation constraint value of the production batch products of the traceability node being updated in different allocation schemes, and the difference between the number of all batch products in the production circulation process when each batch of products is updated to the latest traceability node and the number of production batch products of the traceability node being synchronously updated, include: When the product of the ratio of the inclusiveness of each edge-side device for each batch of products updated to the latest traceability node and the allocation constraint values ​​of the production batch products of the traceability node being updated in different allocation schemes and the difference between the number of all batch products in the production circulation process and the number of production batch products of the traceability node being synchronously updated when each batch of products is updated to the latest traceability node is minimized, the optimal allocation result of the traceability data of the latest traceability node is obtained.