CN-121981078-A - Automatic encoding method and device for unique code of one-object one-code system
Abstract
The invention relates to the technical field of automatic coding, in particular to an automatic coding method and a device for a unique code of an object-to-code system, which are used for determining a matched character space according to a unique code character demand parameter and an actual application parameter required by a user, screening a matched target sub-character space from the matched character space, performing cyclic coding operation on current space parameters, parameters of all characters used for constructing the character space and the unique code character demand parameter to obtain a character cyclic coding result, and the time, the actual application scene and the actual use time are obtained by combining the corresponding characters, the unique code required by the user is obtained by analysis, the code length of the unique code is reduced while the code uniqueness of the unique code is fundamentally ensured, the density of the formed unique code is reduced, the definition of the unique code printed by spraying is ensured, the scanning accuracy and the scanning efficiency of the unique code are improved, and the full-link tracing (traceability) safety management and control performance of the article/product based on the unique code printed by spraying is improved.
Inventors
- TANG YI
- LIN WEIJIAN
- Lin Qinglv
Assignees
- 广州市科帕电子科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260212
Claims (10)
- 1. An automatic encoding method of a unique code for an object-to-code system, the method comprising: determining a unique code character demand parameter corresponding to a unique code required by a target user and an actual application parameter of the unique code required by the target user, wherein the actual application parameter comprises an actual application scene and an actual application time; Determining character spaces matched with the unique code character demand parameters and the actual application parameters according to the unique code character demand parameters and the actual application parameters, and determining the use conditions of the character spaces, wherein the character spaces comprise a plurality of sub-character spaces, the space parameters of each sub-character space are different from each other, and the use conditions of the character spaces comprise the use conditions of each sub-character space; Screening target sub-character spaces matched with the unique code character demand parameters and the actual application parameters from all the sub-character spaces according to the use condition of each sub-character space of the character space, and acquiring current space parameters of the target sub-character spaces in the character space; Performing a cyclic unique code encoding operation according to the unique code character demand parameter, parameters of all characters used for constructing the character space and current space parameters of the target sub-character space to obtain a character cyclic encoding result corresponding to the unique code character demand parameter and the obtaining time of the character cyclic encoding result; and generating an initial unique code corresponding to the target user according to the character cyclic coding result, the obtaining time of the character cyclic coding result and the actual application scene, and executing secondary coding operation on the initial unique code corresponding to the target user based on the actual application time to obtain the unique code required by the target user.
- 2. The method of claim 1, wherein performing a cyclic unique code encoding operation according to the unique codeword requirement parameter, parameters of all characters used for constructing the character space, and current space parameters of the target sub-character space to obtain a character cyclic encoding result corresponding to the unique codeword requirement parameter and a time for obtaining the character cyclic encoding result, comprises: According to the unique codeword demand parameters, analyzing the current space parameters of the target sub-character space and parameters of all characters used for constructing the character space to obtain a space parameter analysis result of the target sub-character space, wherein the space parameter analysis result of the target sub-character space comprises a first parameter and a second parameter of the target sub-character space, and the first parameter and the second parameter of the target sub-character space are unique and have relevance; Determining the position condition of each character in all the characters corresponding to the character space, and screening target characters matched with the first parameters of the target sub-character space from all the characters corresponding to the character space according to the position condition of each character in the character space and the character type of each character; And updating the second parameter of the target sub-character space into the current space parameter of the target sub-character space according to the unique codeword demand parameter, continuously executing the operation of analyzing the current space parameter of the target sub-character space and the parameters of all characters used for constructing the character space to obtain the space parameter analysis result of the target sub-character space until the character cyclic coding result corresponding to the unique codeword demand parameter and the obtaining time of the character cyclic coding result are obtained.
- 3. The method of claim 2, wherein the character loop encoding result comprises a plurality of target character encoding results, and the resulting time of the character loop encoding result comprises a corresponding encoding time for each of the target character encoding results; The generating the initial unique code corresponding to the target user according to the character cycle encoding result, the obtaining time of the character cycle encoding result and the actual application scene includes: When the character cyclic coding results are used for representing that all the target character coding results meet the unique code character demand parameters, coding all the target character coding results according to each target character coding result, the coding time corresponding to each target character coding result and the actual application scene to obtain an initial unique code corresponding to the target user; when the character cyclic coding result is used for indicating that all the target character coding results do not meet the unique code character demand parameters, analyzing character difference parameters between the unique code character demand parameters and each target character coding result according to the unique code character demand parameters and each target character coding result; analyzing all complement character encoding results matched with the character difference parameters according to the character difference parameters and the unique codeword demand parameters; And according to each target character coding result, the coding time corresponding to each target character coding result, all complement character coding results and the actual application scene, coding all target character coding results and all complement character coding results to obtain an initial unique code corresponding to the target user.
- 4. A method according to claim 3, wherein said analyzing all complementary character encoding results matching said character difference parameter based on said character difference parameter and said unique codeword requirement parameter comprises: Analyzing the character difference type and the character difference quantity according to the character difference parameters, screening target character type units matched with the character difference type units from a plurality of preset character type units according to the actual application scene, and determining all complement character coding results matched with the character difference parameters from the target character type units according to the character difference quantity and the character difference type and preset character coding parameters, wherein each preset character type unit has a corresponding actual application scene; Or alternatively And re-screening one new target sub-character space from the character space according to the character difference parameter and the actual application parameter, acquiring the current space parameter of the new target sub-character space, and re-executing the cyclic unique code coding operation according to the current space parameter of the new target sub-character space, the parameters of all characters used for constructing the character space and the character difference parameter until all complement character coding results matched with the character difference parameter are obtained.
- 5. The method of any of claims 1-4, wherein there is a unique ending space parameter for each of the sub-character spaces; The method further comprises the steps of: After the character cyclic coding result is obtained, based on preset space parameters, updating the current space parameters of the target sub-character space to obtain new space parameters of the target sub-character space; analyzing a space parameter difference between a new space parameter of the target sub-character space and an ending space parameter of the target sub-character space; judging whether the space parameter difference corresponding to the target sub-character space meets the predetermined end use requirement of the target sub-character space or not; When judging that the end use requirement of the target sub-character space is not met, updating the new space parameter of the target sub-character space into the current space parameter of the target sub-character space; And deleting the target sub-character space from the character space or setting a depletion identification for the target sub-character space when judging that the end use requirement of the target sub-character space is met, wherein the depletion identification of the target sub-character space is used for indicating that the target sub-character space is not involved in the subsequent unique code encoding operation.
- 6. The method according to claim 3 or 4, characterized in that the method further comprises: determining the scene type of the actual application scene; judging whether the scene type of the actual application scene is a preset code spraying use scene type or not, wherein the preset code spraying use scene type is used for indicating that characters of a preset character type cannot appear in a unique code required by the target user; when judging that the scene type of the actual application scene is not the preset code spraying use scene type, executing the operation of determining a character space matched with the unique code character demand parameter and the actual application parameter according to the unique code character demand parameter and the actual application parameter, or When judging that the scene type of the actual application scene is not the preset code spraying use scene type, acquiring a historical code spraying use condition corresponding to the target user, judging whether the historical code spraying use condition is used for indicating that the target user is sensitive to a character, and executing the operation according to the unique code character demand parameter and the actual application parameter to determine a character space matched with the unique code character demand parameter and the actual application parameter when judging that the historical code spraying use condition is not used for indicating that the target user is sensitive to the character.
- 7. The method of claim 6, wherein the method further comprises: When judging that the scene type of the actual application scene is the preset code spraying use scene type, analyzing the preset character type which is not matched with the scene type of the actual application scene, or when judging that the historical code spraying use condition is used for indicating that the target user is sensitive to a character, determining the sensitivity degree of the target user to each sensitive character and the type of each sensitive character according to the historical code spraying use condition; Deleting all the reject characters with the character type being the target character type from all the characters corresponding to the character space, determining the positions of each reject character in all the characters of the character space, moving the positions of the characters behind the reject characters forward according to the positions of each reject character after deleting all the reject characters, and executing the operation of determining the character space matched with the unique code character demand parameters and the practical application parameters according to the unique code character demand parameters and the practical application parameters after all the characters behind the reject characters are moved forward; Or alternatively Determining the character type of each obtained target character coding result in the process of obtaining the character cyclic coding result, judging whether the character type is a target character type, and deleting the target character coding result corresponding to the character type when judging that the character type is the target character type; the target character type comprises the preset character type or a sensitive character type corresponding to the sensitivity degree greater than or equal to a preset sensitivity degree threshold.
- 8. An automatic encoding device for unique codes of an object-to-code system, the device comprising: The system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a unique code character demand parameter corresponding to a unique code required by a target user and an actual application parameter of the unique code required by the target user, and the actual application parameter comprises an actual application scene and an actual application time; The determining module is further configured to determine, according to the unique code character demand parameter and the actual application parameter, a character space that matches the unique code character demand parameter and the actual application parameter, and determine a usage situation of the character space, where the character space includes a plurality of sub-character spaces, and space parameters of each of the sub-character spaces are different from each other, and the usage situation of the character space includes a usage situation of each of the sub-character spaces; The screening module is used for screening target sub-character spaces matched with the unique code character demand parameters and the actual application parameters from all the sub-character spaces according to the use condition of each sub-character space of the character space, and acquiring current space parameters of the target sub-character spaces in the character space; The coding module is used for executing a cyclic unique code coding operation according to the unique codeword demand parameter, parameters of all characters used for constructing the character space and current space parameters of the target sub-character space to obtain a character cyclic coding result corresponding to the unique codeword demand parameter and the obtaining time of the character cyclic coding result; The generation module is used for generating an initial unique code corresponding to the target user according to the character cyclic coding result, the obtaining time of the character cyclic coding result and the actual application scene; and the coding module is also used for executing secondary coding operation on the initial unique code corresponding to the target user based on the actual application time to obtain the unique code required by the target user.
- 9. An automatic encoding device for unique codes of an object-to-code system, the device comprising: A memory storing executable program code; A processor coupled to the memory; the processor invokes the executable program code stored in the memory to perform the method of automatic encoding of unique codes for an object-to-code system as claimed in any one of claims 1 to 7.
- 10. A computer storage medium storing computer instructions which, when invoked, are operable to perform the method of automatically encoding unique codes for an one-object one-code system of any one of claims 1-7.
Description
Automatic encoding method and device for unique code of one-object one-code system Technical Field The invention relates to the technical field of automatic coding, in particular to an automatic coding method and device of a unique code for an object-to-code system. Background The unique code-based data has the advantages of traceability (traceability), safety and the like, and currently, a lot of products or data of the products are carried through the unique code so as to realize full-link management and control of the products or the products. At present, a 64-bit binary number is often split into a time stamp (41 bits) +a machine ID (10 bits) +a serial number (12 bits), global uniqueness is guaranteed through time increment, different nodes are distinguished by the machine ID, and the serial number solves concurrency conflicts in the same millisecond. However, it is found in practice that such unique codes generated by 64-bit binary numbers, due to their long length, result in high density of the formed unique codes, which easily results in a very unclear printed unique code, and thus in an inability to achieve full link control of the article or product based on the printed unique code. Therefore, it is needed to propose a new automatic encoding method of unique codes, so as to reduce the encoding length while guaranteeing the uniqueness of the unique codes, reduce the density of the formed unique codes, and guarantee the definition of the printed unique codes, so as to improve the technical scheme of performing full-link traceability (traceability) security management and control on the articles or products based on the printed unique codes. Disclosure of Invention The invention provides an automatic encoding method and device for unique codes of an object-to-code system, which can ensure the uniqueness of the unique codes, reduce the encoding length of the unique codes, reduce the density of the formed unique codes, and ensure the definition of the unique codes printed by spraying so as to improve the full-link tracing (tracing) safety control of articles or products based on the unique codes printed by spraying. In order to solve the above technical problems, a first aspect of the present invention discloses an automatic encoding method for a unique code of an object-to-code system, where the method includes: determining a unique code character demand parameter corresponding to a unique code required by a target user and an actual application parameter of the unique code required by the target user, wherein the actual application parameter comprises an actual application scene and an actual application time; Determining character spaces matched with the unique code character demand parameters and the actual application parameters according to the unique code character demand parameters and the actual application parameters, and determining the use conditions of the character spaces, wherein the character spaces comprise a plurality of sub-character spaces, the space parameters of each sub-character space are different from each other, and the use conditions of the character spaces comprise the use conditions of each sub-character space; Screening target sub-character spaces matched with the unique code character demand parameters and the actual application parameters from all the sub-character spaces according to the use condition of each sub-character space of the character space, and acquiring current space parameters of the target sub-character spaces in the character space; Performing a cyclic unique code encoding operation according to the unique code character demand parameter, parameters of all characters used for constructing the character space and current space parameters of the target sub-character space to obtain a character cyclic encoding result corresponding to the unique code character demand parameter and the obtaining time of the character cyclic encoding result; and generating an initial unique code corresponding to the target user according to the character cyclic coding result, the obtaining time of the character cyclic coding result and the actual application scene, and executing secondary coding operation on the initial unique code corresponding to the target user based on the actual application time to obtain the unique code required by the target user. In an optional implementation manner, in a first aspect of the present invention, performing a cyclic unique code encoding operation according to the unique codeword requirement parameter, parameters of all characters used for constructing the character space, and current space parameters of the target sub-character space to obtain a character cyclic encoding result corresponding to the unique codeword requirement parameter and a time for obtaining the character cyclic encoding result, where the method includes: According to the unique codeword demand parameters, analyzing the current space parameters of the target sub-charact