CN111639475B - Product code generation method and device and electronic equipment - Google Patents

Product code generation method and device and electronic equipment Download PDF

Info

Publication number
CN111639475B
CN111639475B CN202010487017.XA CN202010487017A CN111639475B CN 111639475 B CN111639475 B CN 111639475B CN 202010487017 A CN202010487017 A CN 202010487017A CN 111639475 B CN111639475 B CN 111639475B
Authority
CN
China
Prior art keywords
code
values
product
key
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010487017.XA
Other languages
Chinese (zh)
Other versions
CN111639475A (en
Inventor
杨勇
冯沛赟
黎紫薇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Xingbida Netlink Technology Co Ltd
Original Assignee
Hunan Xingbida Netlink 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 Hunan Xingbida Netlink Technology Co Ltd filed Critical Hunan Xingbida Netlink Technology Co Ltd
Priority to CN202010487017.XA priority Critical patent/CN111639475B/en
Publication of CN111639475A publication Critical patent/CN111639475A/en
Application granted granted Critical
Publication of CN111639475B publication Critical patent/CN111639475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device and electronic equipment for generating a product code, and relates to the technical field of product codes, wherein the method acquires a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established code database, and the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs; generating a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key; filling the first code by using a preset mark to generate a second code; and finally, analyzing the second code according to the values of the plurality of key value pairs to generate a product code. According to the method, keys and values of key value pairs in the pre-constructed coding database are processed, and the analysis generation of codes is realized in a data filling mode, so that the normative acquisition of product codes is realized, and meanwhile, the readability of the product codes can be improved.

Description

Product code generation method and device and electronic equipment
Technical Field
The present invention relates to the field of product coding technologies, and in particular, to a method and an apparatus for generating a product code, and an electronic device.
Background
Product type codes generally classify products according to their structural features, and are named by combinations of numbers, letters, and special symbols. A product corresponds to a unique code sequence, each character or character segment in the code having a particular meaning. In the prior art, standards for product model code rules are established empirically, and a strict verification process is not adopted to verify the obtained generated codes, so that the readability of the product model codes is generally poor due to the fact that the product model codes are established empirically.
Disclosure of Invention
Accordingly, the present invention aims to provide a method, an apparatus and an electronic device for generating a product code, which process keys and values of key-value pairs in a pre-constructed code database, and implement analysis generation of the code in a data filling manner, so as to achieve normative acquisition of the product code, and improve readability of the product code.
In a first aspect, an embodiment of the present invention provides a method for generating a product code, where the method includes:
acquiring a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established coding database, wherein the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs;
generating a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key;
filling the first code by using a preset mark to generate a second code;
and analyzing the second code according to the plurality of values to generate a product code.
In some embodiments, the generating the first code according to the plurality of values included in the plurality of key-value pairs includes:
acquiring a plurality of values included in the plurality of key value pairs;
and combining the values according to a preset sequence to generate a first code.
In some embodiments, filling the first code with a preset mark to generate a second code includes:
acquiring a preset length of a second code; wherein the preset length of the second code is greater than the length of the first code;
traversing the values in the first code to obtain the sequence of the values in the first code;
filling the first code by using a preset mark according to the sequence of the values in the first code to generate a temporary code;
stopping padding when the length of the temporary code is equal to the preset length of the second code, and taking the temporary code as the second code.
In some embodiments, the filling the first code with the preset flag according to the sequence of the values in the first code to generate the temporary code includes:
keeping the sequence of the values in the first code unchanged, and randomly filling the first code by using a preset mark;
and taking the filled first code as a temporary code.
In some embodiments, the preset marks are numbers and/or letters that are different from the values in the first code.
In some embodiments, parsing the second code according to the plurality of values to generate a product code includes:
obtaining a plurality of first values through second coding, wherein the first values comprise preset marks;
deleting preset marks in the first values to obtain a plurality of second values; wherein the plurality of second values are in one-to-one correspondence with the plurality of first values;
and matching the plurality of second values with the plurality of values in the first code, and if the plurality of second values are successfully matched with the plurality of values in the first code, taking the second code as a product code.
In some embodiments, the above method further comprises:
judging whether the product code is consistent with the key value pair in the first code; if yes, keeping the product code unchanged; if not, regenerating the product code.
In a second aspect, an embodiment of the present invention provides a device for generating a product code, where the device includes:
the data acquisition module is used for acquiring a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established coding database, wherein the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs;
a first code generation module for generating a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key;
the second code generating module is used for filling the first code by using a preset mark to generate a second code;
and the product code generating module analyzes the second code according to the values of the plurality of key value pairs to generate a product code.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, and a processor, where the memory stores a computer program executable on the processor, where the processor implements the steps of the method of the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of the first aspect described above.
The embodiment of the invention has the following beneficial effects:
the invention provides a method, a device and electronic equipment for generating a product code, wherein the method acquires a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established code database, and the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs; generating a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key; filling the first code by using a preset mark to generate a second code; and finally, analyzing the second code according to the multiple values to generate a product code. According to the method, keys and values of key value pairs in the pre-constructed coding database are processed, and the analysis generation of codes is realized in a data filling mode, so that the normative acquisition of product codes is realized, and meanwhile, the readability of the product codes can be improved.
Additional features and advantages of the invention will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the invention.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for generating a product code according to an embodiment of the present invention;
fig. 2 is a flowchart of step S102 in a method for generating a product code according to an embodiment of the present invention;
fig. 3 is a flowchart of step S103 in a method for generating a product code according to an embodiment of the present invention;
fig. 4 is a flowchart of step S303 in a method for generating a product code according to an embodiment of the present invention;
fig. 5 is a flowchart of step S104 in a method for generating a product code according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a device for generating a product code according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Icon:
610-a data acquisition module; 620-a first code generation module; 630-a second code generation module; 640-a product code generation module; 701-a processor; 702-a memory; 703-a bus; 704-communication interface.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Existing product type codes typically classify products according to their structural features, and name the products by a combination of numbers, letters, and special symbols. A product corresponds to a unique code sequence, each character or character segment in the code having a particular meaning. However, in the prior art, standards for product type code rules are established empirically, and the obtained generated codes are not checked by a strict check process, and the readability of the product type codes is generally poor because the product type codes are established empirically.
Therefore, in the prior art, the making and analyzing processes of the product model codes also lack related technical schemes, and the readability of the obtained product model codes is further improved.
Based on the above, the method, the device and the electronic equipment for generating the product code provided by the embodiment of the invention can process the key and the value of the key value pair in the pre-constructed code database, realize the analysis generation of the code in a data filling mode, realize the normative acquisition of the product code and improve the readability of the product code.
For the sake of understanding the present embodiment, first, a method for generating a product code disclosed in the present embodiment will be described in detail.
Referring to fig. 1, a flowchart of a method for generating a product code is shown, where the method specifically includes the steps of:
step S101, a plurality of key value pairs corresponding to a plurality of product attributes of a target product are obtained from a pre-established coding database, and the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs.
In the construction of the encoding database, various categories of product attributes are included, which may be considered as types, as well as categories, such as: size, color, weight, model, etc. of the product. The data in each class contains key-value pairs corresponding to the classes, the keys in the key-value pairs can be considered as subclasses of the class, the values can be considered as corresponding specific parameters, the content of the keys is generally unchanged, and the content of the values is variable.
For example, a pre-established encoding database is shown below:
size1 (color class): { color1: 'black', color2: 'white', … …, colorN: '…' }
Size2 (character class): {: 'open', b: 'Mimosa', … …, Z: '…' }
Sizen (age class): { age1: '0-10', age2: '10-20', … …, ageN: '…' }
The standardized database of this composition is: DATA (name) = { Size1, size2, …, sizeN }.
The key value pair of the class measures the attribute data of the product under the class, and the result is stored in a pre-established coding database by formatting the data of various classes corresponding to the product attribute. In the process of generating the product code, only the code database is required to be searched for the key value pair corresponding to the required class, and the key and the value corresponding to the obtained key value pair are unique, so that the key value pair data can be used as a data source for generating the subsequent product code.
Step S102, generating a first code according to a plurality of values included in a plurality of key-value pairs, wherein each key-value pair comprises a key and a value corresponding to the key.
Since the obtained keys and values in the plurality of key-value pairs are unique, the keys and the values have a one-to-one correspondence, only the values in the key-value pairs can be used to replace the keys, and the first code can be generated by combining the values in the different key-value pairs.
The first code generated at this time may be affected by a value, and may have a non-uniform length. For example, a key value pair of a certain product weight is obtained, and if one of the key value pairs is 1, the key value pair is 1 digit; and the other value is 10 and is 2 digits, so that the length difference is 1 when the corresponding first codes are acquired; similarly, when measuring the class of product models, different letter combinations may be involved, resulting in a larger difference in corresponding first code lengths. The resulting first code length may not even be logically uniform, but the generated first code is unique.
Step S103, filling the first code by using a preset mark to generate a second code.
Not only is the situation that the lengths of the first coding median value are different filled, but also incomplete data in a pre-established coding database is considered to be filled. Since the types of products are diverse and are affected by the integrity of the data acquisition, there are often a number of drawbacks in the first encoding:
1. there are cases in which the value of the key is omitted in some classes;
2. the length of the bond is different;
3. the keys are unique in this class, but duplicates occur in a different class; it is understood that the bonds are the same and the values are different;
4. the length of the code is different.
In the process of filling the first code by using the preset mark, the preset mark used needs to be in a unified format, and the length of the second code generated after filling of different types needs to be the same, and is generally the same as the length of the finally generated product code.
Filling the first code after the length is determined, arranging and combining the first code and a preset mark in a full arrangement mode, and taking the arrangement and combination result as a second code; or only arranging and combining the corresponding values of part of product attributes in the first code with preset marks according to the requirements; the sequence of the product attributes can be defined in the process of arranging and combining, and the sequence is consistent with the sequence of the corresponding attributes in the finally obtained product codes.
Step S104, analyzing the second code according to the plurality of values to generate a product code.
After the second code is obtained, the second code is analyzed by using a plurality of values in the key value pair, a fixed direction can be selected for sequential traversal in the specific implementation process, for example, the second code is sequentially analyzed from left to right, values with different lengths are sequentially selected for respective analysis, and finally the product code is generated.
In the method for generating the product code, which is disclosed by the embodiment of the invention, a plurality of key value pairs corresponding to a plurality of product attributes of a target product are firstly obtained from a pre-established code database, and the plurality of product attributes and the plurality of key value pairs are in one-to-one correspondence; generating a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key; filling the first code by using a preset mark to generate a second code; and finally, analyzing the second code according to the multiple values to generate a product code. The keys and the values of key value pairs in the pre-constructed coding database are exchanged, and the analysis generation of the codes is realized in a data filling mode, so that the normative acquisition of the product codes is realized, and the readability of the product codes can be improved.
In some embodiments, the step S102 of generating the first code according to the plurality of values included in the plurality of key-value pairs, as shown in fig. 2, includes the following steps:
step S201, obtaining a plurality of values included in the plurality of key-value pairs.
Because the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs, and the key value pairs corresponding to the product attributes are unique, the related keys and the related values have one-to-one correspondence, a plurality of values contained in the plurality of key value pairs can be obtained through traversing and reading the key value pairs for subsequent use.
Step S202, combining the values according to a preset sequence to generate a first code.
The combination process may be performed in an inherent order, or sequentially in front of the data, or sequentially in back of the data, but the order needs to be consistent. The values of the corresponding key value pairs in different types of product attributes can be divided by specific symbols to distinguish different types.
In some embodiments, the step S103 of filling the first code with a preset flag to generate the second code, as shown in fig. 3, includes:
step S301, obtaining a preset length of a second code; wherein the predetermined length of the second code is greater than the length of the first code.
The preset length of the second code is related to the values of the key-value pairs of all classes contained in the first code, and cannot be smaller than the sum of the lengths of the values of all classes in the first code. For example, the first code includes four classes, and the maximum length of the value in each class is 1, 2, 3, and 4, so the preset length of the second code cannot be lower than 1+2+3+4=10.
Step S302, traversing the values in the first encoding, and obtaining the sequence of the values in the first encoding.
In this step, the value in the first code is actually a key in the pre-established code database, so that during the traversal, a search can be performed according to the type of key in the code database, and the resulting order remains unchanged during the subsequent interpolation. Maintaining the order of values relative to the full permutation may reduce the amount of subsequent computations.
Step S303, filling the first code by using a preset mark according to the sequence of the values in the first code, and generating a temporary code.
The above-described filling process still adopts a full permutation mode, but since the order of values in the first code has already been defined, the amount of computation in the temporary code generation process is greatly reduced. As shown in fig. 4, the method comprises the following steps:
step S41, the sequence of the values in the first code is kept unchanged, and the first code is randomly filled by using a preset mark.
In a specific implementation process, the sequence of the values in the first code may be stored in a temporary array, and the corresponding sequence of the values is obtained by reading the array.
Step S42, the first code after filling is used as a temporary code.
Since the preset marks are in a unified form, the first code can be randomly filled with the preset marks to obtain the temporary code under the condition that the sequence of the values in the first code is kept unchanged.
Step S304, stopping filling when the length of the temporary code is equal to the preset length of the second code, and taking the temporary code as the second code.
It can be seen that, although the above-mentioned filling process still adopts a full permutation mode, since the sequence of values in the first encoding is defined, the operand in the second encoding process is reduced, which is beneficial to improving efficiency.
The preset marks in the above embodiment are numbers and/or letters different from the values in the first code. The predetermined flag cannot be the same as the value contained in the first code, otherwise it will affect the subsequent parsing process and generate errors.
In some embodiments, the step S104 of parsing the second code according to the plurality of values to generate the product code, as shown in fig. 5, includes:
step S501, obtaining a plurality of first values through second coding, wherein the first values comprise preset marks;
the process of obtaining the plurality of first values may be obtained by traversing the second code, and may specifically be performed by parsing the second code along a left-to-right direction, or may be performed along a right-to-left direction. The first value is obtained as a description of the first value and a preset mark, the description being intended for subsequent use.
Step S502, deleting preset marks in the first values to obtain a plurality of second values; wherein the plurality of second values are in one-to-one correspondence with the plurality of first values;
since the first value includes not only the preset mark but also the descriptive contents, the result obtained after deleting the preset mark is noted as the second value. Since there are a plurality of first values, the obtained second values are also a plurality of and correspond to the first values one by one.
Step S503, matching the plurality of second values with the plurality of values in the first code, and if the plurality of second values are successfully matched with the plurality of values in the first code, taking the second code as a product code;
the matching process can be implemented by traversing the values in the first code, specifically, the values in the first code can be traversed by the second values, the values in the first code can be searched by the second values, and if the values in the second code and the values in the first code can be searched, the second code is taken as the code of the product.
In some embodiments, the method for generating a product code further includes:
judging whether the product code is consistent with the key value pair in the first code; if yes, keeping the product code unchanged; if not, regenerating the product code.
The step is used as a verification step, the generated product code can be verified, the generation process of the product code can also be verified, and if the product code is found to be inconsistent with the corresponding first code, the product code needs to be generated again.
According to the method for generating the product code, which is disclosed by the embodiment, keys and values of key value pairs in a pre-constructed code database are exchanged, and the analysis generation of the code is realized in a data filling mode, so that the normative acquisition of the product code is realized, and the readability of the product code can be improved.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a device for generating a product code, a schematic structural diagram of which is shown in fig. 6, where the device includes:
the data obtaining module 610 is configured to obtain, from a pre-established encoding database, a plurality of key value pairs corresponding to a plurality of product attributes of a target product, where the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs;
a first code generation module 620, configured to generate a first code according to a plurality of values included in a plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key;
the second code generation module 630 fills the first code with a preset mark to generate a second code;
the product code generation module 640 parses the second code based on the values of the plurality of key-value pairs to generate a product code.
The device for generating the product code provided by the embodiment of the invention has the same technical characteristics as the method for generating the product code provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved. For a brief description, reference is made to the corresponding content of the preceding method embodiments, where the examples section is not mentioned.
The embodiment also provides an electronic device, and a schematic structural diagram of the electronic device is shown in fig. 7, where the device includes a processor 701 and a memory 702; the memory 702 is configured to store one or more computer instructions, where the one or more computer instructions are executed by the processor to implement the method for generating a product code as described above.
The electronic device shown in fig. 7 further comprises a bus 703 and a communication interface 704, the processor 701, the communication interface 704 and the memory 702 being connected by the bus 703.
The memory 702 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. Bus 703 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 7, but not only one bus or type of bus.
The communication interface 704 is configured to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or the IPv4 message to the user terminal through the network interface.
The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), and the like; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks of the disclosure in the embodiments of the disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present disclosure may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 702, and the processor 701 reads information in the memory 702 and, in combination with its hardware, performs the steps of the method of the previous embodiment.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the preceding embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or units, electrical, mechanical, or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. A method of generating a product code, the method comprising:
acquiring a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established coding database, wherein the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs;
generating a first code according to a plurality of values included in the plurality of key-value pairs, each key-value pair including a key and a value corresponding to the key;
filling the first code by using a preset mark to generate a second code;
resolving the second code according to the plurality of values to generate a product code;
filling the first code with a preset mark to generate a second code, including:
acquiring a preset length of a second code; wherein the predetermined length of the second code is greater than the sum of the lengths of all classes of values in the first code;
traversing the values in the first code to obtain the sequence of the values in the first code;
filling the first code by using a preset mark according to the sequence of the values in the first code to generate a temporary code;
stopping padding when the length of the temporary code is equal to the preset length of the second code, and taking the temporary code as the second code;
filling the first code with a preset mark according to the sequence of the values in the first code to generate a temporary code, wherein the method comprises the following steps:
keeping the sequence of the values in the first code unchanged, and randomly filling the first code by using a preset mark;
taking the first code after filling as a temporary code;
the parsing the second code according to the plurality of values to generate a product code includes:
obtaining a plurality of first values through the second codes, wherein the first values comprise the preset marks;
deleting the preset marks in the first values to obtain a plurality of second values; wherein the second values are in one-to-one correspondence with the first values;
and matching the plurality of second values with the plurality of values in the first code, and if the plurality of second values are successfully matched with the plurality of values in the first code, taking the second code as a product code.
2. The method of generating a product code according to claim 1, wherein generating a first code from a plurality of values included in the plurality of key-value pairs includes:
acquiring a plurality of values included in the plurality of key value pairs;
and combining the values according to a preset sequence to generate a first code.
3. The method of claim 1, wherein the predetermined mark is a number and/or letter different from the value in the first code.
4. The method of generating a product code of claim 1, further comprising:
judging whether the product code is consistent with the value of the key value pair in the first code or not; if yes, keeping the product code unchanged; if not, regenerating the product code.
5. A device for generating a product code, the device comprising:
the data acquisition module is used for acquiring a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established coding database, wherein the plurality of product attributes are in one-to-one correspondence with the plurality of key value pairs;
a first code generation module, configured to generate a first code according to a plurality of values included in the plurality of key-value pairs, where each key-value pair includes a key and a value corresponding to the key;
the second code generation module is used for filling the first code by using a preset mark to generate a second code;
the product code generating module analyzes the second code according to the plurality of values to generate a product code;
the second code generation module is further configured to: acquiring a preset length of a second code; wherein the predetermined length of the second code is greater than the sum of the lengths of all classes of values in the first code; traversing the values in the first code to obtain the sequence of the values in the first code; filling the first code by using a preset mark according to the sequence of the values in the first code to generate a temporary code; stopping padding when the length of the temporary code is equal to the preset length of the second code, and taking the temporary code as the second code;
the second code generating module is further configured to, in the process of generating the temporary code, fill the first code with a preset flag according to the sequence of the values in the first code: keeping the sequence of the values in the first code unchanged, and randomly filling the first code by using a preset mark; taking the first code after filling as a temporary code;
the product code generation module is further configured to: obtaining a plurality of first values through the second codes, wherein the first values comprise the preset marks; deleting the preset marks in the first values to obtain a plurality of second values; wherein the second values are in one-to-one correspondence with the first values; and matching the plurality of second values with the plurality of values in the first code, and if the plurality of second values are successfully matched with the plurality of values in the first code, taking the second code as a product code.
6. An electronic device, comprising: a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the steps of the method of generating a product code as claimed in any one of claims 1 to 4.
7. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor performs the steps of the method of generating a product code according to any of the preceding claims 1 to 4.
CN202010487017.XA 2020-05-31 2020-05-31 Product code generation method and device and electronic equipment Active CN111639475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010487017.XA CN111639475B (en) 2020-05-31 2020-05-31 Product code generation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010487017.XA CN111639475B (en) 2020-05-31 2020-05-31 Product code generation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111639475A CN111639475A (en) 2020-09-08
CN111639475B true CN111639475B (en) 2024-04-05

Family

ID=72330608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010487017.XA Active CN111639475B (en) 2020-05-31 2020-05-31 Product code generation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111639475B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297339B (en) * 2021-07-27 2022-02-11 阿里云计算有限公司 Method, apparatus, storage medium and product for storing data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201089A (en) * 2011-06-10 2011-09-28 张宪 Method for encoding and managing materials
CN102609816A (en) * 2012-02-13 2012-07-25 浪潮集团山东通用软件有限公司 General material coding method capable of coding according to user-defined rule
CN103235996A (en) * 2013-04-10 2013-08-07 昆山捷若尔精密机械有限公司 Material coding management method and material coding management system
CN107784611A (en) * 2017-04-11 2018-03-09 平安医疗健康管理股份有限公司 medicine coding method and device
WO2019233084A1 (en) * 2018-06-06 2019-12-12 中山新诺科技股份有限公司 Product identity information generation method, product coding method and production method
CN110807080A (en) * 2019-09-09 2020-02-18 国网电子商务有限公司 Commodity coding method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090065568A1 (en) * 2007-09-07 2009-03-12 Elliott Grant Systems and Methods for Associating Production Attributes with Products
US9928476B2 (en) * 2011-08-29 2018-03-27 Information Resources, Inc. Product information management

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201089A (en) * 2011-06-10 2011-09-28 张宪 Method for encoding and managing materials
CN102609816A (en) * 2012-02-13 2012-07-25 浪潮集团山东通用软件有限公司 General material coding method capable of coding according to user-defined rule
CN103235996A (en) * 2013-04-10 2013-08-07 昆山捷若尔精密机械有限公司 Material coding management method and material coding management system
CN107784611A (en) * 2017-04-11 2018-03-09 平安医疗健康管理股份有限公司 medicine coding method and device
WO2019233084A1 (en) * 2018-06-06 2019-12-12 中山新诺科技股份有限公司 Product identity information generation method, product coding method and production method
CN110807080A (en) * 2019-09-09 2020-02-18 国网电子商务有限公司 Commodity coding method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
翟桂锋 ; 徐丹 ; 钱锋 ; 夏晨 ; .基于键值对存储的水电数据中心编码系统.水电与抽水蓄能.2018,(第06期),29-32. *
黄旭芬 ; 张妍 ; 胡守忠 ; .基于产品特征的内衣信息编码设计与应用.上海纺织科技.2016,(第08期),43-44+47. *

Also Published As

Publication number Publication date
CN111639475A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN111428462B (en) Communication protocol template construction method and terminal equipment
CN108876213B (en) Block chain-based product management method, device, medium and electronic equipment
CN111679979B (en) Destructive testing method and device
CN112149390A (en) Report generation method, system, computer device and computer-readable storage medium
CN111581210A (en) Data importing method and system
CN109145651B (en) Data processing method and device
CN111639475B (en) Product code generation method and device and electronic equipment
CN111562965A (en) Page data verification method and device based on decision tree
CN114781007A (en) Tree-based document batch signature and signature verification method and system
CN111835808A (en) Data storage method and device, data reading method and device, and storage medium
CN111897833A (en) Data processing method and device
WO2021012732A1 (en) Blockchain-based information verification apparatus and method, and storage medium
CN111324645B (en) Block chain data processing method and device
WO2021072872A1 (en) Name storage method and apparatus based on character conversion, and computer device
CN115904317A (en) Method, device, equipment and storage medium for uniformly calling front-end interface and back-end interface
CN115544132A (en) Data import method and system and electronic equipment
CN111459911B (en) Service data processing method and device
CN114490547A (en) Data compression method, device, equipment and medium
CN114297985A (en) Method, device and storage medium for generating product information unordered codes
CN114006819A (en) Detection strategy generation and device, and data transmission method and device
CN112651753A (en) Intelligent contract generation method and system based on block chain and electronic equipment
CN111309811B (en) Authorization information processing method and device and electronic equipment
CN117131840A (en) excel document analysis method and device, electronic equipment and storage medium
CN116560706A (en) Differential upgrading method and device for electric energy meter and server
CN113132055B (en) File transmission method and related product

Legal Events

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