Method for realizing product two-dimensional code acquisition association based on edge calculation
By deploying product QR code acquisition association algorithm on edge gateways, the problem that the existing technology cannot effectively manage multiple assembly lines or multiple workstations is solved, and low-cost and high-efficiency equipment control and QR code acquisition association are achieved.
Patent Information
- Application Number
- CN202411920911.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-22
AI Technical Summary
The prior art cannot effectively manage product QR code collection and equipment control of multiple assembly lines or multiple stations of the same assembly line, resulting in high costs, slow fault response and poor mobile operations.
Using an edge computing-based method, a product QR code acquisition association algorithm is written through a distributed architecture, and deployed and run on an edge gateway. This method can achieve control of multiple pipelines or multiple stations through the registration and computing power evaluation of edge gateways, allocating appropriate computing power.
It realizes product QR code collection and correlation and equipment control for multiple assembly lines or multiple workstations, reduces equipment costs, improves fault response speed and operation convenience.
Smart Images

Figure CN119862899A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of assembly line management, and in particular to a method for realizing product QR code collection and association based on edge computing. Background Art
[0002] The existing desktop application is used to collect the QR codes of products on the assembly line, but it cannot meet the needs of using one industrial computer to collect, associate and control the product QR codes of multiple assembly lines or multiple workstations on the same assembly line.
[0003] like Figure 1 , a set of industrial control equipment (including industrial computers and displays) can only control one station of a production line, and the equipment on each production line is directly connected to the interface of the industrial computer. Due to the influence of physical location, such as Figure 2 As shown, adding assembly line B cannot share the industrial control equipment of assembly line A to control assembly line B. An additional set of industrial control equipment is needed to connect the equipment on assembly line B. If an assembly line is divided into two or more workstations for control, one set of industrial control equipment cannot solve the problem. It is necessary to add a set of industrial control equipment next to each workstation, and then connect the equipment that needs to be controlled at the workstation to the interface on the industrial computer to achieve different controls.
[0004] If a failure occurs during the operation of the assembly line, for some common warning messages, the operator only needs to confirm and then release the alarm. There is no need to debug the equipment on the assembly line, and the operator needs to confirm the operation on the industrial control equipment, which is inefficient.
[0005] This method has the following specific disadvantages:
[0006] 1. High cost: To control multiple production lines at the same time, multiple sets of industrial control equipment are required;
[0007] 2. Slow fault response: When an industrial control device fails, a new set of industrial control equipment needs to be prepared, which takes a long time to switch and affects production efficiency;
[0008] 3. Poor mobile operation: It is impossible to monitor the production status of the assembly line at any time, and the production process data can only be viewed in front of the industrial control display; all operations require personnel to go to the industrial control equipment to perform. Summary of the invention
[0009] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method for realizing product QR code collection and association based on edge computing. The present invention only requires one edge computing gateway to realize the product QR code collection and association and equipment control of multiple assembly lines or different workstations of the same assembly line.
[0010] The purpose of the present invention is achieved through the following technical solutions:
[0011] A method for realizing product QR code collection association based on edge computing includes the following steps:
[0012] S1. Program the product QR code collection association algorithm based on the distributed architecture, and deploy and run the product QR code collection association algorithm on the edge gateway;
[0013] S2, the edge gateway registers and evaluates its computing power;
[0014] S3, according to the computing power required by the assembly line or workstation requested to be connected, allocate an edge gateway that can carry the computing power currently requested from all available edge gateways;
[0015] S4. Run the product QR code collection association algorithm to associate the production line or workstation:
[0016] (1) Create production product information;
[0017] (2) The collector on the assembly line or workstation collects the QR code on the product packaging box and compares it with the database to verify whether the QR code already exists:
[0018] If it exists, it means that the product has a duplicate number, and the QR code and the corresponding product will be removed;
[0019] If it does not exist, go to step (3);
[0020] (5) After verification, the QR code information on the product packaging box is associated with the product information and the box information, and saved in the database;
[0021] (6) After collecting the QR codes on the product packaging boxes of the specified specifications and quantity, print the box labels, save the box label information to the database, and output the lane separation signal at the same time.
[0022] In step S2, the computing capacity of the edge gateway is characterized by the gateway available load value L, and the gateway available load value L is calculated as follows:
[0023] L=WcpuXcpu_usage+WmemoryXmemory_usage
[0024] +WnetworkXnetwork_usage+WdiskXdisk_usage;
[0025] Among them, Wcpu represents CPU weight; Wmemory represents memory weight; Wnetwork represents network bandwidth weight; Wdisk represents disk I / O weight; cpu_usage represents CPU usage; memory_usage represents memory usage; network_usage represents network bandwidth usage; disk_usage represents disk I / O usage.
[0026] In step S3, the edge gateway with the strongest available computing power is allocated to the assembly line or workstation requesting a connection.
[0027] In step S3, the calculation formula of the required load value of the computing capacity required by the assembly line or workstation requested to be connected is as follows:
[0028] C (1~n)cpu =W (1~n)cpu Xcpu_usage -G cpu ;
[0029] C (1~n)memory =W (1~n)memory Xcpu_usage -G memory ;
[0030] C (1~n)network =W (1~n)network Xcpu_usage -G network ;
[0031] C (1~n)disk =W (1~n)disk Xcpu_usage -G disk ;
[0032] A 1~n =L 1~n –(C (1~n)cpu +C (1~n)memory +C (1~n)network +C (1~n)disk );
[0033] Among them, 1~n represents the edge gateway number, starting from 1 and ending at n; A represents the current available load value of the gateway; C cpu Indicates the remaining available CPU load value of the edge gateway; C memory Indicates the remaining available memory load value of the edge gateway; C network Indicates the remaining available load value of the edge gateway; C disk Indicates the remaining available disk I / O load value of the edge gateway; G cpu Indicates the CPU load value required by the product QR code collection association algorithm; G memory Indicates the memory load value required by the product QR code collection association algorithm; G networkIndicates the network bandwidth load value required by the product QR code collection association algorithm; G disk Indicates the disk I / O load value required by the product QR code collection association algorithm;
[0034] Select C cpu、 C memory、 C network、 C disk For edge gateways that are all positive, compare the available load values of A among the qualified edge gateways, and take the gateway with the largest A value as the gateway required by the product QR code collection association algorithm;
[0035] If there is no C cpu、 C memory、 C network、 C disk For edge gateways with positive values, the available load values of A are compared and the gateway with the largest A value is taken as the gateway required by the product QR code collection association algorithm.
[0036] The step S4 is specifically as follows:
[0037] A1. Create production product information:
[0038] Save the product information selected by the user to be produced into a variable named "ProductInfo" and create a variable named "TunnelCount" for the lane count;
[0039] A2. Compare the QR code collected by the collector with the database to check whether it already exists. If it does, output a rejection signal;
[0040] Monitor the QR code collected by the collector through SOCKET communication, and search the QR code in the product QR code table. If it can be retrieved, it means that the product has been collected, and it is necessary to output a rejection signal to the rejection device through SOCKET communication;
[0041] A3. After verification, the QR code information is associated with the product information and saved in the database;
[0042] If the QR code cannot be found in the product QR code table in the database, it means that the product has not been collected. It needs to be recorded in the product QR code table in the database. The product QR code, current time, and the value of the "ProductInfo" variable in A1 are recorded in the fields QR code, collection time, and product information respectively. The value of TunnelCount is increased by 1.
[0043] A4. After collecting the QR codes of the specified number of products, it outputs the lane signal;
[0044] If the value of TunnelCount reaches the specified number, the channel division signal is output to the channel division device through SOCKET communication;
[0045] A5. After collecting the QR codes of the specified specifications and quantities of products, print the box labels and save the box label information to the database;
[0046] If the value of TunnelCount reaches the specified number, set the value of TunnelCount to 0; record the association information between the box code and the product QR code in the product association code table of the database, and record the printed box code, the collected product QR code, the current time, and the value of the "ProductInfo" variable in step A1 in the fields box code, product QR code, box code printing time, and product information respectively; send the box label printing information to the printer through SOCKET communication, and the user will tear off the box label from the printer and stick it on the carton.
[0047] At the same time, the present invention provides:
[0048] A server comprises a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the above-mentioned method for realizing product QR code collection and association based on edge computing.
[0049] A computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the above-mentioned method for realizing product QR code collection and association based on edge computing.
[0050] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0051] 1. Using desktop applications to write product QR code collection association algorithms cannot enable one gateway device to access multiple production lines (or workstations). The present invention uses a distributed architecture-based program to write product QR code collection association algorithms, which can be run on different gateway devices. It can also support simultaneous control of product QR code collection association algorithm programs for different production lines (or workstations) on one gateway device, thereby avoiding a waste of computing power of gateway devices, improving equipment utilization, and reducing the cost of enterprise investment in gateway devices.
[0052] 2. Due to the limitation of the computing power of the edge gateway, if too many assembly lines (or workstations) are allocated for control, the gateway will be overloaded, affecting the operating efficiency of the control assembly lines (or workstations), and ultimately affecting the accuracy of the QR code collection association. If too few are allocated, the computing power of the gateway device cannot be maximized, and additional gateways need to be added, increasing the equipment cost. The computing power that the gateway can load can be accurately evaluated through the gateway's CPU, memory, network bandwidth, disk I / O and other parameters to avoid gateway overload or resource waste.
[0053] The allocation algorithm used in the present invention compares each resource (including CPU, memory, network bandwidth, and disk I / O) separately, such as comparing the CPU, memory, network bandwidth, and disk I / O computing resources required by the product QR code collection association algorithm with the resources in each gateway, and finding the gateway with the best performance for allocation, so as to achieve a more refined load balancing algorithm. At the same time, it is also compatible with a responsible balancing algorithm that performs comprehensive calculation and evaluation on each resource, so as to achieve both the refined load balancing of the gateway and the computing power required by the product QR code collection association algorithm, and the use of the gateway can maximize the allocation of computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a set of industrial control equipment (including an industrial computer and a display) controlling a workstation on an assembly line.
[0055] Figure 2 A schematic diagram of two sets of industrial control equipment (including industrial computers and displays) controlling two workstations of an assembly line respectively.
[0056] Figure 3 The present invention is a flowchart of a method for realizing product QR code collection and association based on edge computing. DETAILED DESCRIPTION
[0057] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0058] like Figure 3 , a method for realizing product QR code collection association based on edge computing, comprising the following steps:
[0059] S1. Program the product QR code collection association algorithm based on the distributed architecture, and deploy and run the product QR code collection association algorithm on the edge gateway;
[0060] S2, the edge gateway registers and evaluates its computing power;
[0061] S3, according to the computing power required by the assembly line or workstation requested to be connected, allocate an edge gateway that can carry the computing power currently requested from all available edge gateways;
[0062] S4. Run the product QR code collection association algorithm to associate the production line or workstation:
[0063] (1) Create production product information;
[0064] (2) The collector on the assembly line or workstation collects the QR code on the product packaging box and compares it with the database to verify whether the QR code already exists:
[0065] If it exists, it means that the product has a duplicate number, and the QR code and the corresponding product will be removed;
[0066] If it does not exist, go to step (3);
[0067] (7) After verification, the QR code information on the product packaging box is associated with the product information and the box information, and saved in the database;
[0068] (8) After collecting the QR codes on the product packaging boxes of the specified specifications and quantity, print the box labels, save the box label information to the database, and output the lane separation signal at the same time.
[0069] In step S2, the computing capacity of the edge gateway is characterized by the gateway available load value L, and the gateway available load value L is calculated as follows:
[0070] L=WcpuXcpu_usage+WmemoryXmemory_usage
[0071] +WnetworkXnetwork_usage+Wdisk×disk_usage;
[0072] Among them, Wcpu represents CPU weight; Wmemory represents memory weight; Wnetwork represents network bandwidth weight; Wdisk represents disk I / O weight; cpu_usage represents CPU usage; memory_usage represents memory usage; network_usage represents network bandwidth usage; disk_usage represents disk I / O usage.
[0073] The registration algorithm obtains the gateway CPU, memory, network bandwidth and disk I / O usage as the weight information for load calculation, evaluates the computing power of the gateway to indicate the computing power that can be carried (different assembly lines or workstations require different computing power).
[0074] In step S3, the edge gateway with the strongest available computing power is allocated to the assembly line or workstation requesting a connection.
[0075] In step S3, the calculation formula of the required load value of the computing capacity required by the assembly line or workstation requested to be connected is as follows:
[0076] C (1~n)cpu =W (1~n)cpu Xcpu_usage -G cpu ;
[0077] C (1~n)memory =W (1~n)memory Xcpu_usage -Gmemory ;
[0078] C (1~n)network =W (1~n)network ×cpu_usage-G network ;
[0079] C (1~n)disk =W (1~n)disk ×cpu_usage-G disk ;
[0080] A 1~n =L 1~n –(C (1~n)cpu +C (1~n)memory +C (1~n)network +C (1~n)disk );
[0081] Among them, 1~n represents the edge gateway number, starting from 1 and ending at n; A represents the current available load value of the gateway; C cpu Indicates the remaining available CPU load value of the edge gateway; C memory Indicates the remaining available memory load value of the edge gateway; C network Indicates the remaining available load value of the edge gateway; C disk Indicates the remaining available disk I / O load value of the edge gateway; G cpu Indicates the CPU load value required by the product QR code collection association algorithm; G memory Indicates the memory load value required by the product QR code collection association algorithm; G network Indicates the network bandwidth load value required by the product QR code collection association algorithm; G disk Indicates the disk I / O load value required by the product QR code collection association algorithm;
[0082] Select C cpu、 C memory、 C network、 C disk For edge gateways that are all positive, compare the available load values of A among the qualified edge gateways, and take the gateway with the largest A value as the gateway required by the product QR code collection association algorithm;
[0083] If there is no C cpu、 C memory、 C network、 C disk For edge gateways with positive values, the available load values of A are compared and the gateway with the largest A value is taken as the gateway required by the product QR code collection association algorithm.
[0084] This load algorithm provides a more sophisticated weight calculation method, which can not only ensure the load balancing of the gateway, but also meet the computing power required by the product QR code collection association algorithm.
[0085] The step S4 is specifically as follows:
[0086] A1. Create production product information:
[0087] Save the product information selected by the user to be produced into a variable named "ProductInfo" and create a variable named "TunnelCount" for the lane count;
[0088] A2. Compare the QR code collected by the collector with the database to check whether it already exists. If it does, output a rejection signal;
[0089] Monitor the QR code collected by the collector through SOCKET communication, and search the QR code in the product QR code table (such as Table 1). If the QR code can be retrieved, it means that the product has been collected, and it is necessary to output a rejection signal to the rejection device through SOCKET communication;
[0090] Table 1
[0091] QR code Collection time Product Information 951753842862 2024-01-0210:56:32 Sugar-free oolong tea 753951248268 2024-01-0211:08:29 Sugar-free oolong tea 426486751953 2024-01-0212:42:17 Sugar-free oolong tea
[0092] A3. After verification, the QR code information is associated with the product information and saved in the database;
[0093] If the QR code cannot be found in the product QR code table in the database, it means that the product has not been collected. It needs to be recorded in the product QR code table in the database. The product QR code, current time, and the value of the "ProductInfo" variable in A1 are recorded in the fields QR code, collection time, and product information respectively. The value of TunnelCount is increased by 1.
[0094] A4. After collecting the QR codes of the specified number of products, it outputs the lane signal;
[0095] If the value of TunnelCount reaches the specified number, the channel division signal is output to the channel division device through SOCKET communication;
[0096] A5. After collecting the QR codes of the specified specifications and quantities of products, print the box labels and save the box label information to the database;
[0097] If the value of TunnelCount reaches the specified number, set the value of TunnelCount to 0; record the association information between the box code and the product QR code in the product association code table of the database (such as Table 2), and record the printed box code, the collected product QR code, the current time, and the value of the "ProductInfo" variable in step A1 in the fields box code, product QR code, box code printing time, and product information respectively; send the box label printing information to the printer through the SOCKET communication method, and the user will tear off the box label from the printer and stick it on the carton.
[0098] Table 2
[0099] Box code Product QR Code Box code printing time Product Information CS654789123 951753842862 2024-01-0212:42:18 Sugar-free oolong tea CS654789123 753951248268 2024-01-0212:42:18 Sugar-free oolong tea CS654789123 426486751953 2024-01-0212:42:18 Sugar-free oolong tea
[0100] The above algorithm is implemented in the SpringBoot project.
[0101] At the same time, the present invention provides:
[0102] A server comprises a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the above-mentioned method for realizing product QR code collection and association based on edge computing.
[0103] A computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the above-mentioned method for realizing product QR code collection and association based on edge computing.
[0104] The present invention has the following advantages:
[0105] 1. Strong scalability: Only one edge computing gateway is needed to control multiple production lines, including the collection and association of product QR codes on the production lines;
[0106] 2. Low maintenance cost: Compared with desktop applications that require running multiple industrial computers to control multiple assembly lines, an edge computing gateway can achieve centralized management, reducing the need for separate maintenance of multiple clients.
[0107] 3. High availability: By deploying multiple edge computing gateways to form redundant computing, when an edge computing gateway fails, the control center will automatically block the failed node and allocate a valid gateway node;
[0108] 4. Fast fault response: When the edge computing gateway controlling the production line fails, you only need to manually stop the line and restart it to automatically find available edge computing gateway nodes, connect and start the line to continue production;
[0109] 5. Flexibility of use: It can be accessed through different devices (such as PC, tablet, PDA), which improves convenience and flexibility.
[0110] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for realizing product QR code collection and association based on edge computing, characterized in that: The following steps are involved: S1. Program the product QR code collection association algorithm based on the distributed architecture, and deploy and run the product QR code collection association algorithm on the edge gateway; S2, the edge gateway registers and evaluates its computing power; S3, according to the computing power required by the assembly line or workstation requested to be connected, allocate an edge gateway that can carry the computing power currently requested from all available edge gateways; S4. Run the product QR code collection association algorithm to associate the production line or workstation: (1) Create production product information; (2) The collector on the assembly line or workstation collects the QR code on the product packaging box and compares it with the database to verify whether the QR code already exists: If it exists, it means that the product has a duplicate number, and the QR code and the corresponding product will be removed; If it does not exist, go to step (3); (3) After verification, the QR code information on the product packaging box is associated with the product information and the box information, and saved in the database; (4) After collecting the QR codes on the product packaging boxes of the specified specifications and quantity, print the box labels, save the box label information to the database, and output the lane separation signal at the same time.
2. According to claim 1, the method for realizing product QR code collection and association based on edge computing is characterized in that: In step S2, the computing capacity of the edge gateway is characterized by the gateway available load value L, and the gateway available load value L is calculated as follows: L=WcpuXcpu_usage+WmemoryXmemory_usage +WnetworkXnetwork_usage+Wdisk×disk_usage; Among them, Wcpu represents CPU weight; Wmemory represents memory weight; Wnetwork represents network bandwidth weight; Wdisk represents disk I / O weight; cpu_usage represents CPU usage; memory_usage represents memory usage; network_usage represents network bandwidth usage; disk_usage represents disk I / O usage.
3. According to claim 1, the method for realizing product QR code collection and association based on edge computing is characterized in that: In step S3, the edge gateway with the strongest available computing power is allocated to the assembly line or workstation requesting a connection.
4. According to claim 1, the method for realizing product QR code collection and association based on edge computing is characterized in that: In step S3, the calculation formula of the required load value of the computing capacity required by the assembly line or workstation requested to be connected is as follows: C (1~n)cpu =W (1~n)cpu ×cpu_usage-G cpu ; C (1~n)memory =W (1~n)memory Xcpu_usage-G memory ; C (1~n)network =W (1~n)network ×cpu_usage-G network ; C (1~n)disk =W (1~n)disk Xcpu_usage-G disk ; A 1~n =L 1~n –(C (1~n)cpu +C (1~n)memory +C (1~n)network +C (1~n)disk ); Among them, 1~n represents the edge gateway number, starting from 1 and ending at n; A represents the current available load value of the gateway; C cpu Indicates the remaining available CPU load value of the edge gateway; C memory Indicates the remaining available memory load value of the edge gateway; C network Indicates the remaining available load value of the edge gateway; C disk Indicates the remaining available disk I / O load value of the edge gateway; G cpu Indicates the CPU load value required by the product QR code collection association algorithm; G memory Indicates the memory load value required by the product QR code collection association algorithm; G network Indicates the network bandwidth load value required by the product QR code collection association algorithm; G disk Indicates the disk I / O load value required by the product QR code collection association algorithm; Select C cpu、 C memory、 C network、 C disk For edge gateways that are all positive, compare the available load values of A among the edge gateways that meet the conditions, and take the gateway with the largest A value as the gateway required by the product QR code collection association algorithm; If there is no C cpu、 C memory、 C network、 C disk For edge gateways with positive values, the available load values of A are compared and the gateway with the largest A value is taken as the gateway required by the product QR code collection association algorithm.
5. According to the method for realizing product QR code collection and association based on edge computing according to claim 1, it is characterized in that: The step S4 is specifically as follows: A1. Create production product information: Save the product information selected by the user to be produced into a variable named "ProductInfo" and create a variable named "TunnelCount" for the lane count; A2. Compare the QR code collected by the collector with the database to check whether it already exists. If it does, output a rejection signal; Monitor the QR code collected by the collector through SOCKET communication, and search the QR code in the product QR code table. If it can be retrieved, it means that the product has been collected, and it is necessary to output a rejection signal to the rejection device through SOCKET communication; A3. After verification, the QR code information is associated with the product information and saved in the database; If the QR code cannot be retrieved from the product QR code table in the database, it means that the product has not been collected and needs to be recorded in the product QR code table in the database. The product QR code, current time, and the value of the "ProductInfo" variable in A1 are recorded in the fields QR code, collection time, and product information respectively; and the value of TunnelCount is increased by 1; A4. After collecting the QR codes of the specified number of products, it outputs the lane signal; If the value of TunnelCount reaches the specified number, the channel division signal is output to the channel division device through SOCKET communication; A5. After collecting the QR codes of the specified specifications and quantities of products, print the box labels and save the box label information to the database; If the value of TunnelCount reaches the specified number, set the value of TunnelCount to 0; record the association information between the box code and the product QR code in the product association code table of the database, and record the printed box code, the collected product QR code, the current time, and the value of the "ProductInfo" variable in step A1 in the fields box code, product QR code, box code printing time, and product information respectively; send the box label printing information to the printer through SOCKET communication, and the user will tear off the box label from the printer and stick it on the carton.
6. A server, comprising a processor and a memory, wherein the memory stores at least one program, and the program is loaded and executed by the processor to implement the method for realizing product QR code collection and association based on edge computing as described in any one of claims 1 to 5.
7. A computer-readable storage medium, wherein at least one program is stored in the storage medium, and the program is loaded and executed by a processor to implement the method for realizing product QR code collection and association based on edge computing as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Two-dimensional code production method for wine bottle
CN105303220A
Interconnection identification production data processing method based on edge gateway calculation
CN113807665A
Gateway load balancing scheduling method and system
CN117640777A
Two-dimensional code online association management method and packaging machine association system
CN118691294A