Electronic anti-counterfeit label data management method and device and nonvolatile storage medium
By building a tag sequence and disassembling and deduplication of data packets, the problem of redundant data in the blockchain network is solved and the efficiency of data management is achieved.
Patent Information
- Application Number
- CN202510106668.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-30
AI Technical Summary
Because the product collects data at various circulation links and puts it on the chain, there is a large amount of duplicate redundant data in the blockchain network.
By determining the product information to which the target electronic anti-counterfeiting tag belongs, a tag sequence is constructed, and the data packet is disassembled into sub-data packets, allocated to each tag in the tag sequence, and deduplication is performed to clear redundant data.
It effectively reduces redundant data in the blockchain network and improves the efficiency of data management.
Smart Images

Figure CN120067082A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain data processing, and more particularly, to a method, apparatus, and non-volatile storage medium for managing electronic anti-counterfeiting label data. Background Art
[0002] In the related art, due to the large number of product circulation links, from production to reaching the hands of users, products go through various links such as transportation, sales, storage, display, and inspection. When each product passes through each link, data needs to be collected and uploaded to the blockchain (stored in the blockchain network), thus forming a huge amount of data, and there will be a large number of duplicate and redundant data in these data.
[0003] For the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of the present application provide a method, apparatus, and non-volatile storage medium for managing electronic anti-counterfeiting label data, so as to at least solve the technical problem of a large amount of duplicate and redundant data existing in the blockchain network due to the data of each link of the product being collected and uploaded to the blockchain in the related art.
[0005] According to one aspect of the embodiments of the present application, a method for managing electronic anti-counterfeiting label data is provided, including: determining product information to which a target electronic anti-counterfeiting label belongs; determining at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information, and constructing a label sequence corresponding to the target electronic anti-counterfeiting label according to the first type of label, the second type of label, the third type of label, and the fourth type of label; determining and disassembling a data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into a plurality of sub-data packets, distributing the plurality of sub-data packets to each label in the label sequence; for each label in the label sequence, determining whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and when it is determined that there is duplicate data to be processed, performing deduplication processing on the sub-data packet corresponding to each label.
[0006] Optionally, the product information includes: a product name field, a product packaging field, a product storage field, a product usage method field, and a product applicable object field; determining at least one first - type label, at least one second - type label, at least one third - type label, and at least one fourth - type label corresponding to the target electronic anti - counterfeiting label based on the product information includes: determining at least one first - type label based on any one of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; determining at least one second - type label based on any two of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; determining at least one third - type label based on any three of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; determining at least one fourth - type label based on the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field.
[0007] Optionally, constructing a label sequence corresponding to the target electronic anti - counterfeiting label based on the first - type label, the second - type label, the third - type label, and the fourth - type label includes: establishing a main sequence, where the arrangement order of the main sequence is the first - type label, the second - type label, the third - type label, and the fourth - type label in sequence; classifying each label corresponding to the target electronic anti - counterfeiting label into the main sequence according to the label category; for each label, establishing a set of process labels to obtain a label sequence, where the process labels include transportation labels, sales labels, storage labels, display labels, and inspection labels.
[0008] Optionally, allocating multiple sub - data packets to each label in the label sequence includes: determining the process label corresponding to the sub - data packet according to the attribute information of the upload node of the sub - data packet; determining the main sequence corresponding to the sub - data packet according to the operation information corresponding to the sub - data packet; determining the label in the main sequence corresponding to the sub - data packet according to the attribute information corresponding to the target electronic anti - counterfeiting label; and allocating the sub - data packet to the corresponding label according to the label in the main sequence corresponding to the sub - data packet and the process label corresponding to the sub - data packet.
[0009] Optionally, determining and disassembling a data packet corresponding to the target electronic anti - counterfeiting label in the blockchain network includes: disassembling the data packet into multiple data contents and determining the generation time of each data content; determining the data volume size of each data content; determining a preset data volume threshold and comparing the data volume size of each data content with the data volume threshold; and determining multiple sub - data packets according to the comparison result and the data content.
[0010] Optionally, determining multiple sub-packets according to the comparison result and the data content includes: when the data volume is greater than a preset data volume threshold, using the data content as a sub-packet; when the data volume is not greater than the preset data volume threshold, merging the data content according to the generation time of the data content to obtain multiple sub-packets.
[0011] Optionally, merging the data content according to the generation time of the data content to obtain multiple sub-packets includes: determining the data content to be merged whose data volume is not greater than the preset data volume threshold; arranging the data content to be merged in the order from the earliest generation time to the latest; merging the data content to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged to obtain multiple sub-packets.
[0012] Optionally, merging the data content to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged includes: determining a first time interval between each data content to be merged and the adjacent previous data content to be merged, and a second time interval between the data content to be merged and the adjacent next data content to be merged; when the first time interval is less than the preset time threshold, merging the data content to be merged with the previous data content to be merged; when the second time interval is less than the preset time threshold, merging the data content to be merged with the next data content to be merged.
[0013] Optionally, the method further includes: after receiving a first packet that needs to be uploaded to the blockchain network, determining the attribute information of the upload node of the first packet; determining a second packet in the blockchain network according to the attribute information of the upload node, where the second packet has the same attribute information of the upload node as the first packet; disassembling the first packet according to the disassembly method of the second packet to obtain multiple sub-packets, and allocating the multiple sub-packets obtained by disassembling the first packet to each label in the label sequence.
[0014] According to another aspect of the embodiments of the present application, an electronic anti-counterfeiting label data management system is further provided, including a blockchain network and an electronic device. The blockchain network includes a regulatory consensus node, a consensus node, and a general full node. The electronic device is used to determine the product information to which the target electronic anti-counterfeiting label belongs; determine at least one first-class label, at least one second-class label, at least one third-class label, and at least one fourth-class label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first-class label, the second-class label, the third-class label, and the fourth-class label; determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into multiple sub-data packets, allocate the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and perform deduplication processing on the sub-data packet corresponding to each label when it is determined that there is duplicate data to be processed.
[0015] According to another aspect of the embodiments of the present application, an electronic anti-counterfeiting label data management device is further provided, including: a first processing module, configured to determine the product information to which the target electronic anti-counterfeiting label belongs; a second processing module, configured to determine at least one first-class label, at least one second-class label, at least one third-class label, and at least one fourth-class label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first-class label, the second-class label, the third-class label, and the fourth-class label; a third processing module, configured to determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into multiple sub-data packets, allocate the multiple sub-data packets to each label in the label sequence; a fourth processing module, configured to determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label in the label sequence, and perform deduplication processing on the sub-data packet corresponding to each label when it is determined that there is duplicate data to be processed.
[0016] According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided. A program is stored in the non-volatile storage medium. When the program runs, it controls the device where the non-volatile storage medium is located to execute the electronic anti-counterfeiting label data management method.
[0017] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory and a processor. The processor is used to run the program stored in the memory. When the program runs, it executes the electronic anti-counterfeiting label data management method.
[0018] According to another aspect of the embodiments of the present application, there is also provided a computer program product, including a computer program which, when executed by a processor, implements the method for managing electronic anti-counterfeiting label data.
[0019] In the embodiments of the present application, the product information to which the target electronic anti-counterfeiting label belongs is determined; at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label are determined according to the product information, and a label sequence corresponding to the target electronic anti-counterfeiting label is constructed according to the first type of label, the second type of label, the third type of label, and the fourth type of label; the data packet corresponding to the target electronic anti-counterfeiting label is determined and disassembled in the blockchain network, and after the data packet is disassembled into multiple sub-data packets, the multiple sub-data packets are assigned to each label in the label sequence; for each label in the label sequence, it is determined whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and in the case where it is determined that there is duplicate data to be processed, the sub-data packet corresponding to each label is de-duplicated. By constructing a label sequence, splitting the data packet, classifying it into each label in the label sequence, and then de-duplicating the sub-data packets corresponding to each label, the purpose of clearing duplicate data is achieved, thereby realizing the technical effect of reducing redundant data in the blockchain network, and further solving the technical problem of a large amount of duplicate redundant data existing in the blockchain network due to the fact that data in each link of the product is collected and uploaded to the chain in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0021] Figure 1 is a schematic structural diagram of an electronic anti-counterfeiting label data management system provided according to an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a node of a blockchain network provided according to an embodiment of the present application;
[0023] Figure 3 is a schematic structural diagram of an electronic device provided according to an embodiment of the present application;
[0024] Figure 4 is a schematic flowchart of a method for managing electronic anti-counterfeiting label data provided according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a label sequence provided according to an embodiment of the present application;
[0026] Figure 6It is a schematic diagram of a data merging method provided according to an embodiment of the present application;
[0027] Figure 7 It is a schematic flowchart of an electronic anti-counterfeiting label data management process provided according to an embodiment of the present application;
[0028] Figure 8 It is a schematic structural diagram of an electronic anti-counterfeiting label data management device provided according to an embodiment of the present application. Detailed implementation manners
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0031] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0032] Blockchain: Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Essentially, blockchain is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of data, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block.
[0033] Electronic anti-counterfeiting label: An electronic anti-counterfeiting label is a product integrating electronic circuits, computers, and information technologies. Compared with the identification function of traditional labels, electronic anti-counterfeiting labels can carry richer information. Electronic anti-counterfeiting labels are widely used for product identification and traceability.
[0034] In product traceability, due to its immutability, blockchain technology can ensure the authenticity of information at the technical level and prevent information from being tampered with. In related technologies, a solution for product traceability by combining an electronic anti-counterfeiting label with blockchain is provided. Combining the electronic anti-counterfeiting label with blockchain technology can give full play to the characteristics of both, namely, rich information storage and information authenticity.
[0035] However, due to the numerous product circulation links, from production to reaching the hands of users, products go through various links such as transportation, sales, storage, display, and inspection. When each product passes through each link, data needs to be collected and uploaded to the chain, resulting in a huge amount of data, which requires high data management requirements. How to simplify data reduction of electronic anti-counterfeiting labels under blockchain technology is a problem that needs to be addressed.
[0036] To solve the above problems, relevant solutions are provided in the embodiments of this application, which are described in detail below.
[0037] According to the embodiments of this application, a method embodiment of an electronic anti-counterfeiting label data management method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0038] The method embodiments provided by the embodiments of this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Figure 1 A schematic structural diagram of an electronic anti-counterfeiting label data management system for implementing the electronic anti-counterfeiting label data management method is shown. It can be seen from Figure 1 that the system includes an electronic device 20 and a blockchain network 22. Among them, the blockchain network 22 includes a regulatory consensus node, a consensus node, and an ordinary full node; the electronic device 20 is used to determine the product information to which the target electronic anti-counterfeiting label belongs; determine at least one first-type label, at least one second-type label, at least one third-type label, and at least one fourth-type label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first-type label, second-type label, third-type label, and fourth-type label; determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network 22, and after disassembling the data packet into multiple sub-data packets, allocate the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and in the case of determining that there is duplicate data to be processed, perform deduplication processing on the sub-data packet corresponding to each label.
[0039] In some embodiments of the present application, as Figure 2 shown, the regulatory consensus node is the highest-level node. While synchronizing all ledger data and participating in blockchain consensus, it is also responsible for managing and authorizing the access of the blockchain to the platform and the entity. The consensus node not only synchronizes all ledger data but also participates in blockchain consensus. The ordinary full node only synchronizes all ledger data.
[0040] Figure 3 shows a hardware block diagram of an electronic device 30 for implementing an electronic anti-counterfeiting label data management method. As Figure 3 shown, the electronic device 30 may include one or more (shown as 302a, 302b,..., 302n in the figure) processors 302 (the processor 302 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 304 for storing data, and a transmission device 306 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 3 the structure shown is only illustrative and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 30 may further include more or fewer components than Figure 3 shown, or have a different configuration from Figure 3 shown.
[0041] It should be noted that the above one or more processors 302 and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the electronic device 30. As involved in the embodiments of the present application, the data processing circuit is a processor control (such as the selection of a variable resistor terminal path connected to an interface).
[0042] The memory 304 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the electronic anti-counterfeiting label data management method in the embodiments of the present application. The processor 302 executes various functional applications and data processing by running the software programs and modules stored in the memory 304, that is, implements the above-mentioned electronic anti-counterfeiting label data management method. The memory 304 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 304 may further include a memory remotely disposed relative to the processor 302, and these remote memories can be connected to the computer terminal 30 through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0043] The transmission device 306 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the electronic device 30. In one instance, the transmission device 306 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 306 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables a user to interact with the user interface of the electronic device 30.
[0045] Under the above operating environment, the embodiments of the present application provide an electronic anti-counterfeiting label data management method, as Figure 4 shown, the method includes the following steps:
[0046] Step S402, determining the product information to which the target electronic anti-counterfeiting label belongs;
[0047] In the technical solution provided in step S402, all the data packets that have been uploaded to the chain for the same target electronic anti-counterfeiting label can also be obtained. Then, after extracting the product information corresponding to the target electronic anti-counterfeiting label, various labels corresponding to the target electronic anti-counterfeiting label are determined according to the product information corresponding to the target electronic anti-counterfeiting label. The product information includes the corresponding fields of the name, packaging, storage, usage method, and applicable object of the product to which the target electronic anti-counterfeiting label belongs.
[0048] Step S404: Determine at least one first - type label, at least one second - type label, at least one third - type label, and at least one fourth - type label corresponding to the target electronic anti - counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti - counterfeiting label based on the first - type label, second - type label, third - type label, and fourth - type label;
[0049] In the technical solution provided in step S404, the product information includes: product name field, product packaging field, product storage field, product usage method field, and product applicable object field; determining at least one first - type label, at least one second - type label, at least one third - type label, and at least one fourth - type label corresponding to the target electronic anti - counterfeiting label according to the product information includes: determining at least one first - type label according to any one of the product name field, product packaging field, product storage field, product usage method field, and product applicable object field; determining at least one second - type label according to any two of the product name field, product packaging field, product storage field, product usage method field, and product applicable object field; determining at least one third - type label according to any three of the product name field, product packaging field, product storage field, product usage method field, and product applicable object field; determining at least one fourth - type label according to the product name field, product packaging field, product storage field, product usage method field, and product applicable object field.
[0050] Specifically, the above - mentioned first - type label is the large - category label of the product corresponding to the target electronic anti - counterfeiting label, the second - type label is the medium - category label of the product corresponding to the target electronic anti - counterfeiting label, the third - type label is the small - category label of the product corresponding to the target electronic anti - counterfeiting label, and the fourth - type label is the detailed - category label of the product corresponding to the target electronic anti - counterfeiting label. It should be noted that there is not necessarily a subordinate relationship between the large - category label, medium - category label, small - category label, and detailed - category label.
[0051] In some embodiments of the present application, the step of constructing a label sequence corresponding to the target electronic anti - counterfeiting label based on the first - type label, second - type label, third - type label, and fourth - type label includes: establishing a main sequence, where the arrangement order of the main sequence is the first - type label, the second - type label, the third - type label, and the fourth - type label in sequence; classifying each label corresponding to the target electronic anti - counterfeiting label into the main sequence according to the label category; for each label, establishing a group of process labels to obtain a label sequence, where the process labels include transportation labels, selling labels, storage labels, display labels, and inspection labels.
[0052] As an alternative implementation manner, the establishment process of the label sequence is as follows:
[0053] The first step: Establish a main sequence composed of large - category, medium - category, small - category, and detailed - category;
[0054] In the second step, classify the major category label, middle category label, minor category label, and detailed category label of the product to which the determined target electronic anti-counterfeiting label belongs under the corresponding items of the main sequence respectively;
[0055] In the third step, establish a set of process labels under each determined label to obtain a label sequence, and each set of process labels includes transportation, selling, storage, display, and inspection.
[0056] In some embodiments of the present application, taking the product as wontons as an example, the corresponding label sequence is as Figure 5 shown. It can be seen from Figure 5 that the major category label of this product includes dry food, the middle category label includes freezing and refrigeration, the minor category label includes wontons, dumplings, and glutinous rice balls, and the detailed category label includes loose wontons and bagged wontons. Then each label will also correspond to a set of process labels, and the process labels include transportation, selling, storage, display, and inspection, etc.
[0057] As an alternative implementation manner, the step of allocating multiple sub-data packets to each label in the label sequence includes: determining the process label corresponding to the sub-data packet according to the attribute information of the upload node of the sub-data packet; determining the main sequence corresponding to the sub-data packet according to the operation information corresponding to the sub-data packet; determining the label corresponding to the sub-data packet in the main sequence according to the attribute information corresponding to the target electronic anti-counterfeiting label; and allocating the sub-data packet to the corresponding label according to the label corresponding to the sub-data packet in the main sequence and the process label corresponding to the sub-data packet.
[0058] Step S406, determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into multiple sub-data packets, allocate the multiple sub-data packets to each label in the label sequence;
[0059] In some embodiments of the present application, the step of determining and disassembling the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network includes: disassembling the data packet into multiple data contents, and determining the generation time of each data content; determining the data volume size of each data content; determining a preset data volume threshold, and comparing the data volume size of each data content with the data volume threshold; and determining multiple sub-data packets according to the comparison result and the data content.
[0060] As an alternative implementation manner, the step of determining multiple sub-data packets according to the comparison result and the data content includes: in the case where the data volume size is greater than the preset data volume threshold, taking the data content as a sub-data packet; in the case where the data volume size is not greater than the preset data volume threshold, merging the data contents according to the generation time of the data content to obtain multiple sub-data packets.
[0061] In some embodiments of the present application, the steps of merging data contents according to the generation time of the data contents to obtain multiple sub-packets include: determining the data contents to be merged whose data volume is not greater than a preset data volume threshold; arranging the data contents to be merged in the order from the front to the back according to the generation time; and performing a merging process on the data contents to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged, so as to obtain multiple sub-packets.
[0062] As an alternative implementation manner, the steps of performing a merging process on the data contents to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged include: determining a first time interval between each data content to be merged and the adjacent previous data content to be merged, and a second time interval between the data content to be merged and the adjacent next data content to be merged; merging the data content to be merged with the previous data content to be merged when the first time interval is less than the preset time threshold; and merging the data content to be merged with the next data content to be merged when the second time interval is less than the preset time threshold.
[0063] In some embodiments of the present application, the process of determining sub-packets includes the following steps:
[0064] First step, disassembling the time content of each packet to obtain multiple data contents and the generation time corresponding to each data content;
[0065] Second step, calculating the data volume size of each data content;
[0066] Third step, setting a data volume threshold, and dividing the data contents whose data volume is greater than the data volume threshold into a single sub-packet;
[0067] Fourth step, for the remaining data contents whose data volume is less than or equal to the data volume threshold, calculating the generation time interval between each data content and the previous data content and recording it as the first interval, and calculating the generation time interval between each data content and the next data content and recording it as the second interval;
[0068] Fifth step, for any data content, comparing the corresponding first interval and second interval with the set time threshold respectively. If the first interval is less than the set time threshold, then merging the previous data content with the current data content; if the second interval is less than the set time threshold, then merging the next data content with the current data content;
[0069] Specifically, during the merging, as Figure 6 shown, it is judged in turn whether each data content is merged in the order from the front to the back according to the generation time. After the merged data content is greater than the data volume threshold, the merged data content will be used as a sub-packet, and this sub-packet will no longer participate in the subsequent merging process.
[0070] Step 6: Repeat the above steps until the data volume of the remaining data content is less than the data volume threshold, and the corresponding first interval and second interval are both greater than or equal to the time threshold;
[0071] Step 7: Divide the remaining data content as a whole into a mixed sub-data packet.
[0072] In the Figure 6 shown merging scenario, a3 is separately divided into a single sub-data packet, a1 and a2 are merged, and the resulting data is greater than the data volume threshold, so it is also divided into a single sub-data packet. The data volume of a4 is small and the interval between it and other data is large, so it is jointly divided into the mixed sub-data packet with other data.
[0073] As an optional implementation manner, the process of attributing a single sub-data packet to the label sequence is as follows:
[0074] Step 1: Determine the corresponding process label of the single sub-data packet according to the attribute of the upload node of each single sub-data packet;
[0075] Step 2: Determine a main sequence corresponding to each single data packet according to the main sequence involved in the operation corresponding to each single sub-data packet;
[0076] Step 3: Determine the corresponding item of each single data packet in each main sequence according to the attribute of the commodity corresponding to the electronic anti-counterfeiting label;
[0077] It should be noted that the above corresponding item refers to a large category label, a medium category label, a small category label or a detailed category label.
[0078] Step 4: Divide the single sub-data packet into the label sequence according to the above steps.
[0079] In some embodiments of the present application, the process of attributing the mixed sub-data packet to the label sequence is as follows:
[0080] Step 1: Determine the corresponding process label of the mixed sub-data packet according to the attribute of the upload node of each mixed sub-data packet;
[0081] Step 2: Determine all the main sequences corresponding to each mixed data packet according to the main sequence involved in the operation corresponding to each mixed sub-data packet;
[0082] Step 3: Determine at least one corresponding item of each mixed data packet in each main sequence according to the attribute of the commodity corresponding to the electronic anti-counterfeiting label;
[0083] Step 4: Copy several copies of the single sub-data packet according to the above steps and divide them into the label sequence.
[0084] Step S408: For each tag in the tag sequence, determine whether there is duplicate data to be processed in the sub-packet corresponding to each tag, and when it is determined that there is duplicate data to be processed, perform deduplication processing on the sub-packets corresponding to each tag.
[0085] In the technical solution provided in step S408, the deduplication process for data packets is as follows:
[0086] First step, determine whether there are at least two sub-packets under the process tag of each classification tag;
[0087] The above classification tags refer to large category tags, medium category tags, small category tags, and fine category tags.
[0088] Second step, if there are at least two sub-packets, disassemble the sub-packets into data contents, compare whether there are the same data contents, and if there are, replace all the same data contents with one data content;
[0089] Third step, mark all the generation time points of the data content in the obtained unique data content.
[0090] In some embodiments of the present application, the method further includes: after receiving the first data packet that needs to be uploaded to the blockchain network, determining the attribute information of the upload node of the first data packet; determining a second data packet in the blockchain network according to the attribute information of the upload node, where the second data packet has the same attribute information of the upload node as the first data packet; disassembling the first data packet according to the disassembling method of the second data packet to obtain multiple sub-packets, and allocating the multiple sub-packets obtained by disassembling the first data packet to each tag in the tag sequence.
[0091] As an alternative implementation, the process of processing the first data packet includes the following steps:
[0092] First step, determine the attribute of the upload node of the first data packet that needs to be uploaded to the chain, and search for the uploaded data packet with the same upload node attribute in the uploaded data packets according to the determined attribute of the upload node, that is, the second data packet;
[0093] Second step, determine whether the searched uploaded data packet is unique. If it is not unique, calculate the data volume of the searched uploaded data packet, and select the data packet with the data volume closest to the data volume of the data packet to be uploaded to the chain as the most similar data packet.
[0094] Third step, disassemble the data packet to be uploaded to the chain according to the disassembling method of the most similar data packet and integrate it into the tag sequence to complete the upload to the chain.
[0095] In some embodiments of the present application, there is also provided a Figure 7The data processing flow shown includes the following steps:
[0096] Step S702, obtaining all the data packets that have been chained for the same electronic anti-counterfeiting label;
[0097] Step S704, selecting several classification labels from the label library according to the classification of the product to which the electronic anti-counterfeiting label belongs;
[0098] Step S706, constructing a label sequence according to the selected classification labels;
[0099] Step S708, disassembling each data packet to obtain several sub-data packets;
[0100] Step S710, integrating all the sub-data packets obtained by disassembling into the label sequence;
[0101] Step S712, integrating all the sub-data packets under the same classification label in the label sequence;
[0102] Step S714, receiving a data packet to be chained, comparing the data packet to be chained with the chained data packets to determine the most similar data packet;
[0103] Step S716, disassembling the data packet to be chained according to the disassembling method of the most similar data packet and integrating it into the label sequence to complete the chaining.
[0104] By adopting the method of determining the product information to which the target electronic anti-counterfeiting label belongs; determining at least one first-class label, at least one second-class label, at least one third-class label and at least one fourth-class label corresponding to the target electronic anti-counterfeiting label according to the product information, and constructing a label sequence corresponding to the target electronic anti-counterfeiting label based on the first-class label, second-class label, third-class label and fourth-class label; determining and disassembling the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into multiple sub-data packets, distributing the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determining whether there is duplicate data to be processed in the sub-data packets corresponding to each label, and in the case of determining that there is duplicate data to be processed, performing deduplication processing on the sub-data packets corresponding to each label. By constructing a label sequence, splitting the data packet and classifying it into each label in the label sequence, and then performing deduplication processing on the sub-data packets corresponding to each label, the purpose of clearing duplicate data is achieved, thereby realizing the technical effect of reducing redundant data in the blockchain network, and further solving the technical problem of a large amount of duplicate redundant data existing in the blockchain network due to the fact that data in each link of the product is collected and chained in the related technology.
[0105] The embodiment of the present application provides an electronic anti-counterfeiting label data management deviceFigure 8 is a structural schematic diagram of the device. As can be seen from Figure 8 it, the device includes: a first processing module 80, configured to determine product information to which a target electronic anti-counterfeiting label belongs; a second processing module 82, configured to determine at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first type of label, the second type of label, the third type of label, and the fourth type of label; a third processing module 84, configured to determine and disassemble a data packet corresponding to the target electronic anti-counterfeiting label in a blockchain network, and after disassembling the data packet into a plurality of sub-data packets, allocate the plurality of sub-data packets to each label in the label sequence; a fourth processing module 86, configured to, for each label in the label sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and perform deduplication processing on the sub-data packet corresponding to each label when it is determined that there is duplicate data to be processed.
[0106] In some embodiments of the present application, the product information includes: a product name field, a product packaging field, a product storage field, a product usage method field, and a product applicable object field; the steps for the second processing module 82 to determine at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information include: determining at least one first type of label according to any one of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; determining at least one second type of label according to any two of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; determining at least one third type of label according to any three of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; and determining at least one fourth type of label according to the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field.
[0107] In some embodiments of the present application, the second processing module 82 constructs a label sequence corresponding to the target electronic anti-counterfeiting label according to the first type of label, the second type of label, the third type of label, and the fourth type of label, including: establishing a main sequence, where the arrangement order of the main sequence is the first type of label, the second type of label, the third type of label, and the fourth type of label in sequence; classifying each label corresponding to the target electronic anti-counterfeiting label into the main sequence according to the label category; and for each label, establishing a group of process labels to obtain a label sequence, where the process labels include a transportation label, a selling label, a storage label, a display label, and an inspection label.
[0108] In some embodiments of the present application, the step of the second processing module 82 allocating multiple sub - data packets to each label in the label sequence includes: determining the process label corresponding to the sub - data packet according to the attribute information of the upload node of the sub - data packet; determining the main sequence corresponding to the sub - data packet according to the operation information corresponding to the sub - data packet; determining the label in the main sequence corresponding to the sub - data packet according to the attribute information of the target electronic anti - counterfeiting label; and allocating the sub - data packet to the corresponding label according to the label in the main sequence corresponding to the sub - data packet and the process label corresponding to the sub - data packet.
[0109] In some embodiments of the present application, the step of the third processing module 84 determining and disassembling the data packet corresponding to the target electronic anti - counterfeiting label in the blockchain network includes: disassembling the data packet into multiple data contents, and determining the generation time of each data content; determining the data volume size of each data content; determining a preset data volume threshold, and comparing the data volume size of each data content with the data volume threshold; and determining multiple sub - data packets according to the comparison result and the data content.
[0110] In some embodiments of the present application, the step of the third processing module 84 determining multiple sub - data packets according to the comparison result and the data content includes: taking the data content as a sub - data packet when the data volume size is greater than the preset data volume threshold; and merging the data contents according to the generation time of the data content to obtain multiple sub - data packets when the data volume size is not greater than the preset data volume threshold.
[0111] In some embodiments of the present application, the step of the third processing module 84 merging the data contents according to the generation time of the data content to obtain multiple sub - data packets includes: determining the data contents to be merged whose data volume size is not greater than the preset data volume threshold; arranging the data contents to be merged in the order of the generation time from front to back; and performing a merging process on the data contents to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged to obtain multiple sub - data packets.
[0112] In some embodiments of the present application, the step of the third processing module 84 performing a merging process on the data contents to be merged according to the time interval between each data content to be merged and the adjacent data content to be merged includes: determining the first time interval between each data content to be merged and the adjacent previous data content to be merged, and the second time interval between the data content to be merged and the adjacent next data content to be merged; merging the data content to be merged with the previous data content to be merged when the first time interval is less than the preset time threshold; and merging the data content to be merged with the next data content to be merged when the second time interval is less than the preset time threshold.
[0113] In some embodiments of the present application, the electronic anti-counterfeiting label data management device is further configured to: after receiving a first data packet that needs to be uploaded to the blockchain network, determine the attribute information of the upload node of the first data packet; determine a second data packet in the blockchain network according to the attribute information of the upload node, where the second data packet has the same attribute information of the upload node as the first data packet; disassemble the first data packet according to the disassembling method of the second data packet to obtain a plurality of sub-data packets, and allocate the plurality of sub-data packets obtained by disassembling the first data packet to each label in the label sequence.
[0114] It should be noted that each module in the above electronic anti-counterfeiting label data management device may be a program module (for example, a set of program instructions for implementing a specific function), or a hardware module. For the latter, it may be presented in the following forms, but not limited to: the manifestation form of each of the above modules is a processor, or the functions of each of the above modules are implemented by a processor.
[0115] According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium. A program is stored in the non-volatile storage medium. When the program runs, it controls the device where the non-volatile storage medium is located to execute the following electronic anti-counterfeiting label data management method: determine the product information to which the target electronic anti-counterfeiting label belongs; determine at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first type of label, the second type of label, the third type of label, and the fourth type of label; determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into a plurality of sub-data packets, allocate the plurality of sub-data packets to each label in the label sequence; for each label in the label sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and when it is determined that there is duplicate data to be processed, perform deduplication processing on the sub-data packet corresponding to each label.
[0116] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory and a processor, where the processor is configured to run a program stored in the memory. When the program runs, it executes the following electronic anti-counterfeiting label data management method: determining product information to which a target electronic anti-counterfeiting label belongs; determining at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information, and constructing a label sequence corresponding to the target electronic anti-counterfeiting label based on the first type of label, the second type of label, the third type of label, and the fourth type of label; determining and disassembling a data packet corresponding to the target electronic anti-counterfeiting label in a blockchain network, and after disassembling the data packet into multiple sub-data packets, distributing the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determining whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and performing deduplication processing on the sub-data packet corresponding to each label when it is determined that there is duplicate data to be processed.
[0117] According to another aspect of the embodiments of the present application, a computer program product is further provided, including a computer program that, when executed by a processor, implements the following electronic anti-counterfeiting label data management method: determining product information to which a target electronic anti-counterfeiting label belongs; determining at least one first type of label, at least one second type of label, at least one third type of label, and at least one fourth type of label corresponding to the target electronic anti-counterfeiting label according to the product information, and constructing a label sequence corresponding to the target electronic anti-counterfeiting label based on the first type of label, the second type of label, the third type of label, and the fourth type of label; determining and disassembling a data packet corresponding to the target electronic anti-counterfeiting label in a blockchain network, and after disassembling the data packet into multiple sub-data packets, distributing the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determining whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and performing deduplication processing on the sub-data packet corresponding to each label when it is determined that there is duplicate data to be processed.
[0118] In the above embodiments of the present application, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0119] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.
[0120] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0122] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the related technology, or all or part of this 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 for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks or optical discs and other various media that can store program codes.
[0123] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for managing electronic anti-counterfeiting label data, characterized in that: include: Determine the product information to which the target electronic anti-counterfeiting label belongs; Determine at least one first-category label, at least one second-category label, at least one third-category label, and at least one fourth-category label corresponding to the target electronic anti-counterfeiting label according to the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first-category label, the second-category label, the third-category label, and the fourth-category label; Determine and disassemble a data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into a plurality of sub-data packets, assign the plurality of sub-data packets to each label in the label sequence; For each tag in the tag sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each tag, and if it is determined that there is duplicate data to be processed, deduplicate the sub-data packet corresponding to each tag.
2. The electronic anti-counterfeiting label data management method according to claim 1, characterized in that: The product information includes: a product name field, a product packaging field, a product storage field, a product usage method field, and a product applicable object field; determining at least one first-category label, at least one second-category label, at least one third-category label, and at least one fourth-category label corresponding to the target electronic anti-counterfeiting label according to the product information includes: Determine the at least one first-category label according to any one of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; Determine the at least one second-category label according to any two of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; Determine the at least one third-category label according to any three of the product name field, the product packaging field, the product storage field, the product usage method field, and the product applicable object field; The at least one fourth category label is determined based on the product name field, the product packaging field, the product storage field, the product usage method field and the product applicable object field.
3. The electronic anti-counterfeiting label data management method according to claim 1, characterized in that: Constructing a label sequence corresponding to the target electronic anti-counterfeiting label according to the first type of label, the second type of label, the third type of label and the fourth type of label comprises: Establishing a main sequence, wherein the main sequence is arranged in the order of the first category of tags, the second category of tags, the third category of tags, and the fourth category of tags; Classifying each label corresponding to the target electronic anti-counterfeiting label into the main sequence according to label category; For each label, a set of process labels is established to obtain the label sequence, wherein the process labels include a transport label, a sales label, a storage label, a display label and an inspection label.
4. The electronic anti-counterfeiting label data management method according to claim 3, characterized in that: Allocating the plurality of sub-data packets to the respective labels in the label sequence comprises: Determining a process label corresponding to the sub-data packet according to the attribute information of the uploading node of the sub-data packet; Determining the main sequence corresponding to the sub-data packet according to the operation information corresponding to the sub-data packet; Determining the label corresponding to the sub-data packet in the main sequence according to the attribute information corresponding to the target electronic anti-counterfeiting label; The sub-data packet is assigned to a corresponding label according to the label corresponding to the sub-data packet in the main sequence and the flow label corresponding to the sub-data packet.
5. The electronic anti-counterfeiting label data management method according to claim 1, characterized in that: Determining and disassembling a data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network includes: Decomposing the data packet into a plurality of data contents, and determining the generation time of each of the data contents; Determine the data volume of each piece of data content; Determine a preset data volume threshold, and compare the data volume size of each piece of the data content with the data volume threshold; A plurality of sub-data packets are determined according to the comparison result and the data content.
6. The electronic anti-counterfeiting label data management method according to claim 5, characterized in that: Determining the plurality of sub-data packets according to the comparison result and the data content comprises: When the data volume is larger than the preset data volume threshold, taking the data content as the sub-data packet; In the case that the data volume size is not greater than the preset data volume threshold, the data content is merged according to the generation time of the data content to obtain a plurality of sub-data packets.
7. The electronic anti-counterfeiting label data management method according to claim 6, characterized in that: Merging the data contents according to the generation time of the data contents to obtain a plurality of sub-data packets includes: Determine the data content to be merged whose data volume is not greater than the preset data volume threshold; Arrange the data contents to be merged in order from the beginning to the end according to the generation time; The data contents to be merged are merged according to the time interval between each of the data contents to be merged and the adjacent data contents to be merged to obtain a plurality of the sub-data packets.
8. The electronic anti-counterfeiting label data management method according to claim 7, characterized in that: The merging of the data contents to be merged according to the time interval between each of the data contents to be merged and the adjacent data contents to be merged includes: Determine a first time interval between each of the to-be-merged data contents and an adjacent previous data content to be merged, and a second time interval between the to-be-merged data content and an adjacent next data content to be merged; When the first time interval is less than a preset time threshold, merging the data content to be merged with the previous data content to be merged; When the second time interval is less than the preset time threshold, the data content to be merged is merged with the subsequent data content to be merged.
9. The electronic anti-counterfeiting label data management method according to claim 1, characterized in that: The method further comprises: After receiving a first data packet that needs to be uploaded to the blockchain network, determining attribute information of an uploading node of the first data packet; Determining a second data packet in the blockchain network according to the attribute information of the uploading node, wherein the second data packet has the same attribute information of the uploading node as the first data packet; The first data packet is disassembled according to the disassembly method of the second data packet to obtain a plurality of sub-data packets, and the plurality of sub-data packets obtained by disassembling the first data packet are allocated to each label in the label sequence.
10. An electronic anti-counterfeiting label data management system, characterized in that: Including blockchain network, electronic devices, among which, The blockchain network includes regulatory consensus nodes, consensus nodes and ordinary full nodes; The electronic device is used to determine product information to which a target electronic anti-counterfeiting label belongs; determine at least one first-category label, at least one second-category label, at least one third-category label and at least one fourth-category label corresponding to the target electronic anti-counterfeiting label based on the product information, and construct a label sequence corresponding to the target electronic anti-counterfeiting label based on the first-category label, the second-category label, the third-category label and the fourth-category label; determine and disassemble the data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into multiple sub-data packets, assign the multiple sub-data packets to each label in the label sequence; for each label in the label sequence, determine whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and when it is determined that there is duplicate data to be processed, deduplicate the sub-data packet corresponding to each label.
11. An electronic anti-counterfeiting label data management device, characterized in that: include: The first processing module is used to determine the product information to which the target electronic anti-counterfeiting label belongs; A second processing module is used to determine at least one first-category label, at least one second-category label, at least one third-category label and at least one fourth-category label corresponding to the target electronic anti-counterfeiting label according to the product information, and to construct a label sequence corresponding to the target electronic anti-counterfeiting label according to the first-category label, the second-category label, the third-category label and the fourth-category label; A third processing module is used to determine and disassemble a data packet corresponding to the target electronic anti-counterfeiting label in the blockchain network, and after disassembling the data packet into a plurality of sub-data packets, assign the plurality of sub-data packets to each label in the label sequence; The fourth processing module is used to determine, for each label in the label sequence, whether there is duplicate data to be processed in the sub-data packet corresponding to each label, and if it is determined that there is duplicate data to be processed, deduplicate the sub-data packet corresponding to each label.
12. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the electronic anti-counterfeiting label data management method according to any one of claims 1 to 9.
13. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the electronic anti-counterfeiting label data management method according to any one of claims 1 to 9 is executed when the program is run.
14. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the electronic anti-counterfeiting label data management method according to any one of claims 1 to 9.