A blockchain-based Chinese medicine traceability method, device and medium
Through the blockchain-based traditional Chinese medicine traceability method, the problem of low information interaction in the production process of traditional Chinese medicine is solved, and the full process traceability and full life cycle control of traditional Chinese medicine is realized, which improves production efficiency and reduces costs.
Patent Information
- Application Number
- CN202210111703.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-01-29
AI Technical Summary
During the production of traditional Chinese medicine, the degree of information interaction and coordination between various business entities is low, which makes it impossible to trace the entire process of traditional Chinese medicine.
The blockchain-based traditional Chinese medicine traceability method is adopted, and the entire process traceability of traditional Chinese medicine is achieved by identifying and encoding the containers containing traditional Chinese medicine, generating identification codes, and correlation and uploading information to the blockchain.
It breaks the information island between Chinese medicine planting, circulation and production, realizes information interaction and data sharing of upstream and downstream enterprises, improves production efficiency, reduces supply and demand docking costs, and realizes the full life cycle control of Chinese medicine manufacturing.
Smart Images

Figure CN114493637B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of pharmaceutical safety technology, and in particular to a blockchain-based Chinese medicine traceability method, equipment and medium. Background Art
[0002] With the development of economy, people pay more and more attention to their health and the quality and safety of medicine. Among them, the application of traditional Chinese medicine is becoming more and more extensive. The production of traditional Chinese medicine is a typical process-based industry, involving multiple links such as medicinal material planting, production and circulation. In the production process, the raw materials of traditional Chinese medicine are circulated step by step according to the process.
[0003] However, the level of information exchange and coordination between various business entities of traditional Chinese medicine is low, and data sharing and feedback are poor, forming obvious information islands between upstream and downstream, making it impossible to trace the entire process of traditional Chinese medicine. Summary of the invention
[0004] The embodiments of the present application provide a blockchain-based Chinese medicine traceability method, device and medium, which are used to solve the problem that it is impossible to trace the entire process of Chinese medicine.
[0005] The present application embodiment adopts the following technical solutions:
[0006] On the one hand, an embodiment of the present application provides a blockchain-based Chinese medicine traceability method, the method comprising: identifying and encoding a container containing Chinese medicine to generate a first identification code for the Chinese medicine; wherein the same type of Chinese medicine is contained in the same container, and the Chinese medicines have the same planting environment; obtaining the planting information of the Chinese medicine through a supplier node, associating the first identification code with the planting information, and uploading the associated planting information to the blockchain; obtaining the first transportation information of the Chinese medicine, associating the first identification code with the first transportation information, and uploading the associated first transportation information to the blockchain; identifying and encoding the smallest packaging layer of the processed Chinese medicine at the production node, and The second identification code of the traditional Chinese medicine is formed; the first identification code is associated with the second identification code; the processing information of the traditional Chinese medicine is obtained through the production node, the second identification code is associated with the processing information, and the associated processing information is uploaded to the blockchain; the second transportation information of the traditional Chinese medicine to the corresponding seller node is obtained, the second identification code is associated with the second transportation information, and the associated second transportation information is uploaded to the blockchain, so that the consumer node can scan the second identification code through a scanning device and obtain the associated planting information, the associated first transportation information, the associated processing information and the associated second transportation information of the traditional Chinese medicine from the blockchain.
[0007] In one example, different types of traditional Chinese medicine correspond to different blocks, and the method also includes: determining the basic information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information, and writing the basic information into the block body; the basic information is related to the identity of each node and the type of each information; generating summary information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information respectively; storing the corresponding summary information in a pre-constructed distributed database; wherein, in the distributed database, the supplier node, the producer node, and the seller node correspond to different databases respectively; establishing a mapping relationship between the distributed database and the block body, and writing the mapping relationship into the block header, so as to put the data mapping into the block header for recording, and obtain the corresponding information from the distributed database through the mapping relationship.
[0008] In one example, each database in the distributed database has a multi-level storage structure, and storing the corresponding summary information in a pre-built distributed database specifically includes: obtaining the summary information and the storage time of the summary information, and storing the summary information in the first level of the corresponding database; wherein, according to a preset data capacity, the database is divided into multiple levels in sequence, and the capacity of the first level is lower than the capacity of other levels; if the storage time of the summary information exceeds a preset time limit, the summary information is backed up and stored in a second level; the first level is lower than the level of the second level; in the first level, a backup link of the summary information is generated, and the summary information is cleared to back up the summary information level by level.
[0009] In one example, uploading the associated planting information to the blockchain specifically includes: through the smart contract in the blockchain, in the preset Chinese medicine planting library, according to the type of the Chinese medicine, matching the associated planting information with the standard planting information in the Chinese medicine planting library; the standard planting information refers to the planting information suitable for the growth of the Chinese medicine released by planting experts; judging whether the associated planting information matches the standard planting information in the Chinese medicine planting library; if so, writing the associated planting information into the block of the blockchain; if not, determining the unmatched planting information and obtaining the medicinal value information of the Chinese medicine; the medicinal value information is used to indicate the treatment of a specified disease by the specified ingredients of the Chinese medicine; based on the growth conditions of the specified ingredients in the life cycle of the Chinese medicine, determining the impact level of the unmatched planting information on the Chinese medicine; if the impact level is greater than the preset level, clearing the unmatched planting information in the associated planting information, obtaining valid associated planting information, and writing the valid associated planting information into the block.
[0010] In one example, obtaining the medicinal value information of the traditional Chinese medicine specifically includes: calling the medicinal value information of the traditional Chinese medicine in a preset medicinal value library according to the type of the traditional Chinese medicine; wherein the preset medicinal value library includes medicinal value information corresponding to a plurality of types of traditional Chinese medicine; based on the growth conditions of the designated component in the life cycle of the traditional Chinese medicine, judging the impact level of the mismatched planting information on the traditional Chinese medicine, specifically including: determining the designated component of the traditional Chinese medicine according to the medicinal value information; determining the growth conditions corresponding to the designated component in the production cycle of the traditional Chinese medicine; and determining the impact level of the mismatched planting information on the traditional Chinese medicine according to the matching relationship between the mismatched planting information and the growth conditions.
[0011] In one example, the determining of the impact level of the mismatched planting information on the traditional Chinese medicine based on the matching relationship between the mismatched planting information and the growth conditions specifically includes: matching the growth factors included in the mismatched planting information with the growth factors included in the generation conditions to determine matching growth factor pairs; the growth factors include sunlight conditions, soil conditions, atmospheric conditions, water quality conditions, etc.; determining the impact level corresponding to the mismatched planting information based on the number of growth factor pairs; wherein, the greater the number of growth factor pairs, the greater the impact level.
[0012] In one example, when the supplier node, the producer node, and the seller node apply to be on-chain, an asymmetric encrypted public and private key pair is generated for each of the nodes, and the associated planting information is uploaded to the blockchain, specifically including: performing hash calculation on the associated planting information to obtain a first hash value, and digitally signing the first hash value with the private key corresponding to the supplier; wherein the public key is used to verify the first hash value of the digital signature; performing hash calculation on the public key to obtain a second hash value, associating the second hash value with the associated planting information, and generating an identity identification number of the supplier node through the second hash value; uploading the first hash value of the digital signature and the identity identification number of the supplier node to the blockchain through the supplier node, and broadcasting them to the entire network.
[0013] In one example, after uploading the associated second transportation information to the blockchain, the method further includes: obtaining an access request initiated by the seller node by scanning the second identification code; obtaining the frequency of the seller node access request within a preset period; judging whether the frequency exceeds an access threshold through a preset access smart contract; if so, determining that the traditional Chinese medicine has the possibility of being potentially unqualified, and notifying the supplier node to conduct quality inspection on the traditional Chinese medicine.
[0014] On the other hand, an embodiment of the present application provides a blockchain-based Chinese medicine traceability device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: identify and encode a container containing Chinese medicine to generate a first identification code for the Chinese medicine; wherein the same container contains the same type of Chinese medicine, and the planting environment of the Chinese medicines is the same; obtain the planting information of the Chinese medicine through a supplier node, associate the first identification code with the planting information, and upload the associated planting information to the blockchain; obtain the first transportation information of the Chinese medicine, associate the first identification code with the first transportation information, and associate the first The first step is to upload transportation information to the blockchain; identify and encode the smallest packaging layer of the processed traditional Chinese medicine at the production node to generate a second identification code for the traditional Chinese medicine; associate the first identification code with the second identification code; obtain the processing information of the traditional Chinese medicine through the production node, associate the second identification code with the processing information, and upload the associated processing information to the blockchain; obtain the second transportation information of the traditional Chinese medicine to the corresponding sales node, associate the second identification code with the second transportation information, and upload the associated second transportation information to the blockchain, so that the consumer node can scan the second identification code through a scanning device to obtain the associated planting information, the associated first transportation information, the associated processing information and the associated second transportation information of the traditional Chinese medicine from the blockchain.
[0015] On the other hand, an embodiment of the present application provides a blockchain-based non-volatile computer storage medium for Chinese medicine traceability, storing computer executable instructions, wherein the computer executable instructions are configured to: identify and encode a container containing Chinese medicine to generate a first identification code for the Chinese medicine; wherein the same type of Chinese medicine is contained in the same container, and the planting environment of the Chinese medicines is the same; through a supplier node, the planting information of the Chinese medicine is obtained, the first identification code is associated with the planting information, and the associated planting information is uploaded to the blockchain; the first transportation information of the Chinese medicine is obtained, the first identification code is associated with the first transportation information, and the associated first transportation information is uploaded to the blockchain; and the processing of the Chinese medicine at the production node is performed The smallest packaging layer of the Chinese medicine is identified and encoded to generate a second identification code for the Chinese medicine; the first identification code is associated with the second identification code; the processing information of the Chinese medicine is obtained through the production node, the second identification code is associated with the processing information, and the associated processing information is uploaded to the blockchain; the second transportation information of the Chinese medicine to the corresponding seller node is obtained, the second identification code is associated with the second transportation information, and the associated second transportation information is uploaded to the blockchain, so that the consumer node can scan the second identification code through a scanning device and obtain the associated planting information, the associated first transportation information, the associated processing information and the associated second transportation information of the Chinese medicine from the blockchain.
[0016] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0017] The application of identification has broken the information silos between Chinese medicine planting, circulation and production, realized information interaction, collaborative operation and data sharing among upstream and downstream enterprises, improved enterprise production efficiency and reduced enterprise supply and demand docking costs. Ultimately, in the Chinese medicine production process, through the docking of the identification resolution system with industrial software, information such as raw material procurement, circulation and production is collected to realize the full life cycle management of Chinese medicine manufacturing from raw material planting, circulation to Chinese medicine production. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solution of the present application, some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings, in which:
[0019] Figure 1 A flowchart of a blockchain-based Chinese medicine traceability method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of the structure of a blockchain-based Chinese medicine traceability device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0022] Some embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0023] Figure 1 A schematic diagram of a process flow of a blockchain-based Chinese medicine traceability method provided in an embodiment of the present application. Certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0024] The analysis method involved in the embodiments of the present application can be implemented by a terminal device or a server, and the present application does not impose any special restrictions on this. For the convenience of understanding and description, the following embodiments are described in detail by taking a server as an example.
[0025] Figure 1 The process in may include the following steps:
[0026] S101: Identify and encode the container containing the Chinese medicine to generate a first identification code for the Chinese medicine; wherein the same container contains the same type of Chinese medicine, and the planting environment of the Chinese medicine is the same.
[0027] That is to say, each container is labeled with its own identification code, there is only one type of Chinese medicine in a single container, and the Chinese medicine in a single container is purchased from the same production site. This enables the classification of Chinese medicine at the smallest granularity, which can facilitate the traceability of Chinese medicine in the later stage.
[0028] S102: Obtain the planting information of the traditional Chinese medicine through the supplier node, associate the first identification code with the planting information, and upload the associated planting information to the blockchain.
[0029] In some embodiments of the present application, since the planting information has a great influence on the growth process of Chinese medicine, it will affect the quality of Chinese medicine. Therefore, the more the planting information conforms to the growth conditions of Chinese medicine, the better the quality of Chinese medicine will be. Based on this, poor quality Chinese medicine can be screened out by screening unqualified planting information.
[0030] Specifically, first, through the smart contract in the blockchain, in the preset Chinese medicine planting database, according to the type of Chinese medicine, the associated planting information is matched with the standard planting information in the Chinese medicine planting database. Among them, the standard planting information refers to the planting information suitable for the growth of Chinese medicine released by planting experts. In other words, the closer the planting information is to the standard planting information, the better the quality of the Chinese medicine.
[0031] It should be noted that in the Chinese medicine planting database, standard planting information corresponding to different types of Chinese medicines is pre-stored.
[0032] Then, it is determined whether the associated planting information matches the standard planting information in the traditional Chinese medicine planting database. If so, the associated planting information is written into the block of the blockchain.
[0033] If not, the unmatched planting information is determined. Then, the medicinal value information of the traditional Chinese medicine is obtained. The medicinal value information is used to indicate the treatment information of the specified disease by the specified components of the traditional Chinese medicine.
[0034] When obtaining the medicinal value information of the traditional Chinese medicine, the medicinal value information of the traditional Chinese medicine is called in the preset medicinal value library according to the type of the traditional Chinese medicine. It should be noted that the preset medicinal value library includes medicinal value information corresponding to multiple types of traditional Chinese medicine.
[0035] Then, the impact level of mismatched planting information on the TCM is determined based on the growing conditions of the designated ingredients during the life cycle of the TCM.
[0036] Among them, when determining the impact level of mismatched planting information on traditional Chinese medicine, first, the designated components of the traditional Chinese medicine are determined based on the medicinal value information. Then, the corresponding growth conditions of the designated components in the production cycle of the traditional Chinese medicine are determined, for example, through the Internet, the growth conditions required for the designated components published by planting experts are obtained. It can be understood that the growth conditions also refer to the planting information.
[0037] Finally, the impact level of mismatched planting information on traditional Chinese medicine was determined based on the matching relationship between mismatched planting information and growth conditions.
[0038] When determining the impact level of mismatched planting information on traditional Chinese medicine, the growth factors included in the mismatched planting information are matched with the growth factors included in the production conditions to determine a matching growth factor pair. The growth factors include sunlight conditions, soil conditions, atmospheric conditions, water quality conditions, etc.
[0039] Then, according to the number of growth factor pairs, the impact level corresponding to the mismatched planting information is determined; wherein, the greater the number of growth factor pairs, the greater the impact level.
[0040] If the impact level is greater than the preset level, the unmatched planting information is cleared from the associated planting information to obtain valid associated planting information, which is then written into the block. If the impact level is less than or equal to the preset level, the unmatched planting information is also written into the block.
[0041] S103: Obtain the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, and upload the associated first transportation information to the blockchain.
[0042] S104: Identify and encode the smallest packaging layer of the processed traditional Chinese medicine at the production node to generate a second identification code for the traditional Chinese medicine.
[0043] It is understandable that due to the characteristics of Chinese medicine itself, Chinese medicine is usually in bulk in the container. Then, when it arrives at the production node, the production party usually processes the bulk Chinese medicine and then continues to package it. Therefore, in order to facilitate traceability, a second identification code is given to the Chinese medicine at the smallest packaging layer.
[0044] S105: Associating the first identification code with the second identification code.
[0045] By associating the first identification code with the second identification code, code-to-code association is achieved, opening up the traceability channel for the raw materials.
[0046] S106: Obtain processing information of the traditional Chinese medicine through the production node, associate the second identification code with the processing information, and upload the associated processing information to the blockchain.
[0047] S107: Obtain the second transportation information of the Chinese medicine to the corresponding seller node, associate the second identification code with the second transportation information, and upload the associated second transportation information to the blockchain, so that the consumer node can scan the second identification code through a scanning device to obtain the associated planting information, the associated first transportation information, the associated processing information and the associated second transportation information of the Chinese medicine from the blockchain.
[0048] In some embodiments of the present application, after the associated second transportation information is uploaded to the blockchain, when quality problems occur in the traditional Chinese medicine, in order to promptly check whether there are problems in each link, the seller's node may frequently check the traceability information of the traditional Chinese medicine in a short period of time.
[0049] Based on this, it is possible to obtain the access request initiated by the seller node by scanning the second identification code, obtain the frequency of the seller node access request within a preset period, and determine whether the frequency exceeds the access threshold through the preset access smart contract.
[0050] If yes, it is determined that the Chinese medicine has the possibility of being potentially unqualified, and the supplier node is notified to conduct quality inspection on the Chinese medicine. If no, it means that the Chinese medicine does not have the possibility of being potentially unqualified, and no notification information is sent to the supplier node.
[0051] In some embodiments of the present application, when uploading the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information to the blockchain, in order to store more efficiently and respond to the needs of each node in a timely manner, first, the basic information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information is determined, and the basic information is written into the block body. The basic information is related to the identity of each node and the type of each information.
[0052] Then, the summary information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information is generated respectively. Then, the corresponding summary information is stored in a pre-constructed distributed database. In the distributed database, the supplier node, the production node, and the seller node correspond to different databases respectively;
[0053] Finally, a mapping relationship between the distributed database and the block body is established, and the mapping relationship is written into the block header so that the data mapping can be recorded in the block header. Through the mapping relationship, the corresponding information can be obtained from the distributed database.
[0054] This enables basic information to be stored in the block body. The data information generated during the operation of the blockchain is stored in a database outside the main chain in the form of a summary, and is stored in a classified form to facilitate traceability and data analysis. The data mapping is recorded in the block header.
[0055] Furthermore, each database in the distributed database has a multi-level storage structure, and stores the corresponding summary information in a pre-built distributed database, specifically including:
[0056] First, the summary information and the storage time of the summary information are obtained, and the summary information is stored in the first level of the corresponding database; wherein the database is divided into multiple levels in sequence according to the preset data capacity, and the capacity of the first level is lower than that of other levels;
[0057] Then, if the storage duration of the summary information exceeds the preset time limit, the summary information is backed up and stored in the second level; the first level is lower than the level of the second level;
[0058] Finally, in the first level, a backup link of the summary information is generated, and the summary information is cleared, so that the summary information is backed up level by level, thereby enabling more efficient storage.
[0059] In some embodiments of the present application, when the supplier node, the producer node, and the seller node apply to go online, an asymmetric encryption public key and private key pair are generated for each node, taking the supplier node as an example.
[0060] First, a hash calculation is performed on the associated planting information to obtain a first hash value, and the first hash value is digitally signed by a private key corresponding to the supplier; wherein the public key is used to verify the digitally signed first hash value.
[0061] Then, the public key is hashed to obtain a second hash value, the second hash value is associated with the associated planting information, and the identity number of the supplier node is generated through the second hash value;
[0062] Finally, the first hash value of the digital signature and the identity number of the supplier node are uploaded to the blockchain through the supplier node and broadcasted to the entire network, thereby achieving fair and equitable supply and demand transactions and providing real data to support decision-making and business evaluation.
[0063] It should be noted that although the embodiments of the present application are based on Figure 1 Steps S101 to S107 are described in sequence, but this does not mean that steps S101 to S107 must be performed in a strict order. Figure 1 The order shown in the figure is to introduce and explain step S101 to step S107 in sequence, in order to facilitate those skilled in the art to understand the technical solution of the embodiment of the present application. In other words, in the embodiment of the present application, the order between step S101 to step S107 can be appropriately adjusted according to actual needs.
[0064] pass Figure 1 The method uses identification to break the information silos between Chinese medicine planting, circulation, and production, realizes information interaction, collaborative operation, and data sharing between upstream and downstream enterprises, improves enterprise production efficiency, and reduces the cost of enterprise supply and demand docking. Ultimately, in the Chinese medicine production process, through the docking of the identification resolution system with industrial software, it collects information such as raw material procurement, circulation, and production, and realizes the full life cycle control of Chinese medicine manufacturing from raw material planting, circulation, to Chinese medicine production.
[0065] Based on the same idea, some embodiments of the present application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0066] Figure 2 A schematic diagram of the structure of a blockchain-based Chinese medicine traceability device provided in an embodiment of the present application, the device includes:
[0067] at least one processor; and,
[0068] a memory communicatively connected to the at least one processor; wherein,
[0069] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0070] Performing identification coding on containers containing Chinese medicines to generate a first identification code of the Chinese medicines; wherein the same container contains the same type of Chinese medicines, and the planting environment of the Chinese medicines is the same;
[0071] Obtaining the planting information of the traditional Chinese medicine through the supplier node, associating the first identification code with the planting information, uploading the associated planting information to the blockchain, and writing the associated planting information into the block through the smart contract in the blockchain;
[0072] Acquire the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, upload the associated first transportation information to the blockchain, and write the associated first transportation information into the block through the smart contract;
[0073] After the production node processes the traditional Chinese medicine, an identification code is performed on the smallest packaging layer of the processed traditional Chinese medicine to generate a second identification code of the traditional Chinese medicine;
[0074] In the attribute information of the second identification code, the first identification code is referenced to associate the first identification code with the second identification code;
[0075] Obtaining the processing information of the traditional Chinese medicine through the producer node, associating the second identification code with the processing information, uploading the associated processing information to the blockchain, and writing the associated processing information into the block through the smart contract;
[0076] Obtain the second transportation information of the traditional Chinese medicine to the corresponding sales point, associate the second identification code with the second transportation information, upload the associated second transportation information to the blockchain, and write the associated second transportation information into the block through the smart contract.
[0077] Some embodiments of the present application provide a blockchain-based non-volatile computer storage medium for tracing the origin of traditional Chinese medicine, storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0078] Performing identification coding on containers containing Chinese medicines to generate a first identification code of the Chinese medicines; wherein the same container contains the same type of Chinese medicines, and the planting environment of the Chinese medicines is the same;
[0079] Obtaining the planting information of the traditional Chinese medicine through the supplier node, associating the first identification code with the planting information, uploading the associated planting information to the blockchain, and writing the associated planting information into the block through the smart contract in the blockchain;
[0080] Acquire the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, upload the associated first transportation information to the blockchain, and write the associated first transportation information into the block through the smart contract;
[0081] After the production node processes the traditional Chinese medicine, an identification code is performed on the smallest packaging layer of the processed traditional Chinese medicine to generate a second identification code of the traditional Chinese medicine;
[0082] In the attribute information of the second identification code, the first identification code is referenced to associate the first identification code with the second identification code;
[0083] Obtaining the processing information of the traditional Chinese medicine through the producer node, associating the second identification code with the processing information, uploading the associated processing information to the blockchain, and writing the associated processing information into the block through the smart contract;
[0084] Obtain the second transportation information of the traditional Chinese medicine to the corresponding sales point, associate the second identification code with the second transportation information, upload the associated second transportation information to the blockchain, and write the associated second transportation information into the block through the smart contract.
[0085] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0086] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0087] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0088] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0089] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0091] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0092] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0093] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0094] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0095] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the technical principle of the present application should all fall within the protection scope of the present application.
Claims
1. A traditional Chinese medicine traceability method based on blockchain, characterized in that: The method comprises: Performing identification coding on containers containing Chinese medicines to generate a first identification code of the Chinese medicines; wherein the same container contains the same type of Chinese medicines, and the planting environment of the Chinese medicines is the same; Obtaining the planting information of the traditional Chinese medicine through the supplier node, associating the first identification code with the planting information, and uploading the associated planting information to the blockchain; Acquire the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, and upload the associated first transportation information to the blockchain; Performing identification coding on the smallest packaging layer of the processed traditional Chinese medicine at the production node to generate a second identification code of the traditional Chinese medicine; Associating the first identification code with the second identification code; Obtaining, through the producer node, processing information of the traditional Chinese medicine, associating the second identification code with the processing information, and uploading the associated processing information to the blockchain; Obtaining second transportation information of the Chinese medicine to the corresponding seller node, associating the second identification code with the second transportation information, and uploading the associated second transportation information to the blockchain, so that the consumer node scans the second identification code through a scanning device and obtains the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information of the Chinese medicine from the blockchain; Different types of traditional Chinese medicine correspond to different blocks, and the method further includes: Determine basic information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information, and write the basic information into a block body; the basic information is related to the identity of each node and the type of each information; respectively generating summary information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information; The corresponding summary information is stored in a pre-constructed distributed database; wherein, in the distributed database, the supplier node, the producer node and the seller node correspond to different databases respectively; Establishing a mapping relationship between the distributed database and the block body, writing the mapping relationship into the block header, so as to put the data mapping into the block header for recording, and obtaining corresponding information from the distributed database through the mapping relationship; Each database in the distributed database has a multi-level storage structure, and storing the corresponding summary information in a pre-built distributed database specifically includes: Acquire the summary information and the storage time of the summary information, and store the summary information in the first level of the corresponding database; wherein the database is divided into multiple levels in sequence according to a preset data capacity, and the capacity of the first level is lower than that of other levels; If the storage time of the summary information exceeds a preset time limit, the summary information is backed up and stored in a second level; the first level is lower than the level of the second level; In the first level, a backup link of the summary information is generated, and the summary information is cleared, so as to back up the summary information level by level.
2. The method according to claim 1, characterized in that The uploading of the associated planting information to the blockchain specifically includes: Through the smart contract in the blockchain, in the preset Chinese medicine planting database, according to the type of the Chinese medicine, the associated planting information is matched with the standard planting information in the Chinese medicine planting database; the standard planting information refers to the planting information suitable for the growth of the Chinese medicine published by the planting experts; Determining whether the associated planting information matches the standard planting information in the traditional Chinese medicine planting database; If yes, writing the associated planting information into a block of the blockchain; If not, then determine the unmatched planting information and obtain the medicinal value information of the traditional Chinese medicine; the medicinal value information is used to indicate the treatment information of the specified disease by the specified component of the traditional Chinese medicine; Determining the impact level of the mismatched planting information on the Chinese medicine based on the growth conditions of the designated component during the life cycle of the Chinese medicine; If the impact level is greater than a preset level, the unmatched planting information is cleared from the associated planting information to obtain valid associated planting information, and the valid associated planting information is written into the block.
3. The method according to claim 2, characterized in that The obtaining of the medicinal value information of the traditional Chinese medicine specifically includes: According to the type of the traditional Chinese medicine, the medicinal value information of the traditional Chinese medicine is called in a preset medicinal value library; wherein the preset medicinal value library includes medicinal value information corresponding to a plurality of types of traditional Chinese medicines; Based on the growth conditions of the designated component in the life cycle of the traditional Chinese medicine, determining the impact level of the mismatched planting information on the traditional Chinese medicine specifically includes: Determining the designated components of the traditional Chinese medicine according to the medicinal value information; Determining the growth conditions corresponding to the designated component in the production cycle of the traditional Chinese medicine; According to the matching relationship between the mismatched planting information and the growth conditions, the impact level of the mismatched planting information on the traditional Chinese medicine is determined.
4. The method according to claim 3, characterized in that The determining, according to the matching relationship between the mismatched planting information and the growth conditions, the impact level of the mismatched planting information on the traditional Chinese medicine specifically includes: Matching the growth factors included in the unmatched planting information with the growth factors included in the generation conditions to determine a matching growth factor pair; the growth factors include sunlight conditions, soil conditions, atmospheric conditions, and water quality conditions; The impact level corresponding to the mismatched planting information is determined according to the number of the growth factor pairs; wherein, a greater number of the growth factor pairs indicates a greater impact level.
5. The method according to claim 1, characterized in that When the supplier node, the producer node, and the seller node apply to be on-chain, an asymmetric encrypted public key and private key pair are generated for each node, and the associated planting information is uploaded to the blockchain, specifically including: Performing hash calculation on the associated planting information to obtain a first hash value, and digitally signing the first hash value using a private key corresponding to the supplier; wherein the public key is used to verify the digitally signed first hash value; Performing hash calculation on the public key to obtain a second hash value, associating the second hash value with the associated planting information, and generating an identity number of the supplier node through the second hash value; The first hash value of the digital signature and the identity identification number of the supplier node are uploaded to the blockchain through the supplier node and broadcast throughout the network.
6. The method according to claim 1, characterized in that After uploading the associated second transportation information to the blockchain, the method further includes: Obtaining an access request initiated by the seller node by scanning the second identification code; Obtaining the frequency of the seller node access request within a preset period; Determine whether the frequency exceeds the access threshold through a preset access smart contract; If so, it is determined that the Chinese medicine has the possibility of being potentially unqualified, and the supplier node is notified to conduct quality inspection on the Chinese medicine.
7. A Chinese medicine traceability device based on blockchain, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Performing identification coding on containers containing Chinese medicines to generate a first identification code of the Chinese medicines; wherein the same container contains the same type of Chinese medicines, and the planting environment of the Chinese medicines is the same; Obtaining the planting information of the traditional Chinese medicine through the supplier node, associating the first identification code with the planting information, uploading the associated planting information to the blockchain, and writing the associated planting information into the block through the smart contract in the blockchain; Acquire the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, upload the associated first transportation information to the blockchain, and write the associated first transportation information into the block through the smart contract; After the production node processes the traditional Chinese medicine, an identification code is performed on the smallest packaging layer of the processed traditional Chinese medicine to generate a second identification code of the traditional Chinese medicine; In the attribute information of the second identification code, the first identification code is referenced to associate the first identification code with the second identification code; Obtaining the processing information of the traditional Chinese medicine through the producer node, associating the second identification code with the processing information, uploading the associated processing information to the blockchain, and writing the associated processing information into the block through the smart contract; Obtaining second transportation information of the Chinese medicine to a corresponding point of sale, associating the second identification code with the second transportation information, uploading the associated second transportation information to the blockchain, and writing the associated second transportation information into the block chain through the smart contract; Different types of Chinese medicine correspond to different blocks, including: Determine basic information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information, and write the basic information into a block body; the basic information is related to the identity of each node and the type of each information; respectively generating summary information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information; The corresponding summary information is stored in a pre-constructed distributed database; wherein, in the distributed database, the supplier node, the producer node and the seller node correspond to different databases respectively; Establishing a mapping relationship between the distributed database and the block body, writing the mapping relationship into the block header, so as to put the data mapping into the block header for recording, and obtaining corresponding information from the distributed database through the mapping relationship; Each database in the distributed database has a multi-level storage structure, and storing the corresponding summary information in a pre-built distributed database specifically includes: Acquire the summary information and the storage time of the summary information, and store the summary information in the first level of the corresponding database; wherein the database is divided into multiple levels in sequence according to a preset data capacity, and the capacity of the first level is lower than that of other levels; If the storage time of the summary information exceeds a preset time limit, the summary information is backed up and stored in a second level; the first level is lower than the level of the second level; In the first level, a backup link of the summary information is generated, and the summary information is cleared, so as to back up the summary information level by level.
8. A blockchain-based non-volatile computer storage medium for Chinese medicine traceability, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Performing identification coding on containers containing Chinese medicines to generate a first identification code of the Chinese medicines; wherein the same container contains the same type of Chinese medicines, and the planting environment of the Chinese medicines is the same; Obtaining the planting information of the traditional Chinese medicine through the supplier node, associating the first identification code with the planting information, uploading the associated planting information to the blockchain, and writing the associated planting information into the block through the smart contract in the blockchain; Acquire the first transportation information of the traditional Chinese medicine, associate the first identification code with the first transportation information, upload the associated first transportation information to the blockchain, and write the associated first transportation information into the block through the smart contract; After the production node processes the traditional Chinese medicine, an identification code is performed on the smallest packaging layer of the processed traditional Chinese medicine to generate a second identification code of the traditional Chinese medicine; In the attribute information of the second identification code, the first identification code is referenced to associate the first identification code with the second identification code; Obtaining the processing information of the traditional Chinese medicine through the producer node, associating the second identification code with the processing information, uploading the associated processing information to the blockchain, and writing the associated processing information into the block through the smart contract; Obtaining second transportation information of the Chinese medicine to a corresponding point of sale, associating the second identification code with the second transportation information, uploading the associated second transportation information to the blockchain, and writing the associated second transportation information into the block chain through the smart contract; Different types of Chinese medicine correspond to different blocks, including: Determine basic information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information, and write the basic information into a block body; the basic information is related to the identity of each node and the type of each information; respectively generating summary information corresponding to the associated planting information, the associated first transportation information, the associated processing information, and the associated second transportation information; The corresponding summary information is stored in a pre-constructed distributed database; wherein, in the distributed database, the supplier node, the producer node and the seller node correspond to different databases respectively; Establishing a mapping relationship between the distributed database and the block body, writing the mapping relationship into the block header, so as to put the data mapping into the block header for recording, and obtaining corresponding information from the distributed database through the mapping relationship; Each database in the distributed database has a multi-level storage structure, and storing the corresponding summary information in a pre-built distributed database specifically includes: Acquire the summary information and the storage time of the summary information, and store the summary information in the first level of the corresponding database; wherein the database is divided into multiple levels in sequence according to a preset data capacity, and the capacity of the first level is lower than that of other levels; If the storage time of the summary information exceeds a preset time limit, the summary information is backed up and stored in a second level; the first level is lower than the level of the second level; In the first level, a backup link of the summary information is generated, and the summary information is cleared, so as to back up the summary information level by level.
Citation Information
Patent Citations
Commodity anti-counterfeiting traceability system, method, device and storage medium
CN109360000A
Traditional Chinese medicinal material quality tracing system
CN113077193A
Distributed data storage method and system based on block chain
CN113360501A