CN112016270B - Logistics information coding method, device and equipment of Chinese-character codes - Google Patents

Logistics information coding method, device and equipment of Chinese-character codes Download PDF

Info

Publication number
CN112016270B
CN112016270B CN202010936615.0A CN202010936615A CN112016270B CN 112016270 B CN112016270 B CN 112016270B CN 202010936615 A CN202010936615 A CN 202010936615A CN 112016270 B CN112016270 B CN 112016270B
Authority
CN
China
Prior art keywords
character
character string
mode
coding
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010936615.0A
Other languages
Chinese (zh)
Other versions
CN112016270A (en
Inventor
罗秋科
王毅
刘晓琰
孙小云
邵小景
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ARTICLE NUMBERING CENTER OF CHINA
Original Assignee
ARTICLE NUMBERING CENTER OF CHINA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ARTICLE NUMBERING CENTER OF CHINA filed Critical ARTICLE NUMBERING CENTER OF CHINA
Priority to CN202010936615.0A priority Critical patent/CN112016270B/en
Publication of CN112016270A publication Critical patent/CN112016270A/en
Application granted granted Critical
Publication of CN112016270B publication Critical patent/CN112016270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the application provides a method, a device and equipment for encoding logistics information of Chinese information codes, which are applied to a GS1 system, wherein the method comprises the following steps: acquiring symbol information corresponding to information to be encoded, wherein the symbol information comprises at least two character strings and at least one separator, and the separator is used for dividing the two character strings; coding the symbol information according to a preset sequence to obtain a coding result; the coding mode of the character string is a digital mode or a text mode, and the coding mode of the separator is a digital mode. The coding efficiency is improved.

Description

Logistics information coding method, device and equipment of Chinese-character codes
Technical Field
The present disclosure relates to the field of code identification, and in particular, to a method, an apparatus, and a device for encoding logistic information of a chinese-character code.
Background
At present, the two-dimensional code is a data carrier widely adopted in the logistics industry, for example, commodity data is written into the two-dimensional code, and a user can acquire the commodity data by scanning the two-dimensional code through mobile equipment (mobile phone and tablet personal computer).
In the prior art, commodity data is generally encoded using a GS1 (global standard for coding) encoding system. For example, commodity data is converted into GS1 data including numbers, letters and characters, and the GS1 data is encoded according to a GS1 encoding system to obtain a two-dimensional code corresponding to the GS1 data. However, when encoding GS1 data, it is necessary to encode a part of the GS1 data by an ASCII encoding method in which 8-bit byte pattern encoding is used for each character, resulting in low encoding efficiency.
Disclosure of Invention
The application provides a method, a device and equipment for encoding logistics information of Chinese information codes. The coding efficiency is improved.
In a first aspect, an embodiment of the present application provides a method for encoding logistics information of a han xin code, which is applied to a GS1 system, and the method includes:
acquiring symbol information corresponding to information to be encoded, wherein the symbol information comprises at least two character strings and at least one separator, and the separator is used for dividing the two character strings;
coding the symbol information according to a preset sequence to obtain a coding result; the coding mode of the character string is a digital mode or a text mode, and the coding mode of the separator is a digital mode.
In one possible implementation manner, the coding the symbol information according to a preset sequence to obtain a coding result includes:
determining a coding mode corresponding to the character string according to the content included in the character string, and coding the character string according to the coding mode;
and when the separator is identified, encoding the separator according to a digital mode.
In one possible implementation manner, determining the coding mode corresponding to the character string according to the content included in the character string includes:
Encoding a character preceding a text character in the character string according to the numerical mode;
and encoding text characters in the character string and characters after the text characters according to the text mode.
In one possible implementation, encoding the character preceding the text character in the string according to the numerical pattern includes:
dividing numbers in the character string into at least one group of characters, wherein the characters in each group of characters are decimal data;
acquiring binary data in each group of characters, wherein the length of the binary data is ten;
the determining of the first coding result corresponding to the digital mode coding comprises the following steps: binary data corresponding to decimal data in each group of characters, a first initiator and a first terminator, wherein the first initiator is positioned at a starting position of the first coding result, and the first terminator is positioned at a terminating position of the first coding result.
In one possible implementation, encoding the text characters in the character string and the characters subsequent to the text characters according to the text mode includes:
acquiring binary data corresponding to each character in the character string;
The determining of the second coding result corresponding to the character string comprises the following steps: binary data corresponding to each character, a second initiator and a second terminator, wherein the second initiator is positioned at the initial position of the second coding result, and the second terminator is positioned at the final position of the second coding result.
In a possible implementation manner, the coding mode of the separator is a digital mode, including:
the digital mode code corresponding to the separator is 1111101000.
In a second aspect, an embodiment of the present application provides a logistic information encoding apparatus of a han code, including: the system comprises a memory, a processor and a communication interface, wherein the memory is used for storing program instructions, and the processor is used for calling the program instructions in the memory to execute the stream information coding method of the Chinese code according to any one of the first aspect.
In a third aspect, embodiments of the present application provide a readable storage medium having a computer program stored thereon; the computer program is used for realizing the logistic information encoding method of the Chinese-character code according to any one of the first aspect.
In the method, the device and the equipment for encoding the logistics information of the Chinese-character code, in the encoding process, symbol information corresponding to information to be encoded, for example, character strings and separators of the character strings, are firstly obtained, the symbol information is encoded according to a preset sequence, and an encoding result is obtained, wherein the encoding mode of the character strings is a digital mode or a text mode, and the encoding mode of the separators is a digital mode. In this way, when coding, the separator is coded according to the digital mode, and when encountering the separator, the switching of the coding mode is not needed, thereby improving the coding efficiency.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a method for encoding logistics information of a han xin code according to an embodiment of the present application;
FIG. 3 is a schematic diagram of converting a character string into binary codes according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a process for encoding a character string according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another process for encoding a character string according to an embodiment of the present disclosure;
fig. 6 is a schematic process diagram of a method for encoding logistics information of a han xin code according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a logistic information encoding device of a han code according to an embodiment of the present application;
fig. 8 is a schematic hardware structure of a physical distribution information encoding device of a han xin code according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
For easy understanding, an application scenario of a system architecture to which the embodiments of the present application are applicable is described below with reference to fig. 1.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. Referring to fig. 1, according to the method for encoding the ms 1 system provided in the present application, commodity information is encoded into a two-dimensional code. The two-dimensional code package can be printed and attached to the surface of the logistics box. The commodity information can be obtained by using the terminal equipment to scan the Chinese letter code on the logistics box. For example, by means of the scanning function in the mobile phone, the two-dimensional code corresponding to the commodity information can be scanned, and the commodity information included in the two-dimensional code can be displayed on the mobile phone page.
It should be noted that fig. 1 illustrates, by way of example only, an application scenario used in the present application, and is not limited to the application scenario.
In the logistic information coding method of the Chinese-character code, in the coding process, symbol information corresponding to information to be coded, for example, character strings and separators of the character strings, are firstly obtained, the symbol information is coded according to a preset sequence, and a coding result is obtained, wherein the coding mode of the character strings is a digital mode or a text mode, and the coding mode of the separators is a digital mode. In this way, when coding, the separator is coded according to the digital mode, and when encountering the separator, the switching of the coding mode is not needed, thereby improving the coding efficiency.
The technical scheme shown in the application is described in detail through specific embodiments. It should be noted that the following embodiments may be combined with each other, and for the same or similar matters, the description will not be repeated in different embodiments.
Fig. 2 is a flow chart of a method for encoding logistics information of a han xin code according to an embodiment of the present application. Referring to fig. 2, the method may include:
s201, symbol information corresponding to information to be coded is obtained.
The execution body of the embodiment of the present application may be an electronic device, or may be an encoding apparatus provided in/out of the electronic device. Optionally, the electronic device may be a mobile phone, a computer, a wearable device, or the like. The coding device may be implemented by software, or may be implemented by a combination of software and hardware.
Alternatively, the information to be encoded may include the original data of the merchandise. For example, the information to be encoded may include the date of manufacture of the commodity, the shelf life of the commodity, the lot number of the commodity, the global trade item code of the commodity, and the like.
Optionally, the symbol information is information composed of characters for representing information to be encoded. The symbol information includes at least two character strings for representing original data of the commodity and at least one separator for dividing the two character strings. For example, the symbol information may be (01) 06901234567892 (10) 20181009% (21) 123456789, where (01) 06901234567892 represents global trade item code 06901234567892, (10) 20181009 represents lot number 20181009, (21) 123456789 represents serial number 123456789, and% represents separator.
Alternatively, the character string may be composed of data corresponding to the application identifier and the application identifier, where the application identifier may be composed of 2-bit, 3-bit or 4-bit digits, and is used to define meaning and format of the data corresponding to the application identifier. For example, the string may be (10) ABCD1234, where 10 is the application identifier indicating the lot number and ABDC1234 is the data corresponding to the lot number, i.e., the string indicates the lot number as: ABCD1234.
Optionally, the character string includes a fixed length unit character string and an indefinite length unit character string. The fixed-length unit string indicates that the data length corresponding to the application identifier is fixed. For example, the global trade item code may be represented as (01) 03453120000011, where 01 is an application identifier, represents the global trade item code, 03453120000011 represents data corresponding to the global trade item code, and its length is fixed. The indefinite length cell character indicates that the data length corresponding to the application identifier is indefinite. For example, the sequence number may be represented by (21) 123456789, where 21 is an application identifier, the sequence number is represented by 123456789, and the length of the data corresponding to the sequence number is not fixed, and may be 123456789 or 123456.
Alternatively, it may be determined whether the string is a fixed-length unit string or an indefinite-length unit string according to the application identifier. For example, the application identifier is 01, representing a global trade item code, and the format of the data after the application identifier is a fixed 14-bit number.
Optionally, when the symbol information corresponding to the information to be encoded includes a plurality of strings, each string may be connected in the order of the preceding fixed-length unit string and the following fixed-length unit string. For example, the symbol information corresponding to the information to be encoded includes 3 strings, wherein 1 string is a fixed-length unit string, 2 strings are indefinite-length unit strings, and the first string of the symbol information is a fixed-length unit string, and the second string and the third string are indefinite-length unit strings.
The separator is used to split two strings. For example, a separator may be added between two indefinite length cell strings to distinguish between the two indefinite length cell strings. Therefore, the two character strings with the variable length units can be prevented from being combined into one character string, and the coding accuracy is improved.
Optionally, no separator is required to be added between the fixed-length unit character strings and the variable-length unit character strings, and no separator is required to be added after the last character string in the symbol information.
Alternatively, the symbol information may be GS1 data, and the symbol information corresponding to the information to be encoded may be determined according to the following possible manner: and converting the original data in the information to be coded into symbol information according to the GS1 unit character string table. For example, the GS1 cell string table may be as shown in table 1:
TABLE 1
Application Identifier (AI) Data definition Coding format (AI + data)
01 Global trade item code N 2 +N 14
10 Batch number N 2 +X… 20
11 Production date (YYMDD) N 2 +N 6
15 Shelf life (YYMDD) N 2 +N 6
17 Expiration date (YYMDD) N 2 +N 6
21 Sequence number N 2 +X… 20
It should be noted that table 1 is merely an example and is not limited to the GS1 cell string table. Wherein N represents a digit; x represents a text character; n (N) 2 Representing a fixed length of 2 bitsIs a number of (a) digits; n (N) 6 A digit representing a fixed length of 6 bits; n (N) 14 A digit representing a fixed length of 14 bits; x … 20 Representing a variable length text character having a maximum length of 20.
For example, when the information to be encoded needs to encode the global trade item code, the application identifier in the symbol information is 01; when the information to be encoded needs to encode the batch number, an application identifier in the symbol information is 10; when the information to be encoded needs to encode the production date, an application identifier in the symbol information is 11; when the information to be encoded needs to encode the quality guarantee period, an application identifier in the symbol information is 15; when the information to be encoded needs to encode the validity period, an application identifier in the symbol information is 17; when the information to be encoded needs to encode the serial number, the application identifier in the symbol information is 21. For example, the code format of the symbol information of the global trade item code may be expressed as (01) 03453120000011; the burst number symbol information may be represented in a Bifiddle format as (10) ABCD1234; the code format of the symbol information of the production date may be expressed as (11) 20200101; the encoding format of the symbol information of the shelf life may be expressed as (15) 20200101; the encoding format of the symbol information of the validity period may be expressed as (17) 20200101; the coding format of the symbol information of the sequence number may be represented as (21) 123456789.
Alternatively, the type of the character string may be determined according to the encoding format. For example, the global trade item code corresponds to a code format of a fixed length 2 digits plus a fixed length 14 digits, and the global trade item code is a fixed length unit string of the type of the string; the code format corresponding to the batch number is a variable length text character with a fixed length of 2 digits and a maximum length of 20, and the character string type of the batch number is an indefinite length unit character string; the code format corresponding to the production date is a fixed-length 2-bit digital reinforced fixed-length 6-bit digital, and the character string type of the production date is a fixed-length unit character string; the code format corresponding to the quality guarantee period is that the number bit with the fixed length of 2 bits is used for reinforcing the data with the fixed length of 6 bits, and the character string type of the quality guarantee period is a character string of a fixed length unit; the code format corresponding to the validity period is a fixed-length 2-bit digit, a fixed-length 6-bit digit is reinforced, and the character string type of the validity period is a fixed-length unit character string; the code format corresponding to the serial number is a variable length text character with a fixed length of 2 digits and a maximum length of 20, and the character string type of the serial number is an indefinite length unit character string.
S202, coding the symbol information according to a preset sequence to obtain a coding result, wherein the coding mode of the character string is a digital mode or a text mode, and the coding mode of the separator is a digital mode.
Alternatively, the preset sequence may be a connection sequence of the character strings. For example, the preset order may be connected in an order in which all the indefinite length cell strings in the symbol information follow the definite length cell string.
Wherein the numeric mode may encode numeric characters in the string and the text mode may encode text characters in the string.
Alternatively, the symbol information may be encoded according to the following possible manner: and determining a coding mode corresponding to the character string according to the content included in the character string, and coding the character string according to the coding mode. Wherein the content included in the character string may include numbers, letters, combinations of numbers and letters and symbols. For example, the character string may be (21) 123456789 or (10) ABCD1234.
Optionally, the coding mode corresponding to the character string may be determined according to the content included in the character string according to the following possible implementation manner: characters preceding text characters in the string are encoded according to a numerical pattern. For example, in the character string (21) 123456789, all the characters are digital characters, and the character string is encoded by a digital pattern. The text characters and characters following the text characters in the character string are encoded according to the text mode. For example, in the character string ABCD1234, the characters in the character string include numeric characters and text characters, the text characters and characters following the text characters are encoded by text mode.
If the number character in the character string is before the text character, the character before the text character is encoded according to the number mode, and the text character and the character after the text character are encoded according to the text mode. For example, in string (10) ABCD1234, the characters in the string include numeric characters and text characters, numeric character 10 precedes the text characters, numeric character 1234 follows the text characters, character 10 is encoded by numeric mode, and character ABCD1234 is encoded by text. In the feasible implementation mode, the coding mode corresponding to the character string is determined according to the content included in the character string, and the content in the character string is coded through the digital mode and the text mode, so that the coding accuracy can be effectively improved.
In the process of coding according to the content in the character string, the separator is used for dividing two character strings with indefinite length units, and when the separator is identified, the separator is coded according to a digital mode. For example, (10) 20181009 and (21) 123456789 are two indefinite length unit strings, a separator may be added to the two indefinite length unit strings, (10) 20181009< fnc1> (21) 123456789, wherein < FNC1> is a separator between the two indefinite length unit strings, and < FNC1> is encoded according to a digital pattern in the encoding process.
And according to the determined coding mode, coding the symbol information according to a preset sequence to obtain a coding result. For example, the symbol information is 123456, the symbol information is divided into three groups of characters, wherein each group of characters is composed of three digital characters, the first group of characters is a decimal number 123 composed of digital characters, the second group of characters is a decimal number 456 composed of digital characters, binary data of 123 and 456 are obtained, the binary data are arranged according to the connection sequence of the character groups in the symbol information, and the coding result of the symbol information is 123456 is obtained: 00011110110111001000.
in the logistic information coding method of the Chinese-character code, in the coding process, symbol information corresponding to information to be coded, for example, character strings and separators of the character strings, are firstly obtained, the symbol information is coded according to a preset sequence, and a coding result is obtained, wherein the coding mode of the character strings is a digital mode or a text mode, and the coding mode of the separators is a digital mode. Therefore, when encoding is performed, the separator is encoded according to the digital mode, and the encoding mode of the character string is determined according to the content of the character string, so that the separator can be integrated into the encoding process of the character string, the separator is not required to be switched when the separator is encountered during encoding, the encoding efficiency is improved, meanwhile, separator symbols used for representing data in the character string are not confused with separator symbols used for separating the character string, and the encoding accuracy is improved.
In any of the above embodiments, the encoding process for each character string in the symbol information is the same, and the encoding process for any character string will be described below as an example.
Fig. 3 is a schematic diagram of converting a character string into binary codes according to an embodiment of the present application. Referring to fig. 3, the method may include:
s301, encoding characters before text characters in the character string according to the digital mode.
Characters preceding text characters in the string may be encoded according to a numerical pattern. For example, in the character string (21) 123456789, all the characters are digital characters, and the character string (21) 123456789 is encoded by a digital mode; in the string (10) ABCD1234, the number character 10 in the string is located before the text character a, and 10 in the string (10) ABCD1234 is encoded by the number pattern.
Alternatively, the characters preceding the text characters in the string may be encoded according to the numerical pattern according to the following possible manner: the method comprises the steps of dividing numbers in a character string into at least one group of characters, wherein the characters in each group of characters are decimal data, acquiring binary data in each group of characters, and the length of the binary data is ten. For example, the character string is 123456, the character string is encoded by an array mode, and the character string can be divided into two groups of characters according to the sequence of characters in the character string, wherein each group of characters comprises three digital characters, and the three digital characters can form decimal numbers; the character string 123456 may be divided into 123 and 456, where the ten-bit binary data corresponding to the obtained 123 is 0001111011, and the ten-bit binary data corresponding to the obtained 456 is 0111001000.
Alternatively, if the number of bits of the binary data is insufficient, the number of bits of the binary data may be supplemented by 0. For example, the number of digital characters in each group of characters in the character string is 3, the number of bits of binary data corresponding to decimal data in each group of characters is 10, if one group of digital characters in the character string is 123, the binary data corresponding to the group of digital characters is 1111011, and since ten bits are insufficient, the binary data corresponding to the group of digital characters is 0001111011.
Optionally, in the process of encoding the character string according to the digit mode, when the character string is divided into at least one group of characters, the number of the digit characters in the last group of characters is smaller than or equal to the number of the digit characters in the other character groups. For example, the string of the digital mode code is 12345678, the string of the digital mode code is divided into three groups of characters, wherein each group of characters is composed of three digital characters, and since the string of the digital mode code includes 8 digital characters, the first group of characters is 123, the second group of characters is 456, and the third group of characters is 78, and if the string of the digital mode code is 1234567, the string of the digital mode code is divided into three groups of characters, the first group of characters is 123, the second group of characters is 456, and the third group of characters is 7.
The determining of the first coding result corresponding to the digital mode coding comprises: binary data corresponding to decimal data in each group of characters, a first initiator and a first terminator, wherein the first initiator is positioned at a starting position of a first coding result, and the first terminator is positioned at a terminating position of the first coding result. For example, a first initiator is set at the start position of the first encoding result, which indicates that the first encoding result is an encoding result obtained by digital mode encoding, and a first terminator is added at the end position in the first encoding result, which indicates that the digital mode encoding is ended.
Alternatively, the first terminator may be determined based on the number of characters of the last group of characters in the string of numeric mode encoded characters. For example, the number of characters of the last group of characters in the string of numeric mode encoding may be 1 character, 2 characters, and 3 characters, with different numbers of characters corresponding to different first terminators.
The coding start position of the digital mode needs to be added with a first initiator, and the termination position of the digital mode coding needs to be added with a first terminator.
S302, coding text characters in the character strings and characters after the text characters according to the text mode.
The text characters in the character string and the characters following the text characters may be encoded according to a text pattern. For example, in the character string ABCD1234, the character string includes text characters and numeric characters, the numeric characters are located after the text characters, and the character string ABCD1234 is encoded by the text mode.
Alternatively, the character string may be encoded according to text mode according to the following possible manner: binary data corresponding to each character in the character string is obtained. For example, the character string is ABCD, the character string includes text characters, the character string ABCD is encoded by a text mode, binary data corresponding to each character in the character string can be obtained according to the sequence of the text characters in the character string, and for the character string ABCD encoded by the text mode, binary data corresponding to the character a, binary data corresponding to the character B, binary data corresponding to the character C, and binary data corresponding to the character D can be obtained respectively, where the binary data is arranged according to the sequence of the characters in the character string.
Alternatively, binary data corresponding to the characters in the text mode may be obtained according to a preset mode. For example, the Text mode encoded string is ABCD, the characters in the string are encoded according to the Text1 sub-mode in the Chinese code, the binary data corresponding to the character a is 001010, the binary data corresponding to the character B is 001011, the binary data corresponding to the character C is 001100, and the binary data corresponding to the character D is 001101, and the binary data is arranged according to the order of the characters in the string.
In the process of encoding the character string according to the text mode, the digital characters in the character string are also encoded according to the text mode. For example, the character string is ABCD1234, the digital characters in the character string are encoded by the text mode, and binary data corresponding to each digital character in the character string is obtained, that is, 1, 2, 3 and 4 are all required to obtain binary data corresponding to each character according to the preset mode, and the digital characters are encoded according to the text mode, so as to obtain binary data.
The determining of the second encoding result corresponding to the text mode encoded character string includes: binary data corresponding to each character, a second initiator and a second terminator, wherein the second initiator is positioned at the initial position of the second coding result, and the second terminator is positioned at the final position of the second coding result. For example, a second initiator is set at the start position of the second encoding result, which indicates that the second encoding result is an encoding result obtained according to the text mode encoding, and a second terminator is added at the end position in the second encoding result, which indicates that the text mode encoding is ended.
The start position of the text mode code requires the addition of a second initiator and the end position of the text mode code requires the addition of a second terminator.
S303, when the separator is encoded in the digital mode, the digital mode code corresponding to the separator is 1111101000.
Optionally, when encoding the separator according to the digital mode, if the encoding result before the separator is the first encoding result, no digital mode initiator needs to be added before encoding the separator, and if the encoding result before the separator is the second encoding result, no digital mode initiator needs to be added before encoding the separator, and the separator is encoded according to the digital mode.
According to the logistics information coding method of the Chinese-character codes, the coding mode corresponding to the character string is determined according to the content in the character string. And encoding the characters before the text characters in the character string according to the numerical mode, encoding the text characters in the character string and the characters after the text characters according to the numerical mode, and encoding the separators according to the numerical mode in the encoding process. Therefore, when encoding is carried out, according to the fact that the separator is integrated into the encoding process of the digital mode, the separator is encountered during encoding, the encoding mode is not required to be switched, meanwhile, separator symbols used for representing data in the character string cannot be confused with separator symbols used for separating the character string, and the encoding accuracy is improved.
On the basis of any one of the above embodiments, the following describes the encoding process of the character string in detail by way of specific example with reference to fig. 4 to 5.
Fig. 4 is a schematic diagram of a process of encoding a character string according to an embodiment of the present application. In the embodiment shown in fig. 4, the character string includes a numeric character, and the character string is encoded according to a numeric mode. Referring to fig. 4, the commodity information, the symbol information and the encoding result are included. Wherein the commodity information comprises the production date of the commodity, the validity period of the commodity and the global trade item code of the commodity. Commodity information is converted into symbol information according to the logistics information coding method of the Chinese character codes in the application, and the symbol information corresponding to the commodity information is obtained as symbol information which is composed of all digital characters: (01) 03453120000011 (17) 191125 (11) 20190101 where (01) 03453120000011 represents commodity global trade item code 03453120000011, (17) 191125 represents commodity expiration date 191125, and (11) 20190101 represents commodity date of production 20190101.
Grouping the character strings, wherein each group of characters comprises 3 characters, a grouping result of the character strings is obtained, and binary data corresponding to decimal data in each group of characters in the character strings is obtained according to the grouping result of the character strings, so that binary data of the character strings are obtained. And (3) arranging binary data according to the arrangement sequence of each group of characters in the character string to obtain the coding result of the character string. Wherein 0001 is the first initiator, the coding mode indicating the coding result is the digital mode, 1111111101 is the first terminator, and indicates the end of the digital mode coding.
Fig. 5 is a schematic diagram of another process for encoding a character string according to an embodiment of the present application. In the embodiment shown in fig. 5, the character string includes a numeric character and a text character, and the character string is encoded according to a numeric mode and a text mode. Referring to fig. 5, the commodity information, the symbol information, and the encoding result are included. The commodity information comprises a commodity batch number, a commodity validity period and a commodity global trade project code. Since the character string indicated by the application identifier in the commodity information is a fixed-length unit character, it is not necessary to add a separator.
According to the logistics information coding method of the Chinese-character codes, commodity information is converted into symbol information, and the characters in the symbol information are combined to obtain a character string with combined digital characters and text characters because the symbol information comprises the digital characters and the text characters. And carrying out coding mode analysis on the combined character strings, coding the characters before the text characters according to the numerical mode, coding the text characters and the characters after the text characters according to the text mode, and dividing the character strings into character strings coded in the numerical mode and character strings coded in the text mode. Grouping the character strings coded in the digital mode, wherein each group of characters comprises 3 digital characters, and acquiring binary data corresponding to decimal data of each group of characters of the character strings coded in the digital mode to obtain binary data of the character strings coded in the digital mode. And encoding each character in the character string encoded by the Text mode according to the Text1 sub-mode in the Chinese message code to obtain binary data of the character string encoded by the Text mode. And arranging binary data according to the arrangement sequence of the characters in the character string, and adding a first initiator, a first terminator, a second initiator and a second terminator to obtain the coding result of the commodity information. Wherein 0001 is the first initiator, 1111111110 is the first terminator, 0010 is the second initiator, 111111 bits of the second terminator.
On the basis of any one of the above embodiments, a method for encoding logistics information of a han-xin code will be described in detail below by way of a specific example with reference to fig. 6.
Fig. 6 is a schematic process diagram of a method for encoding logistics information of a han xin code according to an embodiment of the present application. Referring to fig. 6, commodity information, symbol information, and a coding result are included. The commodity information comprises a commodity batch number, a commodity validity period, a commodity global trade item code and a commodity serial number. Since the character string indicated by the application identifier of the lot number of the commodity is an indefinite length unit character and the character string indicated by the application identifier of the serial number of the commodity is an indefinite length unit character, a separator < FNC1> needs to be added between the lot number of the commodity and the serial number of the commodity in the symbol information for distinguishing the two indefinite length unit characters.
According to the logistics information coding method of the Chinese-character codes, commodity information is converted into symbol information, two indefinite-length character strings in the symbol information are grouped to obtain a character string 1 and a character string 2 because the symbol information comprises two indefinite-length unit characters, separators are added between the character string 1 and the character string 2, and coding mode analysis is carried out on the character string 1 and the character string 2. The numeric mode encoded string in string 1, the text mode encoded string, and the numeric mode encoded string in string 2 are determined.
Grouping the character strings coded in the digital mode in the character string 1, wherein each group of characters comprises 3 digital characters, and acquiring binary data corresponding to decimal data of each group of characters of the character string coded in the digital mode in the character string 1 to acquire binary data of the character string coded in the digital mode in the character string 1. And encoding each character of the Text mode encoded character string in the character string 1 according to the Text1 sub-mode in the Chinese message code to obtain binary data of the Text mode encoded character string in the character string 1. The character strings coded in the digital mode in the character string 2 are grouped by separating Fu Weishu character mode codes, and binary data corresponding to decimal data of each group of characters of the character string coded in the digital mode in the character string 2 are obtained, so that binary data of the character string coded in the digital mode in the character string 2 are obtained. The binary data encoded by the digital pattern of the separator is 1111101000.
The binary data is arranged according to the arrangement order of the character string 1, the separator, and the character string 2, and a first initiator, a first terminator, a second initiator, and a second terminator are added. Since the coding mode of the character string before the separator is text mode, the first initiator is added after the second terminator, and the separator is added in the coding of the character string in digital mode, so as to obtain the coding result. Wherein 0001 is the first initiator of string 1 and string 2, 1111111110 is the first terminator of string 1, 0010 is the second initiator of string 1, 111111 is the second terminator of string 1, 1111101000 is the separator, 1111111101 is the first terminator of string 2.
Optionally, if the separator is a character string coded in a digital mode before, the coding result of the character string coded in the digital mode does not need to add a first terminator, and the character string coded in the digital mode, the separator and the character after the separator are coded according to the digital mode, and the first terminator is added before a text character in the characters after the separator. For example, when the symbol information is 1234< FNC1>123, the first terminator is not required to be added after the 1234 is encoded, the first terminator is not required to be added before < FNC1>, and < FNC1> can be directly added in the encoding of the digital pattern of the character string, and since the number character 123 is not required after < FNC1>, the first terminator is not required to be added after the < FNC1>, and the first terminator is added after the encoding of the character string 123 according to the digital pattern is completed.
According to the logistics information coding method of the Chinese-character code, in the coding process, the separator is coded according to the digital mode and is added into the digital mode character string, so that when coding is carried out, the separator is encountered during coding without switching the coding mode, meanwhile, the separator symbol used for representing data in the character string is in a text mode, and the separator symbol used for separating the character string is confused, so that the coding accuracy is improved.
Fig. 7 is a schematic structural diagram of a physical distribution information encoding device of a han xin code according to an embodiment of the present application. The apparatus may be provided in a terminal device. Referring to fig. 7, the logistic information encoding device 10 of the han-xin code includes a reading module 11 and an encoding module 12, wherein:
the reading module 11 is configured to obtain symbol information corresponding to information to be encoded, where the symbol information includes at least two character strings and at least one separator, and the separator is configured to divide the two character strings;
the encoding module 12 is configured to encode the symbol information according to a preset sequence to obtain an encoding result; the coding mode of the character string is a digital mode or a text mode, and the coding mode of the separator is a digital mode.
In one possible implementation, the encoding module 12 is specifically configured to:
determining a coding mode corresponding to the character string according to the content included in the character string, and coding the character string according to the coding mode;
and when the separator is identified, encoding the separator according to a digital mode.
In one possible implementation, the encoding module 12 is specifically configured to:
Encoding a character preceding a text character in the character string according to the numerical mode;
and encoding text characters in the character string and characters after the text characters according to the text mode.
In one possible implementation, the encoding module 12 is specifically configured to:
dividing numbers in the character string into at least one group of characters, wherein the characters in each group of characters are decimal data;
acquiring binary data in each group of characters, wherein the length of the binary data is ten;
the determining of the first coding result corresponding to the digital mode coding comprises the following steps: binary data corresponding to decimal data in each group of characters, a first initiator and a first terminator, wherein the first initiator is positioned at a starting position of the first coding result, and the first terminator is positioned at a terminating position of the first coding result.
In one possible implementation, the encoding module 12 is specifically configured to:
acquiring binary data corresponding to each character in the character string;
the determining of the second coding result corresponding to the character string comprises the following steps: binary data corresponding to each character, a second initiator and a second terminator, wherein the second initiator is positioned at the initial position of the second coding result, and the second terminator is positioned at the final position of the second coding result.
In one possible implementation, the encoding module 12 is specifically configured to:
the digital mode code corresponding to the separator is 1111101000.
The logistic information encoding device of the Chinese message code provided by the embodiment of the invention can execute the technical scheme shown in the embodiment of the method, and the implementation principle and the beneficial effects are similar, and the description is omitted here.
Fig. 8 is a schematic hardware structure of a physical distribution information encoding device of a han xin code according to an embodiment of the present application. Referring to fig. 8, the logistics information encoding apparatus 20 of the han xin code may include: a processor 21 and a memory 22, wherein the processor 21 and the memory 22 may communicate; the processor 21 and the memory 22 are in communication via a communication bus 23, the memory 22 being for storing program instructions, the processor 21 being for invoking the program instructions in the memory to perform the method of encoding logistics information of a chinese-character code as shown in any of the method embodiments described above.
Optionally, the logistic information encoding device 20 of the han signal code may further include a communication interface, and the communication interface may include a transmitter and/or a receiver.
In the alternative, the processor may be a central processing unit, or may be another general purpose processor, a digital signal processor, an application specific integrated circuit, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor or in a combination of hardware and software modules within a processor.
The present application provides a readable storage medium having a computer program stored thereon; the computer program is used for realizing the method for encoding the logistics information of the Chinese-character codes according to any embodiment.
Embodiments of the present application provide a computer program product comprising instructions that, when executed, cause a computer to perform the method of encoding logistic information of chinese-character codes described above.
All or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. The program, when executed, performs steps including the method embodiments described above.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.
In the present application, the term "include" and variations thereof may refer to non-limiting inclusion; the term "or" and variations thereof may refer to "and/or". The terms "first," "second," and the like in this application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. In the present application, "plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.

Claims (7)

1. A logistic information coding method of a han-xin code, applied to a GS1 system, comprising the steps of:
acquiring symbol information corresponding to information to be encoded, wherein the symbol information comprises at least two character strings and at least one separator, and the separator is used for dividing the two character strings;
coding the symbol information according to a preset sequence to obtain a coding result; the character string is coded in a digital mode or a text mode, and the separator is coded in a digital mode;
Encoding the symbol information according to a preset sequence to obtain an encoding result, wherein the encoding result comprises the following steps:
determining a coding mode corresponding to the character string according to the content included in the character string, and coding the character string according to the coding mode;
encoding the separator according to a digital mode when the separator is identified;
according to the content included in the character string, determining the coding mode corresponding to the character string includes:
encoding a character preceding a text character in the character string according to the numerical mode;
and encoding text characters in the character string and characters after the text characters according to the text mode.
2. The method of claim 1, wherein encoding the character preceding the text character in the string according to the numerical pattern comprises:
dividing numbers in the character string into at least one group of characters, wherein the characters in each group of characters are decimal data;
acquiring binary data in each group of characters, wherein the length of the binary data is ten;
the determining of the first coding result corresponding to the digital mode coding comprises the following steps: binary data corresponding to decimal data in each group of characters, a first initiator and a first terminator, wherein the first initiator is positioned at a starting position of the first coding result, and the first terminator is positioned at a terminating position of the first coding result.
3. The method of claim 1, wherein encoding text characters in the string and characters subsequent to the text characters according to the text pattern comprises:
acquiring binary data corresponding to each character in the character string;
the determining of the second coding result corresponding to the character string comprises the following steps: binary data corresponding to each character, a second initiator and a second terminator, wherein the second initiator is positioned at the initial position of the second coding result, and the second terminator is positioned at the final position of the second coding result.
4. A method according to any of claims 1-3, wherein the coding mode of the separator is a digital mode, comprising:
the digital mode code corresponding to the separator is 1111101000.
5. The utility model provides a logistics information encoding device of chinese-character code, is applied to GS1 system, characterized by including reading module and coding module, wherein:
the reading module is used for acquiring symbol information corresponding to information to be encoded, wherein the symbol information comprises at least two character strings and at least one separator, and the separator is used for dividing the two character strings;
the coding module is used for coding the symbol information according to a preset sequence to obtain a coding result; the character string is coded in a digital mode or a text mode, and the separator is coded in a digital mode;
The coding module is specifically used for:
determining a coding mode corresponding to the character string according to the content included in the character string, and coding the character string according to the coding mode;
encoding the separator according to a digital mode when the separator is identified;
the encoding module is specifically configured to, when determining an encoding mode corresponding to the character string according to content included in the character string:
encoding a character preceding a text character in the character string according to the numerical mode;
and encoding text characters in the character string and characters after the text characters according to the text mode.
6. A logistic information encoding apparatus of a han-xin code, comprising: a memory for storing program instructions, a processor for invoking the program instructions in the memory to perform the method of encoding logistics information of a han-xin code as defined in any one of claims 1-4, and a communication interface.
7. A readable storage medium having a computer program stored thereon; the computer program is used for realizing the logistic information encoding method of the Chinese-character codes according to any one of claims 1 to 4.
CN202010936615.0A 2020-09-08 2020-09-08 Logistics information coding method, device and equipment of Chinese-character codes Active CN112016270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010936615.0A CN112016270B (en) 2020-09-08 2020-09-08 Logistics information coding method, device and equipment of Chinese-character codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010936615.0A CN112016270B (en) 2020-09-08 2020-09-08 Logistics information coding method, device and equipment of Chinese-character codes

Publications (2)

Publication Number Publication Date
CN112016270A CN112016270A (en) 2020-12-01
CN112016270B true CN112016270B (en) 2024-04-02

Family

ID=73521241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010936615.0A Active CN112016270B (en) 2020-09-08 2020-09-08 Logistics information coding method, device and equipment of Chinese-character codes

Country Status (1)

Country Link
CN (1) CN112016270B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113627578B (en) * 2021-08-09 2024-02-09 中国物品编码中心 Two-dimensional code generation method, identification device, two-dimensional code, device and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364142A (en) * 2007-08-08 2009-02-11 孙强国 Method for inputting Chinese characters by numeric keyboard of mobile phone
CN102156825A (en) * 2011-03-28 2011-08-17 重庆大学 Cancer vaccine trial data encoding and processing method based on data mining
CN102592160A (en) * 2012-01-17 2012-07-18 浙江工商大学 Character two-dimension code encoding and decoding method for short message
CN102650989A (en) * 2011-02-23 2012-08-29 上海博路信息技术有限公司 Content parsing system based on digital object identification
CN105450232A (en) * 2014-08-28 2016-03-30 华为技术有限公司 Encoding method, decoding method, encoding device and decoding device
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium
CN111311229A (en) * 2018-12-11 2020-06-19 北京意锐新创科技有限公司 Chinese-sensible code based passive code scanning method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364142A (en) * 2007-08-08 2009-02-11 孙强国 Method for inputting Chinese characters by numeric keyboard of mobile phone
CN102650989A (en) * 2011-02-23 2012-08-29 上海博路信息技术有限公司 Content parsing system based on digital object identification
CN102156825A (en) * 2011-03-28 2011-08-17 重庆大学 Cancer vaccine trial data encoding and processing method based on data mining
CN102592160A (en) * 2012-01-17 2012-07-18 浙江工商大学 Character two-dimension code encoding and decoding method for short message
CN105450232A (en) * 2014-08-28 2016-03-30 华为技术有限公司 Encoding method, decoding method, encoding device and decoding device
CN111311229A (en) * 2018-12-11 2020-06-19 北京意锐新创科技有限公司 Chinese-sensible code based passive code scanning method and device
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Yancong Zhou 等.Research and Implementation of Product's Encoding Intelligent Transformation in Supply China.《2009 Second International Conference on Intelligent Networksemantics and Intelligent Systems》.2009,649-652. *
魏维娜.汉信码在商品条码质量检测中的应用研究.《中国优秀硕士学位论文全文数据库》.2018,I138-1837. *

Also Published As

Publication number Publication date
CN112016270A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN112711935A (en) Encoding method, decoding method, apparatus and computer readable storage medium
CN103400174B (en) The coded method of a kind of Quick Response Code, coding/decoding method and system
US6196466B1 (en) Data compression method using multiple base number systems
US4099257A (en) Markov processor for context encoding from given characters and for character decoding from given contexts
CN100377173C (en) Two-dimensional code construction based on hexadecimal coding
CN116506073B (en) Industrial computer platform data rapid transmission method and system
WO2007149384B1 (en) Data coding
CN101008890A (en) Compression and uncompression method of integral data and device thereof
CN104579360A (en) Method and equipment for data processing
CN112016270B (en) Logistics information coding method, device and equipment of Chinese-character codes
CN111784812A (en) Rendering method, rendering device, storage medium and electronic equipment
CN109660527B (en) Compression transmission method for printer data
CN112152634B (en) Block compression encoding method, device, computer equipment and readable storage medium
CN101796573A (en) Electronic apparatus, character sequence display method, multiple character sequence sorting method and character sequence display/sort program
EP0026267B1 (en) Method and apparatus for compressing and decompressing strings of electrical binary data bits
CN103036641A (en) Method and system of data exchange and deserialization method
CN112200286A (en) Method and device for character string coding
EP2442256A1 (en) Method of encoding and decoding text on a matrix code symbol
CN1201614C (en) Backwards compatible, extended method to execute check number calculation of IMEI
CN111428442B (en) Data conversion method, system and storage medium without dictionary table
CN110569946B (en) QR code generation method suitable for inkjet printer
CN111368508A (en) Data processing method, device, equipment and medium
CN114500670A (en) Encoding compression method, decoding method and device
CN106874979B (en) Bar code processing, displaying and reading method and device
CN104442054A (en) Two-dimension code printing method and device based on mainframe platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant