Patent Description:
Every day across the world, billions of litres of water, milk, juice and other liquid foods are consumed. A large proportion of the liquid food is distributed in paper-based packages, also known as carton packages. These packages are produced to protect both the nutritional value and the taste of the liquid food inside. The underlying technology greatly facilitates packaging and distribution of liquid food products across the world.

The present Applicant has identified a need to mark each package with a unique code. The provision of a unique code on each package enables various functionality, such as tracking and tracing the packages throughout the manufacturing and distribution chain, verifying the authenticity of the package, linking to web content related to the package for access by consumers or retail personnel, associating the codes with promotional campaigns and lotteries, causing manufacturing machines to perform automated actions upon detecting the code, etc..

<CIT> discloses a robust technique for providing marking codes for packages containing liquid food, where the respective marking code uniquely identifies an individual package. The marking code is based on payload data, which uniquely represents the production of the individual package and may be indicative of the time and/or the location of the production. The payload data is encrypted to make it difficult to guess valid codes and generate fraudulent codes. The marking code is formed by combining the encrypted payload data with a non-encrypted header portion. The marking codes are provided on the packages and are also entered in a database, optionally in association with additional data. To enable efficient and fast search in the database, <CIT> proposes to partition the database based on the time and/or location as indicated by the payload portion, and store the respective marking code in the database partition that matches the time and/or location in the marking code.

Packages for liquid food are produced on an industrial scale for the world market. Huge numbers of packages are produced each year. For example, within the ecosystem of Tetra Pak®, <NUM> billion (<NUM><NUM>) packages were produced in <NUM>. Considering that packaged products may have a shelf life of <NUM> months to <NUM> year, or even longer, for example up to <NUM> years, a huge number of unique marking codes need to be produced and stored in the database. The deployment of the marking codes in such an environment is likely to result in data in excess of <NUM> PB. This amount of data is difficult to store and manage in a unitary database.

It is thus a challenge to store these and other types of marking codes for packages of liquid food, provided in huge numbers, in a database without excessive resource consumption while enabling fast and efficient storage and search in the database.

It is an objective to at least partly overcome one or more limitations of the prior art.

A further objective is to enable fast and efficient storage and search in a database containing package-related data for individual packages of liquid food.

Another objective is to enable a database which is scalable and enables a storage capacity of package-related data of more than <NUM> PB.

One or more of these objectives, as well as further objectives that may appear from the description below, are at least partly achieved by a method of generating marking codes, a computer-readable medium, and a system for generating marking codes according to the independent claims, embodiments thereof being defined by the dependent claims.

A first aspect of the present disclosure is a method of generating marking codes to uniquely identify packages for liquid food. The method comprises: obtaining package production data which is unique to each individual package; operating a predefined encryption algorithm on the package production data to generate encrypted package production data; generating a marking code that includes the encrypted package production data; providing the marking code for marking of the individual package; and storing, in a database that comprises a plurality of partitions, package itemization data comprising at least a subset of the marking code and at least a subset of the package production data of the individual package. The storing comprises generating a partition key as a function of the marking code, and operating a controller coupled to the database to determine a selected partition among the plurality of partitions based on the partition key and to store the package itemization data in the selected partition, wherein the partition key equals to the marking code, or the partition key equals the encrypted package production data of the marking code.

In some embodiments, operating the controller comprises operating a predefined mapping function on the partition key, the predefined mapping function being configured to map partition keys to a set of partition identifiers, which comprises a respective partition identifier for each partition among the plurality of partitions, wherein the selected partition is determined based on a current partition identifier generated by the mapping function for the partition key.

In some embodiments, the predefined mapping function comprises a hash function.

In some embodiments, the predefined encryption algorithm is a block cipher.

In some embodiments, the package production data is obtained to represent at least one of a location and a time of producing the individual package.

In some embodiments, the at least a subset of the marking code comprises the encrypted package production data.

In some embodiments, the database is a distributed database.

A second aspect of the present disclosure is a computer-readable medium comprising computer instructions which, when executed by a processor, cause the processor to perform the method of the first aspect or any embodiment thereof.

A third aspect of the present disclosure is a system for generating marking codes to uniquely identify packages for liquid food. The system comprises a code generator configured to operate a predefined encryption algorithm on package production data, which is unique to each individual package, to generate encrypted package production data. The code generator is further configured to generate a marking code that includes the encrypted package production data and to provide the marking code for marking of the individual package. The system further comprises a storage interface coupled to a database that comprises a plurality of partitions. The storage interface is arranged to receive package itemization data comprising at least a subset of the marking code and at least a subset of the package production data of the individual package. The system further comprises a key generator configured to generate a partition key as a function of the marking code and provide the partition key to the storage interface. The storage interface is configured to, upon receipt of the partition key, determine a selected partition among the plurality of partitions based on the partition key and to store the package itemization data in the selected partition, wherein the partition key equals to the marking code, or the partition key equals the encrypted package production data of the marking code.

Any one of the embodiments of the first aspect may be adapted and implemented as an embodiment of the third aspect.

Still other objectives, as well as embodiments, features, aspects and advantages will appear from the following detailed description as well as from the drawings.

Embodiments will now be described, by way of example, with reference to the accompanying schematic drawings.

Embodiments will now be described more fully hereinafter with reference to the accompanying drawings, in which some, but not all, embodiments are shown. Indeed, the invention may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure may satisfy applicable legal requirements.

Also, it will be understood that, where possible, any of the advantages, features, functions, devices, and/or operational aspects of any of the embodiments described and/or contemplated herein may be included in any of the other embodiments described and/or contemplated herein, and/or vice versa. In addition, where possible, any terms expressed in the singular form herein are meant to also include the plural form and/or vice versa, unless explicitly stated otherwise. As used herein, "at least one" shall mean "one or more" and these phrases are intended to be interchangeable. Accordingly, the terms "a" and/or "an" shall mean "at least one" or "one or more", even though the phrase "one or more" or "at least one" is also used herein. As used herein, except where the context requires otherwise owing to express language or necessary implication, the word "comprise" or variations such as "comprises" or "comprising" is used in an inclusive sense, that is, to specify the presence of the stated features but not to preclude the presence or addition of further features in various embodiments. As used herein, the term "and/or" comprises any and all combinations of one or more of the associated listed items.

As used herein, "liquid food" refers to any food product that is non-solid, semiliquid or pourable at room temperature, including beverages, such as fruit juices, wines, beers, sodas, as well as dairy products, sauces, oils, creams, custards, soups, pastes, etc, and also solid food products in a liquid, such as beans, fruits, tomatoes, stews, etc..

As used herein, "a package" refers to any package or container suitable for sealed containment of liquid food products, including but not limited to containers formed of cardboard or packaging laminate, e.g. cellulose-based material, and containers made of or comprising plastic material.

Like reference signs refer to like elements throughout.

<FIG> is a schematic illustration of a manufacturing and distribution chain for packages for liquid food. The illustrated chain comprises a manufacturing stage <NUM> for manufacturing raw material for the packages, a filling stage <NUM> for manufacturing packages containing liquid food, a distribution stage <NUM> for distributing the packages containing liquid food, a retail stage <NUM> for providing the packages to consumers, and a consumer stage <NUM> in which the packages are handled by a consumer and the liquid food is consumed.

In the manufacturing stage <NUM>, a sheet material for the packages is manufactured at a converting factory (plant) <NUM>. The sheet material is typically paper-based and provided to the filling stage <NUM> in rolls <NUM>. In the illustrated example, stage <NUM> further involves a dedicated factory (plant) <NUM> that manufactures caps <NUM> for the packages, typically of plastic material. If the packages are formed without a cap, the factory <NUM> is absent from stage <NUM>. It is also conceivable that stage <NUM> includes additional factories that manufacture specific components for the package.

In the filling stage <NUM>, a filling factory (plant) <NUM> operates on the sheet material <NUM>, the caps <NUM> and the liquid food to provide packages containing liquid food. For example, a production line at the filling plant <NUM> may form the sheet material <NUM> into a container, fill the liquid food into the container, and seal the container to form the package. The production line may also attach a cap <NUM> to the container. <FIG> shows an example of a package <NUM> produced by the filling plant <NUM>. Stage <NUM> may further comprise external handing <NUM> of packages, e.g. palletizing, before entering the distribution stage <NUM>.

It should be understood that the manufacturing chain generally may involve many different converting plants <NUM>, cap plants <NUM> and filling plants <NUM>, which may be distributed globally. Each of the plants <NUM>, <NUM>, <NUM> may include a plurality of production lines.

As indicated in <FIG>, the package <NUM> comprises a data carrier <NUM> that represents a marking code. The data carrier <NUM> may be implemented by any known technique for providing an article of manufacture with a code. In one example, the data carrier <NUM> is printed onto the package <NUM>, e.g. as sequence of human-readable symbols (e.g. characters), or a machine-readable graphical symbol such as one or more bar codes or a 2D code (DataMatrix, QR code, etc.). In another example, the data carrier is an electronic tag, in which the code is stored and made available for retrieval by wireless communication with the tag, e.g. in accordance to any conventional standard for this purpose, such as NFC, RFID, BLE, etc..

The marking code is generated to be unique to the package <NUM> within the entire eco-system of plants <NUM>, <NUM>, <NUM> within the manufacturing chain as exemplified in <FIG>, at least for a predefined lifetime. The marking code may be applied to the package in either of the plants <NUM>, <NUM>, <NUM> shown in <FIG>. For example, marking codes may be applied by the converting plant <NUM> at predefined positions on the sheet material <NUM> so as to be located on each of the packages <NUM> produced by filling plant <NUM>. In another example, a marking code may be applied by the cap plant <NUM> to each cap <NUM>. In a further example, a marking code is applied to the sheet material <NUM>, the cap <NUM>, the intermediate container or the package <NUM> by the filling plant <NUM>. It is to be understood that the package <NUM> may contain more than one such unique marking code, e.g. one on the cap <NUM> and one on the package <NUM>. It is also conceivable that a unique marking code is provided to the packages, or groups of packages, at the subsequent handling <NUM> (e.g. palletizing).

Embodiments are related to storing the marking codes and associated data in a database and will be exemplified in the following with reference to implementations of the marking code described in aforesaid <CIT>.

Specifically, the marking code comprises payload data which is unique to the production of the individual package and which is encrypted by a predefined encryption algorithm. Generally, the marking code consists of a sequence of values, for example binary values. The payload data, which is denoted package production data (PPD) in the following, may include data elements that identify the location of production and/or the time of production. In a first example, the data elements in the PPD include identifiers of the producer that operates a plant (Producer ID), the plant (Plant ID), the production line in the plant (Line ID), the equipment where the marking code is added to the package (Equipment ID), and the PPD further identifies the current time of production, for example by year, day, hour, minute, second and a sub-second resolution counter (Package Counter), which may or may not be randomized. In a second example, the data elements in the PPD include identifiers of the plant (Production Unit ID), a production batch, and a package within the production batch, where the production batch may be identified by a time period, for example current year and month, and a batch number within the time period (Request Number), and where the package may be identified by a package number within the production batch (Package Counter). The package number may or may not be randomized. The marking code may further comprise a non-encrypted header portion, which may or may not be obfuscated and may contain data enabling decryption and validation of the encrypted PPD.

An example embodiment of a system <NUM> which is configured for code generation, code storage and marking of packages is schematically shown in <FIG>. The system <NUM> includes a PPD generator <NUM>, a code generator <NUM>, a marking device <NUM>, and a storage controller <NUM> coupled to a database <NUM>. The PPD generator <NUM> is configured to provide the package production data PPD to be included in the marking code. In one implementation ("inline implementation"), the PPD generator <NUM> is synchronized with the production for automated real-time generation of the PPD, for example in accordance with the first example above. In another implementation ("offline implementation"), the PPD generator <NUM> is operated to provide the PPD in advance of production, for example structured in accordance with the second example above. The code generator <NUM> is configured to generate marking codes, MC, based on the PPDs from the PPD generator <NUM> and provide the marking codes to the marking device <NUM>, which is operated to apply the respective marking code to an article of manufacture, such as the sheet material <NUM>, the cap <NUM> or the package <NUM>. As understood from the foregoing, the marking device <NUM> may be a printer, an ablation device, or a device embedding the code into an electronic tag, which may be attached by the marking device <NUM> onto the article of manufacture or may be pre-attached thereto. In the inline implementation, the code generator <NUM> is synchronized with the production to generate the marking codes in real time. In the offline implementation, the code generator <NUM> may generate the marking codes either in advance of production or in synchronization with production.

The storage controller <NUM> is configured to receive the PPD, the marking code (MC), and possibly additional data. Based thereon, the storage controller <NUM> generates and stores package itemization data, PID, in the database <NUM>. Each PID corresponds to an individual package and forms a data item for storage in the database <NUM>. In some implementations, the data item may, e.g., be a row in a table (SQL database) or a document in a collection (NoSQL database). As understood from the foregoing, a huge volume of data items will eventually be stored in the database <NUM>, which therefore should be scalable, and preferably horizontally scalable for resource efficiency. In one embodiment, the database <NUM> is a distributed database comprising a plurality of logical partitions, where each logical partition may have a predefined maximum size and is assigned a unique partition identifier (Partition ID). In a non-limiting example, the predefined maximum size is in the range of <NUM>-<NUM> GB. A database management system (DBMS) 30A for the database <NUM> is operated to transparently and automatically distribute the data items among the logical partitions, for example based on a "partition key" (aka "distribution key") for each data item. The storage controller <NUM> may provide an interface to the DBMS 30A that allows an operator to set the partition key to be used and that allows for manual or automatic upload of data items for storage in the database <NUM>. The DBMS 30A may be proprietary to the host of the distributed database <NUM> and may be configured to map the logical partitions, in any suitable relation, to a plurality of nodes, which may include any one of physical servers, virtual servers or virtual LUNs (logical unit number) with access to one or more storage devices, such as hard-disk drives (HDDs) and/or solid-state drives (SSDs), for example to efficiently satisfy scalability and performance needs. As the throughput and storage requirements may increase, the DBMS 30A may move logical partitions to automatically spread the load across a greater number of servers. The DBMS 30A may be any commercially available system, and the distributed database <NUM> may be implemented as an SQL or a NoSQL database. In one embodiment, the DBMS 30A is a cloud computing platform. In a specific implementation, the DBMS 30A is included in Microsoft Azure Cosmos DB, which is a globally distributed, multi-model database service. In a specific example, the DBMS 30A is set up to operate as a NoSQL Document Database.

The package itemization data, PID, comprises the marking code, or a subset thereof, and at least a subset of the data elements in the PPD. The PID may also include additional data elements associated with the generation of the marking code, the production of the package or the storage in the database. In one non-limiting example, which conforms to the above-mentioned first and second examples of the PPD, the PID includes the marking code (or a subset thereof), Producer ID, Plant ID, Line ID, Equipment ID, year, day, hour, minute, second, Package Counter, Production Unit ID, and Request Number.

When implementing storage of the PID on the above-mentioned Microsoft Azure Cosmos DB, the present Applicant experienced poor performance, for example in terms of resource consumption and speed of search and retrieval. Further analysis of the data storage in the database <NUM> revealed a substantial non-uniformity in the distribution of data between partitions, also known as "skewness". <FIG> illustrate such skewness when using Line ID as partition key. <FIG> is a plot of the amount of data (vertical axis) stored in each partition (horizontal axis) when the database <NUM> in configured with <NUM><NUM> partitions, and <FIG> is a corresponding plot when the database <NUM> in configured with <NUM><NUM> partitions. The skewness was found to at least partly cause the poor performance and was present irrespective of partition key when selected among the data elements in the PPD, for example among the data elements that indicate the location and the time of production. There are strategies to overcome skewness by generating so-called synthetic partition keys, for example by concatenating two or more data elements, by appending a random suffix to a data element, or by appending a pre-calculated suffix to a data element, where the pre-calculated suffix is a hash value of another data element. However, these strategies tend to increase complexity and may impair the performance of the database.

Surprisingly, the present Applicant found that using the marking code as partition key rendered a substantially more uniform distribution of data among the logical partitions in the distributed database. It is presently believed that the encrypted data in the marking code imparts a randomness to the marking code that manifests itself as a substantially non-skewed data distribution among the partitions in the distributed database.

<FIG> is a block diagram of the system <NUM> in <FIG> in accordance with an embodiment. Here, the database <NUM> is a distributed database comprising partitions P1, P2,. , Pj, with j being a number significantly larger than <NUM>, and typically at least <NUM><NUM>, <NUM><NUM> or <NUM><NUM>. The storage controller <NUM> is coupled to the database <NUM> over a wired and/or wireless communication network <NUM>, for example a WAN (Wide Area Network), LAN (Local Area Network), PAN (Personal Area Network), or any combination thereof. When the database <NUM> is provided as a cloud-based service, the network <NUM> may include a WAN, such as the Internet.

Like in <FIG>, the PPD generator <NUM> provides package production data, PPD, which is received by the code generator <NUM>. The code generator <NUM> comprises an encryption module 22A, which is configured to operate an encryption algorithm or function on the PPD to generate encrypted package production data, EPD. Any conceivable encryption algorithm may be used, including any symmetric encryption algorithm in which a private encryption key is used for both encryption and decryption, and any asymmetric algorithm which utilizes pairs of public and private encryption keys. In one non-limiting embodiment, the encryption algorithm is a block cipher, such as Blowfish, DES, IDEA, RC5 or AES. The encryption algorithm scrambles the PPD and obliterates its structure. Generally, the encryption serves to protect the PPD, to make it difficult to guess a valid marking code based on another marking code and to minimize the risk of fraudulent generation of marking codes. The code generator <NUM> further comprises a code population module 22B, which is configured to form the marking code, MC, by combining the EPD and associated non-encrypted data, for example in a header portion as exemplified in <CIT>. The marking code is supplied from the code generator <NUM> to the marking device <NUM> and to the storage controller <NUM>. The storage controller <NUM> comprises an aggregation module 24A, a key generating module 24B and a storage interface module 24C. The aggregation module 24A is configured to receive the marking code, MC, from the code generator <NUM>, and the PPD from either the PPD generator <NUM> (as shown) or the code generator <NUM>. The aggregation module 24A generates a data item for storage in database <NUM>, the data item being the above-mentioned package itemization data, PID. The key generating module 24B is configured to receive the PID and generate the partition key, PK, as a function of the marking code, or the subset thereof, as included in the PID. According to the claimed invention, the module 24B sets the partition key equal to the marking code or the module 24B sets the partition key equal to the EPD of the marking code. In an example, not according to the claimed invention, the module 24B concatenates the marking code or the EPD with one or more other data elements in the PID. According to another example not according to the claimed invention, the module 24B may also operate any suitable function on the marking code or the EPD to generate the partition key. However, the latter example may require the module 24B to add the partition key to the PID before the PID is stored in the database <NUM>, which will increase the required data storage capacity of the database <NUM>.

The storage interface module 24C is configured to receive the partition key, PK, from the key generating module 24B and the PID from the aggregation module 24C. The storage interface module 24C, which is coupled to the database <NUM>, is further operable to cause the DBMS 30A to select a partition among the partitions P1-Pj based on the partition key, PK, and store the PID in the selected partition. In one embodiment, the module 24C comprises a predefined mapping function which is configured to identify a selected partition, for example by the above-mentioned Partition ID. The module 24C may thus operate the mapping function on the partition key to compute a current Partition ID and provide the current Partition ID to the DBMS 30A for identification of the selected partition. In another embodiment, the mapping function is part of the DBMS 30A, which is caused to compute the current Partition ID when the module 24C supplies the partition key to the DBMS 30A. In one embodiment, the mapping function is configured to map all conceivable partition keys onto a set of unique Partition IDs, one for each partition P1-Pj. In one embodiment, the mapping function is further configured to scramble the bits of the partition key to improve the uniformity of the data distribution in the database <NUM>. In one embodiment, the mapping function is a hash function. Any hash function may be used, including but not limited to a cryptographic hash function, a non-cryptographic hash function or a cyclic redundancy check (CRC) function. In one embodiment, the mapping function involves a modulo operation, e.g. modulo division by j or a prime number close to j. In another embodiment, the mapping function extracts a predefined number of bits in the partition key and collates the extracted bits into the Partition ID.

<FIG> illustrate the data distribution in the Microsoft Azure Cosmos DB when the partition key is set to the marking code and a hash function is operated on the partition key to map it to a predefined number (j) of partitions. <FIG> is a plot of the amount of data (vertical axis) stored in each partition (horizontal axis) when the database <NUM> in configured with <NUM><NUM> partitions, and <FIG> is an enlarged view of <FIG> to show the variations between partitions in greater detail. <FIG> correspond to <FIG> when the database <NUM> in configured with <NUM><NUM> partitions. Compared to the plots in <FIG>, data are significantly more uniformly distributed across the partitions and the skewness is essentially eliminated.

<FIG> is a method <NUM> of generating marking codes in accordance with an embodiment. The method <NUM> may be executed in the system <NUM> of <FIG> or <FIG>. In step <NUM>, which may or may not be part of the method <NUM>, the package production data, PPD, is generated. Steps <NUM>-<NUM> are repeatedly performed for individual packages. Step <NUM>-<NUM> may be performed by the code generator <NUM>, and step <NUM> may be performed by the storage controller <NUM>. Step <NUM> obtains the PPD for a package. Step <NUM> operates the predefined encryption algorithm on the PPD to generate the encrypted package production data, EPD. Step <NUM> generates the marking code, MC, to include at least the EPD. Step <NUM> provides the marking code for marking of the package, for example by use of the marking device <NUM>. Step <NUM> stores the marking code (or a subset thereof) and the PPD (or a subset thereof) in the database <NUM>. The method <NUM> then proceeds to repeat steps <NUM>-<NUM>. In the illustrated embodiment, step <NUM> comprises further steps 606A-606D. Step 606A generates package itemization data, PID, as a function of the marking code and the PPD, for example by merging the marking code (or a subset thereof) and at least a subset of the data elements in the PPD into a common data item. Step 606B generates the partition key, PK, as a function of the marking code. Step 606C selects a partition in the database <NUM> based on the partition key, and step 606D stores the PID on the selected partition.

Claim 1:
A method of generating marking codes to uniquely identify packages for liquid food, said method comprising:
obtaining (<NUM>) package production data (PPD) which is unique to each individual package (<NUM>);
operating (<NUM>) a predefined encryption algorithm on the package production data (PPD) to generate encrypted package production data (EPD);
generating (<NUM>) a marking code (MC) that includes the encrypted package production data (EPD);
providing (<NUM>) the marking code (MC) for marking of the individual package (<NUM>); and
storing (<NUM>), in a database (<NUM>) that comprises a plurality of partitions (P1-Pj), package itemization data (PID) comprising at least a subset of the marking code (MC) and at least a subset of the package production data (PPD) of the individual package (<NUM>),
wherein said storing (<NUM>) comprises generating (606B) a partition key (PK) as a function of the marking code (MC), and operating a controller (<NUM>) coupled to the database (<NUM>) to determine (606C) a selected partition among the plurality of partitions (P1-Pj) based on the partition key (PK) and to store (606D) the package itemization data (PID) in the selected partition,
wherein the partition key (PK) equals to the marking code (MC), or the partition key (PK) equals the encrypted package production data (EPD) of the marking code (MC).