[0020]In order to explain the overall concept of the application more clearly, a detailed description is given below.
[0021]The terms "first" and "second" in the specification and claims of this application are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence. It should be understood that the order used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in orders other than those described.
[0022]In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to the clearly listed Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
[0023]The node referred to in the embodiments of this application can be understood as an abstract machine that responds to specific external trigger conditions and performs state transitions according to certain rules. It can be a mobile phone, a tablet, a handheld computer, a personal PC, etc. It can be based on application software and can be Networked devices.
[0024]A method for querying recycled items on the blockchain, the method includes steps S101-S102.
[0025]S101. The user scans the two-dimensional code of the finished product for sale through the client; where the finished product is obtained after recycling and factory processing of discarded items.
[0026]The QR code is affixed to the finished product, and the QR code is generated by a URL link; each finished product corresponds to a unique URL link, that is, a unique QR code. The use of a QR code makes it easier for users to scan; for users, they only need to scan the QR code to see the recovery process data of the finished product, which is very convenient.
[0027]S102. The client obtains the recovery process data corresponding to the finished product from the blockchain according to the query instruction in the QR code; wherein the recovery process data includes item recovery data, item processing data, item delivery data, and Item sales data.
[0028]In this step, the client obtains the recycling process data corresponding to the finished product from the blockchain according to the query instruction in the QR code, which specifically includes: the client starts according to the query instruction in the QR code Own blockchain browser, and input the key attribute field of the finished product in the blockchain browser; wherein the key attribute field is the finished product number; the client displays the search result of the key attribute field to User, the search result includes the recovery process data.
[0029]At this time, in the blockchain, the way of querying key attributes is different from that of centralized server queries. The database of a centralized server is a data table structure, which can perform field queries of multiple attributes; while in the blockchain, the block structure adopted, the data is stored in intervals and discontinuously, and similar data tables cannot be performed The keywords of this query method. Query in the blockchain can only be performed by hash value, which is a string of characters. In this manual, the product number is used for query.
[0030]In a specific implementation, the blockchain browser of the client, after receiving the key attribute field query, queries the recovery process data in the database of the off-chain server; wherein, the off-chain server has a preset interval At time, the recovery process data stored on the blockchain is obtained, and the recovery process data is verified. After the verification is passed, the recovery process data is stored in its own database.
[0031]At this time, the off-chain server obtains the recycling process data on the blockchain in advance. That is, the recovery process data stored in blocks on the blockchain is parsed into the local database and stored in the form of data tables; in this way, the user is equivalent to directly accessing the database of the off-chain server, and the access speed is fast .
[0032]Therefore, the problem of synchronization between the recovery process data of the off-chain server and the recovery process data on the blockchain, and the authenticity of the recovery process data stored by the off-chain server have arisen. In this regard, on the one hand, the off-chain server needs to periodically obtain the recovery process data on the blockchain and parse it to a local database for storage; on the other hand, it is necessary to verify the acquired recovery process data.
[0033]Therefore, the off-chain server verifying the recovery process data specifically includes: the off-chain server verifies the item recovery data encrypted with the recovery node private key through the recovery node public key; Verify the item processing data and item factory data encrypted with the factory node private key through the factory node public key; use the sales node public key to verify the item encrypted with the sales node private key Sales data is verified.
[0034]At this time, the recycling node, the factory node, and the sales node are all blockchain nodes in the blockchain system, and the item recycling data includes item name, recycling person, item number, recycling time, and recycling site Name, the article processing data includes factory name, finished product number, finished product name, finished product time and finished product person, the article factory data includes factory name, destination name, finished product number, finished product name and factory time, the article sales data Including the name of the sales site, the product number, and the time of sale.
[0035]In addition, the aforementioned product number corresponds to one or more recycling numbers; or one recycling number corresponds to one or more product numbers; wherein, the correspondence between the aforementioned product numbers and the aforementioned recycling numbers is stored on the blockchain.
[0036]The corresponding relationship is stored on the blockchain, so that when users query the recycling process data through the product number, they can find all the recycling process data. In addition, a finished product may be processed from one or more recycled items, and a recycled item may be processed to obtain one or more finished products. This correspondence relationship will be stored on the blockchain when the recycling process data is on the chain. , For users to query.
[0037]The above-mentioned item recovery data, item processing data, item delivery data, and item sales data are the key node data of the entire item recovery process; after these data are obtained by the corresponding blockchain node, these data are uploaded to the chain. The information of these blockchain nodes is stored on the blockchain. The blockchain node can be a node certified by the Global Recycled Standard (GRS) official organization, or it can itself be a node of the GRS official organization. In this manual, the on-chain process of the above recovery process data and the blockchain system consensus verification process will not be described in detail.
[0038]In a specific implementation, the client's blockchain browser, after receiving the key attribute field query, traverses the blocks on the blockchain, so as to obtain all the automatically corresponding key attributes in the blockchain. Describe the recovery process data.
[0039]It should be pointed out that the efficiency of traversing the block to query the recovery process data is low; the advantage is that all the data is obtained directly from the blockchain, which can be verified without verification, and the authenticity is high.
[0040]The method of this application performs the query on the blockchain after all the recycling process data of the item is on the chain, which makes the user query more convenient and improves the user's experience of querying the recycling process data.
[0041]This specification discloses a device for querying recovered items on a blockchain, and the device is a client. The user scans the QR code on the finished product by operating the client.
[0042]The user scans the QR code of the finished product through the client; where the finished product is obtained after recycling and factory processing; the client uses the query instruction in the QR code from the blockchain Obtain the recycling process data corresponding to the finished product; wherein the recycling process data includes item recovery data, item processing data, item delivery data, and item sales data.
[0043]In a specific embodiment, the client includes a blockchain browser; wherein, the client obtains the recycling process data corresponding to the finished product from the blockchain according to the query instruction in the QR code, specifically Including: the client starts its own blockchain browser according to the query instruction in the QR code, and enters the key attribute field of the finished product in the blockchain browser; wherein the key attribute field is the finished product number ; The client displays the search results of the key attribute fields to the user, and the search results include the recovery process data.
[0044]In a specific implementation, the blockchain browser of the client, after receiving the key attribute field query, queries the recovery process data in the database of the off-chain server; wherein, the off-chain server has a preset interval At time, the recovery process data stored on the blockchain is obtained, and the recovery process data is verified. After the verification is passed, the recovery process data is stored in its own database.
[0045]In a specific implementation, the off-chain server verifies the recovery process data, which specifically includes: the off-chain server uses the recovery node public key to verify the item encrypted with the recovery node private key The recovered data is verified; the item processing data encrypted with the factory node private key and the item factory data are verified through the factory node public key; the sales node public key is used to verify the private key of the sales node The item sales data encrypted by the key is verified; wherein, the recycling node, the factory node, and the sales node are all blockchain nodes in the blockchain system, and the item recycling data includes the item name, Recycling person, article number, recycling time and name of the recycling site. The article processing data includes factory name, finished product number, finished product name, finished product time and finished product person. The article factory data includes factory name, destination name, finished product number, The name of the finished product and the time of delivery, and the item sales data includes the name of the sales site, the number of the finished product and the time of sale.
[0046]In a specific embodiment, the aforementioned product number corresponds to one or more recycling numbers; or one recycling number corresponds to one or more product numbers; wherein the correspondence between the aforementioned product numbers and the aforementioned recycling numbers is stored in a block On the chain.
[0047]In a specific implementation, the client's blockchain browser, after receiving the key attribute field query, traverses the blocks on the blockchain, so as to obtain all the automatically corresponding key attributes in the blockchain. Describe the recovery process data.
[0048]In addition, the above-mentioned device embodiment corresponds to the above-mentioned method embodiment, so the same or similar points can be referred to each other, and details are not repeated here.
[0049]The method of this application performs the query on the blockchain after all the recycling process data of the item is on the chain, which makes the user query more convenient and improves the user's experience of querying the recycling process data.
[0050]A computer equipment structure. The computer equipment is a hardware structure of a recovered article inquiry device. The computer equipment may include a processor 310, a memory 320, an input/output interface 330, a communication interface 340, and a bus 350. The processor 340, the memory 320, the input/output interface 330, and the communication interface 340 realize the communication connection between each other in the device through the bus 350.
[0051]The processor 310 may be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for executing related Program to realize the technical solutions provided in the embodiments of this specification.
[0052]The memory 320 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 320 may store an operating system and other application programs. When the technical solutions provided in the embodiments of the present specification are implemented through software or firmware, related program codes are stored in the memory 320 and called and executed by the processor 310.
[0053]The input/output interface 330 is used to connect an input/output module to realize information input and output. The input/output/module can be configured in the device as a component, or it can be connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
[0054]The communication interface 340 is used to connect a communication module to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0055]The bus 350 includes a path to transmit information between various components of the device (for example, the processor 310, the memory 320, the input/output interface 330, and the communication interface 340).
[0056]It should be noted that although the above device only shows the processor 310, the memory 320, the input/output interface 330, the communication interface 340, and the bus 350, in the specific implementation process, the device may also include the equipment necessary for normal operation. Other components. In addition, those skilled in the art can understand that the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of this specification, and not necessarily include all the components shown above.
[0057]The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
[0058]Professionals should also be further aware that the units and algorithm steps of the examples described in the embodiments disclosed in this article can be implemented by electronic hardware, computer software or a combination of both, in order to clearly illustrate the hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
[0059]The above descriptions are only examples of this application and are not intended to limit this application. For those skilled in the art, this application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the scope of the claims of this application.