A logistics freight intelligent accounting method for e-commerce

By employing a dual-time-point anchoring mechanism and dynamic early warning thresholds, the problems of time misalignment and inaccurate forecasting in e-commerce logistics freight cost calculation have been resolved. Real-time deviation perception and automated intervention have been achieved, significantly improving the accuracy and efficiency of freight cost calculation.

CN123032431APending Publication Date: 2026-11-03WEIHAI OCEAN VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610972817.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-01
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

The discrepancy between the timing of accounting entries when e-commerce ERP ships goods and the timing of platform settlement leads to inaccurate monthly cost statistics. The complex and ever-changing rules for calculating logistics freight charges result in inaccurate estimates. Freight reconciliation relies on manual processes, which have a high error rate and cause delays in problem detection. Furthermore, there is a lack of real-time early warning and automated intervention capabilities.

Method used

A dual-time-point anchoring mechanism is adopted, which creates first and second anchor records at the time of shipment and settlement respectively. Combined with weighted deviation rate calculation and dynamic early warning threshold, it realizes real-time deviation perception and automated intervention, and uses blockchain for evidence storage to prevent tampering and automatically handles freight anomalies.

Benefits of technology

It enables full-process cost visualization from shipment to settlement, shortens the deviation detection delay to within 5 minutes, reduces the reconciliation error rate to 0.5%, recovers 60%-85% of potential losses caused by abnormal freight charges, and improves the success rate of appeals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123032431A_ABST
    Figure CN123032431A_ABST
Patent Text Reader

Abstract

The application discloses a kind of logistics freight intelligent accounting methods for e-commerce, it is related to e-commerce logistics technical field.The method of the application includes: first anchor point record is created and is block chain evidence in response to delivery operation creation;Second anchor point record is created in response to order settlement completion event;Weighted deviation rate is calculated based on double anchor points, the deviation rate integrates four factors of basic deviation, billing weight deviation, line complexity and time attenuation;Dynamic early warning threshold is calculated by sliding window weighted moving average;According to the ratio of deviation rate and threshold, trigger yellow card, orange card or three-level early warning;Matched intervention action is automatically executed, including instant messaging push, channel fuse, backup channel switching and blockchain appeal.The application changes freight reconciliation from month-end static activity to dynamic monitoring throughout the order life cycle, significantly reduces freight accounting error and abnormal loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of e-commerce logistics technology, and in particular to an intelligent method for calculating logistics costs for e-commerce. Background Technology

[0002] With the rapid development of e-commerce, logistics costs have become the second largest expense for e-commerce companies after product costs, typically accounting for 5%-15% of operating revenue. Accurately calculating logistics costs and effectively controlling costs are directly related to the profit level of e-commerce companies.

[0003] Currently, in the calculation of e-commerce logistics freight costs, the ERP systems of e-commerce companies, e-commerce platforms, and courier company systems operate independently. The ERP system typically estimates and records freight costs based on the agreed price when goods are shipped, while the e-commerce platform deducts the actual freight costs from the seller's account upon order completion or month-end settlement. This significant time discrepancy—typically 3 to 15 days between recording freight costs upon shipment and deducting them at settlement—leads to severely distorted monthly cost statistics. Existing technology lacks an effective mechanism to address this time discrepancy; finance personnel can only passively reconcile accounts when discrepancies are discovered at the end of the month, unable to intervene in freight cost anomalies in real time, often by which time the appeal period has expired.

[0004] Therefore, there is an urgent need for an intelligent logistics cost calculation method that can solve the time misalignment problem, achieve real-time deviation perception, and has automated intervention capabilities. To this end, an intelligent logistics cost calculation method for e-commerce is proposed. Summary of the Invention

[0005] The main objective of this invention is to provide an intelligent logistics cost calculation method for e-commerce, aiming to solve the following technical problems existing in the prior art: The discrepancy between the timing of accounting entries when the e-commerce ERP ships the goods and the timing of payment deductions when the platform settles accounts leads to inaccurate monthly cost statistics. The complex and ever-changing rules for calculating logistics freight costs, coupled with the inability of the ERP system to synchronize in real time, lead to inaccurate estimates. The problem of freight reconciliation relying on manual labor, having a high error rate, and being slow to detect problems; The problem lies in the lack of real-time alerts and automated intervention capabilities for orders with abnormal shipping costs.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A smart logistics cost calculation method for e-commerce is proposed. This method is based on two core mechanisms: "dual-time-point anchoring" and "dynamic deviation early warning," and specifically includes the following steps: Step S1: Creation and storage of the first anchor point record In response to the e-commerce order shipment operation, the system automatically creates the first anchor point record (T0 anchor point).

[0007] This record includes at least: order identifier, estimated shipping cost, estimated shipping weight, shipping timestamp, and logistics channel information. The estimated shipping cost is calculated by taking into account the agreed price, volumetric weight, remote area surcharges, and historical deviation correction factors.

[0008] To prevent data tampering in subsequent disputes, the first anchor record adopts a dual storage strategy: on the one hand, it is stored in a Redis cache with a 72-hour lifespan for real-time querying; on the other hand, the hash values ​​of the order identifier, estimated shipping cost, and shipping timestamp are uploaded to the blockchain evidence storage platform to obtain a judicially recognized evidence storage certificate.

[0009] Step S2: Second anchor point record capture and association In response to the order settlement completion event on the e-commerce platform, the system obtains the actual shipping cost and detailed breakdown information of the order through API, and creates a second anchor record (T1 anchor).

[0010] This record includes: order identifier, actual shipping cost, settlement timestamp, and detailed breakdown of costs (including basic shipping cost, remote area surcharge, fuel surcharge, etc.).

[0011] The system automatically associates the corresponding first anchor record with the order identifier. If the second anchor record is not received within the preset timeout period (e.g., 72 hours), a timeout warning is triggered.

[0012] Step S3: Calculation of weighted deviation rate Calculate the overall weighted deviation rate based on the first anchor point record and the second anchor point record. .

[0013] Among them, the overall weighted deviation rate Based on the basic deviation rate Billing weight deviation factor Line complexity factor With time decay factor calculate: ; In the formula, To estimate the shipping cost, This is the actual shipping cost; To estimate the cost weight, The actual weight measured for billing by the logistics provider. To obtain the maximum value; , These are indicator variables for remote provinces, village / township addresses, and overseas locations, respectively. For shipping timestamps, For settlement timestamp, The maximum effective time window is preset, and the preferred value is 48 to 168 hours.

[0014] Step S4: Calculation of dynamic early warning threshold The dynamic early warning threshold The weighted moving average of the historical deviation rate sequence With safety factor The product of, and not less than the preset minimum threshold. The calculation method is as follows: For the combination k of logistics channel-receiving province-weight range, collect the historical deviation rate sequence of the most recent N days and calculate the weighted moving average. ,in Attenuation coefficient: The preferred value for N is 3 to 30 days. Dynamic early warning threshold Among them, the preset minimum threshold The preferred value is 5% to 20%; safety factor The preferred value is between 1.2 and 2.0.

[0015] This dynamic threshold can be adaptively adjusted based on historical data, avoiding false alarms caused by overall industry fluctuations.

[0016] Step S5: Real-time Early Warning and Classification When the weighted deviation rate is not less than the dynamic warning threshold, a real-time warning of the corresponding level is triggered based on the ratio of the weighted deviation rate to the dynamic warning threshold. The triggering conditions for the warning level include: Level 1 warning: When Triggered at time; Level 2 warning: When It will be triggered when, or when the same logistics channel and receiving province combination has no fewer than 5 Level 1 warnings within a preset time window; Level 3 Warning: When It can be triggered at any time, or when the same logistics channel triggers a level 2 warning for 3 consecutive days.

[0017] Step S6: Automated Intervention Execution Automatically execute matching intervention actions based on the warning level, including: For Level 1 alerts: push alert messages to designated instant messaging groups, mark the corresponding orders as "pending review - freight anomaly" in the ERP system, and create a reconciliation work order with ordinary priority; For Level 2 alerts: send a mandatory reminder message to the relevant person in charge, add the corresponding logistics channel-receiving province combination to the temporary blacklist for 4 hours, automatically switch subsequent orders to the backup logistics channel, and create an emergency work order with high priority; For Level 3 alerts: a multi-channel broadcast including emails, SMS messages, and instant messaging is sent to the logistics manager, finance manager, and operations director to remove the logistics channel from the preferred list. It can only be reactivated after manual approval. The courier company's API is automatically invoked to initiate a reconciliation appeal, with the blockchain evidence hash value recorded at the first anchor point attached.

[0018] Preferably, this method also includes a cumulative loss warning step: Calculate the loss amount for order i ; Calculate the cumulative loss within the preset time period T. ; When the cumulative loss exceeds the preset loss threshold Triggering a Level 3 alert with a preset loss threshold The preferred setting is 5% of the average monthly logistics cost.

[0019] Preferably, this method further includes a prediction and correction step: Obtain historical order data for logistics channel-weight combination k, and calculate the historical deviation moving average: Where M is the number of historical orders involved in the calculation, preferably the most recent 500 orders; The decay rate; Set the revised estimated freight amount as This is used to replace the original estimated freight rate when creating the first anchor point record.

[0020] Preferably, this method further includes a sliding window threshold adaptive optimization step: Define the early warning cost function False positive rate False negative rate and the cost of intervention Weighting function: Preset weighting coefficients; The optimal threshold is determined every 7 days using either grid search or Bayesian optimization. Update the dynamic early warning threshold.

[0021] Preferably, this method also includes a seasonal adjustment step: Check if the current date is a preset promotional event day. Preset promotional event days include Singles' Day (November 11th), Double Twelve (December 12th), and 618 (June 18th). Calculate the adjustment factor based on the type of promotional activity. Adjustment factor The preferred value is: ; Adjust the dynamic early warning threshold to .

[0022] Preferably, the storage method of the first anchor record is as follows: the first anchor record is stored in the Redis cache and a 72-hour lifespan is set, and the SHA-256 hash values ​​of the order identifier, estimated shipping cost, and shipping timestamp are uploaded to the blockchain evidence storage platform to obtain an evidence storage certificate.

[0023] Preferably, after the second anchor record is created, the system automatically associates it with the first anchor record. If the second anchor record is not received within the preset timeout period, a timeout warning is triggered and an abnormal work order is created. Beneficial effects

[0024] Compared with the prior art, the present invention has the following beneficial effects: By employing a dual-point-of-time anchoring mechanism, the freight accounting throughout the order lifecycle is upgraded from "single-point-of-time accounting" to "dynamic tracking," achieving full-process cost visualization from shipment to settlement. The deviation perception delay is reduced from the traditional 15-45 days to less than 5 minutes.

[0025] The technical solution of this invention can reduce the reconciliation error rate from more than 5% in traditional methods to less than 0.5%, and shorten the monthly reconciliation time from 18 days to 2 hours.

[0026] The technical solution of this invention can trigger an early warning within 5 minutes of the first batch of abnormal orders when a courier company temporarily raises prices or miscalculates fees, and automatically shut down the problematic channel to minimize losses. Empirical data shows that this mechanism can recover 60%-85% of potential losses caused by abnormal shipping fees.

[0027] The technical solution of this invention uses sliding window weighted moving average and adaptive threshold optimization. The system can automatically adjust the warning threshold according to historical data and seasonal changes, avoiding false alarms or missed alarms caused by static thresholds.

[0028] The technical solution of this invention records the first anchor point on the blockchain for evidence storage, providing tamper-proof evidence support in freight dispute appeals, and significantly improving the success rate of appeals. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of the overall structure of a smart logistics cost calculation method for e-commerce according to the present invention. Figure 2 This is a schematic diagram of the data flow of the dual-time-point anchoring mechanism in an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0031] Example 1: System Deployment Environment: This implementation example was deployed and implemented in the production environment of the e-commerce company "XX Technology Co., Ltd." The company processes approximately 5,000 orders daily, primarily using ZTO Express, YTO Express, and J&T Express for shipping. The goods are mainly daily necessities, with package weights ranging from 0.5 to 10 kg. The company has deployed the Wangdiantong ERP system and integrated it with three e-commerce platforms: Taobao, Pinduoduo, and Douyin.

[0032] The system hardware configuration is as follows: two cloud servers with 4-core CPUs and 16GB of memory (one for API services and one for real-time computing), a Redis 6.2 cluster, a MySQL 8.0 database, and a WeChat Work robot for message push.

[0033] Example 2: The creation process of the first anchor point record: When a user completes order shipment scanning and generates a waybill number in the ERP system, the system automatically triggers step S1.

[0034] Take a specific order as an example: Order number: DD202605210001; Product: 12 stainless steel insulated cups; Actual weight: 2.3kg; Packaging dimensions: 35cm × 25cm × 20cm; Delivery address: A residential community in Urumqi, Xinjiang Uygur Autonomous Region; Logistics channel: ZTO Express; Calculate the estimated cost weight: Volumetric weight = 35 × 25 × 20 ÷ 6000 = 2.92kg; Actual weight = 2.3kg; Billing weight = max(2.3, 2.92) = 2.92kg, rounded up to 3kg; Calculate the estimated shipping cost (agreement price: 5 yuan for the first 1kg, 2 yuan for each additional kg): Basic shipping cost = 5 + 2 × 2 = 9 yuan; Remote area surcharge = 3 yuan (Xinjiang region); Estimated shipping cost Yuan.

[0035] Create the first anchor point record, as shown in the example below: {“Anchor ID”: “T0_20260521_001”, Order Number: DD202605210001 "Timestamp": "2026-05-21 10:23:45.123", Estimated shipping cost: 12.00 "Billable Weight": 3 Volumetric weight: 2.92 Actual weight: 2.3 "Logistics Channel": "ZTO Express" "Receiving Province": "Xinjiang" “Remote Area Identifier”: 1, "Historical deviation rate": 0.12}.

[0036] This record is synchronously stored in Redis (Key: order: DD202605210001: t0). anchor (TTL: 72 hours) and blockchain evidence storage platform.

[0037] Example 3: Capture and Deviation Calculation of the Second Anchor Point Record: Three days later (May 24, 2026, 14:15:30), the e-commerce platform returned an order settlement completion event, triggering steps S2 and S3 in the system.

[0038] Get the actual shipping cost: Obtain the actual deduction details through the platform API: Basic shipping fee: 12 yuan; Remote area surcharge: 5 yuan (2 yuan more than estimated); Fuel surcharge: 0.8 yuan; Actual shipping cost Yuan.

[0039] Calculate the basic deviation rate: ; In this embodiment: .

[0040] Calculate the billing weight deviation factor: ; In this embodiment: the logistics provider's actual measured chargeable weight is 3kg (consistent with the actual weight), therefore λ w = 0 Calculate the circuit complexity factor: ; In this embodiment: the delivery address is Xinjiang. Urban areas, not rural areas , non-overseas , .

[0041] Calculate the time decay factor: ; In this embodiment: t1 - t0 = 72 hours 12 minutes ≈ 72.2 hours, T max = 72 hours; φ(t) = min(1, 72.2 / 72) = 1.

[0042] Calculate the overall weighted deviation rate: ; In this embodiment: .

[0043] Example 4: Dynamic threshold calculation and early warning triggering: The system queries historical deviation data for this logistics channel and weight range combination (ZTO Express - Xinjiang - 3kg): There were 32 orders in the past 7 days, with the following deviation rate sequence: [12%, 15%, 11%, 48%, 13%, 14%, 12%,...] (only the first order showed a 48% anomaly). Calculate the weighted moving average: ; In this embodiment: using exponential decay weight (γ=0.099), the weight of orders in the most recent 3 days is higher, and the calculation result is ≈14.2%.

[0044] Calculate the dynamic threshold: ; In this embodiment: ; .

[0045] Determine the warning level: Δ = 145% > 2.5 × 21.3% = 53.25% → Trigger a Level 3 warning.

[0046] Example 5: Automated Intervention Execution: The system performs the following intervention actions: Multi-channel broadcasting: Send alerts to logistics and finance managers via WeChat Work bot, SMS, and email. Example content: [Shipping Cost Level 3 Warning] - Urgent Order No.: DD202605210001 Logistics provider: ZTO Express → Xinjiang Estimated price: 12.00 yuan → Actual price: 17.80 yuan Deviation rate: 145% (threshold 21.3%) Reason for deviation: The remote area surcharge was increased by 2 yuan, and the basic shipping fee increased by 1 yuan. Implemented: ZTO Express has been removed from the list of preferred routes to Xinjiang. Please submit an anomaly report within 2 hours.

[0047] Channel downgrade: The system will add the "ZTO Express-Xinjiang" combination to the blacklist, and subsequent Xinjiang orders will be automatically switched to J&T Express (the current price difference for this route is only +5%).

[0048] Automatic appeal: The system calls the ZTO Express API to submit a dispute work order, attaching the blockchain evidence hash 0x7d9f3a... of the first anchor point record, requesting a refund of the overcharged 2 yuan remote area surcharge.

[0049] Generate a work order: Create a reconciliation work order with the priority of "urgent" and assign it to the finance specialist for follow-up.

[0050] Example 6: Estimated Correction Effect: After a week of operation, the system collected order data for 35 ZTO Express orders on the Xinjiang route. Historical deviation moving average. It dropped from an initial 12% to 8%.

[0051] For subsequent orders, the system automatically applies a correction factor when creating the first anchor record: Revised estimated freight cost = Original estimate × (1 + 8%) = 12 × 1.08 = 12.96 yuan.

[0052] After correction, the average deviation rate of the line decreased from 48% to 9%, significantly improving the accuracy of the prediction.

[0053] Example 7: System Performance Test The performance of this invention was tested in a real production environment, and the results are as follows:

[0054] The above data shows that the present invention can effectively solve the technical problems in the prior art, such as time misalignment in freight accounting, large reconciliation errors, and delayed anomaly detection, and has significant progressiveness and practicality.

[0055] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for intelligent calculation of logistics costs in e-commerce, characterized in that, Includes the following steps: S1: In response to the e-commerce order shipment and outbound operation, create a first anchor record. The first anchor record includes at least the order identifier, estimated shipping cost, estimated shipping weight, shipping timestamp, and logistics channel information. The first anchor record is then stored in the blockchain evidence storage platform. S2: In response to the order settlement completion event on the e-commerce platform, obtain the actual shipping cost of the order and create a second anchor record. The second anchor record contains the order identifier, actual shipping cost, settlement timestamp, and detailed breakdown of the cost information. S3: Calculate the weighted deviation rate based on the first anchor point record and the second anchor point record. ; S4: Obtain the historical deviation rate sequence of the target logistics channel within the sliding time window, and calculate the dynamic early warning threshold. ; S5: When the weighted deviation rate is not less than the dynamic warning threshold, a real-time warning of the corresponding level is triggered according to the ratio of the weighted deviation rate to the dynamic warning threshold. S6: In response to an alert trigger, automatically execute intervention actions that match the alert level.

2. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, The weighted deviation rate Based on the basic deviation rate Billing weight deviation factor Line complexity factor With time decay factor calculate: ,in To estimate the shipping cost, This is the actual shipping cost; To estimate the cost weight, The actual weight measured for billing by the logistics provider. To obtain the maximum value; , , , These are indicator variables for remote provinces, village / township addresses, and overseas locations, respectively. , For shipping timestamps, For settlement timestamp, The maximum effective time window is preset, with a value ranging from 48 to 168 hours.

3. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, The dynamic early warning threshold The weighted moving average of the historical deviation rate sequence With safety factor The product of, and not less than the preset minimum threshold. .

4. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, The triggering conditions for the aforementioned warning level include: Level 1 warning: When Triggered at time; Level 2 warning: When It will be triggered when, or when the same logistics channel and receiving province combination has no fewer than 5 Level 1 warnings within a preset time window; Level 3 Warning: When It can be triggered at any time, or when the same logistics channel triggers a level 2 warning for 3 consecutive days.

5. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, The intervention actions include at least one of the following: pushing instant messaging messages, creating reconciliation work orders, and suspending the current logistics channel. The specific intervention actions that match the warning level are as follows: For Level 1 alerts: push alert messages to designated instant messaging groups, mark the corresponding orders as "pending review - freight anomaly" in the ERP system, and create a reconciliation work order with ordinary priority; For Level 2 alerts: send a mandatory reminder message to the relevant person in charge, add the corresponding logistics channel-receiving province combination to the temporary blacklist for 4 hours, automatically switch subsequent orders to the backup logistics channel, and create an emergency work order with high priority; For Level 3 alerts: a multi-channel broadcast including emails, SMS messages, and instant messaging is sent to the logistics manager, finance manager, and operations director to remove the logistics channel from the preferred list. It can only be reactivated after manual approval. The courier company's API is automatically invoked to initiate a reconciliation appeal, with the blockchain evidence hash value recorded at the first anchor point attached.

6. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, It also includes a cumulative loss warning step: Calculate the loss amount for order i ; Calculate the cumulative loss within the preset time period T. ; When the cumulative loss exceeds the preset loss threshold A level-three warning was triggered.

7. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, It also includes the estimation and correction steps: Obtain historical order data for logistics channel-weight combination k, and calculate the historical deviation moving average. ; Set the revised estimated freight amount as This is used to replace the original estimated freight rate when creating the first anchor point record.

8. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, It also includes a sliding window threshold adaptive optimization step: Define the early warning cost function False positive rate False negative rate and the cost of intervention The weighting function; The optimal threshold is determined every 7 days using either grid search or Bayesian optimization. Update the dynamic warning threshold.

9. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, It also includes seasonal adjustment steps: Check if the current date is a preset promotional event date; Calculate the adjustment factor based on the type of promotional activity. ; Adjust the dynamic early warning threshold to .

10. The intelligent logistics cost calculation method for e-commerce according to claim 1, characterized in that, The storage method for the first anchor record is as follows: the first anchor record is stored in the Redis cache and a 72-hour lifespan is set. At the same time, the SHA-256 hash values ​​of the order identifier, estimated shipping cost, and shipping timestamp are uploaded to the blockchain evidence storage platform to obtain an evidence storage certificate. After the second anchor record is created, the system automatically associates it with the first anchor record. If the second anchor record is not received within the preset timeout period, a timeout warning is triggered and an abnormal work order is created.