国际邮政物品识别标准
The international standard for identifying postal items

原始链接: https://www.akpain.net/blog/s10-upu/

你瑞士包裹上的那个追踪号码并非英国皇家邮政发明的!它是一个标准化的S10代码,是一个由万国邮联(UPU)规定的13位字符标识符。这个联合国机构确保国际邮件的顺利流通。 追踪号码的构成如下:两个字母(服务标识符),八位数字(序列号),一位数字(校验位),以及两个字母(原产国ISO代码)。前两个字母表示邮政服务类型,“E”前缀专门保留给EMS,这是一种由万国邮联通过各国邮政服务运营的国际快递邮件服务。 序列号是唯一的,理想情况下至少保持24个月唯一。校验位使用算法来防止错误。S10标准还规定了条形码格式(Code 128或Code 39)以及包裹上条形码附近明文追踪号码的位置。有趣的是,国家代码标识的是承运人的国籍,而不一定是物品的实际原产地。

Hacker News 的讨论线程围绕着识别邮政邮件的国际标准展开。一个核心问题是,该系统有限的序列号容量能否应对巨大的邮件量,特别是来自中国的邮件量。 一些评论者认为,中国通过将货物批量运送到目的地国家,然后使用当地邮政系统或私人快递进行“最后一公里”递送来规避序列号限制。这允许使用不同的跟踪系统。讨论还澄清了序列号组件允许用于信件,并且不严格基于十进制。 一些用户指出,原文错误地说明了1000万的限制,现已更正为每个服务指示符1亿个唯一号码。即使更正后,仍然有人怀疑1亿个是否足够。 其他人指出,服务指示符/国家代码(两个字母)可以每年重复使用,从而提供更大的容量。校验位算法的复杂性也受到了质疑,一位评论者认为它与其他系统相比过于复杂。简而言之,该组质疑了当前序列号系统在考虑全球需求时的可扩展性。
相关文章

原文

Have you ever received a parcel from overseas? I did recently, from Switzerland!

Looking at the envelope, I realised the format of the tracking number (UT038926726CH) was in a very similar (if not identical) format to ones I'd used frequently here in the UK.

I'd been receiving emails from Royal Mail about the parcel, so I just presumed that there was some data-sharing agreement in place with Swiss Post and Royal Mail had just given the parcel their own internal reference number.

But seeing the reference number printed on the envelope from the get-go made me want to see what Swiss Post had to say about it...

The same tracking number works across multiple carriers, and it's the same format as all the UK ones! What gives??

The Universal Postal Union (UPU) is an agency of the UN that coordinates postal policies to facilitate post flowing across the world. As part of this, it publishes the S10 standard for the identification of postal items in a 13-character format - ie. what we've been seeing on our parcels!

If you're interested in learning more about the UPU's interesting 150-year history, you might want to check out this article written by fellow webring inhabitant Imaan!

Each country's national postal service is assigned as having exclusive reign over S10 codes for that country, and they go about issuing S10 codes from their country.

Tracking Number Format

As it turns out, the structure of our tracking number has a strict design, and our tracking number contains four distinct things:

Character number Format Description
1 and 2 2 letters Service indicator
3 to 10 8 digits Serial number
11 1 digit A check digit
12 and 13 2 letters ISO 3166–1 country code representing the origin of the item

The Service Indicator

The first two characters represent the service that's been used to post the item. There's a fairly extensive list in the standard, with specific options for tracked post, letter post, parcel post... the list goes on. The most interesting part of the service indicators are threefold:

First, there are specific carve-outs in the specification for an organisation called EMS - they get all E prefixes, so EA, EB, EC, and so on and so forth. EMS is an express international mail service that's run by the UPU itself, but that delegates operations to the national postal services that control their country's S10 codes. This is why you'll not see any way to buy shipping using EMS directly on their website - you buy express international shipping at your local post office and they route it accordingly. It's also worth noting that this only applies to express shipping - not regular-rate traffic.

Second, countries are allowed to override some of the service indicator assignment rules set out in the S10 standard. This can happen when either a parcel is being sent domestically or when a carrier has an agreement with other countries' carriers to reassign some service indicators for other purposes, hence the inclusion of the origin country code to aid interpretation of tracking numbers where this is the case.

Lastly, some service indicators are explicitly disallowed from being used. These are JA–JZ, KA–KZ, SA–SZ, TA–TZ and WA–WZ since these carry the risk of causing a tracking number to be confused with codes from a different UN data encoding standard.

All in, the possible service indicator space looks like this:

Table source

The Serial Number

This is just a serial number. It's exactly 8 digits long and is generated by the originating carrier as they see fit, provided they don't resue the same number within 12 months. In theory, this means a lost parcel can only be lost for 12 months before it vanishes from the world forever, but in reality, the S10 recommends not reusing a number within a minimum period of 24 months. Even then, you have 10 million parcels per service indicator per country available to be issued, so it's probably not going to be necessary for a carrier to reuse a number for a much longer period of time anyway.

The Check Digit

The check digit corrects any errors in the serial number preceding it, using the following algorithm:

  • Multiply each digit in the sequence with the corresponding number from this sequence: 8 6 4 2 3 5 9 7
  • Sum all these values
  • Divide the sum by 11
  • Substrac the remainder from 11
  • If the result is in the range 1-9, use that as the checksum
  • If the result is 10, use 0 as the checksum
  • If the result is 11, use 5 as the checksum

This is not a particularly strong checksum, but it's good enough to guard against a couple of accidental digit-swaps here and there. You can play with an interactive demo of it here.

Barcode Format

The S10 standard requires tracking numbers to be printed on an item as a barcode, either being in Code 128 or Code 39 format.

Additional barcodes on the label are discouraged, particularly for international items, and carriers that must include other barcodes are required to use a different format and not obscure the S10 code. This is why you'll see Royal Mail, for example, using data matrices on their labels.

The square code on the left side is the data matrix, the barcode on the right is the S10 code

Other Fun Things in the Standard

  1. A plaintext representation of an S10 code must be printed within 1-5mm of the barcode
  2. Such plaintext should be in the format AB 123 456 789 GB
  3. Sans-serif fonts are required, with specific requirements as to the sizing of each letter
  4. National carriers are allowed to delegate issuing responsibility to a third party provided they can ensure no number is reissued within the year
  5. The country code at the end of the tracking number isn't actually a reliable indicator of the country of origin but the nationality of the carrier of origin (eg. in the case of an overseas territory, a national carrier could still use the mainland code)

联系我们 contact @ memedata.com