A method and related device for tracing the source of aggregation
By using smart contracts and oracles in the aggregation traceability platform, we obtain traceability results from external traceability platforms, solving the problem of interconnection between different traceability platforms and achieving convenient product traceability services.
Patent Information
- Application Number
- CN202011043776.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-09-28
Smart Images

Figure CN112184262B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain traceability technology, and in particular to a method and related device for aggregate traceability. Background Art
[0002] With the widespread application of blockchain technology, in order to improve users' trust in products and downstream companies' trust in upstream companies' delivery of products, blockchain is used to implement product traceability services to avoid product counterfeiting and selling inferior products as good ones, etc.
[0003] In the existing technology, major manufacturers generally provide customized product traceability solutions for specific products, and upload relevant information on the production, processing, transportation and other links of specific products to the chain to form a specific product traceability blockchain and store it on their own traceability platform. Users can obtain the traceability results of the product by scanning the product code, etc.
[0004] However, it is difficult to achieve interconnection and sharing between product traceability blockchains on different traceability platforms, which easily leads to isolated traceability information islands. Different traceability platforms have different traceability operations and different traceability standards and specifications, which makes it extremely inconvenient for users to log in to different traceability platforms for product traceability. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a method and related device for aggregated traceability, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging into different traceability platforms for product traceability, and provide users with more convenient product traceability services.
[0006] In a first aspect, an embodiment of the present application provides a method for aggregated tracing, which is applied to an aggregated tracing platform, and the method includes:
[0007] Obtaining a traceability query request from a target user through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type;
[0008] Based on the target traceability product identifier and the target traceability service type, determining a corresponding target traceability service identifier;
[0009] If the target traceability service identifier belongs to the external traceability platform set, a first traceability result is obtained from the target external traceability platform through a smart contract and a oracle according to the target traceability service identifier, the target traceability product identifier and the target traceability service type;
[0010] The first tracing result is returned in response to the tracing query request.
[0011] Optionally, also include:
[0012] In the aggregated traceability platform, for each traceability service, the traceability service identifier, traceability product category and traceability service type corresponding to the traceability service are pre-registered; the traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain;
[0013] A correspondence between the traceability service, the traceability service identifier, the traceability product category and the traceability service type is established and stored.
[0014] Optionally, the traceability service type is specifically a full life cycle traceability service, a product quality traceability service, a product maintenance traceability service or a channel management traceability service.
[0015] Optionally, the determining a corresponding target traceability service identifier based on the target traceability product identifier and the target traceability service type includes:
[0016] Determine the corresponding target traceability product category based on the target traceability product identifier;
[0017] Based on the target traceability product category and the target traceability service type, the corresponding target traceability service identifier is determined.
[0018] Optionally, obtaining a first traceability result from a target external traceability platform through a smart contract and a oracle according to the target traceability service identifier, the target traceability product identifier, and the target traceability service type includes:
[0019] Triggering the smart contract corresponding to the target traceability service identifier, and determining the target external traceability platform from the external traceability platform set according to the target traceability service identifier;
[0020] Utilizing the oracle, the first traceability result is obtained from the traceability blockchain of the target external traceability platform according to the target traceability product identifier and the target traceability service type.
[0021] Optionally, also include:
[0022] If the target traceability service identifier belongs to the internal traceability blockchain, a second traceability result is obtained from the internal traceability blockchain according to the target traceability service identifier, the target traceability product identifier and the target traceability service type;
[0023] The second tracing result is returned in response to the tracing query request.
[0024] Optionally, the target user is specifically an individual registered user, a corporate registered user, an institutional registered user or a visitor user.
[0025] In a second aspect, an embodiment of the present application provides a device for aggregated traceability, which is applied to an aggregated traceability platform, and the device includes:
[0026] An acquisition unit is used to acquire a traceability query request of a target user through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type;
[0027] A determination unit, configured to determine a corresponding target traceability service identifier based on the target traceability product identifier and the target traceability service type;
[0028] A first obtaining unit is configured to obtain a first tracing result from a target external tracing platform through a smart contract and an oracle according to the target tracing service identifier, the target tracing product identifier, and the target tracing service type if the target tracing service identifier belongs to an external tracing platform set;
[0029] The first returning unit is configured to return the first tracing result in response to the tracing query request.
[0030] Optionally, the device further comprises:
[0031] A registration unit, configured to pre-register, for each traceability service, a traceability service identifier, a traceability product category, and a traceability service type corresponding to the traceability service in the aggregated traceability platform; the traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain;
[0032] An establishing unit is used to establish and store the corresponding relationship between the traceability service, the traceability service identifier, the traceability product category and the traceability service type.
[0033] Optionally, the traceability service type is specifically a full life cycle traceability service, a product quality traceability service, a product maintenance traceability service or a channel management traceability service.
[0034] Optionally, the determining unit includes:
[0035] A first determining subunit, configured to determine a corresponding target traceability product category based on the target traceability product identifier;
[0036] The second determining subunit is used to determine the corresponding target traceability service identifier based on the target traceability product category and the target traceability service type.
[0037] Optionally, the first obtaining unit includes:
[0038] A third determination subunit is used to trigger the smart contract corresponding to the target traceability service identifier, and determine the target external traceability platform from the external traceability platform set according to the target traceability service identifier;
[0039] The obtaining subunit is used to use the oracle to obtain the first traceability result from the traceability blockchain of the target external traceability platform according to the target traceability product identifier and the target traceability service type.
[0040] Optionally, the device further comprises:
[0041] A second obtaining module is used to obtain a second tracing result from the internal tracing blockchain according to the target tracing service identifier, the target tracing product identifier and the target tracing service type if the target tracing service identifier belongs to the internal tracing blockchain;
[0042] The second returning module is used to return the second tracing result in response to the tracing query request.
[0043] Optionally, the target user is specifically an individual registered user, a corporate registered user, an institutional registered user or a visitor user.
[0044] In a third aspect, an embodiment of the present application provides a terminal device, wherein the terminal device includes a processor and a memory:
[0045] The memory is used to store program code and transmit the program code to the processor;
[0046] The processor is used to execute the aggregation tracing method described in any one of the first aspects above according to the instructions in the program code.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the aggregation traceability method described in any one of the first aspects above.
[0048] Compared with the prior art, this application has at least the following advantages:
[0049] By adopting the technical solution of the embodiment of the present application, in the aggregated traceability platform, the target user's traceability query request including the target traceability product identification and the target traceability service type is obtained through the aggregated traceability query interface; based on the target traceability product identification and the target traceability service type, the corresponding target traceability service identification is determined; if the target traceability service identification belongs to the external traceability platform set, the first traceability result is obtained from the target external traceability platform through the smart contract and the oracle according to the target traceability service identification, the target traceability product identification and the target traceability service type; the first traceability result is returned in response to the traceability query request. It can be seen that the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and obtains traceability results from external traceability platforms through smart contracts and oracle machines, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging in to different traceability platforms for product traceability, and provide users with more convenient product traceability services. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 A schematic diagram of a system framework involved in an application scenario in an embodiment of the present application;
[0052] Figure 2 A flowchart of a method for tracing the source of an aggregate provided in an embodiment of the present application;
[0053] Figure 3 A flowchart of another aggregation tracing method provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of the structure of an aggregate traceability device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. 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 this field without creative work are within the scope of protection of this application.
[0056] At present, blockchain product traceability refers to the customized product traceability solutions provided by major manufacturers for specific products, which store the relevant information of the production, processing, transportation and other links of specific products on the chain, form a specific product traceability blockchain and store it on their own traceability platform, and users can obtain the traceability results of the products by scanning the product code. However, the inventors have found through research that it is difficult to achieve interconnection and sharing between product traceability blockchains on different traceability platforms, which easily forms traceability information islands; different traceability platforms have different traceability operations and different traceability standards and specifications, which makes it extremely inconvenient for users to log in to different traceability platforms to trace the product.
[0057] In order to solve this problem, in an embodiment of the present application, in an aggregated traceability platform, an aggregated traceability query interface is used to obtain a traceability query request of a target user including a target traceability product identifier and a target traceability service type; based on the target traceability product identifier and the target traceability service type, the corresponding target traceability service identifier is determined; if the target traceability service identifier belongs to an external traceability platform set, a first traceability result is obtained from the target external traceability platform through a smart contract and a oracle according to the target traceability service identifier, the target traceability product identifier and the target traceability service type; the first traceability result is returned in response to the traceability query request. It can be seen that the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and obtains traceability results from external traceability platforms through smart contracts and oracle machines, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging in to different traceability platforms for product traceability, and provide users with more convenient product traceability services.
[0058] For example, one of the scenarios of the embodiments of the present application may be applied to Figure 1 In the scenario shown. The scenario includes an aggregated traceability platform 101 and an external traceability platform set 102, wherein the external traceability platform set 102 includes multiple external traceability platforms. The user logs in to the aggregated traceability platform 101 to initiate a traceability query request, and the aggregated traceability platform 101 interacts with the external traceability platform set 102 to complete product traceability in the manner of the embodiment of the present application.
[0059] First, in the above application scenario, although the action description of the implementation method provided in the embodiment of the present application is executed by the aggregation traceability platform 101; however, the embodiment of the present application is not restricted in terms of the execution subject, as long as the actions disclosed in the implementation method provided in the embodiment of the present application are executed.
[0060] Secondly, the above scenario is only an example scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
[0061] The specific implementation of the aggregation traceability method and related devices in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0062] Exemplary Methods
[0063] See also Figure 2 , shows a flow chart of a method for aggregated tracing in an embodiment of the present application. In this embodiment, applied to an aggregated tracing platform, the method may include the following steps:
[0064] Step 201: Obtain a target user's traceability query request through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type.
[0065] Because it is difficult to achieve interconnection and sharing between product traceability blockchains of different traceability platforms in the current blockchain product traceability, it is easy to form traceability information islands; different traceability platforms have different traceability operations and different traceability standards and specifications, which makes it extremely inconvenient for users to log in to different traceability platforms for product traceability. Therefore, in an embodiment of the present application, the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and the aggregated traceability query interface is obtained by uniformly standardizing the traceability query interfaces of different traceability platforms. Through the aggregated traceability query interface, various traceability query requests can be received to obtain traceability results from different traceability platforms, so as to achieve the aggregation of different traceability platforms and provide users with more convenient product traceability services.
[0066] First, in the embodiment of the present application, in the above-mentioned aggregated traceability platform, it is necessary to pre-register the traceability service identifier corresponding to the traceability service provided by each different traceability platform that it aggregates. A traceability service identifier uniquely identifies a traceability service, and the traceability service can be divided into the internal traceability blockchain provided by the aggregated traceability platform itself or the external traceability platform outside the aggregated traceability platform. The traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain, and the aggregated traceability query interface connects the internal traceability blockchain of the aggregated traceability platform itself, as well as the external traceability platforms outside the aggregated traceability platform; in addition, the traceability product categories and traceability service types represented by different traceability services are different, and the traceability product categories and traceability service types corresponding to the traceability service need to be pre-registered; based on this, the corresponding relationship between the traceability service, the traceability service identifier, the traceability product category and the traceability service type is established and stored, so that the corresponding traceability service identifier can be found through the traceability product category and the traceability service type in the future, and then the corresponding traceability service can be found through the traceability service identifier. Therefore, in an optional implementation of the embodiment of the present application, the following steps may also be included:
[0067] Step A: In the aggregated traceability platform, for each traceability service, the traceability service identifier, traceability product category and traceability service type corresponding to the traceability service are pre-registered; the traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain.
[0068] Step B: Establish and store the correspondence between the traceability service, the traceability service identifier, the traceability product category and the traceability service type.
[0069] Among them, the traceability service type actually represents the user's traceability demand for the traceability product, which is usually the user's traceability demand for the entire life cycle, product quality, product maintenance, and channel management of the traceability product. Therefore, in an optional implementation of the embodiment of the present application, the traceability service type is specifically a full life cycle traceability service, a product quality traceability service, a product maintenance traceability service, or a channel management traceability service.
[0070] Then, in the embodiment of the present application, any user is the target user. When realizing product traceability, the target user logs in to the above-mentioned aggregated traceability platform and initiates a traceability query request through the aggregated traceability query interface. That is, the aggregated traceability query interface can obtain the traceability query request of the target user, and the traceability query request generally includes a target traceability product identifier that uniquely identifies the target traceability product and a target traceability service type that represents the target user's traceability demand for the target traceability product. The target traceability product identifier can be a unique identifier of a target traceability product or a unique identifier of a class of target traceability products.
[0071] The target user can be a user who has pre-registered on the aggregation and tracing platform, for example, a personal registered user, a corporate registered user, or an institutional registered user; or a visitor user who has not yet registered on the aggregation and tracing platform. Therefore, in an optional implementation of the embodiment of the present application, the target user is specifically a personal registered user, a corporate registered user, an institutional registered user, or a visitor user.
[0072] Step 202: Based on the target traceability product identifier and the target traceability service type, determine a corresponding target traceability service identifier.
[0073] In this embodiment of the present application, since the traceability query request obtained in step 201 includes the target traceability product identifier and the target traceability service type, after step 201, the correspondence between the traceability service, traceability service identifier, traceability product category and traceability service type stored in the above step B is searched through the target traceability product identifier and the target traceability service type, and the corresponding target traceability service identifier can be determined.
[0074] In the specific implementation process of step 202, first, based on the characteristic of the target traceability product identifier that uniquely identifies the target traceability product, the target traceability product identifier can be used to determine the category of the target traceability product, that is, the target traceability product category; then, through the target traceability product category and the target traceability service type, the corresponding relationship between the traceability service, traceability service identifier, traceability product category and traceability service type stored in the above step B is searched, and the corresponding target traceability service identifier can be determined, so that the corresponding traceability service can be found according to the target traceability service identifier later. Therefore, in an optional implementation of the embodiment of the present application, the step 202 may, for example, include the following steps:
[0075] Step C: determining the corresponding target traceability product category based on the target traceability product identifier;
[0076] Step D: Based on the target traceability product category and the target traceability service type, determine the corresponding target traceability service identifier.
[0077] Step 203: If the target traceability service identifier belongs to the external traceability platform set, a first traceability result is obtained from the target external traceability platform through a smart contract and an oracle according to the target traceability service identifier, the target traceability product identifier and the target traceability service type.
[0078] In the embodiment of the present application, after determining the target traceability service identifier in step 202, it is necessary to determine whether the target traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain. When the target traceability service identifier belongs to the external traceability platform set, it means that the traceability service corresponding to the target traceability service identifier is provided by the target external traceability platform outside the aggregated traceability platform. At this time, in order to obtain the traceability result from the target external traceability platform, the aggregated traceability platform needs to connect with the target external traceability platform through the mechanism of smart contract-oracle, retrieve the first traceability result in the target external traceability platform and return it to the aggregated traceability platform.
[0079] During the specific implementation of step 203, first, it is necessary to find the target external tracing platform corresponding to the target tracing service identifier from the external tracing platform set, that is, trigger the corresponding smart contract through the target tracing service identifier, and determine the external tracing platform corresponding to the target tracing service identifier in the external tracing platform set as the target external tracing platform; then, obtain the first tracing result from the determined target external tracing platform, that is, connect the target external tracing platform through the oracle, and perform product tracing according to the target tracing product identifier and the target tracing service type on the tracing blockchain of the target external tracing platform, and obtain the first tracing result and return it to the aggregated tracing platform. Therefore, in an optional implementation of the embodiment of the present application, step 203 may, for example, include the following steps:
[0080] Step E: triggering the smart contract corresponding to the target traceability service identifier, and determining the target external traceability platform from the external traceability platform set according to the target traceability service identifier;
[0081] Step F: Using the oracle, according to the target traceability product identifier and the target traceability service type, obtain the first traceability result from the traceability blockchain of the target external traceability platform.
[0082] Step 204: Return the first traceability result in response to the traceability query request.
[0083] In the embodiment of the present application, after obtaining the first tracing result in step 203, the aggregation tracing platform also needs to return the first tracing result to the target user; that is, the first tracing result needs to be returned in response to the tracing query request.
[0084] Of course, after step 202 is determined, the result of judging whether the target traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain is that when the target traceability service identifier belongs to the internal blockchain, it means that the traceability service corresponding to the target traceability service identifier is provided by the internal traceability blockchain of the aggregated traceability platform itself. At this time, corresponding to steps 203-204, it is necessary to first obtain the second traceability result on the internal traceability blockchain through the target traceability service identifier, the target traceability product identifier and the target traceability service type and return it to the aggregated traceability platform; then return the second traceability result to the target user; that is, it is necessary to return the second traceability result in response to the traceability query request. Therefore, in an optional implementation of the embodiment of the present application, the following steps may also be included after step 202, for example:
[0085] Step G: If the target traceability service identifier belongs to the internal traceability blockchain, obtain a second traceability result from the internal traceability blockchain according to the target traceability service identifier, the target traceability product identifier and the target traceability service type;
[0086] Step H: Return the second tracing result in response to the tracing query request.
[0087] Through the various implementation methods provided in this embodiment, in the aggregated traceability platform, the target user's traceability query request including the target traceability product identification and the target traceability service type is obtained through the aggregated traceability query interface; based on the target traceability product identification and the target traceability service type, the corresponding target traceability service identification is determined; if the target traceability service identification belongs to the external traceability platform set, the first traceability result is obtained from the target external traceability platform through the smart contract and the oracle according to the target traceability service identification, the target traceability product identification and the target traceability service type; the first traceability result is returned in response to the traceability query request. It can be seen that the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and obtains traceability results from external traceability platforms through smart contracts and oracle machines, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging in to different traceability platforms for product traceability, and provide users with more convenient product traceability services.
[0088] See also Figure 3 , shows a flow chart of another method for aggregate tracing in an embodiment of the present application. In this embodiment, the method may include the following steps:
[0089] Step 301: Obtain a target user's traceability query request through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type.
[0090] In an optional implementation of the embodiment of the present application, the method further includes:
[0091] In the aggregated traceability platform, for each traceability service, the traceability service identifier, traceability product category and traceability service type corresponding to the traceability service are pre-registered; the traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain;
[0092] A correspondence between the traceability service, the traceability service identifier, the traceability product category and the traceability service type is established and stored.
[0093] In an optional implementation of the embodiment of the present application, the traceability service type is specifically a full life cycle traceability service, a product quality traceability service, a product maintenance traceability service or a channel management traceability service.
[0094] In an optional implementation of the embodiment of the present application, the target user is specifically an individual registered user, a corporate registered user, an institutional registered user or a visitor user.
[0095] Step 302: Based on the target traceability product identifier and the target traceability service type, determine the corresponding target traceability service identifier; if the target traceability service identifier belongs to the external traceability platform set, execute steps 303-304; if the target traceability service identifier belongs to the internal traceability blockchain, execute steps 305-306.
[0096] In an optional implementation of the embodiment of the present application, step 302 includes:
[0097] Determine the corresponding target traceability product category based on the target traceability product identifier;
[0098] Based on the target traceability product category and the target traceability service type, the corresponding target traceability service identifier is determined.
[0099] Step 303: Obtain a first traceability result from a target external traceability platform through a smart contract and an oracle according to the target traceability service identifier, the target traceability product identifier, and the target traceability service type.
[0100] In an optional implementation of the embodiment of the present application, step 303 includes:
[0101] Triggering the smart contract corresponding to the target traceability service identifier, and determining the target external traceability platform from the external traceability platform set according to the target traceability service identifier;
[0102] Utilizing the oracle, the first traceability result is obtained from the traceability blockchain of the target external traceability platform according to the target traceability product identifier and the target traceability service type.
[0103] Step 304: Return the first traceability result in response to the traceability query request.
[0104] Step 305: Obtain a second traceability result from the internal traceability blockchain according to the target traceability service identifier, the target traceability product identifier, and the target traceability service type.
[0105] Step 306: Return the second tracing result in response to the tracing query request.
[0106] Through the various implementation methods provided in this embodiment, in the aggregated traceability platform, the target user's traceability query request including the target traceability product identification and the target traceability service type is obtained through the aggregated traceability query interface; based on the target traceability product identification and the target traceability service type, the corresponding target traceability service identification is determined; if the target traceability service identification belongs to the external traceability platform set, the first traceability result is obtained from the target external traceability platform through the smart contract and the oracle according to the target traceability service identification, the target traceability product identification and the target traceability service type; the first traceability result is returned in response to the traceability query request. It can be seen that the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and obtains traceability results from external traceability platforms through smart contracts and oracle machines, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging in to different traceability platforms for product traceability, and provide users with more convenient product traceability services.
[0107] Exemplary Devices
[0108] See also Figure 4 , shows a schematic diagram of the structure of an aggregated traceability device in an embodiment of the present application. In this embodiment, applied to an aggregated traceability platform, the device may specifically include:
[0109] An acquisition unit 401 is used to acquire a traceability query request of a target user through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type;
[0110] A determination unit 402 is used to determine a corresponding target traceability service identifier based on the target traceability product identifier and the target traceability service type;
[0111] A first obtaining unit 403 is configured to obtain a first tracing result from a target external tracing platform through a smart contract and an oracle according to the target tracing service identifier, the target tracing product identifier, and the target tracing service type if the target tracing service identifier belongs to an external tracing platform set;
[0112] The first returning unit 404 is configured to return the first tracing result in response to the tracing query request.
[0113] In an optional implementation manner of the embodiment of the present application, the device further includes:
[0114] A registration unit, configured to pre-register, for each traceability service, a traceability service identifier, a traceability product category, and a traceability service type corresponding to the traceability service in the aggregated traceability platform; the traceability service identifier belongs to the external traceability platform set or the internal traceability blockchain;
[0115] An establishing unit is used to establish and store the corresponding relationship between the traceability service, the traceability service identifier, the traceability product category and the traceability service type.
[0116] In an optional implementation of the embodiment of the present application, the traceability service type is specifically a full life cycle traceability service, a product quality traceability service, a product maintenance traceability service or a channel management traceability service.
[0117] In an optional implementation of the embodiment of the present application, the determining unit 402 includes:
[0118] A first determining subunit, configured to determine a corresponding target traceability product category based on the target traceability product identifier;
[0119] The second determining subunit is used to determine the corresponding target traceability service identifier based on the target traceability product category and the target traceability service type.
[0120] In an optional implementation of the embodiment of the present application, the first obtaining unit 403 includes:
[0121] A third determination subunit is used to trigger the smart contract corresponding to the target traceability service identifier, and determine the target external traceability platform from the external traceability platform set according to the target traceability service identifier;
[0122] The obtaining subunit is used to use the oracle to obtain the first traceability result from the traceability blockchain of the target external traceability platform according to the target traceability product identifier and the target traceability service type.
[0123] In an optional implementation manner of the embodiment of the present application, the device further includes:
[0124] A second obtaining module is used to obtain a second tracing result from the internal tracing blockchain according to the target tracing service identifier, the target tracing product identifier and the target tracing service type if the target tracing service identifier belongs to the internal tracing blockchain;
[0125] The second returning module is used to return the second tracing result in response to the tracing query request.
[0126] In an optional implementation of the embodiment of the present application, the target user is specifically an individual registered user, a corporate registered user, an institutional registered user or a visitor user.
[0127] Through the various implementation methods provided in this embodiment, in the aggregated traceability platform, the target user's traceability query request including the target traceability product identification and the target traceability service type is obtained through the aggregated traceability query interface; based on the target traceability product identification and the target traceability service type, the corresponding target traceability service identification is determined; if the target traceability service identification belongs to the external traceability platform set, the first traceability result is obtained from the target external traceability platform through the smart contract and the oracle according to the target traceability service identification, the target traceability product identification and the target traceability service type; the first traceability result is returned in response to the traceability query request. It can be seen that the aggregated traceability platform provides an aggregated traceability query interface for uniformly receiving traceability query requests, and obtains traceability results from external traceability platforms through smart contracts and oracle machines, which can aggregate different traceability platforms to effectively avoid the phenomenon of users logging in to different traceability platforms for product traceability, and provide users with more convenient product traceability services.
[0128] In addition, an embodiment of the present application further provides a terminal device, wherein the terminal device includes a processor and a memory:
[0129] The memory is used to store program code and transmit the program code to the processor;
[0130] The processor is used to execute the aggregation tracing method described in the above method embodiment according to the instructions in the program code.
[0131] An embodiment of the present application also provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the aggregation traceability method described in the above method embodiment.
[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0134] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0135] The above is only a preferred embodiment of the present application and does not constitute any formal limitation to the present application. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present application using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still fall within the scope of protection of the technical solution of the present application.
Claims
1. A method for aggregate tracing, characterized in that: Applied to the aggregation traceability platform, including: In the aggregated traceability platform, the traceability service identifier, traceability product category and traceability service type corresponding to each traceability service are pre-registered; the traceability service identifier belongs to an external traceability platform set or an internal traceability blockchain; Establishing and storing the correspondence between the traceability service, the traceability service identifier, the traceability product category and the traceability service type; Obtaining a target user's traceability query request through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type; the target traceability product identifier is used to determine the target traceability product category; Based on the target traceability product identifier and the target traceability service type, determining a corresponding target traceability service identifier; If the target traceability service identifier belongs to the external traceability platform set, a first traceability result is obtained from the target external traceability platform through a smart contract and a oracle according to the target traceability service identifier, the target traceability product identifier and the target traceability service type; The first tracing result is returned in response to the tracing query request.
2. The method according to claim 1, characterized in that The traceability service types specifically include full life cycle traceability service, product quality traceability service, product maintenance traceability service or channel management traceability service.
3. The method according to claim 1, characterized in that The determining, based on the target traceability product identifier and the target traceability service type, a corresponding target traceability service identifier includes: Determine the corresponding target traceability product category based on the target traceability product identifier; Based on the target traceability product category and the target traceability service type, the corresponding target traceability service identifier is determined.
4. The method according to claim 1, characterized in that The method of obtaining a first traceability result from a target external traceability platform through a smart contract and a oracle according to the target traceability service identifier, the target traceability product identifier, and the target traceability service type includes: Triggering the smart contract corresponding to the target traceability service identifier, and determining the target external traceability platform from the external traceability platform set according to the target traceability service identifier; Utilizing the oracle, the first traceability result is obtained from the traceability blockchain of the target external traceability platform according to the target traceability product identifier and the target traceability service type.
5. The method according to claim 1, characterized in that Also includes: If the target traceability service identifier belongs to the internal traceability blockchain, a second traceability result is obtained from the internal traceability blockchain according to the target traceability service identifier, the target traceability product identifier and the target traceability service type; The second tracing result is returned in response to the tracing query request.
6. The method according to claim 1, characterized in that The target user is specifically a personal registered user, a corporate registered user, an institutional registered user or a visitor user.
7. A device for aggregate tracing, characterized in that: Applied to the aggregation traceability platform, including: A registration unit, used to pre-register, for each traceability service, a traceability service identifier, a traceability product category, and a traceability service type corresponding to the traceability service in the aggregated traceability platform; the traceability service identifier belongs to an external traceability platform set or an internal traceability blockchain; An establishing unit, configured to establish and store a correspondence between the traceability service, the traceability service identifier, the traceability product category, and the traceability service type; An acquisition unit, configured to acquire a target user's traceability query request through an aggregated traceability query interface; the traceability query request includes a target traceability product identifier and a target traceability service type; the target traceability product identifier is used to determine a target traceability product category; A determination unit, configured to determine a corresponding target traceability service identifier based on the target traceability product identifier and the target traceability service type; A first obtaining unit is configured to obtain a first tracing result from a target external tracing platform through a smart contract and an oracle according to the target tracing service identifier, the target tracing product identifier, and the target tracing service type if the target tracing service identifier belongs to the external tracing platform set; The first returning unit is configured to return the first tracing result in response to the tracing query request.
8. A terminal device, characterized in that: The terminal device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the aggregation tracing method described in any one of claims 1-6 according to the instructions in the program code.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the aggregation traceability method described in any one of claims 1-6.
Citation Information
Patent Citations
Processing method of product traceability identification and its device
CN106355415A
Commodity tracing method and system based on blockchains
CN108305083A