CN113590132A - Handle identification code generation method based on configuration rule - Google Patents

Handle identification code generation method based on configuration rule Download PDF

Info

Publication number
CN113590132A
CN113590132A CN202110886062.7A CN202110886062A CN113590132A CN 113590132 A CN113590132 A CN 113590132A CN 202110886062 A CN202110886062 A CN 202110886062A CN 113590132 A CN113590132 A CN 113590132A
Authority
CN
China
Prior art keywords
rule
code
coding
item
handle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110886062.7A
Other languages
Chinese (zh)
Inventor
周光勇
陈虎
卢仁谦
李宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Humi Network Technology Co Ltd
Original Assignee
Chongqing Humi Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Humi Network Technology Co Ltd filed Critical Chongqing Humi Network Technology Co Ltd
Priority to CN202110886062.7A priority Critical patent/CN113590132A/en
Publication of CN113590132A publication Critical patent/CN113590132A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention relates to the technical field of internet identification, in particular to a method for generating a Handle identification code based on a configuration rule, which comprises the following steps: creating a coding rule, and setting a rule item and a rule item sequence in the coding rule; when receiving a coding request corresponding to a rule item, firstly searching a coding interface corresponding to the rule item; then judging whether corresponding data exists in the coding interface corresponding to the rule item; if yes, calling a corresponding coding interface to generate a code; otherwise, self-defining data according to the configuration rule to generate a corresponding code; and combining the codes of all the rule items according to the set rule item sequence, and splicing the corresponding identifier analysis prefix before coding to form the corresponding Handle identifier code. The method for generating the Handle identification code can generate the Handle identification code with code uniqueness, and meanwhile, the user operation cost can be reduced, the code generation efficiency can be improved, and therefore the generation effect of the identification code can be improved.

Description

Handle identification code generation method based on configuration rule
Technical Field
The invention relates to the technical field of internet identification, in particular to a method for generating a Handle identification code based on a configuration rule.
Background
The identity resolution system is similar to a domain name resolution system (DNS) in the field of the Internet, and is one of the core infrastructures for the safe operation of the global industrial Internet. There are various identification resolution systems around the world, such as GS1 system, OID system, Handle system, Ecode system, UID system, and the like. The Handle system is a distributed information system and aims to provide efficient, extensible and safe global name service for the Internet. The Handle architecture includes open source protocols, namespaces, and reference implementations of protocols that enable distributed computer systems to store names or identities (handles) of digital resources and resolve these handles to information needed to locate, access, and otherwise use the resources. The identification method is characterized in that the associated value of the Handl can be changed as required to reflect the current state of the identified resource, and the name of the identification is allowed to keep unchanged during the change of the position and other current state information without changing the name of the Handl.
To solve the problems that the traditional identification method easily causes the duplication of the identification code, violates the principle of the uniqueness of the identification code and has low efficiency, the chinese patent with publication number CN112653774A discloses "an industrial internet identification coding method and device", which includes: creating a prefix code of the Handle identifier to be created based on the country code, the industry code and the enterprise code; creating a suffix code of the Handle identifier to be created according to an industry classification standard and an industry coding rule; and splicing the prefix code and the suffix code of the Handle identifier to be created to obtain the Handle identifier.
The industrial internet identification coding method in the existing scheme is also a Handle identification coding generation method, and can uniformly use a Handle system to identify and code resources such as materials, products and the like in the industrial production process. However, the conventional method for generating the Handle id mainly includes generation by month, week, date of manufacture, etc., but when defining the product or device code in an enterprise, the Handle id generated by the conventional method is only applicable to the interior of the enterprise, and the code may be repeated when the product or device is introduced into the market. Therefore, how to provide a method for generating a Handle identification code capable of generating a unique code Handle identification code is a technical problem which needs to be solved urgently.
Disclosure of Invention
Aiming at the defects of the prior art, the technical problems to be solved by the invention are as follows: how to provide a method for generating a Handle identification code with code uniqueness, which can reduce the operation cost of a user and improve the code generation efficiency, thereby improving the generation effect of the identification code.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for generating a Handle identification code based on a configuration rule comprises the following steps:
s1: creating a coding rule, and setting a rule item and a rule item sequence in the coding rule;
s2: when receiving a coding request corresponding to a rule item, firstly searching a coding interface corresponding to the rule item; then judging whether corresponding data exists in the coding interface corresponding to the rule item; if yes, calling a corresponding coding interface to generate a code; otherwise, self-defining data according to the configuration rule to generate a corresponding code;
s3: and combining the codes of all the rule items according to the set rule item sequence, and splicing the corresponding identifier analysis prefix before coding to form the corresponding Handle identifier code.
Preferably, in step S1, the rule items include, but are not limited to, a product code, a batch number, a serial number, and a random number.
Preferably, the product code: uploading when calling the coding interface;
batch number: the method supports the generation of an alphanumeric combination and a time coding;
sequence number: support the combination of alphanumerics and generate according to the incremental coding two ways;
random code: generated by combining letters and numbers.
Preferably, in step S2, a code generator is defined in advance for each rule item through the Spring framework of the Java language to generate a corresponding code interface.
Preferably, in step S2, when receiving the encoding request corresponding to the rule item, the encoding interface corresponding to the rule item is used to search for the encoding generator supporting the corresponding rule type, and the encoding generation method corresponding to the encoding generator is called to generate the encoding.
Preferably, in step S2, the specific way to find the code generator is: acquiring an implementation class example of a coding generator in a Spring framework, defining a rule type enumeration class corresponding to a rule item in an annotation through a custom annotation, comparing the enumeration defined by the annotation of the implementation class example with the coding type in a coding request parameter, and if the rule type enumeration class is the same as the enumeration defined by the annotation of the implementation class example, implementing the class by using the corresponding coding generator and calling a coding generation method of the class.
Preferably, in step S2, when the custom data is generated and encoded, each rule item needs to be classified and a corresponding rule item type number needs to be set; then, caching the custom-generated code into a corresponding rule item type; after each custom generation of a code, the code needs to be checked for existence in the cache corresponding to the rule item type.
Preferably, in step S3, if a separator is selected in the encoding rule, a separator needs to be added to the corresponding code when the codes are combined.
Compared with the prior art, the method for generating the Handle identification code has the following beneficial effects:
in the invention, the Handle identification code generated by combining the enterprise identification analysis prefix with the code creation rule created by the user can meet the requirement of an identification analysis system and has code uniqueness, namely, the Handle identification code with code uniqueness can be effectively generated, thereby improving the generation effect of the identification code. Meanwhile, the flexible rule item configuration and the rule item code generation mode based on the configuration rule can reduce the operation cost of a user, improve the code generation efficiency, increase the code generation speed and improve the service capability of the system. In addition, the invention can satisfy the integration between enterprise product characteristics and information systems by acquiring data through the coding interface, thereby further improving the generation effect of the identification code.
Drawings
For purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made in detail to the present invention as illustrated in the accompanying drawings, in which:
FIG. 1 is a logic diagram of a method for generating a Handle ID code in an embodiment;
fig. 2, fig. 3, fig. 4, fig. 5, fig. 6, and fig. 7 are schematic diagrams of operation interfaces of each step when the engine coding rule is taken as an example in the embodiment.
Detailed Description
The following is further detailed by the specific embodiments:
example (b):
the embodiment discloses a method for generating a Handle identification code based on a configuration rule.
As shown in fig. 1, a method for generating a Handle id code based on a configuration rule includes the following steps:
s1: and creating an encoding rule, and setting a rule item and a rule item sequence in the encoding rule. Taking the engine encoding rules as an example, as shown in fig. 2, the rule items include, but are not limited to, a product code, a lot number, a serial number, and a random number.
S2: when receiving a coding request corresponding to a rule item, firstly searching a coding interface corresponding to the rule item; then judging whether corresponding data exists in the coding interface corresponding to the rule item; if yes, calling a corresponding coding interface to generate a code; otherwise, the data is customized according to the configuration rule to generate a corresponding code. Taking the engine coding rule as an example, the specific operation is shown in fig. 3, fig. 4, fig. 5, and fig. 6.
S3: and combining the codes of all the rule items according to the set rule item sequence, and splicing the corresponding identifier analysis prefix before coding to form the corresponding Handle identifier code. Specifically, if a separator is selected in the encoding rule, a separator needs to be added to the corresponding code when encoding and combining. Taking the engine coding rule as an example, the obtained Handle identification code is shown in fig. 7.
In the invention, the Handle identification code generated by combining the enterprise identification analysis prefix with the code creation rule created by the user can meet the requirement of an identification analysis system and has code uniqueness, namely, the Handle identification code with code uniqueness can be effectively generated, thereby improving the generation effect of the identification code. Meanwhile, the flexible rule item configuration and the rule item code generation mode based on the configuration rule can reduce the operation cost of a user, improve the code generation efficiency, increase the code generation speed and improve the service capability of the system. In addition, the invention can satisfy the integration between enterprise product characteristics and information systems by acquiring data through the coding interface, thereby further improving the generation effect of the identification code.
Product code: uploading when the coding interface is called. Specifically, letter and number combinations: the length is 8 bits, and the length of the letter bit and the length of the digital bit can be respectively established. The letters start by default with a, the numbers start by default with 1, and are filled in from the beginning with 0.
Batch number: support the combination of alphanumerics and the generation by time coding. Specifically, letter and number combinations: the length is 8 bits, and the length of the letter bit and the length of the digital bit can be respectively established. The letters start by default with a, the numbers start by default with 1, and are filled in from the beginning with 0. When coding according to time, the current cycle sequence code can be added, the minimum length of the sequence code is 8, the maximum length is 15, 3 coding modes are provided, firstly, coding according to 'day': the rule is "year, month, day + sequential code", which starts with 1 and is filled with 0 from the beginning. ② encoding according to week, the rule is 'year + week + sequence code', for example, '2021160001' indicates the first time of 16 th week in 2021. And thirdly, the code is coded according to the 'month', the rule is 'year + month + sequence code', for example, '2021060001' indicates that 6 months are the first time in 2021.
Sequence number: support both alphanumeric combination and generation in incremental encoding. Specifically, letter and number combinations: the length is 8 bits, and the length of the letter bit and the length of the digital bit can be respectively established. The letters start by default with a, the numbers start by default with 1, and are filled in from the beginning with 0. The rule for incremental encoding is to specify a total length of 6 minimum and 8 maximum, with the initial letter and initial number set by the letter and number combination.
Random code: generated by combining letters and numbers. Specifically, letter and number combinations: the length is 8 bits, and the length of the letter bit and the length of the digital bit can be respectively established. The letters start by default with a, the numbers start by default with 1, and are filled in from the beginning with 0.
In the specific implementation process, a code generator is defined for each rule item in advance through a Spring framework of the Java language to generate a corresponding code interface. Specifically, when a coding request corresponding to a rule item is received, a coding generator supporting the corresponding rule type is searched through a coding interface corresponding to the rule item, and a coding generation method corresponding to the coding generator is called to generate a code. The specific way to find the code generator is: acquiring an implementation class example of a coding generator in a Spring framework, defining a rule type enumeration class corresponding to a rule item in an annotation through a custom annotation, comparing the enumeration defined by the annotation of the implementation class example with the coding type in a coding request parameter, and if the rule type enumeration class is the same as the enumeration defined by the annotation of the implementation class example, implementing the class by using the corresponding coding generator and calling a coding generation method of the class.
In the invention, in a software system developed by JAVA language, an interface class and an implementation class are created by using an annotation mark and a Spring framework of the JAVA language, so that annotation configuration can be effectively carried out on the implementation class, a specific rule generation implementation class instance can be obtained through a rule type when a rule generator is selected, a generation strategy can be effectively formulated, codes can be generated quickly, and the generation effect of identification codes can be improved.
In the specific implementation process, in step S2, when the custom data generates codes, each rule item needs to be classified and a corresponding rule item type number needs to be set; then, caching the custom-generated code into a corresponding rule item type; after each custom generation of a code, the code needs to be checked for existence in the cache corresponding to the rule item type.
In the invention, the new code which is not generated can be obtained for use by caching the code and checking whether the code exists, on one hand, the code uniqueness of the Handle identification code can be effectively ensured, and on the other hand, the performance can be improved to carry out batch generation and batch check on the code, thereby further improving the code generation efficiency of the Handle identification code.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that, while the invention has been described with reference to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Meanwhile, the detailed structures, characteristics and the like of the common general knowledge in the embodiments are not described too much. Finally, the scope of the claims should be determined by the content of the claims, and the description of the embodiments and the like in the specification should be used for interpreting the content of the claims.

Claims (8)

1. A method for generating a Handle identification code based on a configuration rule is characterized by comprising the following steps:
s1: creating a coding rule, and setting a rule item and a rule item sequence in the coding rule;
s2: when receiving a coding request corresponding to a rule item, firstly searching a coding interface corresponding to the rule item; then judging whether corresponding data exists in the coding interface corresponding to the rule item; if yes, calling a corresponding coding interface to generate a code; otherwise, self-defining data according to the configuration rule to generate a corresponding code;
s3: and combining the codes of all the rule items according to the set rule item sequence, and splicing the corresponding identifier analysis prefix before coding to form the corresponding Handle identifier code.
2. The configuration rule based Handle id code generation method as claimed in claim 1, wherein: in step S1, the rule items include, but are not limited to, a product code, a lot number, a serial number, and a random number.
3. The configuration rule based Handle id code generation method as claimed in claim 2, wherein:
product code: uploading when calling the coding interface;
batch number: the method supports the generation of an alphanumeric combination and a time coding;
sequence number: support the combination of alphanumerics and generate according to the incremental coding two ways;
random code: generated by combining letters and numbers.
4. The configuration rule based Handle id code generation method as claimed in claim 1, wherein: in step S2, a code generator is defined in advance for each rule item through the Spring framework of the Java language to generate a corresponding code interface.
5. The configuration rule based Handle id code generation method as claimed in claim 4, wherein: in step S2, when receiving the encoding request corresponding to the rule item, the encoding generator supporting the corresponding rule type is searched through the encoding interface corresponding to the rule item, and the encoding generation method corresponding to the encoding generator is called to generate an encoding.
6. The method for generating Handle id code based on configuration rule according to claim 5, wherein in step S2, the specific way to find the code generator is: acquiring an implementation class example of a coding generator in a Spring framework, defining a rule type enumeration class corresponding to a rule item in an annotation through a custom annotation, comparing the enumeration defined by the annotation of the implementation class example with the coding type in a coding request parameter, and if the rule type enumeration class is the same as the enumeration defined by the annotation of the implementation class example, implementing the class by using the corresponding coding generator and calling a coding generation method of the class.
7. The configuration rule based Handle id code generation method as claimed in claim 1, wherein: in step S2, when the custom data generates codes, each rule item needs to be classified and a corresponding rule item type number is set; then, caching the custom-generated code into a corresponding rule item type; after each custom generation of a code, the code needs to be checked for existence in the cache corresponding to the rule item type.
8. The configuration rule based Handle id code generation method as claimed in claim 1, wherein: in step S3, if a delimiter is selected in the encoding rule, a delimiter needs to be added to the corresponding code when encoding and combining.
CN202110886062.7A 2021-08-03 2021-08-03 Handle identification code generation method based on configuration rule Pending CN113590132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110886062.7A CN113590132A (en) 2021-08-03 2021-08-03 Handle identification code generation method based on configuration rule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110886062.7A CN113590132A (en) 2021-08-03 2021-08-03 Handle identification code generation method based on configuration rule

Publications (1)

Publication Number Publication Date
CN113590132A true CN113590132A (en) 2021-11-02

Family

ID=78254336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110886062.7A Pending CN113590132A (en) 2021-08-03 2021-08-03 Handle identification code generation method based on configuration rule

Country Status (1)

Country Link
CN (1) CN113590132A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510815A (en) * 2022-11-17 2022-12-23 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Rule-based identification generation method and apparatus
CN116306503A (en) * 2023-05-16 2023-06-23 中科科界(北京)科技有限公司 Member number generation method and device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729191A (en) * 2014-01-06 2014-04-16 中国南方电网有限责任公司 Code generating method and system capable of being flexibly adjusted
CN106920019A (en) * 2015-12-24 2017-07-04 北京计算机技术及应用研究所 Multi-class coding management system
CN110636097A (en) * 2018-06-25 2019-12-31 马上消费金融股份有限公司 Identification generation and management method, node, system and storage device
CN111859861A (en) * 2020-07-30 2020-10-30 华中科技大学 Extensible universal code generation system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729191A (en) * 2014-01-06 2014-04-16 中国南方电网有限责任公司 Code generating method and system capable of being flexibly adjusted
CN106920019A (en) * 2015-12-24 2017-07-04 北京计算机技术及应用研究所 Multi-class coding management system
CN110636097A (en) * 2018-06-25 2019-12-31 马上消费金融股份有限公司 Identification generation and management method, node, system and storage device
CN111859861A (en) * 2020-07-30 2020-10-30 华中科技大学 Extensible universal code generation system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王婷婷 等: "基于Handle标识解析技术的供应链平台构建探讨", 《互联网天地》, no. 6, 20 June 2019 (2019-06-20), pages 47 - 50 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510815A (en) * 2022-11-17 2022-12-23 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Rule-based identification generation method and apparatus
CN116306503A (en) * 2023-05-16 2023-06-23 中科科界(北京)科技有限公司 Member number generation method and device and computer equipment

Similar Documents

Publication Publication Date Title
US8175875B1 (en) Efficient indexing of documents with similar content
US6539373B1 (en) Contextual searching by determining intersections of search results
US7917480B2 (en) Document compression system and method for use with tokenspace repository
JP3889762B2 (en) Data compression method, program, and apparatus
US6898592B2 (en) Scoping queries in a search engine
JP4805267B2 (en) Multi-stage query processing system and method for use with a token space repository
CN113590132A (en) Handle identification code generation method based on configuration rule
WO1998039715A9 (en) System and method for rapidly identifying the existence and location of an item in a file
CN112163000A (en) Data query method and device
CN112540923A (en) Interface parameter checking and converting method, device, equipment and storage medium
CN106649360B (en) Data repeatability checking method and device
WO2010123705A2 (en) System and method for performing longest common prefix strings searches
US7574457B2 (en) Non-mutating tree-structured file identifiers
CN106649217A (en) Data matching method and device
CN108090034B (en) Cluster-based uniform document code coding generation method and system
Salas et al. RDB2RDF plugin: relational databases to RDF plugin for eclipse
US9176972B1 (en) Implied M83 names in alternate name generation in directories supporting multiple naming protocols
CN111211966A (en) Method and system for storing transmission files in chat tool
CN108268517B (en) Method and system for managing labels in database
US20130091166A1 (en) Method and apparatus for indexing information using an extended lexicon
CN114528440A (en) Efficient terminal model matching method based on DFA algorithm
CN112866375B (en) Code analysis system and method
US10664547B1 (en) Configurable short locators
CN105955982A (en) Method and system for information sequence feature encoding and retrieval
Doan et al. A graph database for persistent identifiers

Legal Events

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