A method, device and terminal device for identifying an identity
Through the sequence-to-sequence model, the Internet of Things identification code is encoded and decoded to identify the identification category, which solves the problem that different Internet of Things identification codes cannot be interoperable in the prior art, and realizes the automatic identification and analysis of heterogeneous identifiers.
Patent Information
- Application Number
- CN202011232011.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-11-06
AI Technical Summary
The prior art cannot realize the analysis and interoperability between different Internet of Things identification codes, resulting in difficulties in mutual recognition of data and resource sharing.
The sequence-to-sequence model is used to encode and decode the Internet of Things identification coding. By obtaining semantic vectors and one-hot encoding sequence identification categories, the automatic identification and analysis of heterogeneous identification is realized.
Without creating a new identification system or changing the existing system, automatic identification and analysis of heterogeneous Internet of Things identification codes is realized, solving the problem of interoperability of different encodings.
Smart Images

Figure CN114444443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an identification recognition method, device and terminal equipment. Background Art
[0002] IoT identifiers are name tags used to identify different IoT objects. Product codes, device serial numbers, device network addresses, page Uniform Resource Identifiers (URIs), etc. are all IoT identifiers. With the rapid development of IoT, different countries and different fields have continuously introduced IoT identification systems, resulting in the coexistence of multiple heterogeneous IoT identifiers. Due to the differences in the encoding format and parsing method of each identifier, data mutual recognition and resource sharing between IoT systems face severe challenges, hindering the further development of IoT.
[0003] Since there are many different encoding methods currently used, the corresponding encoding parsing system needs to be used to complete the parsing when performing identification. It is impossible to use a unified identification system to complete the parsing and interoperability of different encodings. In addition, in order to achieve automatic identification of heterogeneous IoT identifiers, it is currently possible to pre-agreed on the mapping rules of other encodings through compatibility identifiers to achieve compatibility of heterogeneous identifiers, and then complete the automatic identification and parsing of heterogeneous identifiers. Although this method of using a compatible identification system can achieve interoperability of some identification systems, it requires pre-conversion of different encoding methods and cannot meet the needs of identification recognition. Summary of the invention
[0004] The purpose of the present invention is to provide an identification recognition method, device and terminal equipment to solve the current problem that different codes cannot be parsed and communicated.
[0005] To achieve the above object, an embodiment of the present invention provides a method for identifying an identifier, comprising:
[0006] Get the IoT identification code;
[0007] Segment the characters in the IoT identification code to obtain a first sequence;
[0008] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0009] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs;
[0010] The Internet of Things identification code is identified and processed according to the target code category corresponding to the one-hot coding sequence.
[0011] Optionally, segmenting the characters in the IoT identification code to obtain a first sequence includes:
[0012] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0013] The character sequence is determined as the first sequence.
[0014] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes:
[0015] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0016] The first one-hot vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0017] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0018] Optionally, segmenting the characters in the IoT identification code to obtain a first sequence includes:
[0019] Segment the characters in the IoT identifier code according to the Chinese language model (n-gram) to obtain an n-gram string sequence;
[0020] The n-gram string sequence is determined as the first sequence.
[0021] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes:
[0022] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0023] Using the word vector as the input of the recurrent neural network unit in the encoder to obtain the vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0024] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0025] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a one-hot encoded sequence includes:
[0026] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0027] The sequence composed of the output elements of all recurrent neural network units in the decoder is determined as the one-hot encoding sequence.
[0028] Optionally, the identifying process of the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence includes:
[0029] According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category;
[0030] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0031] To achieve the above-mentioned purpose, an embodiment of the present invention provides an identification recognition device, comprising:
[0032] An acquisition module is used to obtain the IoT identification code;
[0033] A processing module, used for segmenting the characters in the IoT identification code to obtain a first sequence;
[0034] an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence;
[0035] A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs;
[0036] The recognition module is used to identify the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence.
[0037] Optionally, the processing module includes:
[0038] A first processing unit, configured to segment the characters in the IoT identification code according to each character to obtain a character sequence;
[0039] The second processing unit is configured to determine the character sequence as the first sequence.
[0040] Optionally, the encoding module includes:
[0041] A first conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0042] A first encoding unit, used to use the first one-hot vector as an input of a recurrent neural network unit in the encoder, and obtain a vector output by a last recurrent neural network unit; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0043] The first determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0044] Optionally, the processing module includes:
[0045] A third processing unit is used to segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0046] The fourth processing unit is used to determine the n-gram string sequence as the first sequence.
[0047] Optionally, the encoding module includes:
[0048] A second conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0049] A second encoding unit is used to use the word vector as an input of a recurrent neural network unit in the encoder to obtain a vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0050] The second determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0051] Optionally, the decoding module includes:
[0052] A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder;
[0053] The third determination unit is used to determine the sequence composed of the output elements of all the recurrent neural network units in the decoder as the one-hot encoding sequence.
[0054] Optionally, the identification module includes:
[0055] A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the one-hot coding sequence;
[0056] The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
[0057] To achieve the above object, an embodiment of the present invention provides a terminal device, including: a transceiver and a processor;
[0058] The transceiver is used to obtain the Internet of Things identification code;
[0059] The processor is used to:
[0060] Segment the characters in the IoT identification code to obtain a first sequence;
[0061] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0062] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs;
[0063] The Internet of Things identification code is identified and processed according to the target code category corresponding to the one-hot coding sequence.
[0064] Optionally, the processor is further configured to:
[0065] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0066] The character sequence is determined as the first sequence.
[0067] Optionally, the processor is further configured to:
[0068] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0069] The first one-hot vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0070] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0071] Optionally, the processor is further configured to:
[0072] Segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0073] The n-gram string sequence is determined as the first sequence.
[0074] Optionally, the processor is further configured to:
[0075] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0076] Using the word vector as the input of the recurrent neural network unit in the encoder to obtain the vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0077] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0078] Optionally, the processor is further configured to:
[0079] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0080] The sequence composed of the output elements of all recurrent neural network units in the decoder is determined as the one-hot encoding sequence.
[0081] Optionally, the processor is further configured to:
[0082] According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category;
[0083] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0084] To achieve the above-mentioned purpose, an embodiment of the present invention provides a terminal device, including: a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the steps of the identification method as described above are implemented.
[0085] To achieve the above objective, an embodiment of the present invention provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the identification method described above are implemented.
[0086] To achieve the above object, an embodiment of the present invention provides a method for identifying an identifier, comprising:
[0087] Get the IoT identification code;
[0088] Segment the characters in the IoT identification code to obtain a first sequence;
[0089] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0090] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs;
[0091] The Internet of Things identification code is identified and processed according to the target code category corresponding to the binary code sequence.
[0092] Optionally, segmenting the characters in the IoT identification code to obtain a first sequence includes:
[0093] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0094] The character sequence is determined as the first sequence.
[0095] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes:
[0096] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0097] The first one-hot encoding vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0098] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0099] Optionally, segmenting the characters in the IoT identification code to obtain a first sequence includes:
[0100] Segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0101] The n-gram string sequence is determined as the first sequence.
[0102] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes:
[0103] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0104] The word vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0105] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0106] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a binary encoding sequence comprises:
[0107] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0108] The sequence formed by the output elements of all recurrent neural network units in the decoder is determined as the binary coding sequence.
[0109] Optionally, the identifying process of the Internet of Things identification code according to the target code category corresponding to the binary code sequence includes:
[0110] According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category;
[0111] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0112] To achieve the above object, an embodiment of the present invention further provides an identification recognition device, comprising:
[0113] An acquisition module is used to obtain the IoT identification code;
[0114] A processing module, used for segmenting characters in the Internet of Things identification code to obtain a first sequence;
[0115] an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence;
[0116] A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs;
[0117] The identification module is used to identify the Internet of Things identification code according to the target code category corresponding to the binary code sequence.
[0118] Optionally, the processing module includes:
[0119] A first processing unit, configured to segment the characters in the IoT identification code according to each character to obtain a character sequence;
[0120] The second processing unit is configured to determine the character sequence as the first sequence.
[0121] Optionally, the encoding module includes:
[0122] A first conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0123] A first encoding unit, used to use the first one-hot encoding vector as an input of a recurrent neural network unit in the encoder, and obtain a vector output by the last recurrent neural network unit; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0124] The first determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0125] Optionally, the processing module includes:
[0126] A third processing unit is used to segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0127] The fourth processing unit is used to determine the n-gram string sequence as the first sequence.
[0128] Optionally, the encoding module includes:
[0129] A second conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0130] A second encoding unit is used to use the word vector as an input of a recurrent neural network unit in the encoder and obtain a vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0131] The second determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0132] Optionally, the decoding module includes:
[0133] A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder;
[0134] The third determination unit is used to determine the sequence composed of output elements of all recurrent neural network units in the decoder as the binary coding sequence.
[0135] Optionally, the identification module includes:
[0136] A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the binary coding sequence;
[0137] The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
[0138] To achieve the above object, an embodiment of the present invention further provides a terminal device, including: a transceiver and a processor;
[0139] The transceiver is used to obtain the Internet of Things identification code;
[0140] The processor is used to:
[0141] Segment the characters in the IoT identification code to obtain a first sequence;
[0142] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0143] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs;
[0144] The Internet of Things identification code is identified and processed according to the target code category corresponding to the binary code sequence.
[0145] Optionally, the processor is further configured to:
[0146] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0147] The character sequence is determined as the first sequence.
[0148] Optionally, the processor is further configured to:
[0149] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0150] The first one-hot encoding vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0151] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0152] Optionally, the processor is further configured to:
[0153] Segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0154] The n-gram string sequence is determined as the first sequence.
[0155] Optionally, the processor is further configured to:
[0156] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0157] The word vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0158] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0159] Optionally, the processor is further configured to:
[0160] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0161] The sequence formed by the output elements of all recurrent neural network units in the decoder is determined as the binary coding sequence.
[0162] Optionally, the processor is further configured to:
[0163] According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category;
[0164] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0165] To achieve the above-mentioned purpose, an embodiment of the present invention provides a terminal device, including: a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the steps of the identification method as described above are implemented.
[0166] To achieve the above objective, an embodiment of the present invention provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the identification method described above are implemented.
[0167] The beneficial effects of the above technical solution of the present invention are as follows:
[0168] The embodiment of the present invention automatically identifies the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic identification of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem that parsing and intercommunication of different codes cannot be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0169] Figure 1 One of the flow charts of the identification method according to an embodiment of the present invention;
[0170] Figure 2 This is one of the schematic diagrams of the architecture of the sequence-to-sequence model according to an embodiment of the present invention;
[0171] Figure 3 A flowchart of sequence-to-sequence model training according to an embodiment of the present invention;
[0172] Figure 4 This is a second schematic diagram of the architecture of a sequence-to-sequence model according to an embodiment of the present invention;
[0173] Figure 5 This is a third schematic diagram of the architecture of a sequence-to-sequence model according to an embodiment of the present invention;
[0174] Figure 6 This is a second flowchart of the identification method according to an embodiment of the present invention;
[0175] Figure 7 This is a fourth schematic diagram of the architecture of a sequence-to-sequence model according to an embodiment of the present invention;
[0176] Figure 8 This is a fifth schematic diagram of the architecture of a sequence-to-sequence model according to an embodiment of the present invention;
[0177] Fig. 9 A schematic diagram of a normal process of a heterogeneous identification service use case in an embodiment of the present invention;
[0178] Fig.10 A high-level schematic diagram illustrating a heterogeneous identity recognition service according to an embodiment of the present invention;
[0179] Fig.11 One of the block diagrams of the terminal device according to the embodiment of the present invention;
[0180] Fig.12 This is a second block diagram of a terminal device according to an embodiment of the present invention;
[0181] Fig.13 This is the third block diagram of the terminal device according to the embodiment of the present invention. DETAILED DESCRIPTION
[0182] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0183] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0184] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0185] Additionally, the terms "system" and "network" are often used interchangeably herein.
[0186] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0187] The embodiment of the present invention provides an identification recognition method to solve the problem that the parsing and intercommunication of different codes cannot be realized at present.
[0188] Optionally, based on the compatibility and scalability of the identification system, identification can be divided into two categories: proprietary identification and compatible identification.
[0189] Proprietary identification has an independent coding structure and a fixed identification field or identification object, such as GS1 (including European Article Number (EAN), bar code (UCC)), Electronic Product Code (EPC), sensor node identification, Internet Protocol version 4 (IPv4), Internet Protocol Version 6 (IPv6), etc.
[0190] Compatibility identification supports the identification of any object in different fields. It is a comprehensive identification system. Common comprehensive identification systems include Handle, object identifier also known as IoT domain name (Object Identifier, OID) and national IoT identification system (Entity Code, Ecode).
[0191] Handle is a globally distributed system that defines a set of hierarchical service models, as well as the corresponding global resolution system and segment management operation and maintenance mechanism. It can provide services such as identification definition, dynamic resolution, and security management for digital objects. Its encoding structure is: authoritative domain (prefix) / local naming (suffix). An authoritative domain can have several sub-authoritative domains, separated from left to right by ".". The prefix and suffix are separated by " / ". For example: "86.1000.15 / 201308081001".
[0192] OID is an identification mechanism jointly proposed by the International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) and the International Telegraph and Telephone Consultative Committee (ITU-T). It uses a hierarchical tree structure to globally unambiguously and uniquely name any type of object, concept or "thing". Its encoding structure is: a tree structure, with "." separating different levels, and no limit on the number of levels. When identifying an object, the identifier is a combination of the nodes on the entire path from the root to the leaf.
[0193] Ecode is a coding solution independently developed by China that is suitable for any object in the Internet of Things. It is composed of Ecode coding, data identification, middleware, parsing system, information query and discovery services, security mechanisms, etc. It is a complete system. Its coding structure is: version (V) + coding system identification (NSI) + master code (MD). Among them, V is used to distinguish Ecodes of different data structures. NSI is used to indicate the code of a certain identification system. MD is used to indicate the standardized coding in a certain industry or application system.
[0194] Ecode forms a complete Ecode by agreeing on the corresponding version (V) and coding system identifier (NSI) combination for different identification systems, and using the code in the original coding system as the main code (MD) in Ecode. For example: "100036901234567892", where V is 1 and NSI is 0003, the combination of V and NSI 1003 corresponds to the GS1 item coding system, and "6901234567892" is the item identification code in GS1. When parsing, Ecode first determines the identification system of the MD part through V and NSI, and then sends the MD part to the corresponding parsing system to complete the parsing.
[0195] like Figure 1 As shown, a method for identifying an identifier in an embodiment of the present invention includes:
[0196] Step 11: Get the IoT ID code.
[0197] Step 12: Segment the characters in the IoT identification code to obtain a first sequence.
[0198] Step 13: Input the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence.
[0199] Step 14: Input the semantic vector into the decoder in the sequence-to-sequence model for decoding to obtain a one-hot encoded sequence.
[0200] Among them, the one-hot coding sequence is used to indicate the number of the target coding category to which the Internet of Things identification code belongs.
[0201] Step 15: According to the target coding category corresponding to the one-hot coding sequence, the Internet of Things identification code is identified.
[0202] For example, obtaining the IoT identification code on different carriers such as QR code, bar code, Radio Frequency Identification (RFID), etc. Of course, the method of obtaining the IoT identification code in the embodiment of the present invention is not limited to this.
[0203] Optionally, the characters in the IoT identification code may be segmented into single characters or character strings, thereby converting the identification into a sequence form. In this way, the sequence obtained by converting the IoT identification code is used as the input of a sequence to sequence (seq2seq) model to obtain a sequence indicating the identification category to which the IoT identification code belongs.
[0204] Among them, the sequence-to-sequence model belongs to a type of encoder-decoder structure. The basic idea is to use a recurrent neural network (RNN), such as a long short-term memory network (LSTM) as an encoder and decoder. Figure 2 shown.
[0205] The encoder is responsible for compressing the input sequence into a vector of a specified length. This vector can be regarded as the semantics of the sequence. This process is called encoding. Optionally, the last input hidden state h m As a semantic vector, the last hidden state can be transformed to obtain a semantic vector, and all hidden states of the input sequence can be transformed to obtain a semantic vector.
[0206] The decoder is responsible for generating the specified sequence based on the semantic vector, a process also called decoding. Optionally, the semantic variable obtained by the encoder can be input into the decoder's RNN as the initial state to obtain the output sequence. For example, the output of the previous moment will be used as the input of the current moment, and the semantic vector is used as the decoder's initial state to participate in the operation.
[0207] In addition, the encoder and decoder of the sequence-to-sequence model each have an embedding layer, which is responsible for converting each element in the sequence into a vector form, thereby participating in the calculation of the hidden state and predicted output of each unit.
[0208] The above scheme of the present invention automatically identifies the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic identification of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem that parsing and intercommunication of different codes cannot be achieved.
[0209] In addition, the scheme adopts one-hot encoding at the decoder end, that is, assigning a unique integer to each identification category, and then converting the number into an N-bit (N is the total number of identification categories supported by the sequence-to-sequence model) one-hot encoding as the output sequence. In this way, the output sequence is actually a binary sequence containing only 0 and 1. In the embedding layer of the decoder, each element in the output sequence can be represented by a 2-dimensional one-hot vector, ensuring a simpler decoding process.
[0210] Optionally, a sequence-to-sequence model for identifying the identification category to which the Internet of Things identification code belongs can be trained in advance. After the sequence-to-sequence model is trained, the sequence converted from the Internet of Things identification code to be identified is used as the input of the sequence-to-sequence model to obtain a sequence for indicating the identification category to which the Internet of Things identification code belongs.
[0211] Among them, the sequence-to-sequence model used to identify the category of the IoT identification code is trained, that is, the automatic identification of the identification code category is converted into a sequence-to-sequence learning problem, and the encoding system of the input identification is obtained by decoding the output sequence of the model decoder to achieve accurate classification of the identification. Figure 3 As shown, the training process of the sequence-to-sequence model may include:
[0212] Step 31: The identification code of each identification category is regarded as a class of samples, and the agreed digital number of the identification category is regarded as the label.
[0213] For example, the digital number corresponding to the identification category OID is 1, the digital number corresponding to the identification category Ecode is 2, the digital number corresponding to the identification category EAN is 3, etc.; the numbers corresponding to the specific identification categories can be pre-set, and the embodiments of the present invention are not limited thereto.
[0214] Step 32: Convert the identification code samples in the training set into sequence form.
[0215] Step: 33: Each element of the input sequence is converted into a vector form through the embedding layer of the encoder as the input of the encoder.
[0216] Step 34: Convert the identification category number corresponding to the identification code sample into a sequence form.
[0217] For example, the number identifying the category can be converted into a sequence containing 0 and 1.
[0218] Step 35: Convert each element of the output sequence into a 2D one-hot vector through the embedding layer of the decoder as the input of the decoder.
[0219] Step 36: After completing serialization and vectorization, train the sequence-to-sequence model.
[0220] Optionally, as an implementation method: the step of segmenting the characters in the IoT identification code to obtain the first sequence may specifically include:
[0221] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0222] The character sequence is determined as the first sequence.
[0223] In the embodiment of the present invention, in the sequence-to-sequence model, the identifier code is the input of the encoder, and the identifier category corresponding to the identifier code is the output of the encoder. In order to meet the requirements of the sequence-to-sequence model for input and output, it is necessary to convert the identifier and its system into a sequence form, and it is necessary to design the embedding layer of the encoder and the embedding layer of the decoder to obtain a vector representation of each sequence element.
[0224] Each identification code is a string consisting of characters, numbers and special symbols (such as '.' '-', etc.). In this embodiment, it can be converted into a character sequence by character segmentation. For example, taking the EAN identification "6945091708456" as an example, "6945091708456" is segmented according to each character to obtain the sequence {6,9,4,5,0,9,1,7,0,8,4,5,6}.
[0225] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence may specifically include:
[0226] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0227] The first one-hot vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0228] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0229] Optionally, converting each character in the first sequence into a first one-hot vector through the embedding layer of the encoder includes: converting each character in the first sequence into a 128-dimensional first one-hot vector according to an ASCII code corresponding to the character through the embedding layer of the encoder.
[0230] For example: In the embedding layer of the encoder, one-hot encoding is used to convert each character into a 128-dimensional one-hot vector. One-hot encoding is the representation of categorical variables as binary vectors. Each integer value is represented as a binary vector. Except for the index of the integer, it is all zero value, which is marked as 1. In the ASCII encoding system, each character corresponds to an integer number from 0 to 127, and the index of 1 in its one-hot vector is the ASCII code of the character. For example, the ASCII code of the character '6' is 54, so the corresponding one-hot vector index 54 (the 55th element in the vector) has a value of 1, and the rest are 0.
[0231] Furthermore, after the semantic vector outputted by the encoder is obtained, it can be used as the input of the decoder, or it can be used as the input of the decoder after being transformed. In addition, the semantic vector obtained after all the implicit states outputted by the encoder are transformed can also be used as the input of the decoder, but the embodiment of the present invention is not limited thereto.
[0232] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a one-hot encoded sequence may specifically include:
[0233] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0234] The sequence composed of the output elements of all recurrent neural network units in the decoder is determined as the one-hot encoding sequence.
[0235] For example, at the decoder end, a unique integer is assigned to each identification category, and then the number is converted into an N-bit (N is the total number of identification categories supported by the seq2seq model) one-hot encoding as the output sequence, so that the output sequence is actually a binary sequence containing only 0 and 1. At the embedding layer of the decoder, each element in the output sequence is represented by a 2-dimensional one-hot vector, and the output sequence of the decoder is decoded to obtain the identification category corresponding to the IoT identification code.
[0236] Optionally, the step of identifying the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence may specifically include:
[0237] According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category;
[0238] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0239] For example, the EAN identification code "6945091708456" mentioned above is parsed by the China Article Coding Center, so the parsing of the "6945091708456" identification can be completed by calling its parsing service.
[0240] In this way, the identification category to which the IoT identification code belongs is obtained through sequence-to-sequence model recognition, and a suitable parsing system is selected to automatically parse the IoT identification code, thereby ensuring automatic recognition of heterogeneous IoT identification codes without creating a new identification system or changing the existing identification system.
[0241] The above method is described below with reference to a specific example:
[0242] like Figure 4 As shown, the training set of the sequence-to-sequence model contains 20 identification categories, taking the EAN identification code as "6945091708456" and the number corresponding to the EAN identification category as 3 as an example.
[0243] The EAN identifier code "6945091708456" is converted to the sequence {6,9,4,5,0,9,1,7,0,8,4,5,6}. In the embedding layer of the encoder, each character is converted into a 128-dimensional one-hot vector according to its ASCII code value. For example, the ASCII code of the character '6' is 54, so the corresponding one-hot vector index is 54 (the 55th element in the vector) with a value of 1, and the rest are 0.
[0244] The output sequence of the decoder is 00100…00 (length is 20, because the number corresponding to the EAN system is 3, the third bit of the output sequence is set to 1, and the rest are 0). At the decoder end, the output of the previous LSTM is used as the input of the next LSTM (such as the output of H1 is used as the input of H2, and the input of H1 can be a starting default value, such as 0 or 1). For the output sequence of the decoder, the elements only contain '0' and '1', the vector of 0 is {1,0}, and the vector of 1 is {0,1}.
[0245] In the above scheme of the present invention, the encoder adopts character encoding, and the decoder adopts one-hot encoding to represent the identification category. In the embedding layer of the encoder, each character is represented by a 128-dimensional one-hot vector, and the index position of 1 in the vector is the ASCII code value corresponding to the character. In the embedding layer of the decoder, each one-hot element value is represented by a 2-dimensional 0-1 vector. This scheme is aimed at the situation where the storage space is limited and the identification categories are few, and can accurately and effectively identify the identification category corresponding to the Internet of Things identification, and it is more concise.
[0246] Optionally, the identification recognition method can be applied to a terminal, and of course can be applied to the cloud, but the embodiments of the present application are not limited thereto.
[0247] Optionally, as another implementation manner: the step of segmenting the characters in the IoT identification code to obtain the first sequence may specifically include:
[0248] Segment the characters in the IoT identifier code according to the Chinese language model n-gram to obtain an n-gram string sequence;
[0249] The n-gram string sequence is determined as the first sequence.
[0250] For example: When the encoding length and element value range of two identifiers belonging to different identification categories are the same, but the encoding rules are different, they cannot be fully distinguished by character sequence alone. For example: The MSISDN identifier code "6524054521877" and the EAN identifier code "6945091708456" both contain 13 digits. In the EAN identifier code, the strings of different parts can express clear physical meanings, such as the string composed of the first three characters is the country code. In the above EAN identifier code, the string "694" indicates that the origin of the currently identified product is China. In addition, the string "652" composed of the first three characters in the MSISDN identifier code is not used by any identifier in the EAN identification system. Based on the above analysis, the identifier represented by the n-gram string sequence has better differentiation.
[0251] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence may specifically include:
[0252] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0253] Using the word vector as the input of the recurrent neural network unit in the encoder to obtain the vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0254] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0255] Optionally, the step of converting each n-gram string in the first sequence into a word vector through the embedding layer of the encoder may include: converting each n-gram string in the first sequence into a word vector through the embedding layer of the encoder using a natural language pre-trained model (ELMo).
[0256] For example, if we treat each n-gram string as a single word and the entire sequence as a sentence, and input it into the ELMo model, we can get the word vector corresponding to each n-gram string, with a dimension of 1024. In this way, by introducing the ELMo model, we can solve the problem of using one-hot encoding to represent each n-gram string, so that the dimension of the vector will reach 128. n , which results in the problem that the final trained sequence-to-sequence model will be extremely large and have poor accuracy.
[0257] Furthermore, after the semantic vector outputted by the encoder is obtained, it can be used as the input of the decoder, or it can be used as the input of the decoder after being transformed. In addition, the semantic vector obtained after all the implicit states outputted by the encoder are transformed can also be used as the input of the decoder, but the embodiment of the present invention is not limited thereto.
[0258] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a one-hot encoded sequence includes:
[0259] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0260] The sequence composed of the output elements of all recurrent neural network units in the decoder is determined as the one-hot encoding sequence.
[0261] For example, at the decoder end, a unique integer is assigned to each identification category, and then the number is converted into an N-bit (N is the total number of identification categories supported by the seq2seq model) one-hot encoding as the output sequence, so that the output sequence is actually a binary sequence containing only 0 and 1. At the embedding layer of the decoder, each element in the output sequence is represented by a 2-dimensional one-hot vector, and the output sequence of the decoder is decoded to obtain the identification category corresponding to the IoT identification code.
[0262] Optionally, the step of identifying the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence may specifically include:
[0263] According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category;
[0264] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0265] For example, the EAN identification code "6945091708456" mentioned above is parsed by the China Article Coding Center, so the parsing of the "6945091708456" identification can be completed by calling its parsing service.
[0266] In this way, the identification category to which the IoT identification code belongs is obtained through sequence-to-sequence model recognition, and a suitable parsing system is selected to automatically parse the IoT identification code, thereby ensuring automatic recognition of heterogeneous IoT identification codes without creating a new identification system or changing the existing identification system.
[0267] The above method is described below with reference to a specific example:
[0268] like Figure 5 As shown, the training set of the sequence-to-sequence model contains 20 identification categories, taking the EAN identification code as "6945091708456" and the number corresponding to the EAN identification category as 3 as an example.
[0269] The EAN identifier code "6945091708456" is converted to the sequence {694,509,170,845,6}. In the embedding layer of the encoder, each n-gram string is passed through the ELMo model to obtain a 1024-dimensional real number vector.
[0270] The output sequence of the decoder is 00100…00 (length is 20, because the number corresponding to the EAN system is 3, the 3rd bit of the output sequence is set to 1, and the rest are 0). At the decoder end, the output of the previous LSTM is used as the input of the next LSTM (such as the output of H1 is used as the input of H2, and the input of H1 can be a starting default value, such as 0 or 1). For the one-hot output sequence of the decoder, the elements only contain '0' and '1', the vector of 0 is {1,0}, and the vector of 1 is {0,1}.
[0271] The above scheme of the present invention adopts n-gram encoding on the encoder side and one-hot encoding on the decoder side. In the embedding layer of the encoder, the ELMo model is used to generate a 1024-dimensional vector for each n-gram string. In the embedding layer of the decoder, each one-hot element value is represented by a 2-dimensional 0-1 vector. This scheme can accurately and effectively identify the identification category corresponding to the Internet of Things identification for the case where there is sufficient storage space and fewer identification categories, and has higher identification recognition accuracy.
[0272] Optionally, the identification recognition method can be applied to the cloud, and of course can also be applied to a terminal with sufficient storage space, but the embodiments of the present application are not limited thereto.
[0273] like Figure 6 As shown, the embodiment of the present invention also provides a method for identifying an identifier, including:
[0274] Step 61: Obtain the IoT identification code.
[0275] Step 62: Segment the characters in the Internet of Things identification code to obtain a first sequence.
[0276] Step 63: Input the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence.
[0277] Step 64: Input the semantic vector into the decoder in the sequence-to-sequence model for decoding to obtain a binary coding sequence.
[0278] Among them, the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs.
[0279] Step 65: Identify the Internet of Things identification code according to the target code category corresponding to the binary code sequence.
[0280] For example, obtaining the IoT identification code on different carriers such as a QR code, a barcode, and an RFID. Of course, the method of obtaining the IoT identification code in the embodiment of the present invention is not limited to this.
[0281] Optionally, the characters in the IoT identification code may be segmented into single characters or character strings, thereby converting the identification into a sequence form. In this way, the sequence obtained by converting the IoT identification code is used as the input of the sequence-to-sequence model to obtain a sequence indicating the identification category to which the IoT identification code belongs.
[0282] Among them, the sequence-to-sequence model belongs to a type of encoder-decoder structure. The basic idea is to use RNN, such as LSTM, as encoder and decoder. Figure 2 As shown, the specific introduction can be found in the above embodiments, and to avoid repetition, it will not be described here.
[0283] The above scheme of the present invention automatically identifies the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic identification of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem that parsing and intercommunication of different codes cannot be achieved.
[0284] In addition, the scheme adopts binary coding at the decoder end, and uses the binary coding of the digital number corresponding to the identification category at the decoder end as the output sequence at the decoder end, so that the output sequence length of the decoder is (where N is the number of identification categories), thereby effectively reducing the length of the output sequence.
[0285] Optionally, a sequence-to-sequence model for identifying the identification category to which the Internet of Things identification code belongs can be trained in advance. After the sequence-to-sequence model is trained, the sequence converted from the Internet of Things identification code to be identified is used as the input of the sequence-to-sequence model to obtain a sequence for indicating the identification category to which the Internet of Things identification code belongs.
[0286] Among them, the sequence-to-sequence model used to identify the category of the IoT identifier code is trained, that is, the automatic identification of the identifier code category is converted into a sequence-to-sequence learning problem, and the encoding system of the input identifier is obtained by decoding the output sequence of the model decoder end to achieve accurate classification of the identifier. The specific training process of the sequence-to-sequence model can be referred to the above embodiment, and to avoid repetition, this type will not be repeated.
[0287] Optionally, as an implementation method: the step of segmenting the characters in the IoT identification code to obtain the first sequence may specifically include:
[0288] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0289] The character sequence is determined as the first sequence.
[0290] In the embodiment of the present invention, in the sequence-to-sequence model, the identifier code is the input of the encoder, and the identifier category corresponding to the identifier code is the output of the encoder. In order to meet the requirements of the sequence-to-sequence model for input and output, it is necessary to convert the identifier and its system into a sequence form, and it is necessary to design the embedding layer of the encoder and the embedding layer of the decoder to obtain a vector representation of each sequence element.
[0291] Each identification code is a string consisting of characters, numbers and special symbols (such as '.' '-', etc.). In this embodiment, it can be converted into a character sequence by character segmentation. For example, taking the EAN identification "6945091708456" as an example, "6945091708456" is segmented according to each character to obtain the sequence {6,9,4,5,0,9,1,7,0,8,4,5,6}.
[0292] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence may specifically include:
[0293] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0294] The first one-hot encoding vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0295] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0296] Optionally, converting each character in the first sequence into a first one-hot vector through the embedding layer of the encoder includes: converting each character in the first sequence into a 128-dimensional first one-hot vector according to an ASCII code corresponding to the character through the embedding layer of the encoder.
[0297] For example: In the embedding layer of the encoder, one-hot encoding is used to convert each character into a 128-dimensional one-hot vector. One-hot encoding is the representation of categorical variables as binary vectors. Each integer value is represented as a binary vector. Except for the index of the integer, it is all zero value, which is marked as 1. In the ASCII encoding system, each character corresponds to an integer number from 0 to 127, and the index of 1 in its one-hot vector is the ASCII code of the character. For example, the ASCII code of the character '6' is 54, so the corresponding one-hot vector index 54 (the 55th element in the vector) has a value of 1, and the rest are 0.
[0298] Furthermore, after the semantic vector outputted by the encoder is obtained, it can be used as the input of the decoder, or it can be used as the input of the decoder after being transformed. In addition, the semantic vector obtained after all the implicit states outputted by the encoder are transformed can also be used as the input of the decoder, but the embodiment of the present invention is not limited thereto.
[0299] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a binary coding sequence may specifically include:
[0300] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0301] The sequence formed by the output elements of all recurrent neural network units in the decoder is determined as the binary coding sequence.
[0302] When the number of identification categories of training samples is large (e.g., more than 1000), if one-hot encoding is used, the decoder will cyclically apply for too many network units (the number of units is equal to the number of sequence elements), which will deteriorate the robustness of the model. Therefore, in the embodiment of the present application, the binary encoding of the digital number corresponding to the identification category at the decoder end is used as the output sequence at the decoder end, so that the length of the output sequence is (where N is the number of identification categories), which effectively reduces the length of the output sequence and improves the robustness of the sequence-to-sequence model.
[0303] Optionally, the step of identifying the Internet of Things identification code according to the target code category corresponding to the binary code sequence may specifically include:
[0304] According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category;
[0305] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0306] For example, the EAN identification code "6945091708456" mentioned above is parsed by the China Article Coding Center, so the parsing of the "6945091708456" identification can be completed by calling its parsing service.
[0307] In this way, the identification category to which the IoT identification code belongs is obtained through sequence-to-sequence model recognition, and a suitable parsing system is selected to automatically parse the IoT identification code, thereby ensuring automatic recognition of heterogeneous IoT identification codes without creating a new identification system or changing the existing identification system.
[0308] The above method is described below with reference to a specific example:
[0309] like Figure 7 As shown, the training set of the sequence-to-sequence model contains 20 identification categories, taking the EAN identification code as "6945091708456" and the number corresponding to the EAN identification category as 3 as an example.
[0310] The EAN identifier code "6945091708456" is converted to the sequence {6,9,4,5,0,9,1,7,0,8,4,5,6}. In the embedding layer of the encoder, each character is converted into a 128-dimensional one-hot vector according to its ASCII code value. For example, the ASCII code of the character '6' is 54, so the corresponding one-hot vector index is 54 (the 55th element in the vector) with a value of 1, and the rest are 0.
[0311] The output sequence of the decoder is 00011 (length is 5). At the decoder end, the output of the previous LSTM is used as the input of the next LSTM (such as the output of H1 is used as the input of H2, and the input of H1 can be a starting default value, such as 0 or 1). For the output sequence of the decoder, similar to the one-hot encoding, the elements only contain '0' and '1', the vector of 0 is {1,0}, and the vector of 1 is {0,1}.
[0312] In the above scheme of the present invention, the encoder side adopts character encoding, and the decoder adopts one-hot encoding to represent the identification category. In the embedding layer of the encoder, each character is represented by a 128-dimensional one-hot vector, and the index position of 1 in the vector is the ASCII code value corresponding to the character. On the decoder side, binary encoding is used to represent the number corresponding to the identification category, reducing the length of the output sequence on the decoder side, and in the embedding layer of the decoder, each one-hot element value is represented by a 2-dimensional 0-1 vector. This solution can accurately and effectively identify the identification category corresponding to the Internet of Things identification and ensure the robustness of the sequence-to-sequence model in the case of limited storage space and a large number of identification categories.
[0313] Optionally, the identification recognition method can be applied to a terminal, and of course can be applied to the cloud, but the embodiments of the present application are not limited thereto.
[0314] Optionally, as another implementation manner: the step of segmenting the characters in the IoT identification code to obtain the first sequence may specifically include:
[0315] Segment the characters in the IoT identifier code according to the Chinese language model n-gram to obtain an n-gram string sequence;
[0316] The n-gram string sequence is determined as the first sequence.
[0317] For example: When the encoding length and element value range of two identifiers belonging to different identification categories are the same, but the encoding rules are different, they cannot be fully distinguished by character sequence alone. For example: The MSISDN identifier code "6524054521877" and the EAN identifier code "6945091708456" both contain 13 digits. In the EAN identifier code, the strings of different parts can express clear physical meanings, such as the string composed of the first three characters is the country code. In the above EAN identifier code, the string "694" indicates that the origin of the currently identified product is China. In addition, the string "652" composed of the first three characters in the MSISDN identifier code is not used by any identifier in the EAN identification system. Based on the above analysis, the identifier represented by the n-gram string sequence has better differentiation.
[0318] Optionally, the step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence may specifically include:
[0319] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0320] The word vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0321] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0322] Optionally, the step of converting each n-gram string in the first sequence into a word vector through the embedding layer of the encoder may include: converting each n-gram string in the first sequence into a word vector through the embedding layer of the encoder using a natural language pre-trained model (ELMo).
[0323] For example, if we treat each n-gram string as a single word and the entire sequence as a sentence, and input it into the ELMo model, we can get the word vector corresponding to each n-gram string, with a dimension of 1024. In this way, by introducing the ELMo model, we can solve the problem of using one-hot encoding to represent each n-gram string, so that the dimension of the vector will reach 128. n , which results in the problem that the final trained sequence-to-sequence model will be extremely large and have poor accuracy.
[0324] Optionally, the step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a binary coding sequence may specifically include:
[0325] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0326] The sequence formed by the output elements of all recurrent neural network units in the decoder is determined as the binary coding sequence.
[0327] When the number of identification categories of training samples is large (e.g., more than 1000), if one-hot encoding is used, the decoder will cyclically apply for too many network units (the number of units is equal to the number of sequence elements), which will deteriorate the robustness of the model. Therefore, in the embodiment of the present application, the binary encoding of the digital number corresponding to the identification category at the decoder end is used as the output sequence at the decoder end, so that the length of the output sequence is (where N is the number of identification categories), which effectively reduces the length of the output sequence and improves the robustness of the sequence-to-sequence model.
[0328] Optionally, the step of identifying the Internet of Things identification code according to the target code category corresponding to the binary code sequence may specifically include:
[0329] According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category;
[0330] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0331] For example, the EAN identification code "6945091708456" mentioned above is parsed by the China Article Coding Center, so the parsing of the "6945091708456" identification can be completed by calling its parsing service.
[0332] In this way, the identification category to which the IoT identification code belongs is obtained through sequence-to-sequence model recognition, and a suitable parsing system is selected to automatically parse the IoT identification code, thereby ensuring that automatic recognition of heterogeneous IoT identification codes is achieved without creating a new identification system or changing the existing identification system. In addition, this solution has better scalability and can continuously increase the types of identification that support automatic recognition.
[0333] The above method is described below with reference to a specific example:
[0334] like Figure 8 As shown, the training set of the sequence-to-sequence model contains 20 identification categories, taking the EAN identification code as "6945091708456" and the number corresponding to the EAN identification category as 3 as an example.
[0335] The EAN identifier code "6945091708456" is converted to the sequence {694,509,170,845,6}. In the embedding layer of the encoder, each n-gram string is passed through the ELMo model to obtain a 1024-dimensional real number vector.
[0336] The output sequence of the decoder is 00011 (length is 5). At the decoder end, the output of the previous LSTM is used as the input of the next LSTM (such as the output of H1 is used as the input of H2, and the input of H1 can be a starting default value, such as 0 or 1). For the output sequence of the decoder, similar to the one-hot encoding, the elements only contain '0' and '1', the vector of 0 is {1,0}, and the vector of 1 is {0,1}.
[0337] The above scheme of the present invention adopts n-gram encoding on the encoder side and one-hot encoding on the decoder side. In the embedding layer of the encoder, the ELMo model is used to generate a 1024-dimensional vector for each n-gram string. On the decoder side, binary encoding is used to represent the number corresponding to the identification category, reducing the length of the output sequence on the decoder side, and in the embedding layer of the decoder, each one-hot element value is represented by a 2-dimensional 0-1 vector. This scheme can accurately and effectively identify the identification category corresponding to the Internet of Things identification for the situation where there is sufficient storage space and a large number of identification categories, and has higher identification recognition accuracy, and can also ensure the robustness of the sequence-to-sequence model.
[0338] Optionally, the identification recognition method can be applied to the cloud, and of course can also be applied to a terminal with sufficient storage space, but the embodiments of the present application are not limited thereto.
[0339] The above introduces the recognition method of four identification categories of the embodiments of the present application, among which strategy 1 is that the encoder adopts character encoding and the decoder adopts one-hot encoding; strategy 2 is that the encoder adopts character encoding and the decoder adopts binary encoding; strategy 3 is that the encoder adopts n-gram encoding and the decoder adopts one-hot encoding; strategy 4 is that the encoder adopts n-gram encoding and the decoder adopts binary encoding.
[0340] In order to verify the effectiveness of the scheme of the present invention, a data set of 20 identification categories is selected as an example to compare the classification accuracy of the scheme of the present application on the data and 7 typical sequence classification methods. Among them, LR and SVM are classic machine learning algorithms, the LSTM model is good at classifying time series data, and the other 4 are deep neural networks based on one-dimensional sequence data. The classification results are shown in Table 1. By comparison, it can be seen that the recognition of identification categories of the sequence-to-sequence model implemented by the scheme of the present invention through 4 different strategies has achieved a classification accuracy of more than 94%, which exceeds other comparison schemes. The accuracy of the model implemented by strategies 3 and 4 exceeds that of strategies 1 and 2, verifying that the n-gram encoding method has an improving effect on the accuracy of identification classification.
[0341] Table 1
[0342]
[0343] The above scheme of the present invention can be applied to the new retail field represented by unmanned retail, such as unmanned supermarket business. The automatic recognition technology of heterogeneous Internet of Things identification codes proposed by the scheme of the present invention can support automatic shopping of goods identified by different coding methods, without the need for retailers to re-label the goods, saving a lot of labor and operating costs. Moreover, the application of this technology in unmanned retail can support the verification of multiple identities (such as ID card number, passport number, mobile phone number, etc.) in the future, which is more conducive to the increase of customer volume and product promotion.
[0344] The above scheme of the present invention can also be applied to the field of product tracing, wherein product tracing refers to the process of using identification technology to record and query product status, attributes, location and other information throughout the entire life cycle of the product from design, production planning, manufacturing, transportation, service to recycling. Its purpose is to grasp the data of the product in all aspects of the whole process, promote the interconnection of information data between various systems within the enterprise, between enterprises, and between enterprises and customers, realize the optimal allocation of enterprise resources, and improve product quality, production efficiency and the core competitiveness of the enterprise. Automatic identification and parsing of identification is the core key to achieving product tracing. Using the automatic identification technology of heterogeneous Internet of Things identification coding of the scheme of the present invention, it is possible to identify the identification of products at different stages of the entire life cycle (raw materials, production, transportation, sales), thereby realizing the automatic acquisition of product information and comprehensive management of real-time monitoring.
[0345] In addition, 5G is an important direction for the upgrade of the new generation of information and communication technology, and the industrial Internet is a development trend for the transformation and upgrading of the manufacturing industry. 5G combined with the industrial Internet will undoubtedly become an important driving force for the digital transformation of the manufacturing industry. The industrial Internet identification resolution system is a key hub for realizing information interoperability among all industrial elements and links. By assigning an identifier to each object and using the industrial Internet identification resolution system, cross-regional, cross-industry, and cross-enterprise information query and sharing can be achieved. In the industrial field, there are currently a variety of identification resolution systems in the world, such as the GS1 system, the OID system, the Handle system, the Ecode system, the UID system, etc. With the help of the solution proposed in the present invention, the compatibility and connection of various industrial identification systems can be effectively realized, supporting the sharing and application of industrial data and promoting the development of the industrial Internet.
[0346] like Fig. 9 As shown in FIG. 1 , the normal process of the heterogeneous identification service use case is given. The heterogeneous identification service use case includes 9 steps. In step 2, it is clearly stated that the M2M platform has the ability to identify the heterogeneous identification category (identify the identifier type), such as Fig.10A high-level description of heterogeneous identity recognition service is given. According to the resolved identity category, a resolution request is sent to the corresponding identity resolution system, thereby completing the unified resolution service of heterogeneous identities. The embodiment of the present invention proposes a corresponding solution to the potential demand for automatic recognition of heterogeneous identities.
[0347] The embodiment of the present invention further provides a marking recognition device, comprising:
[0348] An acquisition module is used to obtain the IoT identification code;
[0349] A processing module, used for segmenting characters in the Internet of Things identification code to obtain a first sequence;
[0350] an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence;
[0351] A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs;
[0352] The recognition module is used to identify the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence.
[0353] Optionally, the processing module includes:
[0354] A first processing unit, configured to segment the characters in the IoT identification code according to each character to obtain a character sequence;
[0355] The second processing unit is configured to determine the character sequence as the first sequence.
[0356] Optionally, the encoding module includes:
[0357] A first conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0358] A first encoding unit, used to use the first one-hot vector as an input of a recurrent neural network unit in the encoder, and obtain a vector output by a last recurrent neural network unit; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0359] The first determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0360] Optionally, the processing module includes:
[0361] A third processing unit is used to segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0362] The fourth processing unit is used to determine the n-gram string sequence as the first sequence.
[0363] Optionally, the encoding module includes:
[0364] A second conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0365] A second encoding unit is used to use the word vector as an input of a recurrent neural network unit in the encoder to obtain a vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0366] The second determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0367] Optionally, the decoding module includes:
[0368] A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder;
[0369] The third determination unit is used to determine the sequence composed of the output elements of all the recurrent neural network units in the decoder as the one-hot encoding sequence.
[0370] Optionally, the identification module includes:
[0371] A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the one-hot coding sequence;
[0372] The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
[0373] The above-mentioned identification recognition device in the embodiment of the present invention can implement each process implemented by the above-mentioned method and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0374] The identification recognition device in the embodiment of the present invention automatically recognizes the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic recognition of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem of being unable to achieve parsing and intercommunication of different codes.
[0375] In addition, the scheme adopts one-hot encoding at the decoder end, that is, assigning a unique integer to each identification category, and then converting the number into an N-bit (N is the total number of identification categories supported by the sequence-to-sequence model) one-hot encoding as the output sequence. In this way, the output sequence is actually a binary sequence containing only 0 and 1. In the embedding layer of the decoder, each element in the output sequence can be represented by a 2-dimensional one-hot vector, ensuring a simpler decoding process.
[0376] like Fig.11 As shown, an embodiment of the present invention further provides a terminal device 1100, including: a transceiver 1110 and a processor 1120;
[0377] The transceiver 1110 is used to obtain the Internet of Things identification code;
[0378] The processor 1120 is used for:
[0379] Segment the characters in the IoT identification code to obtain a first sequence;
[0380] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0381] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs;
[0382] The Internet of Things identification code is identified and processed according to the target code category corresponding to the one-hot coding sequence.
[0383] Optionally, the processor 1120 is further configured to:
[0384] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0385] The character sequence is determined as the first sequence.
[0386] Optionally, the processor 1120 is further configured to:
[0387] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0388] The first one-hot vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0389] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0390] Optionally, the processor 1120 is further configured to:
[0391] Segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0392] The n-gram string sequence is determined as the first sequence.
[0393] Optionally, the processor 1120 is further configured to:
[0394] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0395] Using the word vector as the input of the recurrent neural network unit in the encoder to obtain the vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0396] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0397] Optionally, the processor 1120 is further configured to:
[0398] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0399] The sequence composed of the output elements of all recurrent neural network units in the decoder is determined as the one-hot encoding sequence.
[0400] Optionally, the processor 1120 is further configured to:
[0401] According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category;
[0402] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0403] The above-mentioned terminal device in the embodiment of the present invention can implement each process implemented by the above-mentioned method and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0404] The terminal device in the embodiment of the present invention automatically identifies the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic identification of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem of being unable to achieve parsing and intercommunication of different codes.
[0405] In addition, the scheme adopts one-hot encoding at the decoder end, that is, assigning a unique integer to each identification category, and then converting the number into an N-bit (N is the total number of identification categories supported by the sequence-to-sequence model) one-hot encoding as the output sequence. In this way, the output sequence is actually a binary sequence containing only 0 and 1. In the embedding layer of the decoder, each element in the output sequence can be represented by a 2-dimensional one-hot vector, ensuring a simpler decoding process.
[0406] The embodiment of the present invention further provides a marking recognition device, comprising:
[0407] An acquisition module is used to obtain the IoT identification code;
[0408] A processing module, used for segmenting characters in the Internet of Things identification code to obtain a first sequence;
[0409] an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence;
[0410] A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs;
[0411] The identification module is used to identify the Internet of Things identification code according to the target code category corresponding to the binary code sequence.
[0412] Optionally, the processing module includes:
[0413] A first processing unit, configured to segment the characters in the IoT identification code according to each character to obtain a character sequence;
[0414] The second processing unit is configured to determine the character sequence as the first sequence.
[0415] Optionally, the encoding module includes:
[0416] A first conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0417] A first encoding unit, used to use the first one-hot encoding vector as an input of a recurrent neural network unit in the encoder, and obtain a vector output by the last recurrent neural network unit; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0418] The first determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0419] Optionally, the processing module includes:
[0420] A third processing unit is used to segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0421] The fourth processing unit is used to determine the n-gram string sequence as the first sequence.
[0422] Optionally, the encoding module includes:
[0423] A second conversion unit, configured to input the first sequence into an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0424] A second encoding unit is used to use the word vector as an input of a recurrent neural network unit in the encoder and obtain a vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0425] The second determination unit is used to determine the vector output by the last recurrent neural network unit as the semantic vector corresponding to the first sequence.
[0426] Optionally, the decoding module includes:
[0427] A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder;
[0428] The third determination unit is used to determine the sequence composed of output elements of all recurrent neural network units in the decoder as the binary coding sequence.
[0429] Optionally, the identification module includes:
[0430] A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the binary coding sequence;
[0431] The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
[0432] The above-mentioned identification recognition device in the embodiment of the present invention can implement each process implemented by the above-mentioned method and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0433] The above-mentioned identification recognition device of the present invention automatically recognizes the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic recognition of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem that different codes cannot be parsed and interoperable.
[0434] In addition, the scheme adopts binary coding at the decoder end, and uses the binary coding of the digital number corresponding to the identification category at the decoder end as the output sequence at the decoder end, so that the output sequence length of the decoder is (where N is the number of identification categories), thereby effectively reducing the length of the output sequence.
[0435] like Fig.11 As shown, an embodiment of the present invention further provides a terminal device, including: a transceiver 1110 and a processor 1120;
[0436] The transceiver 1110 is used to obtain the Internet of Things identification code;
[0437] The processor 1120 is used for:
[0438] Segment the characters in the IoT identification code to obtain a first sequence;
[0439] Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence;
[0440] Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs;
[0441] The Internet of Things identification code is identified and processed according to the target code category corresponding to the binary code sequence.
[0442] Optionally, the processor 1120 is further configured to:
[0443] The characters in the IoT identification code are divided according to each character to obtain a character sequence;
[0444] The character sequence is determined as the first sequence.
[0445] Optionally, the processor 1120 is further configured to:
[0446] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder;
[0447] The first one-hot encoding vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder;
[0448] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0449] Optionally, the processor 1120 is further configured to:
[0450] Segment the characters in the IoT identifier code according to n-gram to obtain an n-gram string sequence;
[0451] The n-gram string sequence is determined as the first sequence.
[0452] Optionally, the processor 1120 is further configured to:
[0453] Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder;
[0454] The word vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder;
[0455] The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
[0456] Optionally, the processor 1120 is further configured to:
[0457] Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder;
[0458] The sequence formed by the output elements of all recurrent neural network units in the decoder is determined as the binary coding sequence.
[0459] Optionally, the processor 1120 is further configured to:
[0460] According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category;
[0461] The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
[0462] The above-mentioned terminal device in the embodiment of the present invention can implement each process implemented by the above-mentioned method and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0463] The above-mentioned terminal device of the present invention automatically identifies the identification category to which the Internet of Things identification code belongs through a sequence-to-sequence model, and further parses the Internet of Things identification code based on the identification category to which the identified Internet of Things identification code belongs, thereby ensuring that automatic identification of heterogeneous Internet of Things identification codes is achieved without creating a new identification system or changing the existing identification system, thereby solving the current problem of being unable to achieve parsing and intercommunication of different codes.
[0464] In addition, the scheme adopts binary coding at the decoder end, and uses the binary coding of the digital number corresponding to the identification category at the decoder end as the output sequence at the decoder end, so that the output sequence length of the decoder is (where N is the number of identification categories), thereby effectively reducing the length of the output sequence.
[0465] The embodiment of the present invention also provides a terminal device, such as Fig.12 As shown, it includes a transceiver 1210, a processor 1200, a memory 1220, and a program or instruction stored in the memory 1220 and executable on the processor 1200; when the processor 1200 executes the program or instruction, the steps applied to the identification recognition method are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
[0466] The transceiver 1210 is used to receive and send data under the control of the processor 1200 .
[0467] Among them, Fig.12 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1200 and various circuits of memory represented by memory 1220 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 1210 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 1200 is responsible for managing the bus architecture and general processing, and the memory 1220 may store data used by the processor 1200 when performing operations.
[0468] The embodiment of the present invention also provides a terminal device, such as Fig.13 As shown, it includes a transceiver 1310, a processor 1300, a memory 1320, and a program or instruction stored in the memory 1320 and executable on the processor 1300; when the processor 1300 executes the program or instruction, the steps applied to the above-mentioned identification method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0469] The transceiver 1310 is used to receive and send data under the control of the processor 1300 .
[0470] Among them, Fig.13 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1300 and various circuits of memory represented by memory 1320 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 1310 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 1330 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0471] The processor 1300 is responsible for managing the bus architecture and general processing, and the memory 1320 can store data used by the processor 1300 when performing operations.
[0472] An embodiment of the present invention also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the identification method as described above are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0473] The processor is the processor in the terminal device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0474] It should be further explained that the terminals described in this specification include but are not limited to smart phones, tablet computers, etc., and many of the functional components described are called modules in order to more particularly emphasize the independence of their implementation methods.
[0475] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.
[0476] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0477] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.
[0478] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present invention will be perfect and complete, and the scope of the present invention will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "including" and / or "comprising" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
[0479] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for identifying a logo, characterized in that: include: Get the IoT identification code; Segment the characters in the IoT identification code to obtain a first sequence; Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence; Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs; According to the target coding category corresponding to the one-hot coding sequence, the Internet of Things identification code is identified; The step of inputting the semantic vector into the decoder of the sequence-to-sequence model for decoding to obtain a one-hot encoding sequence includes: Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder; Determine the sequence composed of the output elements of all recurrent neural network units in the decoder as the one-hot encoding sequence; The step of identifying the IoT identification code according to the target code category corresponding to the one-hot code sequence includes: According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category; The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
2. The identification method according to claim 1, characterized in that: The step of segmenting the characters in the IoT identification code to obtain a first sequence includes: The characters in the IoT identification code are divided according to each character to obtain a character sequence; The character sequence is determined as the first sequence.
3. The identification method according to claim 2, characterized in that: The step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes: Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder; The first one-hot vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder; The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
4. The identification method according to claim 1, characterized in that: The step of segmenting the characters in the IoT identification code to obtain a first sequence includes: Segment the characters in the IoT identifier code according to the Chinese language model n-gram to obtain an n-gram string sequence; The n-gram string sequence is determined as the first sequence.
5. The identification method according to claim 4, characterized in that: The step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes: Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder; Using the word vector as the input of the recurrent neural network unit in the encoder to obtain the vector output by the last recurrent neural network unit; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder; The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
6. A method for identifying a logo, characterized in that: include: Get the IoT identification code; Segment the characters in the IoT identification code to obtain a first sequence; Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence; Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs; According to the target code category corresponding to the binary code sequence, the Internet of Things identification code is identified; The step of inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding to obtain a binary coding sequence includes: Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder; Determine the sequence composed of the output elements of all recurrent neural network units in the decoder as the binary code sequence; The step of identifying the IoT identification code according to the target code category corresponding to the binary code sequence includes: According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category; The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
7. The identification method according to claim 6, characterized in that: The step of segmenting the characters in the IoT identification code to obtain a first sequence includes: The characters in the IoT identification code are divided according to each character to obtain a character sequence; The character sequence is determined as the first sequence.
8. The identification method according to claim 7, characterized in that: The step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes: Input the first sequence to an encoder in a sequence-to-sequence model, and convert each character in the first sequence into a first one-hot vector through an embedding layer of the encoder; The first one-hot encoding vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the first one-hot vector corresponding to a character is input into a recurrent neural network unit in the encoder; The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
9. The identification method according to claim 6, characterized in that: The step of segmenting the characters in the IoT identification code to obtain a first sequence includes: Segment the characters in the IoT identifier code according to the Chinese language model n-gram to obtain an n-gram string sequence; The n-gram string sequence is determined as the first sequence.
10. The identification method according to claim 9, characterized in that: The step of inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence includes: Input the first sequence to an encoder in a sequence-to-sequence model, and convert each n-gram string in the first sequence into a word vector through an embedding layer of the encoder; The word vector is used as the input of the recurrent neural network unit in the encoder, and the vector output by the last recurrent neural network unit is obtained; wherein the word vector corresponding to an n-gram string is input into a recurrent neural network unit in the encoder; The vector output by the last recurrent neural network unit is determined as the semantic vector corresponding to the first sequence.
11. A marking recognition device, characterized in that: include: An acquisition module is used to obtain the IoT identification code; A processing module, used for segmenting the characters in the IoT identification code to obtain a first sequence; an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence; A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs; An identification module, used to identify the Internet of Things identification code according to the target code category corresponding to the one-hot code sequence; Wherein, the decoding module comprises: A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder; A third determining unit is used to determine a sequence composed of output elements of all recurrent neural network units in the decoder as the one-hot encoding sequence; Wherein, the identification module includes: A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the one-hot coding sequence; The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
12. A terminal device, characterized in that: include: transceivers and processors; The transceiver is used to obtain the Internet of Things identification code; The processor is used to: Segment the characters in the IoT identification code to obtain a first sequence; Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence; Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a one-hot encoding sequence; wherein the one-hot encoding sequence is used to indicate the number of the target encoding category to which the Internet of Things identification code belongs; According to the target coding category corresponding to the one-hot coding sequence, the Internet of Things identification code is identified; Wherein, the processor is further used for: Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder; Determine the sequence composed of the output elements of all recurrent neural network units in the decoder as the one-hot encoding sequence; Wherein, the processor is further used for: According to the target coding category corresponding to the one-hot coding sequence, calling the identity resolution service corresponding to the target coding category; The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
13. A marking recognition device, characterized in that: include: An acquisition module is used to obtain the IoT identification code; A processing module, used for segmenting the characters in the IoT identification code to obtain a first sequence; an encoding module, configured to input the first sequence into an encoder in a sequence-to-sequence model for encoding, so as to obtain a semantic vector corresponding to the first sequence; A decoding module, used for inputting the semantic vector into a decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs; An identification module, used for identifying the Internet of Things identification code according to the target code category corresponding to the binary code sequence; Wherein, the decoding module comprises: A decoding unit, configured to input the semantic vector into a decoder in the sequence-to-sequence model, and convert an element of each recurrent neural network unit input into the decoder into a second one-hot vector through an embedding layer of the decoder; A third determining unit is used to determine the sequence composed of output elements of all recurrent neural network units in the decoder as the binary code sequence; Wherein, the identification module includes: A calling unit, configured to call an identification resolution service corresponding to the target coding category according to the target coding category corresponding to the binary coding sequence; The identification unit is used to identify the description information of the Internet of Things object corresponding to the Internet of Things identification code through the identification resolution service corresponding to the target coding category.
14. A terminal device, characterized in that: include: transceivers and processors; The transceiver is used to obtain the Internet of Things identification code; The processor is used to: Segment the characters in the IoT identification code to obtain a first sequence; Inputting the first sequence into an encoder in a sequence-to-sequence model for encoding to obtain a semantic vector corresponding to the first sequence; Inputting the semantic vector into the decoder in the sequence-to-sequence model for decoding processing to obtain a binary code sequence; wherein the binary code sequence is used to indicate the number of the target code category to which the Internet of Things identification code belongs; According to the target code category corresponding to the binary code sequence, the Internet of Things identification code is identified; Wherein, the processor is further used for: Input the semantic vector to a decoder in the sequence-to-sequence model, and convert the elements of each recurrent neural network unit input to the decoder into a second one-hot vector through an embedding layer of the decoder; Determine the sequence composed of the output elements of all recurrent neural network units in the decoder as the binary code sequence; Wherein, the processor is further used for: According to the target coding category corresponding to the binary coding sequence, calling the identification resolution service corresponding to the target coding category; The description information of the Internet of Things object corresponding to the Internet of Things identification code is identified through the identification resolution service corresponding to the target coding category.
15. A terminal device, comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; characterized in that when the processor executes the program or instruction, the steps of the identification method as described in any one of claims 1 to 10 are implemented.
16. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the identification method according to any one of claims 1 to 10 are implemented.
