Logistics single-flow traceability method and system, electronic device, and storage medium
By generating a global tracking identifier during the logistics order transfer process and writing the data into the consortium blockchain, the problems of data tampering and traceability during the logistics order transfer process are solved. This achieves the immutable storage of transfer data and the authenticity of responsibility, ensuring efficient traceability and link tracking.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MACAU INTERNET MEDIA DEV CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-29
AI Technical Summary
The logistics order transfer process suffers from data silos, high risk of tampering, and difficulty in tracing the source, especially in the case of order transfer, where there are problems of shirking responsibility and broken track.
By generating a global tracking identifier and writing core data into the consortium blockchain, and combining the decentralized and hash encryption characteristics of blockchain, the system achieves tamper-proof storage and real-time tracking of logistics orders, and records the global tracking identifier, transfer timestamp, and change information of responsible parties for order transfer events.
It achieves tamper-proof storage of logistics order transfer data, ensuring the authenticity of the responsible party, avoiding shirking of responsibility, and realizing efficient traceability and real-time link tracking.
Smart Images

Figure CN122114770A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data resource service technology, and in particular to a logistics single-transfer traceability method, system, electronic device and storage medium. Background Technology
[0002] With the rapid development of e-commerce and logistics, the flow of logistics orders involves multiple participants, including shippers, logistics carriers, warehousing nodes, and recipients. The flow data is scattered and stored in the information systems of each participant, resulting in problems such as data silos, high risk of tampering, and difficulty in traceability. Especially in logistics order transfer scenarios, such as dedicated delivery to crowdsourcing or dedicated delivery to foot delivery (delivery on foot due to geographical limitations), there is a lack of unified records and evidence for data such as the triggering conditions for order transfer, changes in the responsible parties before and after the transfer, and the status connection of the transfer nodes. This can easily lead to problems such as shirking responsibility and broken order transfer trajectories. Summary of the Invention
[0003] This invention aims to solve at least one of the technical problems existing in the prior art. To this end, this invention proposes a method, system, electronic device, and storage medium for tracing the flow of logistics orders, which can realize the immutable storage of logistics order transfer data, real-time link tracking, and efficient traceability.
[0004] In a first aspect, embodiments of the present invention provide a logistics single-transfer traceability method, including: In response to the creation operation of a logistics order, a logistics order number and a global tracking identifier are generated and associated and stored, and a creation event containing the logistics order number, the global tracking identifier, the creation timestamp, and the initial responsible party is published through the event bus; The core data of the creation event is written into the consortium blockchain through the blockchain adaptation service, and the global tracking identifier is associated with the corresponding transaction hash and stored in the cache database, and the creation event is recorded in the distributed tracing log. During the transfer process of the logistics order, a transfer event containing the global tracking identifier, transfer timestamp, and change of responsible entity information is published. The core data of the transfer event is written into the consortium blockchain through the blockchain adaptation service, the associated data in the cache database is updated, and the link tracking log is recorded. In response to a responsibility traceability query command containing a tracking number and a target time, a corresponding global tracking identifier is determined based on the tracking number, and the responsible party is determined based on the global tracking identifier and the target time.
[0005] According to some embodiments of the present invention, during the transfer process of the logistics order, a transfer event including the global tracking identifier, transfer timestamp, and change of responsible entity information is published. This is to write the core data of the transfer event into the consortium blockchain through the blockchain adaptation service, update the associated data in the cache database, and record the link tracing log, including: During the business flow of the logistics order, when the transfer conditions are met, a transfer initiation event is published, which includes the global tracking identifier, the transfer initiation timestamp, and the current responsible entity. The core data of the transfer initiation event is written into the consortium blockchain through the blockchain adaptation service, the associated data in the cache database is updated, and the link tracking log is recorded.
[0006] According to some embodiments of the present invention, during the transfer process of the logistics order, a transfer event including the global tracking identifier, transfer timestamp, and change of responsible entity information is published to write the core data of the transfer event into the consortium blockchain through the blockchain adaptation service, update the associated data in the cache database, and record the link tracing log. This further includes: In response to the order transfer confirmation operation, an order transfer confirmation event is published, which includes the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, and the current responsible party. The core data of the order transfer confirmation event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracing log is recorded.
[0007] According to some embodiments of the present invention, when the order transfer conditions are met, publishing an order transfer initiation event including the global tracking identifier, the order transfer initiation timestamp, and the current responsible entity further includes: When the order transfer conditions are met, a transfer initiation event is published, which includes the global tracking identifier, the order transfer initiation timestamp, the current responsible entity, the order transfer conditions, and the delivery type change plan information.
[0008] The response to the order transfer confirmation operation, which publishes an order transfer confirmation event including the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, and the current responsible party, also includes: In response to the order transfer confirmation operation, a order transfer confirmation event is published, which includes the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, the current responsible party, and the current delivery type.
[0009] According to some embodiments of the present invention, during the transfer process of the logistics order, a transfer event including the global tracking identifier, transfer timestamp, and change of responsible entity information is published to write the core data of the transfer event into the consortium blockchain through the blockchain adaptation service, update the associated data in the cache database, and record the link tracing log. This further includes: When a transfer fails, a transfer failure event is published, which includes the global tracking identifier, the transfer failure timestamp, the current responsible party, and the reason for the transfer failure. The core data of the transfer failure event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracing log is recorded.
[0010] According to some embodiments of the present invention, the logistics single-transfer traceability method further includes: During the business flow of the logistics order, when the business operation is completed, a business event is triggered, which includes the global tracking identifier, the completion timestamp, and the current responsible entity. The core data of the business event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded.
[0011] According to some embodiments of the present invention, the logistics single-transfer traceability method further includes: In response to a link traceability query command containing a logistics tracking number or a global tracking identifier, the complete business flow link is obtained from and displayed on the consortium blockchain based on the logistics tracking number or the global tracking identifier.
[0012] Secondly, embodiments of the present invention provide a logistics single-transfer traceability and tracking device, comprising: The creation module is used to respond to the creation operation of a logistics order, generate a logistics order number and a global tracking identifier and store them together, and publish a creation event containing the logistics order number, the global tracking identifier, the creation timestamp and the initial responsible party through the event bus; The on-chain service module is used to write the core data of the creation event into the consortium blockchain through the blockchain adaptation service, associate the global tracking identifier with the corresponding transaction hash and store it in the cache database, and record the creation event in the distributed tracing log. The order transfer service module is used to publish an order transfer event containing the global tracking identifier, order transfer timestamp, and change of responsible entity information during the order transfer process of the logistics order. The core data of the order transfer event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded. The traceability query module is used to respond to a responsibility traceability query command containing a logistics tracking number and a target time, determine the corresponding global tracking identifier based on the logistics tracking number, and determine the responsible party based on the global tracking identifier and the target time.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to implement the above-mentioned logistics single-transfer traceability method.
[0014] Fourthly, embodiments of the present invention provide a storage medium storing a computer program, which, when run, implements the above-described logistics single-transfer traceability method.
[0015] The embodiments of the present invention have at least the following beneficial effects: During the creation phase of a logistics order, a corresponding global tracking identifier is assigned, and core data is written into the consortium blockchain. The decentralized and hash-encrypted characteristics of the blockchain prevent data tampering. During the order transfer process, core data such as the global tracking identifier of the transfer event, the transfer timestamp, and the change information of the responsible party are written into the consortium blockchain. The associated data in the cache database is updated, and the link tracking log is recorded. When traceability is required, the responsible party is determined based on the global tracking identifier and the target time. This achieves tamper-proof storage of logistics order transfer data, real-time link tracking, and efficient traceability, ensuring the authenticity of the responsible party in the transfer and avoiding the shirking of responsibility.
[0016] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0017] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating the steps of the logistics single-transfer traceability method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the logistics single-transfer traceability and tracking device according to an embodiment of the present invention; Figure 3 This is a schematic block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," "exceeding," etc. are understood to exclude the stated number, and "above," "below," "within," etc. are understood to include the stated number. If "first," "second," etc. are used in the description, they are only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of the indicated technical features.
[0020] To achieve traceability of logistics order flow, a microservice cluster covering the entire logistics order process is built based on Spring Cloud. Microservices are an architectural style that emphasizes dividing large and complex system functions into a series of small, independent services based on business needs. Each service focuses on meeting a specific business requirement and can be independently deployed, run, and scaled. Spring Cloud provides a complete set of tools and components needed for microservice development, facilitating the construction and management of microservice applications. In this embodiment, the microservices in the cluster include logistics order creation service, warehousing and receiving service, transportation scheduling service, last-mile delivery service, order transfer management service, and receipt confirmation service. Among them, the order transfer management service handles the relevant business logic of logistics order transfer, including order transfer condition judgment (such as insufficient dedicated delivery capacity or delivery range exceeding the dedicated delivery coverage), order transfer type matching (such as dedicated delivery to crowdsourcing or dedicated delivery to foot delivery), change of responsible party for order transfer (such as merchant, platform, delivery personnel, or customer), and reassignment of delivery tasks after order transfer.
[0021] Each microservice communicates via a REST API or gRPC protocol. The microservice cluster also integrates a distributed tracing system, such as Spring Cloud Sleuth or Zipkin. Sleuth generates and propagates tracing data within the microservice applications, while Zipkin provides a data collection, storage, and visualization interface. Together, they achieve distributed tracing. In this embodiment, Sleuth assigns a unique global tracking identifier (TraceId) to each logistics order and maintains this identifier during the order transfer process. Only new span identifiers (spanId) are generated for calls to the order transfer management service, ensuring that the order transfer process is integrated into the original logistics order flow, forming a complete tracing log of "creation-flow-transfer-reflow-receipt," which is uploaded in real-time to a distributed log system (such as a Zipkin server), supporting visualized querying of the flow.
[0022] In addition to building the microservice architecture for logistics orders, an event bus is also built based on Spring Cloud Stream. Each microservice application is configured with corresponding business events, such as the logistics order creation event (WaybillCreatedEvent), goods storage event (GoodsStoredEvent), transportation start event (TransportStartedEvent), delivery arrival event (DeliveryArrivedEvent), and logistics order signature event (WaybillSignedEvent). Furthermore, to achieve detailed recording of the order transfer process, relevant order transfer event types are configured. WaybillTransferInitiatedEvent: Triggered when the order transfer management service determines that an order transfer is required, it is used to record the order transfer initiation conditions, the original delivery type (such as dedicated delivery), the proposed delivery type (such as crowdsourcing or foot delivery), the order transfer initiation timestamp, and the initiating entity identifier (original responsible entity or current responsible entity). WaybillTransferConfirmedEvent: Triggered after a new delivery entity (such as a crowdsourced rider or foot deliveryman) receives a Waybill transfer task. It is used to record the new delivery type, the new delivery entity identifier (new responsible entity or current responsible entity), the Waybill transfer confirmation timestamp, and the Waybill transfer task receipt voucher. WaybillTransferFailedEvent: Triggered when an exception occurs during the order transfer process (such as no crowdsourced rider accepting the order or order transfer information verification failure). It is used to record the reason for the order transfer failure, the number of retries, and the failure timestamp.
[0023] After completing their respective business operations, each microservice triggers a corresponding event and sends it to the event bus. The event bus forwards the event to the blockchain adaptation service (the client of the consortium blockchain platform). Using the software development kit (SDK) provided by the consortium blockchain platform, the core data in the event is encapsulated into a blockchain transaction and written into the consortium blockchain to ensure data immutability. Simultaneously, the blockchain transaction hash and global tracking identifier are associated and stored in a cache database (such as Redis) for easy locating of relevant blockchain data during subsequent traceability queries. Alternatively, the transaction hash, global tracking identifier, and event identifier of the business event can also be associated and stored together in the cache database.
[0024] Furthermore, the participants involved in the logistics order flow, including the shipper, logistics carrier, warehousing provider, consignee, and various delivery entities (such as dedicated delivery teams, crowdsourcing platforms, and foot delivery stations), are treated as nodes in the consortium blockchain. Each node possesses an independent digital certificate, and transaction consensus is achieved through the consortium blockchain's consensus mechanism (such as RAFT or PBFT), ensuring the consistency and security of the data on the chain. Additionally, a smart contract for logistics order data is defined in the consortium blockchain, defining the following method logic: adding logistics order data (addWaybillData), querying logistics order data based on the global tracking identifier (queryWaybillDataByTraceId), and verifying the authenticity of logistics order data (verifyWaybillData). Furthermore, the following method logic is specifically configured for transferred order data: Add WaybillTransferData to write the core data of the Waybill transfer event into the consortium blockchain and associate it with the global tracking identifier of the logistics order and the event identifier of the Waybill transfer event; The queryWaybillTransferDataByTraceId function retrieves transfer data based on the global tracking identifier. This function returns all transfer event data for the corresponding logistics order based on the input global tracking identifier, including transfer initiation events, transfer confirmation events, and transfer failure events. VerifyWaybillTransferResponsibility: This function compares the on-chain transfer data with the input tracking number and target time to confirm the responsible party at the target time point, thus avoiding shirking responsibility.
[0025] To facilitate source tracing and querying, three query methods for order transfer source tracing can be configured through the source tracing query service: Link tracing query: Based on the tracking number or global tracking identifier entered by the user, it retrieves the corresponding complete link log from a distributed link log system (such as a Zipkin server) and visualizes the original logistics path, as well as annotating relevant information of the transfer process, such as the span identifier (spanId), the call time of the transfer management service, and one or more time intervals from transfer initiation to confirmation, clearly presenting the link connection process of "original delivery service - transfer management service - new delivery service"; In particular, during the generation stage of the tracking number, the tracking number and the global tracking identifier can be associated and stored in a database (such as a MySQL database). When the user enters the tracking number, the tracking number is converted into the global tracking identifier by looking up the table.
[0026] Blockchain traceability query: Based on the logistics order number or global tracking identifier entered by the user, it retrieves the associated blockchain transaction hash from the cache database, and then calls the relevant methods of the consortium blockchain smart contract (such as queryWaybillTransferDataByTraceId) to read the full process data of the corresponding logistics order from the consortium blockchain. Order transfer responsibility verification query: This function is used to call relevant methods of the consortium blockchain smart contract (such as verifyWaybillTransferResponsibility) based on the logistics order number and specific target time node entered by the user, extract the order transfer data before and after the target time node from the consortium blockchain, and return the responsible party at that time. For example, at 14:30, the logistics order is in the confirmation stage of special delivery to crowdsourcing, and the responsible party is crowdsourcing rider XXX (number 9527).
[0027] Please refer to Figure 1 Based on the aforementioned distributed system, this embodiment discloses a logistics single-transfer traceability method, including steps S100 to S400. It should be noted that the numbering of the steps in this embodiment is only for ease of review and understanding, and not to limit the execution order of the steps. The details of each step are described below: S100: In response to the creation operation of the logistics order, generate the logistics order number and global tracking identifier and store them together, and publish a creation event containing the logistics order number, global tracking identifier, creation timestamp and initial responsible entity through the event bus; For example, during the creation phase of a logistics order, the user submits logistics order information through a front-end interactive interface, triggering the creation operation. The logistics order creation service responds to this operation by generating a logistics order number and a global tracking identifier, which are then stored in a cache database (such as Redis). For the business flow of logistics orders, the logistics order number can only identify the business entity and cannot express the process context information. Therefore, assigning an independent global tracking identifier to each business entity corresponding to a logistics order number during each state change process, and maintaining the consistent propagation of the global tracking identifier throughout the entire chain of event generation, transmission, storage, and on-chain evidence storage, facilitates the logical atomicity encapsulation and causal verifiable traceability of distributed business operations. In the observability standard of distributed tracing systems, an end-to-end request is modeled as a Trace-Span model. A Trace represents a complete business process instance, possessing a globally unique global trace identifier, shared by all services participating in the request. A Span represents an operation unit executed by a service or component within the business process. Each Span is uniquely identified by a SpanId and includes a parent SpanId to reflect the call hierarchy, forming a tree structure. In this embodiment, the creation event includes the tracking number, global trace identifier, creation timestamp, and initial responsible party (e.g., shipper identifier). The core data of the creation event can be transmitted via the event bus. In some application examples, the core data is hashed using SHA-256 hashing, and then the core data and its corresponding hash are included in the creation event for transmission, thereby improving the security and reliability of data flow.
[0028] S200: The core data of the creation event is written into the consortium blockchain through the blockchain adaptation service, and the global tracking identifier is associated with the corresponding transaction hash and stored in the cache database, and the creation event is recorded in the distributed link tracing log. For example, the blockchain adaptation service acts as a client of the consortium blockchain, extracting core data from business events and writing it into the consortium blockchain. It should be understood that a consortium blockchain is a specific implementation of blockchain technology. The core data for creating an event includes the tracking number, global tracking identifier, creation timestamp, and initial responsible party. In some application examples, the core data for creating an event may also include a data hash generated through hash operations. By writing the core data into the consortium blockchain, the tamper-proof nature of the core data and its authenticity can be ensured. After the core data is written into the consortium blockchain, a corresponding transaction hash is generated. The global tracking identifier is associated with the corresponding transaction hash and stored in a cache database. This allows for quick determination of the corresponding transaction hash based on the global tracking identifier, thereby retrieving relevant data from the consortium blockchain, balancing data query efficiency and data reliability. Furthermore, recording the creation event in a distributed tracking log allows for detailed recording of the logistics document's flow process, facilitating subsequent traceability.
[0029] S300: During the transfer of a logistics order, a transfer event containing a global tracking identifier, a transfer timestamp, and information on changes in the responsible party is published. The core data of the transfer event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded. For example, the transfer process of a logistics order involves changes in the responsible party at different time points. Traditional technologies lack unified data recording and storage, resulting in broken transfer trajectories and potential issues of shirking responsibility among different responsible parties. In this embodiment, during the transfer process, when the transfer conditions are met, the transfer management service publishes a transfer event. The transfer event includes core data such as a global tracking identifier, a transfer timestamp, and information on changes in the responsible party. The transfer event is sent to the blockchain adaptation service via an event bus to write the core data of the transfer event into the consortium blockchain, update the associated data of the global tracking identifier and transaction hash in the cache database, and record the transfer event in a link tracing log, thereby ensuring the reliability of the transfer data.
[0030] S400: In response to a responsibility traceability query command containing a tracking number and a target time, determine the corresponding global tracking identifier based on the tracking number, and determine the responsible party based on the global tracking identifier and the target time.
[0031] For example, when disputes arise, it is usually necessary to determine the responsible party based on the timeline of the dispute. Users input the tracking number and target time through the front-end interface to send a responsibility tracing query command. The tracing query service responds to this command by determining the corresponding global tracking identifier based on the tracking number, for example, by querying the database using a table lookup method. Then, based on the global tracking identifier, it calls the relevant methods of the consortium blockchain smart contract (such as verifyWaybillTransferResponsibility) to determine the responsible party at the target time.
[0032] In this way, a corresponding global tracking identifier is assigned during the creation stage of the logistics order, and the core data is written into the consortium blockchain. Through the decentralized and hash encryption characteristics of the blockchain, data tampering is prevented. During the transfer process, the global tracking identifier of the transfer event, the transfer timestamp, and the information on changes in the responsible party are written into the consortium blockchain. The associated data in the cache database is updated, and the link tracking log is recorded. When traceability query is required, the responsible party is determined based on the global tracking identifier and the target time. This achieves tamper-proof storage of logistics order transfer data, real-time link tracking, and efficient traceability, ensuring the authenticity of the responsible party in the transfer and avoiding the shirking of responsibility.
[0033] Step S300: During the transfer of a logistics order, a transfer event containing a global tracking identifier, a transfer timestamp, and information on the change of responsible party is published. This is done by using a blockchain adaptation service to write the core data of the transfer event into the consortium blockchain, update the associated data in the cache database, and record the tracking log, including: During the business flow of logistics orders, when the conditions for order transfer are met, an order transfer initiation event is released, which includes a global tracking identifier, an order transfer initiation timestamp, and the current responsible entity. The core data of the order transfer initiation event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded.
[0034] For example, the order transfer process for logistics orders involves multiple stages, with changes in time points and responsible parties at different stages. To achieve automated and refined management, the order transfer management service monitors the business flow of logistics orders through a rule engine. When transfer conditions are met, such as no rider accepting a delivery order within 30 minutes, the order transfer management service publishes an order transfer initiation event and forwards it to the corresponding subscribed entity via the event bus. The order transfer initiation event includes a global tracking identifier, an order transfer initiation timestamp, and the current responsible party, which is the initiating entity of the order transfer event, such as the delivery dispatch center.
[0035] Step S300: During the transfer of a logistics order, a transfer event is published, including a global tracking identifier, a transfer timestamp, and information on the change of responsible party. This is done by using a blockchain adaptation service to write the core data of the transfer event into the consortium blockchain, update the associated data in the cache database, and record the tracking log. This also includes: In response to the order transfer confirmation operation, an order transfer confirmation event is published, which includes a global tracking identifier, an order transfer confirmation timestamp, historical responsible parties, and current responsible parties. This is done by writing the core data of the order transfer confirmation event into the consortium blockchain through the blockchain adaptation service, updating the related data in the cache database, and recording the link tracing log.
[0036] For example, after a transfer order initiation event is published, the last-mile delivery service (crowdsourcing platform) receives the transfer order initiation event and publishes the transfer order task. When a crowdsourced rider successfully accepts the order, the last-mile delivery service publishes a transfer order confirmation event. The transfer order confirmation event includes core data such as a global tracking identifier, a transfer order confirmation timestamp, the historical responsible party, and the current responsible party (new responsible party). The transfer order confirmation event is sent to the blockchain adaptation service through the event bus to write the core data of the transfer order confirmation event into the consortium blockchain, update the association data between the global tracking identifier and the consortium blockchain transaction hash in the cache database, and record the transfer order confirmation event in the link tracing log. In this way, the key links and corresponding time nodes of the change of responsible party in the transfer process can be recorded and written into the consortium blockchain to ensure that the data cannot be tampered with, to ensure the authenticity and reliability of the data, and to update the associated data in the cache database, which is conducive to improving the efficiency of data query. It should be noted that the query efficiency of the cache database is much higher than that of the consortium blockchain. By associating the global tracking identifier with the consortium blockchain transaction hash and storing them in the cache database, the transaction hash of the corresponding stage can be quickly queried on demand based on the global tracking identifier, thereby reducing the amount of data queried by the consortium blockchain and thus improving query efficiency.
[0037] In some application examples, the order transfer initiation event may also include the tracking number, delivery type change plan information, and one or more transfer conditions, thereby recording detailed data for the order transfer initiation event to provide more data for subsequent traceability queries. The delivery type change plan information includes the original delivery type (e.g., dedicated delivery) and the proposed transfer type (e.g., crowdsourcing). That is, the above steps—when the transfer conditions are met, publishing an order transfer initiation event containing a global tracking identifier, an order transfer initiation timestamp, and the current responsible entity—also include: When the conditions for order transfer are met, a transfer initiation event is published, which includes a global tracking identifier, a transfer initiation timestamp, the current responsible party, transfer conditions, and information on the change plan for delivery type.
[0038] Accordingly, the above steps, in response to the order transfer confirmation operation, include publishing an order transfer confirmation event containing a global tracking identifier, an order transfer confirmation timestamp, historical responsible parties, and current responsible parties, and also include: In response to an order transfer confirmation operation, a transfer confirmation event is published, which includes a global tracking identifier, an order transfer confirmation timestamp, the historical responsible party, the current responsible party, and the current delivery type.
[0039] In step S300 above, during the transfer of a logistics order, a transfer event is published, including a global tracking identifier, a transfer timestamp, and information on the change of responsible party. This is done by using a blockchain adaptation service to write the core data of the transfer event into the consortium blockchain, update the associated data in the cache database, and record the link tracking log. The process also includes: When a transfer fails, a transfer failure event is published, which includes a global tracking identifier, a transfer failure timestamp, the current responsible party, and the reason for the transfer failure. The core data of the transfer failure event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracing log is recorded.
[0040] For example, in the order transfer process, to ensure the timeliness of logistics order scheduling, the order transfer management service monitors the order transfer process through a rule engine. For instance, if no rider of the corresponding type accepts the order within 10 minutes of the order being initiated, the order transfer management service issues an order transfer failure event and forwards it to the blockchain adaptation service via the event bus. The order transfer failure event includes core data such as a global tracking identifier, an order transfer failure timestamp, the current responsible party, and the reason for failure. This allows the blockchain adaptation service to write the relevant core data into the consortium blockchain. After obtaining the transaction hash from the consortium blockchain, it updates the association data between the global tracking identifier and the transaction hash in the cache database and records the order transfer failure event in a link tracing log, thus recording the complete order transfer process for subsequent traceability queries.
[0041] In some application examples, logistics single-transfer traceability methods also include: During the business flow of a logistics order, when a business operation is completed, a business event is triggered, which includes a global tracking identifier, a completion timestamp, and the current responsible party. The core data of the business event is then written into the consortium blockchain through a blockchain adaptation service, the related data in the cache database is updated, and a link tracking log is recorded.
[0042] For example, after a logistics order is created, it flows through different business stages, such as warehousing and receiving, transportation scheduling, delivery arrival, and logistics order signing. In the warehousing and receiving stage, after the warehouse receiving service completes the corresponding business operations, it publishes a goods receiving event. The goods receiving event includes core data such as a global tracking identifier, a goods receiving timestamp, and the warehouse provider's identifier (i.e., the current responsible party). The goods receiving event is forwarded to the blockchain adaptation service via the event bus to write the core data of the goods receiving event into the consortium blockchain, update the related data in the cache database, and record the link tracing log. Similarly, for the transportation scheduling stage, after the transportation scheduling service completes its business operations, it publishes a transportation start event so that the core data of the transportation start event can be written into the consortium blockchain through the blockchain adaptation service, update the related data in the cache database, and record the link tracing log. In this way, the core data of events corresponding to different business stages can be written into the consortium blockchain, ensuring the authenticity and reliability of the data throughout the entire chain, and facilitating subsequent full-chain traceability queries.
[0043] In some application examples, logistics single-item flow traceability methods also include: In response to a traceability query command containing a logistics tracking number or a global tracking identifier, the complete business flow link is retrieved and displayed from the consortium blockchain based on the logistics tracking number or the global tracking identifier.
[0044] For example, when it's necessary to query detailed records of each stage of a logistics order's business flow, the user enters the logistics order number or global tracking identifier through the front-end interface to generate a link tracing query command. The tracing query service responds to the command, querying the corresponding business flow link based on the logistics order number or global tracking identifier. Specifically, based on the global tracking identifier, it queries the corresponding consortium blockchain transaction hash from the cache database and calls the relevant methods of the consortium blockchain's smart contract based on the transaction hash to read the full-process data of the corresponding logistics order from the consortium blockchain. Furthermore, relevant log records can be read from the distributed link system to display a complete link log. For the order transfer stage, additional annotations can be added, including the corresponding span identifier, the call time of the order transfer management service, and the time interval from order transfer initiation to order transfer confirmation, to clearly present the link connection between "original delivery service - order transfer management service - new delivery service".
[0045] Please refer to Figure 2 Based on the above technical concept, this embodiment provides a logistics single-transfer traceability and tracking device, including: The creation module 110 is used to respond to the creation operation of the logistics order, generate the logistics order number and global tracking identifier and store them together, and publish a creation event containing the logistics order number, global tracking identifier, creation timestamp and initial responsible entity through the event bus; The on-chain service module 120 is used to write the core data of the creation event into the consortium blockchain through the blockchain adaptation service, associate the global tracking identifier with the corresponding transaction hash and store it in the cache database, and record the creation event in the distributed link tracing log. The transfer service module 130 is used to publish transfer events containing global tracking identifiers, transfer timestamps, and information on changes in responsible parties during the transfer process of logistics orders. This allows the core data of the transfer events to be written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database to be updated, and the link tracking logs to be recorded. The traceability query module 140 is used to respond to a responsibility traceability query command containing a logistics tracking number and a target time, determine the corresponding global tracking identifier based on the logistics tracking number, and determine the responsible party based on the global tracking identifier and the target time.
[0046] The inventive concept of this logistics order traceability device embodiment is the same as that of the above-described logistics order traceability method embodiment. Contents not covered in this logistics order traceability device embodiment can be referred to in the above-described logistics order traceability method embodiment, and will not be repeated here. During the creation stage of the logistics order, a corresponding global tracking identifier is assigned, and core data is written into the consortium blockchain. The decentralized and hash-encrypted characteristics of the blockchain prevent data tampering. During the order transfer process, core data such as the global tracking identifier of the transfer event, the transfer timestamp, and the change information of the responsible party are written into the consortium blockchain. Related data in the cache database is updated, and link tracking logs are recorded. When traceability queries are needed, the responsible party is determined based on the global tracking identifier and the target time. This achieves immutable storage of logistics order transfer data, real-time link tracking, and efficient traceability, ensuring the authenticity of the responsible party and avoiding shirking of responsibility.
[0047] Please refer to Figure 3 This embodiment also provides an electronic device, including a processor 210 and a memory 220. The memory 220 stores a computer program, and the processor 210 runs the computer program to implement the above-mentioned logistics order flow traceability method. Detailed information on the logistics order flow traceability method can be found above and will not be repeated here. During the creation stage of the logistics order, a corresponding global tracking identifier is assigned, and core data is written into the consortium blockchain. The decentralized and hash-encrypted characteristics of the blockchain prevent data tampering. During the order transfer process, core data such as the global tracking identifier of the transfer event, the transfer timestamp, and the change information of the responsible party are written into the consortium blockchain. Related data in the cache database is updated, and link tracking logs are recorded. When traceability queries are needed, the responsible party is determined based on the global tracking identifier and the target time. This achieves immutable storage of logistics order transfer data, real-time link tracking, and efficient traceability, ensuring the authenticity of the responsible party and avoiding shirking of responsibility.
[0048] This embodiment also provides a storage medium storing a computer program. When the computer program is run, it implements the aforementioned logistics order flow traceability method. Details of the logistics order flow traceability method can be found above and will not be repeated here. During the creation phase of the logistics order, a corresponding global tracking identifier is assigned, and core data is written to the consortium blockchain. The decentralized and hash-encrypted characteristics of the blockchain prevent data tampering. During the order transfer process, core data such as the global tracking identifier of the transfer event, the transfer timestamp, and information on changes in the responsible party are written to the consortium blockchain. Related data in the cache database is updated, and link tracking logs are recorded. When traceability queries are needed, the responsible party is determined based on the global tracking identifier and the target time. This achieves immutable storage of logistics order transfer data, real-time link tracking, and efficient traceability, ensuring the authenticity of the responsible party and preventing shirking of responsibility.
[0049] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for tracing and tracking the flow of logistics orders, characterized in that, include: In response to the creation operation of a logistics order, a logistics order number and a global tracking identifier are generated and associated and stored, and a creation event containing the logistics order number, the global tracking identifier, the creation timestamp, and the initial responsible party is published through the event bus; The core data of the creation event is written into the consortium blockchain through the blockchain adaptation service, and the global tracking identifier is associated with the corresponding transaction hash and stored in the cache database, and the creation event is recorded in the distributed tracing log. During the transfer process of the logistics order, a transfer event containing the global tracking identifier, transfer timestamp, and change of responsible entity information is published. The core data of the transfer event is written into the consortium blockchain through the blockchain adaptation service, the associated data in the cache database is updated, and the link tracking log is recorded. In response to a responsibility traceability query command containing a tracking number and a target time, a corresponding global tracking identifier is determined based on the tracking number, and the responsible party is determined based on the global tracking identifier and the target time.
2. The logistics single-transfer traceability method according to claim 1, characterized in that, During the transfer process of the logistics order, a transfer event is published, including the global tracking identifier, transfer timestamp, and information on the change of responsible party. This is done by writing the core data of the transfer event into the consortium blockchain through the blockchain adaptation service, updating the associated data in the cache database, and recording the link tracking log, including: During the business flow of the logistics order, when the transfer conditions are met, a transfer initiation event is published, which includes the global tracking identifier, the transfer initiation timestamp, and the current responsible entity. The core data of the transfer initiation event is written into the consortium blockchain through the blockchain adaptation service, the associated data in the cache database is updated, and the link tracking log is recorded.
3. The logistics single-transfer traceability method according to claim 2, characterized in that, During the transfer process of the logistics order, a transfer event is published, including the global tracking identifier, transfer timestamp, and information on the change of responsible party. This is done so that the core data of the transfer event is written into the consortium blockchain via the blockchain adaptation service, the associated data in the cache database is updated, and a link tracking log is recorded. The process also includes: In response to the order transfer confirmation operation, an order transfer confirmation event is published, which includes the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, and the current responsible party. The core data of the order transfer confirmation event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracing log is recorded.
4. The logistics single-transfer traceability method according to claim 3, characterized in that, The step of publishing a transfer initiation event containing the global tracking identifier, the transfer initiation timestamp, and the current responsible entity when the transfer conditions are met also includes: When the order transfer conditions are met, a transfer initiation event is published, which includes the global tracking identifier, the order transfer initiation timestamp, the current responsible entity, the order transfer conditions, and the delivery type change plan information. The response to the order transfer confirmation operation, which publishes an order transfer confirmation event including the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, and the current responsible party, also includes: In response to the order transfer confirmation operation, a order transfer confirmation event is published, which includes the global tracking identifier, the order transfer confirmation timestamp, the historical responsible party, the current responsible party, and the current delivery type.
5. The logistics single-transfer traceability method according to claim 2, 3 or 4, characterized in that, During the transfer process of the logistics order, a transfer event is published, including the global tracking identifier, transfer timestamp, and information on the change of responsible party. This is done so that the core data of the transfer event is written into the consortium blockchain via the blockchain adaptation service, the associated data in the cache database is updated, and a link tracking log is recorded. The process also includes: When a transfer fails, a transfer failure event is published, which includes the global tracking identifier, the transfer failure timestamp, the current responsible party, and the reason for the transfer failure. The core data of the transfer failure event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracing log is recorded.
6. The logistics single-transfer traceability method according to claim 1, characterized in that, The logistics single-item flow traceability method also includes: During the business flow of the logistics order, when the business operation is completed, a business event is triggered, which includes the global tracking identifier, the completion timestamp, and the current responsible entity. The core data of the business event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded.
7. The logistics single-transfer traceability method according to claim 6, characterized in that, The logistics single-item flow traceability method also includes: In response to a link traceability query command containing a logistics tracking number or a global tracking identifier, the complete business flow link is obtained from and displayed on the consortium blockchain based on the logistics tracking number or the global tracking identifier.
8. A logistics single-transfer traceability and tracking device, characterized in that, include: The creation module is used to respond to the creation operation of a logistics order, generate a logistics order number and a global tracking identifier and store them together, and publish a creation event containing the logistics order number, the global tracking identifier, the creation timestamp and the initial responsible party through the event bus; The on-chain service module is used to write the core data of the creation event into the consortium blockchain through the blockchain adaptation service, associate the global tracking identifier with the corresponding transaction hash and store it in the cache database, and record the creation event in the distributed tracing log. The order transfer service module is used to publish an order transfer event containing the global tracking identifier, order transfer timestamp, and change of responsible entity information during the order transfer process of the logistics order. The core data of the order transfer event is written into the consortium blockchain through the blockchain adaptation service, the related data in the cache database is updated, and the link tracking log is recorded. The traceability query module is used to respond to a responsibility traceability query command containing a logistics tracking number and a target time, determine the corresponding global tracking identifier based on the logistics tracking number, and determine the responsible party based on the global tracking identifier and the target time.
9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, When the processor runs the computer program, it is used to implement the logistics single-transfer traceability method as described in any one of claims 1 to 7.
10. A storage medium storing a computer program, characterized in that, When the computer program is run, it implements the logistics single-transfer traceability method as described in any one of claims 1 to 7.