CN111639475A - Method and device for generating product code and electronic equipment - Google Patents

Method and device for generating product code and electronic equipment Download PDF

Info

Publication number
CN111639475A
CN111639475A CN202010487017.XA CN202010487017A CN111639475A CN 111639475 A CN111639475 A CN 111639475A CN 202010487017 A CN202010487017 A CN 202010487017A CN 111639475 A CN111639475 A CN 111639475A
Authority
CN
China
Prior art keywords
code
values
product
key
generating
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.)
Granted
Application number
CN202010487017.XA
Other languages
Chinese (zh)
Other versions
CN111639475B (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

Images

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

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 comprises the steps of acquiring a plurality of key value pairs corresponding to a plurality of product attributes of a target product from a pre-established code database, wherein the plurality of product attributes correspond to the plurality of key value pairs one by one; then 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; 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 values to generate a product code. The method processes the keys and values of the key value pairs in the pre-constructed coding database, and realizes the analysis and generation of the codes in a data filling mode, thereby realizing the normative acquisition of the product codes and simultaneously improving the readability of the product codes.

Description

Method and device for generating product code and electronic equipment
Technical Field
The present invention relates to the technical field of product codes, and in particular, to a method and an apparatus for generating a product code, and an electronic device.
Background
Product model codes generally classify products according to structural features of the products, and the products are named through combinations of numbers, letters and special symbols. A product corresponds to a unique code sequence, and each character or character segment in the code has a specific meaning. In the prior art, the standard of the product model code rule is established through experience, the obtained generated code is not checked in a strict checking process, and the readability of the product model codes is generally poor due to the fact that the product model codes are established through experience.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus and an electronic device for generating a product code, where the key and the value of the key value pair in a pre-constructed coding database are processed, and the code is generated by parsing in a data filling manner, so that normalization of the product code is obtained, and readability of the product code can be improved.
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 correspond to the plurality of key value pairs one to one;
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 a first code according to a plurality of values included in the plurality of key value pairs includes:
obtaining 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, padding the first code with the preset marker, generating a second code, comprises:
acquiring the 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 with a preset mark according to the sequence of the values in the first code to generate a temporary code;
stopping the padding when the length of the temporary code is equal to the preset length of the second code, and regarding the temporary code as the second code.
In some embodiments, the padding the first code with the preset flag according to the order 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 with a preset mark;
and taking the filled first code as a temporary code.
In some embodiments, the predetermined indicia are numbers and/or letters that are different from the values in the first code.
In some embodiments, the parsing the second code according to the plurality of values to generate the product code includes:
obtaining a plurality of first values through second coding, wherein the first values comprise preset marks;
deleting the preset marks in the first values to obtain a plurality of second values; the plurality of second values correspond to the plurality of first values one to one;
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 value of the key value pair in the first code; if yes, keeping the product code unchanged; and if not, regenerating the product code.
In a second aspect, an embodiment of the present invention provides an apparatus for generating a product code, where the apparatus 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 generation module is used for filling the first code by using the 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 values to generate the 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 that is executable on the processor, and when the processor executes the computer program, the steps of the method in the first aspect are implemented.
In a fourth aspect, the present invention further provides a computer-readable medium having non-volatile program code executable by a processor, where the program code causes the processor to execute the method of the first aspect.
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 comprises the steps of obtaining 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 correspond to the plurality of key value pairs one by one; then 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; filling the first code by using a preset mark to generate a second code; and finally, analyzing the second code according to the plurality of values to generate a product code. The method processes the keys and values of the key value pairs in the pre-constructed coding database, and realizes the analysis and generation of the codes in a data filling mode, thereby realizing the normative acquisition of the product codes and simultaneously improving the readability of the product codes.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth above.
In order to make the aforementioned and other objects, features and advantages of the present invention 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 used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
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 — a communication interface.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The existing product model codes generally classify products according to the structural characteristics of the products, and the products are named through the combination of numbers, letters and special symbols. A product corresponds to a unique code sequence, and each character or character segment in the code has a specific meaning. However, in the prior art, the standard of the product model code rule is established through experience, the obtained generated code is not checked through a strict verification process, and the readability of the product model code is generally poor due to the fact that the product model code is established through experience.
Therefore, related technical schemes are lacked in the process of making and analyzing the product model codes in the prior art, and the readability of the obtained product model codes further improves the space.
Based on this, according to the method, the device and the electronic device for generating the product code provided by the embodiment of the invention, the analysis and generation of the code can be realized by processing the key and the value of the key value pair in the pre-constructed coding database and in a data filling manner, the normative acquisition of the product code is realized, and the readability of the product code is improved.
For the convenience of understanding the present embodiment, a detailed description will be given to a method for generating a product code disclosed in the present embodiment.
Referring to a flowchart of a method for generating a product code shown in fig. 1, the method includes the following specific steps:
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.
During the construction of the encoded database, various categories of product attributes are included, which may be considered as types or categories, such as: size, color, weight, model, etc. of the product. The data in each class contains key value pairs corresponding to the classes, keys in the key value pairs can be regarded as subclasses of the classes, values can be regarded as corresponding specific parameters, the content of the keys is generally invariable, and the content of the values is variable.
For example, the pre-established coding database is as follows:
size1 (color class) { color 1: 'Black', color 2: 'white', … …, color: '…' }
Size2 (character category) {: 'Kairan', b: 'Mimosa', … …, Z: '…' }
SizeN (age group) { age 1: '0-10', age 2: '10-20', … …, gen: '…' }
The standardized database composed at this time was: data (name) { Size1, Size2, …, SizeN }.
The key value of the class is used for measuring 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 coding database needs to be searched, the key value pair corresponding to the required class is searched, and the key and the value corresponding to the key value pair are unique, so that the key value pair data can be used as a data source for the subsequent generation of the 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 includes a key and a value corresponding to the key.
Because the obtained keys and values in the plurality of key value pairs are unique and have one-to-one correspondence relationship, only the values in the key value pairs can be used for replacing the keys, and the values of the key value pairs of different classes are combined to generate the first code.
The first code generated at this time is affected by the value, and may not have a uniform length. For example, a key value pair of a certain product weight is obtained, if one of the values is 1, the value is 1 digit; and the other value is 10, which is 2 digits, then the length difference of 1 occurs when the corresponding first codes are obtained; similarly, when measuring the class of the product model, different letter combinations are involved, and the corresponding first code length differences are larger. Although the resulting first code length may not even be logically uniform, the generated first code is unique.
And step S103, filling the first code with a preset mark to generate a second code.
Not only the situation that the values in the first codes are different in length needs to be filled, but also incomplete data in a pre-established coding database needs to be considered for filling. Since the types of products are various and affected by the integrity of data acquisition, the following defects generally exist in the first code:
1. there are cases where the values of the keys are omitted in some classes;
2. the length of the bonds varies;
3. keys are unique within a class, but duplicates can occur in yet different classes; 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 with the preset mark, the used preset mark needs to have a uniform format, and the length of the second code generated after different types of filling needs to be the same as the length of the finally generated product code in general.
After the length is determined, filling the first code, arranging and combining the first code and the preset mark in a full arrangement mode, and taking the result of arrangement and combination as a second code; only values corresponding to part of product attributes in the first code and preset marks can be arranged and combined according to requirements; the sequence of the product attributes can be limited in the process of permutation and combination, and the sequence is required to be consistent with the corresponding attribute sequence in the finally obtained product code.
And step S104, analyzing the second code according to the plurality of values to generate a product code.
After the second code is obtained, the key value pairs are analyzed by using a plurality of values, in a specific implementation process, a fixed direction can be selected for traversing in sequence, for example, the second code is analyzed from left to right in sequence, values with different lengths are selected in sequence for analyzing respectively, and finally, a product code is generated.
In the method for generating a product code according to the embodiment of the present invention, it can be seen that, first, 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 and the plurality of key value pairs maintain a one-to-one correspondence relationship; then 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; filling the first code by using a preset mark to generate a second code; and finally, analyzing the second code according to the plurality of values to generate a product code. The keys and the values of the key value pairs in the pre-constructed coding database are interchanged, and the codes are analyzed and generated in a data filling mode, so that the normalization 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 a plurality of product attributes are in one-to-one correspondence with a plurality of key value pairs, the key value pairs corresponding to the product attributes are unique, and the related keys and values have one-to-one correspondence, a plurality of values included in the plurality of key value pairs can be acquired for subsequent use by traversing and reading the key value pairs.
Step S202, combining the values according to a preset sequence to generate a first code.
The combination process can be added in the proper order, in the front of the data, or in the back of the data, but the order is consistent. The values of the corresponding key value pairs in the product attributes of different types can be divided through specific symbols to distinguish different types.
In some embodiments, the step S103 of padding the first code with the preset flag to generate the second code, as shown in fig. 3, includes:
step S301, 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.
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 less 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, respectively, so the preset length of the second code cannot be less than 1+2+3+4 — 10.
Step S302, traverse the values in the first encoding, and obtain the order of the values in the first encoding.
In this step, the value in the first code is actually a key in a pre-established coding database, so that a search can be performed according to the type of the key in the coding database during traversal, and the obtained sequence remains unchanged during subsequent interpolation. Maintaining the order of the values may reduce the amount of subsequent computations relative to a full permutation.
Step S303, padding the first code with a preset flag according to the order of the values in the first code, and generating a temporary code.
The padding process is still a full permutation method, but the order of the values in the first code is already limited, so the computation amount in the temporary code generation process is greatly reduced. Specifically, as shown in fig. 4, the method comprises the following steps:
step S41, keeping the order of the values in the first code unchanged, randomly padding the first code with a preset flag.
In a specific implementation process, the sequence of the values in the first code may be stored in a temporary array, and the sequence of the corresponding values is obtained by reading the array.
In step S42, the padded first code is used as a temporary code.
Since the preset mark is in a uniform form, the first code can be randomly padded with the preset mark to obtain the temporary code under the condition of keeping the order of the values in the first code unchanged.
And 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.
Therefore, although the filling process still adopts a full-array mode, the sequence of the values in the first coding is limited, so that the operation amount in the process of obtaining the second coding is reduced, and the efficiency is improved.
The preset mark in the above embodiment is a number and/or a letter different from the value in the first code. The default flag cannot be the same as the value contained in the first code, otherwise the subsequent parsing process is affected and errors are generated.
In some embodiments, the step S104 of parsing the second code according to a plurality of values to generate the product code includes, as shown in fig. 5:
step S501, a plurality of first values are obtained through second coding, and the first values comprise preset marks;
the process of obtaining the plurality of first values may be obtained by traversing the second code, and specifically, the second code may be parsed along a left-to-right direction, or may be obtained along a right-to-left direction. And obtaining the descriptive content including the preset mark and the first value in the first value, wherein the descriptive content is used for subsequent use.
Step S502, deleting the preset marks in the first values to obtain a plurality of second values; the plurality of second values correspond to the plurality of first values one to one;
since the first value includes not only the preset flag but also the description content, the result obtained after deleting the preset flag is recorded 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 realized by traversing and searching, specifically, the second values can be respectively traversed on the values in the first code, the second values are respectively used for searching the values in the first code, and if the second values and the values in the first code can be searched, all information required by the product code contained in the second code is indicated, the second code is used 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 value of the key value pair in the first code; if yes, keeping the product code unchanged; and 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.
As can be seen from the method for generating a product code mentioned in the foregoing embodiment, in the method, the key and the value of the key value pair in the pre-constructed coding database are exchanged, and the code is analyzed and generated in a data filling manner, so that normalization acquisition of the product code is realized, and readability of the product code can be improved.
Corresponding to the above method embodiment, an 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:
a data obtaining module 610, configured to obtain multiple key value pairs corresponding to multiple product attributes of a target product from a pre-established coding database, where the multiple product attributes are in one-to-one correspondence with the multiple 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;
a second code generating module 630, which fills the first code with the preset mark to generate a second code;
and the product code generating module 640 analyzes the second code according to the values of the plurality of key values to generate a product code.
The product code generation device provided by the embodiment of the invention has the same technical characteristics as the product code generation method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved. For the sake of brevity, where not mentioned in the examples section, reference may be made to the corresponding matter in the preceding method examples.
The embodiment also provides an electronic device, which is shown in fig. 7 as a schematic structural diagram of the electronic device, and includes a processor 701 and a memory 702; the memory 702 is used for storing one or more computer instructions, which are executed by the processor to implement the method for generating the product code.
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 via the bus 703.
The Memory 702 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Bus 703 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
The communication interface 704 is used for connecting with at least one user terminal and other network units through a network interface, and sending the packaged IPv4 message or 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 implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 701. The Processor 701 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present 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 the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps of the method of the foregoing embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into 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 such understanding, the technical solution of the present invention or a part thereof, which essentially contributes to the prior art, can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for 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;
and analyzing the second code according to the plurality of values to generate a product code.
2. The method for generating a product code according to claim 1, wherein the generating a first code according to the plurality of values included in the plurality of key value pairs comprises:
obtaining 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 for generating a product code according to claim 1, wherein the padding the first code with a preset mark to generate a second code comprises:
acquiring the 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 with 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 a preset length of the second code, and regarding the temporary code as the second code.
4. The method for generating a product code according to claim 3, wherein the generating a temporary code by filling the first code with a preset mark according to the order of the values in the first code comprises:
keeping the sequence of the values in the first code unchanged, and randomly filling the first code with a preset mark;
and taking the first code after filling as a temporary code.
5. The method for generating a product code according to claim 4, wherein the preset mark is a number and/or a letter different from the value in the first code.
6. The method of claim 5, wherein the parsing the second code according to the plurality of values to generate a product code comprises:
obtaining a plurality of first values through the second coding, wherein the first values comprise the preset marks;
deleting the preset marks in the first values to obtain a plurality of second values; the plurality of second values correspond to the plurality of first values in a one-to-one mode;
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.
7. The method of generating a product code according to claim 1, wherein the method further comprises:
judging whether the values of the key-value pairs in the product code and the first code are consistent; if yes, keeping the product code unchanged; and if not, regenerating the product code.
8. An apparatus for generating a product code, the apparatus 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 for 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;
the second code generation 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 plurality of values to generate a product code.
9. An electronic device, comprising: a processor and a storage device; the storage device has stored thereon a computer program which, when being executed by the processor, carries out the steps of the method of generating a product code according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for generating a product code according to any one of claims 1 to 7.
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 true CN111639475A (en) 2020-09-08
CN111639475B 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)

Cited By (1)

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

Citations (8)

* 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
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
US20130054419A1 (en) * 2011-08-29 2013-02-28 Jay Alan Yusko Product information management
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

Patent Citations (8)

* 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
CN102201089A (en) * 2011-06-10 2011-09-28 张宪 Method for encoding and managing materials
US20130054419A1 (en) * 2011-08-29 2013-02-28 Jay Alan Yusko Product information management
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
翟桂锋;徐丹;钱锋;夏晨;: "基于键值对存储的水电数据中心编码系统", no. 06, pages 29 - 32 *
黄旭芬;张妍;胡守忠;: "基于产品特征的内衣信息编码设计与应用", no. 08, pages 43 - 44 *

Cited By (1)

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

Also Published As

Publication number Publication date
CN111639475B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN108876213B (en) Block chain-based product management method, device, medium and electronic equipment
KR20170052672A (en) Conditional validation rules
CN110597511B (en) Page automatic generation method, system, terminal equipment and storage medium
CN110990276A (en) Automatic testing method and device for interface field and storage medium
CN111159329A (en) Sensitive word detection method and device, terminal equipment and computer-readable storage medium
CN111209736A (en) Text file analysis method and device, computer equipment and storage medium
CN111835808B (en) Data storage method and device, data reading method and device, and storage medium
CN111562965A (en) Page data verification method and device based on decision tree
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN111639475B (en) Product code generation method and device and electronic equipment
CN113283675A (en) Index data analysis method, device, equipment and storage medium
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN117371002A (en) Model encryption method, model decryption method, encryption device, and readable storage medium
CN111897833A (en) Data processing method and device
CN111933244A (en) Medicine data encoding method and device, computer readable medium and electronic equipment
CN112579141A (en) Firmware updating method, device, equipment and storage medium of embedded system
CN116302079A (en) Service data processing method and device, electronic equipment and storage medium
CN115994182A (en) Code generation method and device and electronic equipment
CN111324645A (en) Data processing method and device for block chain
CN115544132A (en) Data import method and system and electronic equipment
CN113703753B (en) Method and device for product development and product development system
CN113676290A (en) Data transmission method based on fund system and related equipment
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment
CN114490547A (en) Data compression method, device, equipment and medium
CN113157671A (en) Data monitoring method and device

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