Label generation method, electronic equipment, storage medium and program product
By obtaining and analyzing the object information, historical label generation data and packaging level information of the target object, and generating target labels to reflect the packaging level of the target object, the problem of low correlation caused by the independence of cascading object labels in the prior art is solved, and the correlation of labels is improved.
Patent Information
- Application Number
- CN202510114885.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, when there is a cascade relationship between objects, the labels between objects at each cascade level are independent of each other, resulting in a low correlation between objects.
By obtaining the object information and historical label generation data and packaging level information of the target object, determine the target packaging level and corresponding label template of the target object, and fill the label data into the template to generate the target label.
The packaging level of the target object is determined through historical label generation data and packaging level information, thereby reflecting the packaging level of the target object on the target label, improving the correlation between cascading objects.
Smart Images

Figure CN119918524A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and in particular to a label generation method, electronic device, storage medium and program product. Background Art
[0002] In some scenarios, objects can be described by labeling them. For example, in a manufacturing scenario, a label can be attached to a manufacturing object to prompt the user with relevant information about the object.
[0003] In the related art, for different objects, users can generate corresponding labels for the objects according to preset label templates and relevant information of the objects, and print and attach the labels to the objects.
[0004] However, in the above method, when there is a cascade relationship between objects, the labels between objects at each cascade level are independent of each other, resulting in low correlation between objects. Summary of the invention
[0005] The embodiments of the present application provide a label generation method, electronic device, storage medium and program product to achieve the effect of cascade generation.
[0006] In a first aspect, an embodiment of the present application provides a method for generating a label, comprising:
[0007] Obtain a label generation request, where the label generation request is used to request generation of a label for a target object;
[0008] According to the label generation request, object information, historical label generation data, and packaging level information of the target object are acquired, wherein the packaging level information includes multiple packaging levels and the number of objects corresponding to each packaging level;
[0009] Determine, according to the historical label generation data and the packaging level information, a target packaging level of the target object and a label template corresponding to the target packaging level, wherein the label template includes a plurality of fields and a padding bit corresponding to each field;
[0010] In the object information, obtain label data corresponding to each field;
[0011] The label data corresponding to each field and the target packaging level are filled into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
[0012] In a possible design, determining a target packaging level of the target object according to the historical tag generation data and the packaging level information includes:
[0013] Determine, according to the packaging level information and the historical tag generation data, M historical tags generated before the current moment and the packaging level corresponding to each historical tag;
[0014] According to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level, the target packaging level and the tag template corresponding to the target packaging level are determined.
[0015] In a possible design, determining the target packaging level according to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level includes:
[0016] Sorting the M historical labels according to the order of label generation time from early to late;
[0017] According to the packaging level corresponding to each of the M history tags, determine the last N history tags among the sorted M history tags as N first history tags, the packaging levels corresponding to the N first history tags are the same, and N is a positive integer less than or equal to M;
[0018] Determine a first packaging level corresponding to the first history tag and a first number of objects corresponding to the first packaging level;
[0019] According to the first object quantity and N, the target packaging level and the label template corresponding to the target packaging level are determined.
[0020] In a possible design, determining the target packaging level according to the first number of objects and N includes:
[0021] If the first number of objects is equal to N, determining that the target packaging level is a previous packaging level of the first packaging level;
[0022] If the first number of objects is greater than N, the target packaging level is determined to be the first packaging level.
[0023] In a possible design, determining the label template corresponding to the target packaging level according to the first object quantity and N includes:
[0024] Determine the number of label templates corresponding to the target packaging level;
[0025] If the number of label templates corresponding to the target packaging level is 1, the label template corresponding to the target packaging level is determined as the label template corresponding to the target packaging level;
[0026] If the number of label templates corresponding to the target packaging level is greater than 1, the target object order of the target object under the target packaging level is determined, and the label template of the target object order under the target packaging level is determined as the label template corresponding to the target packaging level.
[0027] In a possible design, after obtaining the target label corresponding to the target object according to the label data corresponding to each field, the target packaging level, and the label template, the following steps are included:
[0028] Generate a label image corresponding to the target label;
[0029] A print request is sent to a printing device, wherein the print request includes the label image, and the print request is used to control the printing device to print the label image.
[0030] In a possible design, the history tag generation data includes a plurality of history tags that have been generated and a packaging level corresponding to each history tag; and the method further includes:
[0031] The historical tag generation data is updated according to the target tag and the target packaging level.
[0032] In a second aspect, an embodiment of the present application provides a label generation device, including: a first acquisition module, a second acquisition module, a determination module, a third acquisition module and a filling module, wherein:
[0033] The first acquisition module is used to acquire a label generation request, where the label generation request is used to request generation of a label for a target object;
[0034] The second acquisition module is used to acquire object information, historical label generation data, and packaging level information of the target object according to the label generation request, wherein the packaging level information includes multiple packaging levels and the number of objects corresponding to each packaging level;
[0035] The determination module is used to determine the target packaging level of the target object and the label template corresponding to the target packaging level according to the historical label generation data and the packaging level information, wherein the label template includes a plurality of fields and a padding bit corresponding to each field;
[0036] The third acquisition module is used to acquire label data corresponding to each field in the object information;
[0037] The filling module is used to fill the label data corresponding to each field and the target packaging level into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
[0038] In a possible design, the determining module is specifically configured to:
[0039] Determine, according to the packaging level information and the historical tag generation data, M historical tags generated before the current moment and the packaging level corresponding to each historical tag;
[0040] According to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level, the target packaging level and the tag template corresponding to the target packaging level are determined.
[0041] In a possible design, the determining module is specifically configured to:
[0042] Sorting the M historical labels according to the order of label generation time from early to late;
[0043] According to the packaging level corresponding to each of the M history tags, determine the last N history tags among the sorted M history tags as N first history tags, the packaging levels corresponding to the N first history tags are the same, and N is a positive integer less than or equal to M;
[0044] Determine a first packaging level corresponding to the first history tag and a first number of objects corresponding to the first packaging level;
[0045] According to the first object quantity and N, the target packaging level and the label template corresponding to the target packaging level are determined.
[0046] In a possible design, the determining module is specifically configured to:
[0047] If the first number of objects is equal to N, determining that the target packaging level is a previous packaging level of the first packaging level;
[0048] If the first number of objects is greater than N, the target packaging level is determined to be the first packaging level.
[0049] In a possible design, the determining module is specifically configured to:
[0050] Determine the number of label templates corresponding to the target packaging level;
[0051] If the number of label templates corresponding to the target packaging level is 1, the label template corresponding to the target packaging level is determined as the label template corresponding to the target packaging level;
[0052] If the number of label templates corresponding to the target packaging level is greater than 1, the target object order of the target object under the target packaging level is determined, and the label template of the target object order under the target packaging level is determined as the label template corresponding to the target packaging level.
[0053] In a possible design, a sending module is also included after the filling module.
[0054] The sending module is used to generate a label image corresponding to the target label;
[0055] A print request is sent to a printing device, wherein the print request includes the label image, and the print request is used to control the printing device to print the label image.
[0056] In a possible design, an update module is also included.
[0057] The updating module is used for updating the historical tag generation data according to the target tag and the target packaging level.
[0058] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the label generation method described in the first aspect and various possible designs of the first aspect.
[0059] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the method for generating a label as described in the first aspect and various possible designs of the first aspect is implemented.
[0060] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the label generation method described in the first aspect and various possible designs of the first aspect.
[0061] The embodiment of the present application provides a label generation method, electronic device, storage medium and program product. When it is necessary to generate a label for a target object, the object information, historical label generation data and packaging level information of the target object can be obtained. The label template and label data can be determined based on the above information, and then the corresponding target label of the target object can be obtained based on the packaging level of the target object. Through the above method, the packaging level of the target object can be determined through the historical label generation data and packaging level information, so that the packaging level of the target object is reflected on the target label, which improves the correlation between cascade objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0063] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;
[0064] Figure 2 A flowchart of a method for generating a label provided in an embodiment of the present application;
[0065] Figure 3 A schematic diagram of a visual operation window of a label generation system provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of packaging level information provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of a label template provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of a target tag provided in an embodiment of the present application;
[0069] Figure 7 A schematic diagram of a process for determining a target packaging level and a corresponding label template provided in an embodiment of the present application;
[0070] Figure 8 A schematic diagram of the structure of a label generation device provided in an embodiment of the present application;
[0071] Fig. 9 A schematic diagram of the structure of another label generation device provided in an embodiment of the present application;
[0072] Fig.10 A schematic diagram of the structure of another label generation device provided in an embodiment of the present application;
[0073] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0074] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0075] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0077] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.
[0078] It should be noted that the label generation method, electronic device, storage medium and program product provided in the present application can be used in the field of big data, and can also be used in any field except the field of big data. The application field of the label generation method, electronic device, storage medium and program product in the present application is not limited.
[0079] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0080] For ease of understanding, the following Figure 1 , the system architecture applicable to the embodiments of the present application is described.
[0081] Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of this application. Figure 1, including a terminal device 101 and a printing device 102. The terminal device 101 may be a local device of a user, and the terminal device 101 may store object information of a packaging object and generate a label image according to the object information. The terminal device 101 may send the generated label image to the printing device 102. The printing device 102 may receive the label image sent by the terminal device 101 and print the label image.
[0082] In the related art, for different objects, users can generate corresponding labels for the objects according to the preset label templates and the relevant information of the objects, and print and attach them to the objects. However, in the above method, when there is a cascade relationship between objects, the labels between the objects at each cascade level are independent of each other, resulting in a low correlation between the objects.
[0083] In view of the above technical problems, in an embodiment of the present application, when it is necessary to generate a label for a target object, the object information, historical label generation data, and packaging level information of the target object can be obtained, and the label template and label data can be determined according to the above information, and then the corresponding target label of the target object can be obtained according to the packaging level of the target object. Through the above method, the packaging level of the target object can be determined through the historical label generation data and the packaging level information, so that the packaging level of the target object is reflected on the target label, which improves the association between cascade objects.
[0084] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0085] Figure 2 A flowchart of a label generation method provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:
[0086] S201: Obtain a label generation request.
[0087] The execution subject of the embodiment of the present application may be a terminal device, or a label generation device set in the terminal device. The label generation device may be implemented by software, or by a combination of software and hardware.
[0088] The label generation request may be used to request the generation of a label for a target object. The target object may refer to an object for which a label needs to be generated, for example, a mobile terminal, a packaging box, etc.
[0089] The terminal device may be provided with a label generation system, and the user may select the target object for which a label needs to be generated in the label generation system of the terminal device, and generate a label generation request by clicking the "Generate" control. After the terminal device obtains the label generation request, it may generate a corresponding label according to the target object.
[0090] Next, combine Figure 3 ,Through specific examples, the visual operation window of the label generation system is explained.
[0091] Figure 3 For a schematic diagram of a visual operation window of a label generation system provided in an embodiment of the present application, see Figure 3 , including a target object selection module and a "generate" control. The user can click the target object selection module to select the target object for which a label needs to be generated, and then click the "generate" control to generate a label generation request.
[0092] S202: According to the label generation request, obtain the object information, historical label generation data, and packaging level information of the target object.
[0093] The object information of the target object may refer to detailed description information of the target object. The object information may include multiple production data. For example, the object information may include object name, specification model, place of origin, object identification, label barcode, etc.
[0094] The object information can be determined in the following ways: determine the target object based on the tag generation request; determine the target object identifier corresponding to the target object based on the target object; based on the target object identifier, obtain the object information corresponding to the target object identifier in the database of the terminal device, wherein the database can store multiple object identifiers and object information corresponding to the object identifiers.
[0095] The packaging level information may include multiple packaging levels and the number of objects corresponding to each packaging level. The packaging level information may indicate a packaging architecture. The packaging level may refer to the number of packaging levels where the historical tag is located. For example, the packaging level information may include: the first level corresponds to 4 objects, the second level corresponds to 4 objects, and the third level corresponds to 1 object.
[0096] Next, combine Figure 4 , the packaging level information is explained through specific examples.
[0097] Figure 4 For a schematic diagram of packaging level information provided in the embodiment of this application, please refer to Figure 4 , including multiple packaging levels and the number of objects corresponding to the multiple packaging levels, wherein the first level includes 4 objects, the second level includes 4 objects, and the third level includes 1 object.
[0098] The historical label generation data may refer to the label data generated by the terminal device in the historical period, and the historical label generation data may include multiple historical labels that have been generated, multiple packaging data corresponding to the multiple historical labels, and packaging levels corresponding to each historical label. The historical label generation data may be stored in a database of the terminal device. For any historical label, the packaging data corresponding to the historical label may include a packaging architecture unit corresponding to the historical label. The packaging architecture unit may be used to distinguish objects with the same packaging level information but belonging to different packaging architectures.
[0099] For example, assuming that object A belongs to the first packaging structure unit and object B belongs to the second packaging structure unit, it means that object A and object B do not belong to the same packaging structure unit, that is, object A and object B are in different packaging structures. Specifically, assuming that mobile phone A belongs to the first packaging structure unit and mobile phone B belongs to the second packaging structure unit, it can be shown that mobile phone A and mobile phone B have the same mobile phone box structure but do not belong to the same mobile phone box.
[0100] S203: Determine the target packaging level of the target object and the label template corresponding to the target packaging level according to the historical label generation data and the packaging level information.
[0101] The packaging level information also includes label templates corresponding to each packaging level. The target packaging level of the target object may refer to the level where the target object is located in the packaging level information. For example, assuming that the packaging level includes the first level, the second level, the third level, and the fourth level, the target packaging level may be the third level.
[0102] The target packaging layer and the corresponding label template can be determined in the following way: based on the packaging level information and historical label generation data, the M historical labels generated before the current moment and the packaging level corresponding to each historical label are determined; based on the packaging level corresponding to each historical label in the M historical labels and the number of labels corresponding to each packaging level, the target packaging level and the label template corresponding to the target packaging level are determined.
[0103] The label template may include multiple fields and padding bits corresponding to each field.
[0104] Next, combine Figure 5 , the label template is explained through specific examples.
[0105] Figure 5 For a schematic diagram of the label template provided in the embodiment of the present application, see Figure 5 , including multiple fields and padding bits corresponding to each field. Figure 5As shown, the multiple fields include product name, specification model, target packaging level and production date, and each field corresponds to a filling position.
[0106] The label template can be generated in the following way: for any object, obtain the object identifier of the object, and determine the multiple fields and the number of the multiple fields corresponding to the object identifier in the database based on the object identifier; based on the number of the multiple fields, determine the corresponding design template in the database; fill the multiple fields into the design template to generate the label template of the object.
[0107] S204. Obtain label data corresponding to each field in the object information.
[0108] The label data may refer to the value corresponding to each field. For example, assuming that a field is "production date", the label data corresponding to the field may be "June 5, 2024".
[0109] The label data corresponding to each field can be determined in the following manner: obtain the label template corresponding to the target packaging level, and determine multiple fields according to the label template corresponding to the target packaging level; obtain the object information of the target object, the object information includes multiple production data; determine the target fields corresponding to the multiple fields and the multiple production data, search for the production data corresponding to the multiple target fields in the object information, determine the production data corresponding to the multiple target fields as label data, and determine the fields except the target fields in the multiple fields as fields to be filled.
[0110] S205 , fill the label data and target packaging level corresponding to each field into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
[0111] The target label can be determined in the following manner: multiple target fields are determined in each field, and label data corresponding to the multiple target fields are filled into corresponding filling positions; a field to be filled is determined in each field, and a target packaging level corresponding to the target object is filled into the filling position corresponding to the field to be filled, so as to obtain a target label corresponding to the target object. After determining the target label and the target packaging level, the target label, the target packaging level, and the packaging data corresponding to the target label are updated into the historical label generation data.
[0112] Next, combine Figure 6 , the target label is explained through specific examples.
[0113] Figure 6 For a schematic diagram of the target tag provided in the embodiment of the present application, please refer to Figure 6, including each field and the label data and target packaging level corresponding to each field. For example, the fields may include "product name", "specification model", "target packaging level" and "production date". The value of the fill bit corresponding to "product name" is "mobile phone", the value of the fill bit corresponding to "specification model" is "V18.1.0", the value of the fill bit corresponding to "target packaging level" is "third level", and the value of the fill bit corresponding to "production date" is "May 30, 2024".
[0114] After obtaining the target label, the process further includes generating a label image corresponding to the target label and sending a print request to a printing device. The print request includes the label image, and the print request is used to control the printing device to print the label image. The printing device may refer to a label printer, etc.
[0115] In an embodiment of the present application, when it is necessary to generate a label for a target object, the object information, historical label generation data, and packaging level information of the target object can be obtained first; based on the historical label generation data and packaging level information, the target packaging level of the target object and the label template corresponding to the target packaging level can be determined; based on the object information of the target object, the label data corresponding to each field is obtained; the label data and target packaging level corresponding to each field are filled into the corresponding filling position in the label template to obtain the target label corresponding to the target object. Through the above method, the target packaging level of the target object can be determined through the historical label generation data and packaging level information, so that the target packaging level is reflected on the target label, which improves the relevance of the target label. At the same time, the cascading information of the target object can be reflected through the target label, which enhances the user's traceability of the target object and facilitates the user to quickly identify and track the target object.
[0116] Based on any of the above embodiments, Figure 7 , the process of determining the target packaging level and the corresponding label template ( Figure 2 S203) in the embodiment is described in detail.
[0117] Figure 7 Schematic diagram of the process of determining the target packaging level and the corresponding label template provided in the embodiment of the present application. Figure 7 , the method may include:
[0118] S701. Determine, based on packaging level information and historical tag generation data, M historical tags generated before the current moment and the packaging level corresponding to each historical tag.
[0119] Obtain historical tag generation data, which includes multiple historical tags that have been generated and the packaging level corresponding to each historical tag, determine the current moment information, and in the historical tag generation data, determine the M historical tags that have been generated before the current moment and the packaging level corresponding to each historical tag.
[0120] For example, suppose that four historical tags have been generated before the current moment, and the four historical tags are the first tag, the second tag, the third tag and the fourth tag, respectively. Among them, the packaging level corresponding to the first tag is the first level, the packaging level corresponding to the second tag is the first level, the packaging level corresponding to the third tag is the first level, and the packaging level corresponding to the fourth tag is the second level.
[0121] The order of the M historical labels generated before the current moment can be determined according to the packaging level information. Specifically, the label generation order is: first generate labels of multiple objects of the first level in the packaging level information, and then generate labels of multiple objects of the corresponding levels in ascending order.
[0122] For example, suppose that according to the packaging level information, it can be determined that there are 4 objects in the first level, 4 objects in the second level, and 1 object in the third level. Figure 4 , the order of label generation is: first generate labels for the four objects in the first level, then generate labels for the four objects in the second level, and finally generate labels for the one object in the third level.
[0123] S702: Sort the M historical labels according to the order of label generation time from early to late.
[0124] The label generation times of the M historical labels are obtained in sequence, and the M historical labels are sorted in order from the earliest to the latest to obtain a sorted sequence queue.
[0125] For example, assuming that four historical labels have been generated before the current moment, the four historical labels are the first label, the second label, the third label and the fourth label, wherein the label generation time of the first label is 4 o'clock, the label generation time of the second label is 2 o'clock, the label generation time of the third label is 3 o'clock, and the label generation time of the fourth label is 5 o'clock, then the M historical labels are sorted in order from early to late, and the resulting sequential queue is the second label, the third label, the first label, and the fourth label.
[0126] S703 . According to the packaging level corresponding to each history tag in the M history tags, determine the last N history tags in the sorted M history tags as N first history tags.
[0127] Among them, the packaging levels corresponding to the N first history tags are the same, and N is a positive integer less than or equal to M.
[0128] For example, assuming that four historical tags have been generated before the current moment, the four historical tags are sorted in order from early to late, and the resulting sequential queue is the first tag, the second tag, the third tag and the fourth tag, and the packaging level corresponding to the first tag is the first level, the packaging level corresponding to the second tag is the second level, the packaging level corresponding to the third tag is the second level, and the packaging level corresponding to the fourth tag is the second level; it can be determined that the packaging levels of the last three historical tags are the same, and the last three historical tags can be determined as three first historical tags, that is, N=3, and the three first historical tags are the second tag, the third tag and the fourth tag, respectively.
[0129] S704: Determine a first packaging level corresponding to the first history tag and a first object quantity corresponding to the first packaging level.
[0130] According to the historical tag generation data, the first packaging level corresponding to the first historical tag can be determined, and according to the packaging level information, the first object quantity corresponding to the first packaging level can be determined.
[0131] For example, assuming that the packaging level corresponding to the first history tag is the second level, and in the packaging level information, the number of objects corresponding to the second level is 4, it can be determined that the first packaging level is the second level and the number of first objects is 4.
[0132] S705: Determine whether the number of first objects is equal to N.
[0133] If yes, execute S706.
[0134] If not, execute S707.
[0135] S706: Determine that the target packaging level is the previous packaging level of the first packaging level.
[0136] For example, assuming that N=3, the first historical labels are the second label, the third label and the fourth label, the first packaging level is the second level, and the first object quantity is 3. It can be determined that the first object quantity is equal to N, then the target packaging level is the previous packaging level of the first packaging level, that is, the target packaging level is the third level.
[0137] S707: Determine that the target packaging level is the first packaging level.
[0138] For example, assuming N=3, the first historical labels are the second label, the third label and the fourth label, the first packaging level is the second level, and the first object quantity is 4. It can be determined that the first object quantity is greater than N, then the target packaging level is the first packaging level, that is, the target packaging level is the second level.
[0139] S708. Obtain the number of label templates corresponding to the target packaging level.
[0140] The number of label templates corresponding to the target packaging level can be determined in the following manner: based on the packaging level information, the number of packaging objects corresponding to each packaging level is determined, where the number of packaging objects may refer to the number of object categories corresponding to the packaging level; based on the number of packaging objects, the number of label templates corresponding to the target packaging level is determined, where the number of label templates corresponds to the number of packaging objects, i.e., objects of the same object category have the same label templates.
[0141] S709: Determine whether the number of label templates corresponding to the target packaging level is equal to 1.
[0142] If yes, execute S710.
[0143] If not, execute S711.
[0144] S710: Determine the label template corresponding to the target packaging level as the label template corresponding to the target packaging level.
[0145] The label template corresponding to the target packaging level can be determined in the following ways: according to the packaging level information, the label template corresponding to each packaging level can be determined; according to the target packaging level, the label template corresponding to the target packaging level can be determined.
[0146] S711. Determine the target object order of the target object under the target packaging level, and determine the label template of the target object order under the target packaging level as the label template corresponding to the target packaging level.
[0147] The label template corresponding to the target packaging level can be determined in the following way: based on the historical label generation data, determine the number K of objects whose packaging level is the target packaging level among the M historical labels; if K is less than M, the target object order is K+1; if K is equal to M, the target object order is 1; based on the packaging level information, determine the label template under the target packaging level and the target object order as the label template corresponding to the target packaging level.
[0148] For example, assuming that among the 4 historical tags, the target packaging level is the second level, and the number of objects under the packaging level is the target packaging level is 2, that is, M=4, K=2, then the target object order can be determined to be 3; assuming that among the 4 historical tags, the target packaging level is the third level, and the number of objects under the packaging level is the target packaging level is 4, that is, M=4, K=4, then the target object order can be determined to be 1.
[0149] In an embodiment of the present application, when it is necessary to generate a label for a target object, the target packaging level and the corresponding label template of the target object can be determined first. According to the packaging level information, the target quantity M can be determined. According to the historical label generation data, the M historical labels generated before the current moment and the packaging level corresponding to each historical label can be determined. According to the order of label generation time from early to late, the M historical labels are sorted, and the last N historical labels of the sorted M historical labels are determined as N first historical labels. The first packaging level corresponding to the first historical label and the first object corresponding to the first packaging level are determined. Quantity, determine whether the first object quantity is equal to N, if so, determine that the target packaging level is the previous packaging level of the first packaging level, if not, determine that the target packaging level is the first packaging level; obtain the number of label templates corresponding to the target packaging level, and determine whether the number of label templates corresponding to the target packaging level is equal to 1, if so, determine the label template corresponding to the target packaging level as the label template corresponding to the target packaging level, if not, then according to the target object order under the target packaging level, determine the label template under the target packaging level and the target object order as the label template corresponding to the target packaging level. Through the above method, the target packaging level of the target object can be determined through historical label generation data and packaging level information, so that the target packaging level is reflected on the target label, which improves the relevance of the target label. At the same time, the cascade information of the corresponding target object can be reflected through the target label, which enhances the user's traceability of the target object and facilitates the user to quickly identify and track the target object.
[0150] Figure 8 This is a schematic diagram of a structure of a label generation device provided in an embodiment of the present application. Figure 8 The label generation device 10 includes: a first acquisition module 11, a second acquisition module 12, a determination module 13, a third acquisition module 14 and a filling module 15, wherein:
[0151] The first acquisition module 11 is used to acquire a label generation request, where the label generation request is used to request generation of a label for a target object;
[0152] The second acquisition module 12 is used to acquire object information, historical label generation data, and packaging level information of the target object according to the label generation request, wherein the packaging level information includes multiple packaging levels and the number of objects corresponding to each packaging level;
[0153] The determination module 13 is used to determine the target packaging level of the target object and the label template corresponding to the target packaging level according to the historical label generation data and the packaging level information, wherein the label template includes multiple fields and padding bits corresponding to each field;
[0154] The third acquisition module 14 is used to acquire label data corresponding to each field in the object information;
[0155] The filling module 15 is used to fill the label data corresponding to each field and the target packaging level into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
[0156] A label generation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0157] In a possible design, the determining module 13 is specifically configured to:
[0158] Determine a target quantity M according to the packaging level information, where M is the maximum number of objects corresponding to each packaging level;
[0159] Determine, according to the historical tag generation data, M historical tags generated before the current moment, and the packaging level corresponding to each historical tag;
[0160] According to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level, the target packaging level and the tag template corresponding to the target packaging level are determined.
[0161] In a possible design, the determining module 13 is specifically configured to:
[0162] Sorting the M historical labels according to the order of label generation time from early to late;
[0163] According to the packaging level corresponding to each of the M history tags, determine the last N history tags among the sorted M history tags as N first history tags, the packaging levels corresponding to the N first history tags are the same, and N is a positive integer less than or equal to M;
[0164] Determine a first packaging level corresponding to the first history tag and a first number of objects corresponding to the first packaging level;
[0165] According to the first object quantity and N, the target packaging level and the label template corresponding to the target packaging level are determined.
[0166] In a possible design, the determining module 13 is specifically configured to:
[0167] If the first number of objects is equal to N, determining that the target packaging level is a previous packaging level of the first packaging level;
[0168] If the first number of objects is greater than N, the target packaging level is determined to be the first packaging level.
[0169] In a possible design, the determining module 13 is specifically configured to:
[0170] Determine the number of label templates corresponding to the target packaging level;
[0171] If the number of label templates corresponding to the target packaging level is 1, the label template corresponding to the target packaging level is determined as the label template corresponding to the target packaging level;
[0172] If the number of label templates corresponding to the target packaging level is greater than 1, the target object order of the target object under the target packaging level is determined, and the label template of the target object order under the target packaging level is determined as the label template corresponding to the target packaging level.
[0173] Fig. 9 A schematic diagram of the structure of another label generation device provided in an embodiment of the present application. Figure 8 Based on the examples shown, see Fig. 9 The label generating device 10 further includes a sending module 16,
[0174] The sending module 16 is used to generate a label image corresponding to the target label;
[0175] A print request is sent to a printing device, wherein the print request includes the label image, and the print request is used to control the printing device to print the label image.
[0176] Fig.10 A schematic diagram of the structure of another label generation device provided in an embodiment of the present application. Fig. 9 Based on the examples shown, see Fig.10 The label generation device 10 further includes an updating module 17,
[0177] The updating module 17 is used to update the historical tag generation data according to the target tag and the target packaging level.
[0178] A label generation device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0179] Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 20 may include: a transceiver 21 , a processor 22 , and a memory 23 .
[0180] The processor 22 executes the computer execution instructions stored in the memory, so that the processor 22 executes the scheme in the above embodiment. The processor 22 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0181] The memory 23 is connected to the processor 22 via a system bus and completes communication between them. The memory 23 is used to store computer program instructions.
[0182] The transceiver 21 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.
[0183] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0184] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0185] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the label generation method in the above embodiment.
[0186] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the label generation method in the above embodiment.
[0187] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the label generation method in the above embodiment can be implemented.
[0188] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0189] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0190] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0191] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0192] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0193] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0194] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0195] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0196] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.
[0197] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a label, characterized in that: include: Obtain a label generation request, where the label generation request is used to request generation of a label for a target object; According to the label generation request, object information, historical label generation data, and packaging level information of the target object are acquired, wherein the packaging level information includes multiple packaging levels and the number of objects corresponding to each packaging level; Determine, according to the historical label generation data and the packaging level information, a target packaging level of the target object and a label template corresponding to the target packaging level, wherein the label template includes a plurality of fields and a padding bit corresponding to each field; In the object information, obtain label data corresponding to each field; The label data corresponding to each field and the target packaging level are filled into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
2. The method according to claim 1, characterized in that: Determining a target packaging level of the target object according to the historical tag generation data and the packaging level information includes: Determine, according to the packaging level information and the historical tag generation data, M historical tags generated before the current moment and the packaging level corresponding to each historical tag; According to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level, the target packaging level and the tag template corresponding to the target packaging level are determined.
3. The method according to claim 2, characterized in that Determining the target packaging level according to the packaging level corresponding to each historical tag in the M historical tags and the number of tags corresponding to each packaging level includes: Sorting the M historical labels according to the order of label generation time from early to late; According to the packaging level corresponding to each of the M history tags, determine the last N history tags among the sorted M history tags as N first history tags, the packaging levels corresponding to the N first history tags are the same, and N is a positive integer less than or equal to M; Determine a first packaging level corresponding to the first history tag and a first number of objects corresponding to the first packaging level; According to the first object quantity and N, the target packaging level and the label template corresponding to the target packaging level are determined.
4. The method according to claim 3, characterized in that Determining the target packaging level according to the first number of objects and N includes: If the first number of objects is equal to N, determining that the target packaging level is a previous packaging level of the first packaging level; If the first number of objects is greater than N, the target packaging level is determined to be the first packaging level.
5. The method according to claim 3 or 4, characterized in that: Determining a label template corresponding to the target packaging level according to the first object quantity and N includes: Determine the number of label templates corresponding to the target packaging level; If the number of label templates corresponding to the target packaging level is 1, the label template corresponding to the target packaging level is determined as the label template corresponding to the target packaging level; If the number of label templates corresponding to the target packaging level is greater than 1, the target object order of the target object under the target packaging level is determined, and the label template of the target object order under the target packaging level is determined as the label template corresponding to the target packaging level.
6. The method according to any one of claims 1 to 5, characterized in that: After obtaining the target label corresponding to the target object according to the label data corresponding to each field, the target packaging level, and the label template, the method includes: Generate a label image corresponding to the target label; A print request is sent to a printing device, wherein the print request includes the label image, and the print request is used to control the printing device to print the label image.
7. The method according to any one of claims 1 to 6, characterized in that: The historical tag generation data includes a plurality of generated historical tags and a packaging level corresponding to each historical tag; the method further includes: The historical tag generation data is updated according to the target tag and the target packaging level.
8. A label generation device, characterized in that: include: A first acquisition module, a second acquisition module, a determination module, a third acquisition module and a filling module, wherein: The first acquisition module is used to acquire a label generation request, where the label generation request is used to request generation of a label for a target object; The second acquisition module is used to acquire object information, historical label generation data, and packaging level information of the target object according to the label generation request, wherein the packaging level information includes multiple packaging levels and the number of objects corresponding to each packaging level; The determination module is used to determine the target packaging level of the target object and the label template corresponding to the target packaging level according to the historical label generation data and the packaging level information, wherein the label template includes a plurality of fields and a padding bit corresponding to each field; The third acquisition module is used to acquire label data corresponding to each field in the object information; The filling module is used to fill the label data corresponding to each field and the target packaging level into the corresponding filling position in the label template to obtain the target label corresponding to the target object.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
Citation Information
Cited By
Motorcycle multi-production-line information interaction system
CN120893465A