Package two-dimensional code management and control method, device and equipment and medium
By querying and updating QR code status information in the database, and combining technologies such as identity verification, encrypted transmission, and time interval verification, a closed-loop management system is built to solve the problem of QR code leakage in the packaging supply chain, thereby improving the security of QR codes and the transparency of the supply chain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INNER MONGOLIA MENGNIU DAIRY IND (GROUP) CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the lack of source control in the packaging supply chain can lead to QR codes being leaked or illegally misused in advance, resulting in counterfeit products entering the market.
By querying the QR code status information in the database, the status is updated to active only when the QR code is in a pending activation state, and an approval instruction is generated at the production enterprise's end. This constructs a closed-loop management process across the entire chain, including technical means such as identity verification, encrypted transmission, time interval verification, and digital signature, to ensure the security of QR code data.
It achieves closed-loop management of the entire chain from source to production line, preventing QR codes from being copied or leaked after leaving the factory, improving the security of QR code management throughout its entire life cycle, and ensuring the authenticity of products and the transparency of the supply chain.
Smart Images

Figure CN122022145A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, equipment, and medium for QR code management of packaging. Background Technology
[0002] Currently, the food industry widely uses one-item-one-code technology to achieve functions such as product traceability and anti-counterfeiting. However, existing technologies mostly focus on the end consumer's scanning and verification process, lacking source control over the upstream packaging supply chain.
[0003] In existing methods, after the packaging supplier prints the QR code, the lack of source control over the upstream packaging supply chain poses a risk that the QR code may be leaked or illegally misused, leading to counterfeit products entering the market. Improving the security of QR code control at the packaging source is a crucial issue that the industry urgently needs to address. Summary of the Invention
[0004] This invention provides a method, apparatus, equipment, and medium for QR code control of packaging, in order to improve the security of QR code control at the source of packaging over the packaging supply end.
[0005] This invention provides a method for controlling packaging using QR codes, comprising the following steps: In response to the activation request of the target QR code, the status information of the target QR code is queried in the database; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. If the target QR code is determined to be in an activation state based on the status information, the status information of the target QR code in the database is updated to an activation state, and an approval instruction is sent to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, an abnormal alarm instruction is generated. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0006] According to a QR code management method for packaging provided by the present invention, before verifying the QR code data, the method further includes: The first moment when the packaging supplier performs the coding operation during the coding process of the target batch of packaging, and the second moment when the production enterprise puts the target batch of packaging into the production line, are obtained, and the time interval between the first moment and the second moment is determined. Obtain the physical distance information between the packaging supplier and the production enterprise, and determine the logistics time based on the physical distance information and logistics speed; The difference between the logistics time and the time interval is determined to be less than a preset interval threshold.
[0007] According to a QR code control method for packaging provided by the present invention, before the receiving packaging supplier collects multiple QR code data during the packaging coding process of the target batch, the method further includes: In response to a connection request from the packaging supplier, verify the identity information of the packaging supplier; After verifying the identity of the packaging supplier, an encrypted transmission channel is established based on the session key. This encrypted transmission channel is used to transmit the QR code data.
[0008] According to the present invention, a QR code control method for packaging is provided, wherein the QR code data is obtained by digitally signing the packaging data based on the batch identifier received by the encrypted transmission channel, and encrypting the obtained signature data based on the public key; The packaging data is obtained by packaging the original QR code collected during the packaging and coding process of the target batch and the hash value of the original QR code.
[0009] According to a QR code management method for packaging provided by the present invention, the step of verifying the QR code data includes: The QR code data is decrypted using the private key to obtain decrypted data, and the private key corresponds to the public key; Based on the batch identifier of the target batch, the decrypted data is verified. After the verification is successful, the packaged data is parsed from the decrypted data, and a verification process is performed based on the original QR code separated from the packaged data and the hash value of the original QR code.
[0010] The QR code control method for packaging provided by the present invention further includes: Determine the number of QR codes in the database that are in an inactive state; Based on the number of QR codes, determine the quantity of finished inventory at the production enterprise's end; Based on the quantity of completed inventory and the total number of orders for the target batch, the production progress information for the target batch is determined.
[0011] The present invention also provides a QR code control device for packaging, comprising the following modules: The query module is used to query the status information of the target QR code in the database in response to the activation request of the target QR code; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. The control module is used to update the status information of the target QR code in the database to an activated state and send an approval instruction to the production enterprise when the target QR code is determined to be in an activated state based on the status information; and to generate an abnormal alarm instruction when the target QR code is determined not to be in an activated state based on the status information. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the QR code control method for packaging as described above.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the QR code management method for packaging as described above.
[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a QR code management method for packaging as described above.
[0015] The QR code management method, apparatus, equipment, and medium provided by this invention receive QR code data collected by the packaging supplier during the packaging coding process. After verification, the verified QR code data is marked as pending activation and a database is built. Then, in the actual production process at the manufacturing enterprise, the system responds to activation requests for target QR codes and queries and verifies the target QR code's status information in the database. Only QR codes in the pending activation state are allowed to be activated and their status is immediately updated to active. QR codes that do not meet the pending activation state trigger an abnormal alarm. This collaborative approach between the packaging supplier and the manufacturing enterprise constructs a closed-loop management process from the source supplier to the production line, fundamentally solving the security risks of QR codes being copied, leaked, and illegally misused after leaving the factory but before activation, thereby improving the security of QR code management throughout its entire lifecycle. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the QR code control method for packaging provided by the present invention.
[0018] Figure 2 This is a schematic diagram of the QR code control device for packaging provided by the present invention.
[0019] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0021] Figure 1 This is a flowchart illustrating the QR code control method for packaging provided by the present invention, as shown below. Figure 1 As shown, the method includes the following: Step 110: In response to the activation request of the target QR code, query the status information of the target QR code in the database; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. Step 120: If the target QR code is determined to be in an activation state based on the status information, update the status information of the target QR code in the database to an activation state and send an approval instruction to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, generate an abnormal alarm instruction. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0022] The technical solution of this invention will be described in detail below, taking the QR code control method for packaging provided by this invention implemented by the control platform as an example.
[0023] This method involves the interaction between a control platform, packaging suppliers, and manufacturing companies. The packaging supplier can be a cardboard box factory that provides packaging cartons to food companies. The manufacturing company can be a food processing plant that uses these packaging cartons to package its products. The control platform is typically built from a central server deployed in the cloud or on-premises.
[0024] At the hardware level, a QR code verification algorithm is deployed on the management platform, with preset QR code encoding rules and verification parameters. A database is established, dividing the platform into four status fields: "Unverified," "Pending Activation," "Activated," and "Abnormal." Simultaneously, a supply chain data statistics module is developed on the management platform, setting an automatic calculation formula for order delivery cycles. Industrial high-definition cameras are installed on the food packaging production line, communicating with the management platform in real time. The camera's response time for reading QR codes is ≤0.5 seconds. Alarm devices are installed at key nodes on the production line, linked to the alarm module of the management platform. When packaging is printed at the supply end, the collector captures and uploads the QR code in real time. After verification by the management platform, it is marked as "Pending Activation." After the packaging arrives at the factory, the production line camera reads the QR code, and the platform verifies the "Pending Activation" status to complete activation and update the data synchronously. If an undefined QR code is read, the alarm device is immediately activated, and staff promptly remove the abnormal packaging.
[0025] The specific equipment for the packaging supply side includes: A QR code acquisition module: A QR code scanner is used, with a scanning accuracy of 0.1mm, a scanning speed of 150 scans / second, supporting mainstream code formats such as Data Matrix and Quick Response Code (QR Code), operating at DC 5V, and an interface type of USB 2.0 + RS-232. It is linked with the packaging printhead through a General Purpose Input / Output (GPIO) interface to achieve synchronous triggering of printing and acquisition. Printing equipment: An offset printing machine is used, equipped with a customized QR code printing unit, with a printing resolution of 1200dpi, QR code size controlled at 15mm×15mm, and an error ≤±0.1mm, ensuring accurate recognition by the production line camera. Encrypted transmission equipment: A firewall is deployed, and a Virtual Private Network (VPN) encrypted channel is enabled. A dedicated communication link between the packaging supply side and the management platform is established using the Internet Protocol Security (IPSec) protocol, with a bandwidth ≥100Mbps and a data transmission latency ≤50ms.
[0026] For manufacturing enterprises, the specific equipment includes: Production line reading module: equipped with an industrial camera, 5 megapixels, 30fps frame rate, recognition distance 10-30cm, reading angle ±30°, built-in illumination source (wavelength 650nm), supporting dynamic reading (adapted to production line speed ≤60m / min). Alarm module: using a touchscreen + audible and visual alarm, alarm response time ≤0.2 seconds, audible and visual alarm volume ≥85dB, light flashing frequency 2Hz, and simultaneously displaying an abnormality prompt window in the production line system.
[0027] In step 110, in response to the activation request of the target QR code, the status information of the target QR code is queried in the database; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line.
[0028] Specifically, the database construction process begins at the packaging supply end. When the packaging supply end performs the coding operation on a batch of packaging, the production equipment can collect the QR code data contained in each generated QR code in real time based on the acquisition module.
[0029] There are several ways to receive this QR code data. For example, the data collection system on the packaging supply side can use an application programming interface (API) to send multiple QR code data collected during the packaging coding process of the target batch to the management platform in batches or individually.
[0030] Optionally, to ensure the security of data transmission, the receiving process is completed through a secure network channel, such as a Virtual Private Network (VPN) or an encrypted connection based on Transport Layer Security (TLS).
[0031] After receiving these QR code data, the management platform needs to verify the data to ensure that only legitimate QR codes generated by authorized packaging suppliers can access the system. Verification methods may include: Legality verification: This checks whether the QR code data format conforms to preset encoding rules, or verifies whether the data contains a valid digital signature. For example, the management platform can verify whether the data was generated by a valid private key signature from the packaging supplier.
[0032] Uniqueness check: Query the database for the QR code data to ensure it is the first occurrence. If the same QR code already exists in the database, it is considered a duplicate code, and the check fails.
[0033] For QR code data that passes verification, the management platform will store it in the database and mark its status information as pending activation.
[0034] It's important to note that status information is a key field in the database used to track the lifecycle of QR codes. A QR code can have multiple statuses, such as pending activation, activated, expired, and abnormal. A QR code marked as pending activation indicates that it is a packaging QR code that has been produced by the supplier and delivered or is being delivered to the manufacturing company, but has not yet been officially used on the production line. Through the above process, the database containing data on multiple QR codes in pending activation states is constructed.
[0035] When these packages are transported to the manufacturing plant and ready to be used on the production line for product packaging, the control process enters the activation phase. The production line at the manufacturing plant is equipped with data collection devices, such as industrial cameras. When a package bearing a previously generated QR code enters the production station, the data collection device scans and acquires the target QR code on the package.
[0036] Based on the acquired QR code information, the production line system (such as the Manufacturing Execution System (MES)) at the manufacturing enterprise end will generate an activation request for the target QR code and send it to the management and control platform.
[0037] In step 120, after responding to the activation request, the management platform will query the status information of the target QR code in the database.
[0038] If the retrieved status information is "pending activation," it indicates that the packaging is permitted for use and is being used on the production line for the first time. In this case, the control platform first updates the status information of the target QR code in the database to "activated," ensuring that a QR code can only be successfully activated once. Secondly, the control platform sends an approval instruction to the production company. This instruction can be a signal notifying the production line control system that the packaging has passed verification and can proceed to the next packaging step.
[0039] If the retrieved status information is not in an "activation pending" state—for example, the QR code cannot be found, or its status is already "activated" or "abnormal"—it indicates a problem with the packaging. It could be a counterfeit code or a reused code. In this case, the management platform will immediately generate an anomaly alarm command. This alarm command will trigger the alarm mechanism on the manufacturing company's end.
[0040] Optionally, if three consecutive QR codes fail to be successfully transmitted from the packaging plant, the firewall will automatically detect the network link and switch to the backup VPN channel if the network is abnormal; if the equipment fails, a local audible and visual alarm will be triggered and an SMS will be sent to the packaging supply side maintenance personnel (response time ≤ 5 minutes).
[0041] When QR code verification fails, the management platform automatically records the abnormal code information and marks it as invalid. At the same time, it notifies the packaging supplier to suspend production of that batch until manual verification (verification period ≤ 2 hours) is completed and production is restarted.
[0042] Production line activation anomaly: When a QR code with no pending activation status is read, the alarm device is activated, the production line workstation is suspended, and staff scan the QR code on the abnormal packaging to obtain detailed information. After confirming whether it is a missed transmission or an invalid code, they will either re-encode and activate it or destroy it.
[0043] The QR code management method for packaging provided by this invention receives QR code data collected by the packaging supplier during the packaging coding process. After verification, the verified QR code data is marked as pending activation and a database is built. Then, in the actual production process at the manufacturing enterprise, the system responds to activation requests for target QR codes and queries and verifies the status information of the target QR codes in the database. Only QR codes in the pending activation state are allowed to be activated and their status is immediately updated to active. QR codes that do not meet the pending activation state trigger an abnormal alarm. This method, combining the packaging supplier and the manufacturing enterprise, constructs a closed-loop management process from the source supplier to the production line, fundamentally solving the security risks of QR codes being copied, leaked, and illegally misused after leaving the factory but before activation, thereby improving the security of QR code management throughout its entire lifecycle.
[0044] In one embodiment, before verifying the QR code data, the method further includes: The first moment when the packaging supplier performs the coding operation during the coding process of the target batch of packaging, and the second moment when the production enterprise puts the target batch of packaging into the production line, are obtained, and the time interval between the first moment and the second moment is determined. Obtain the physical distance information between the packaging supplier and the production enterprise, and determine the logistics time based on the physical distance information and logistics speed; The difference between the logistics time and the time interval is determined to be less than a preset interval threshold.
[0045] Specifically, the first moment of acquisition can be a precise timestamp. When the acquisition module on the packaging supply side collects a QR code data and is ready to upload it, the system on the packaging supply side automatically records it and sends it to the management and control platform along with the QR code data.
[0046] This captures the second moment when the manufacturer places the target batch of unused packaging into the production line. This second moment is also a timestamp, automatically recorded by the production line system when the production line camera scans the QR code on the packaging and initiates an activation request.
[0047] The control platform uses these two timestamps to determine the time interval between the first and second moments. This time interval reflects the actual physical time taken from the completion of coding to the use of the packaging on the production line.
[0048] At the same time, the management platform also needs to obtain physical distance information between the packaging supplier and the production enterprise. This physical distance information can be the geographical coordinates or addresses of the two factories pre-configured in the management platform, from which the straight-line distance or the distance of a conventional logistics route can be calculated.
[0049] Based on this physical distance information and a logistics speed, a theoretical logistics time is determined. The logistics speed can be determined comprehensively based on historical transportation data, transportation methods, and other factors.
[0050] Determining whether the difference between the logistics time and the time interval is less than a preset interval threshold is for a rapid rationality check. For example, a rule can be set that the actual time interval must be greater than or approximately equal to the theoretical logistics time. If the difference between the time interval and the logistics time is a significantly negative number, it indicates that the packaging arrives at the production line much faster than the theoretically fastest transportation time, which is physically impossible. This situation most likely indicates that the QR code data was leaked to the production company in advance through non-physical means such as the network, rather than arriving through the physical packaging that carries it. If the judgment result is abnormal, even if the QR code data itself is normal, it can be marked as high risk, triggering an alarm or requiring manual review.
[0051] It's important to note that in the food packaging industry, particularly in sectors like dairy products with short shelf lives, the supply chain is fast-paced. Packaging materials (such as cardboard boxes) are typically put into use quickly after arriving at the production line from the packaging supplier. This keeps the actual physical time from code assignment to activation on the production line relatively stable and predictable. Therefore, comparing this time interval with the theoretical logistics time constitutes an efficient and rapid logical verification method. If the time interval is found to be significantly shorter than the reasonable logistics time, it can be highly likely that the QR code data was leaked prematurely through non-physical channels, enabling rapid early warning and interception. This method not only verifies the authenticity of the QR code but also the rationality of the packaging's circulation trajectory. It effectively identifies and prevents illegal QR codes leaked through online channels and used in different locations, further enhancing the rigor and security of the control system.
[0052] In one embodiment, before the receiving packaging supplier collects multiple QR code data during the packaging coding process of the target batch, the method further includes: In response to a connection request from the packaging supplier, verify the identity information of the packaging supplier; After verifying the identity of the packaging supplier, an encrypted transmission channel is established based on the session key. This encrypted transmission channel is used to transmit the QR code data.
[0053] The control platform responds to connection requests from the packaging supplier. These requests are initiated by the packaging supplier's data upload program, which establishes communication with the control platform.
[0054] Before any data transmission, the identity of the packaging supplier must be verified to prevent unauthorized devices or systems from injecting illegal data into the platform. Identity verification can be achieved using various technical means, such as: Digital certificate-based authentication: The packaging supplier needs to provide a client certificate issued by a Certificate Authority (CA) or pre-issued by the management platform. The platform verifies the validity of the certificate to confirm its identity.
[0055] Authentication based on Application Programming Interface (API) keys: A unique API Key and secret key are assigned to each legitimate packaging provider, and the provider must carry valid signature information in each request.
[0056] After the packaging supplier's authentication is confirmed, both parties will negotiate and establish an encrypted transport channel based on a temporary session key. The establishment of the encrypted transport channel follows cryptographic protocols such as Transport Layer Security (TLS) / Secure Sockets Layer (SSL). For example, during the TLS handshake, both parties can securely exchange or determine the session key used by a symmetric encryption algorithm (such as Rivest-Shamir-Adleman, RSA) or a symmetric encryption algorithm (such as Advanced Encryption Standard, AES).
[0057] Once the encrypted transmission channel is established, all subsequent QR code data will be transmitted through this channel. Even if the data packets are intercepted on the public internet, attackers will not be able to decrypt them and obtain their content.
[0058] By establishing a strict identity authentication and encryption channel mechanism before data transmission, the confidentiality, integrity, and non-repudiation of QR code data are ensured during transmission from the packaging supplier to the management platform. This effectively prevents data from being tampered with or forged during transmission.
[0059] In one embodiment, the QR code data is obtained by digitally signing the packaged data based on the batch identifier received by the encrypted transmission channel, and then encrypting the signed data based on the public key. The packaging data is obtained by packaging the original QR code collected during the packaging and coding process of the target batch and the hash value of the original QR code.
[0060] First, the packaged data needs to be determined. Packaged data is an encapsulation of the core information to be transmitted. Specifically, it can contain two parts: one is the original QR code, which is the information directly obtained by scanning the QR code on the packaging; the other is the hash value calculated from the original QR code data, such as a digest generated using the SHA-256 algorithm. Packaged together with the hash value and the original QR code, an additional integrity check can be performed at the receiving end.
[0061] The packaging supply system uses pre-configured batch identifiers to digitally sign the packaging data. Digital signature technology ensures the data's authenticity and that its content has not been tampered with. The batch identifier can be a designation used by the control platform or by identifying the target batch.
[0062] To further enhance security, the obtained signature data can be encrypted using the public key of the management platform.
[0063] The QR code management method for packaging provided by this invention greatly enhances the anti-counterfeiting and anti-tampering capabilities of QR code data by applying multiple cryptographic technologies such as hashing, digital signatures, and asymmetric encryption.
[0064] In one embodiment, verifying the QR code data includes: The QR code data is decrypted using the private key to obtain decrypted data, and the private key corresponds to the public key; Based on the batch identifier of the target batch, the decrypted data is verified. After the verification is successful, the packaged data is parsed from the decrypted data, and a verification process is performed based on the original QR code separated from the packaged data and the hash value of the original QR code.
[0065] Once the management platform receives QR code data from the packaging supplier through an encrypted channel, it performs a verification process.
[0066] The control platform uses the private key corresponding to the public key used for encryption to decrypt the received QR code data, obtaining the decrypted data. Since only the platform possesses this private key, it ensures that only the platform can read this information.
[0067] The control platform needs to verify the signature of the decrypted data. The control platform will verify the signature based on the batch identifier of the received target batch. If the signature verification is successful, it proves that the data was indeed sent by the legitimate packaging supplier and that the content has not been changed after signing.
[0068] After the signature verification is successful, the platform parses the packaged data from the decrypted and verified data.
[0069] Finally, an internal integrity check is performed. The platform separates the original QR code data and its accompanying hash value from the packaged data. Then, the platform independently recalculates the hash value of the separated original QR code data and compares the result with the hash value carried in the packaged data. If they match, the final verification is complete.
[0070] Through a multi-step decryption and verification process, the management platform can ensure the authenticity and integrity of every QR code data entering the warehouse with extremely high reliability, providing a data foundation for subsequent activation and traceability processes.
[0071] In one embodiment, it also includes: Determine the number of QR codes in the database that are in an inactive state; Based on the number of QR codes, determine the quantity of finished inventory at the production enterprise's end; Based on the quantity of completed inventory and the total number of orders for the target batch, the production progress information for the target batch is determined.
[0072] The management platform can determine the number of QR codes in the database that are in an inactive state in real time or periodically. The number of QR codes reflects the inventory of packaging materials that have been produced, coded, and transported to the production enterprise by the packaging supplier, but have not yet been consumed.
[0073] Based on the number of QR codes that are in an activating state, the quantity of finished goods inventory at the manufacturing enterprise can be further determined.
[0074] It's important to note that the finished goods inventory here refers to the packaging inventory awaiting activation, considered as the packaging inventory prepared by the manufacturer for the soon-to-be-completed finished products, directly linked to the quantity of finished products that can be packaged in the near future. Furthermore, the number of QR codes in the activated state can also be counted, corresponding to the quantity of finished products that have been packaged and can be included in the finished goods inventory. Therefore, by counting the number of QR codes in different states, the inventory flow from packaging materials to finished products can be tracked.
[0075] The production schedule information for the target batch is determined based on the inventory quantity and the total order quantity for that target batch. For example, the total order quantity can be imported from the enterprise resource planning system or manually entered into the platform.
[0076] This system integrates the security control functions of QR codes with supply chain data management functions. By statistically analyzing the lifecycle status of QR codes, enterprises can not only ensure product safety but also monitor the delivery progress of upstream suppliers, their own packaging material inventory, and the production progress of production lines in real time and with high accuracy, thereby improving the transparency and efficiency of supply chain management.
[0077] The QR code control device for packaging provided by the present invention will be described below. The QR code control device for packaging described below can be referred to in correspondence with the QR code control method for packaging described above.
[0078] like Figure 2 As shown, the device includes: The query module 210 is used to query the status information of the target QR code in the database in response to the activation request of the target QR code; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. The control module 220 is used to update the status information of the target QR code in the database to an activated state and send an approval instruction to the production enterprise when the target QR code is determined to be in an activated state based on the status information; and to generate an abnormal alarm instruction when the target QR code is determined not to be in an activated state based on the status information. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0079] The QR code management device for packaging provided by this invention receives QR code data collected by the packaging supplier during the packaging coding process. After verification, the verified QR code data is marked as pending activation and a database is built. Then, in the actual production process at the manufacturing enterprise, the device responds to the activation request of the target QR code and queries and verifies the status information of the target QR code in the database. Only QR codes in the pending activation state are allowed to be activated and their status is immediately updated to the activated state. QR codes that do not meet the pending activation state will trigger an abnormal alarm. This device, in conjunction with the packaging supplier and the manufacturing enterprise, constructs a closed-loop management process from the source supplier to the production line, fundamentally solving the security risks of QR codes being copied, leaked, and illegally misused after leaving the factory but before activation, thereby improving the management security of QR codes throughout their entire lifecycle.
[0080] In one embodiment, the control module 220 is specifically used for: Before verifying the QR code data, the process also includes: The first moment when the packaging supplier performs the coding operation during the coding process of the target batch of packaging, and the second moment when the production enterprise puts the target batch of packaging into the production line, are obtained, and the time interval between the first moment and the second moment is determined. Obtain the physical distance information between the packaging supplier and the production enterprise, and determine the logistics time based on the physical distance information and logistics speed; The difference between the logistics time and the time interval is determined to be less than a preset interval threshold.
[0081] In one embodiment, the control module 220 is further configured to: Before the receiving packaging supplier collects multiple QR code data during the packaging coding process of the target batch, it also includes: In response to a connection request from the packaging supplier, verify the identity information of the packaging supplier; After verifying the identity of the packaging supplier, an encrypted transmission channel is established based on the session key. This encrypted transmission channel is used to transmit the QR code data.
[0082] In one embodiment, the control module 220 is further configured to: The QR code data is obtained by digitally signing the packaged data based on the batch identifier received through the encrypted transmission channel, and then encrypting the signed data based on the public key. The packaging data is obtained by packaging the original QR code collected during the packaging and coding process of the target batch and the hash value of the original QR code.
[0083] In one embodiment, the control module 220 is further configured to: The verification of the QR code data includes: The QR code data is decrypted using the private key to obtain decrypted data, and the private key corresponds to the public key; Based on the batch identifier of the target batch, the decrypted data is verified. After the verification is successful, the packaged data is parsed from the decrypted data, and a verification process is performed based on the original QR code separated from the packaged data and the hash value of the original QR code.
[0084] In one embodiment, the control module 220 is further configured to: Also includes: Determine the number of QR codes in the database that are in an inactive state; Based on the number of QR codes, determine the quantity of finished inventory at the production enterprise's end; Based on the quantity of completed inventory and the total number of orders for the target batch, the production progress information for the target batch is determined.
[0085] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, communications interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a QR code control method for packaging. This method includes: responding to an activation request for a target QR code, querying the status information of the target QR code in a database; the activation request for the target QR code is generated by the manufacturing enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. If the target QR code is determined to be in an activation state based on the status information, the status information of the target QR code in the database is updated to an activation state, and an approval instruction is sent to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, an abnormal alarm instruction is generated. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0086] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0087] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the QR code management method for packaging provided by the above methods. The method includes: responding to an activation request of a target QR code, querying the status information of the target QR code in a database; the activation request of the target QR code is generated by the manufacturing enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. If the target QR code is determined to be in an activation state based on the status information, the status information of the target QR code in the database is updated to an activation state, and an approval instruction is sent to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, an abnormal alarm instruction is generated. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0088] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements a QR code management method for packaging provided by the above methods. The method includes: in response to an activation request for a target QR code, querying the status information of the target QR code in a database; the activation request for the target QR code is generated by the manufacturing enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. If the target QR code is determined to be in an activation state based on the status information, the status information of the target QR code in the database is updated to an activation state, and an approval instruction is sent to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, an abnormal alarm instruction is generated. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
[0089] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling packaging using QR codes, characterized in that, include: In response to the activation request of the target QR code, the status information of the target QR code is queried in the database; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. If the target QR code is determined to be in an activation state based on the status information, the status information of the target QR code in the database is updated to an activation state, and an approval instruction is sent to the manufacturing enterprise; if the target QR code is determined not to be in an activation state based on the status information, an abnormal alarm instruction is generated. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
2. The QR code control method for packaging according to claim 1, characterized in that, Before verifying the QR code data, the process also includes: The first moment when the packaging supplier performs the coding operation during the coding process of the target batch of packaging, and the second moment when the production enterprise puts the target batch of packaging into the production line, are obtained, and the time interval between the first moment and the second moment is determined. Obtain the physical distance information between the packaging supplier and the production enterprise, and determine the logistics time based on the physical distance information and logistics speed; The difference between the logistics time and the time interval is determined to be less than a preset interval threshold.
3. The QR code control method for packaging according to claim 1, characterized in that, Before the receiving packaging supplier collects multiple QR code data during the packaging coding process of the target batch, it also includes: In response to a connection request from the packaging supplier, verify the identity information of the packaging supplier; After verifying the identity of the packaging supplier, an encrypted transmission channel is established based on the session key. This encrypted transmission channel is used to transmit the QR code data.
4. The QR code control method for packaging according to claim 3, characterized in that, The QR code data is obtained by digitally signing the packaged data based on the batch identifier received through the encrypted transmission channel, and then encrypting the signed data based on the public key. The packaging data is obtained by packaging the original QR code collected during the packaging and coding process of the target batch and the hash value of the original QR code.
5. The QR code control method for packaging according to claim 4, characterized in that, The verification of the QR code data includes: The QR code data is decrypted using the private key to obtain decrypted data, and the private key corresponds to the public key; Based on the batch identifier of the target batch, the decrypted data is verified. After the verification is successful, the packaged data is parsed from the decrypted data, and a verification process is performed based on the original QR code separated from the packaged data and the hash value of the original QR code.
6. The QR code control method for packaging according to claim 1, characterized in that, Also includes: Determine the number of QR codes in the database that are in an inactive state; Based on the number of QR codes, determine the quantity of finished inventory at the production enterprise's end; Based on the quantity of completed inventory and the total number of orders for the target batch, the production progress information for the target batch is determined.
7. A QR code control device for packaging, characterized in that, include: The query module is used to query the status information of the target QR code in the database in response to the activation request of the target QR code; the activation request of the target QR code is generated by the production enterprise after collecting the QR code information on the packaging to be used when the target batch of packaging is put into the production line. The control module is used to update the status information of the target QR code in the database to an activated state and send an approval instruction to the production enterprise when the target QR code is determined to be in an activated state based on the status information; and to generate an abnormal alarm instruction when the target QR code is determined not to be in an activated state based on the status information. The database construction process includes: Receive multiple QR code data collected by the packaging supplier during the packaging coding process of the target batch; The QR code data is verified, and the verified QR code data is marked as pending activation. The database is then constructed based on the marked QR code data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the QR code control method for packaging as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the QR code management method for packaging as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the QR code management method for packaging as described in any one of claims 1 to 6.