CN110263895B - Code graph generation method and system - Google Patents

Code graph generation method and system Download PDF

Info

Publication number
CN110263895B
CN110263895B CN201910553915.8A CN201910553915A CN110263895B CN 110263895 B CN110263895 B CN 110263895B CN 201910553915 A CN201910553915 A CN 201910553915A CN 110263895 B CN110263895 B CN 110263895B
Authority
CN
China
Prior art keywords
code
converted
code value
value
previous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910553915.8A
Other languages
Chinese (zh)
Other versions
CN110263895A (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.)
Beijing Huiyan Zhixing Technology Co ltd
Original Assignee
Beijing Huiyan Zhixing 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 Beijing Huiyan Zhixing Technology Co ltd filed Critical Beijing Huiyan Zhixing Technology Co ltd
Priority to CN201910553915.8A priority Critical patent/CN110263895B/en
Publication of CN110263895A publication Critical patent/CN110263895A/en
Application granted granted Critical
Publication of CN110263895B publication Critical patent/CN110263895B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a code graph generating method and a system, which are characterized in that code values to be converted are obtained according to the arrangement sequence of the code values from first to last, a code graph is generated according to the code values to be converted, whether the conversion of the code graph corresponding to the previous code value adjacent to the code values to be converted is finished or not is judged, and if the conversion is finished, the code graph corresponding to the code values to be converted is output. By the method, under the condition of not changing hardware, the process of converting the code values into the code diagrams is executed in parallel by the threads, and the corresponding code diagrams are output according to the sequence of the code values, so that the problem that the code diagrams are output out of order when the code diagrams are generated in parallel by multiple threads is avoided, the generation efficiency of the code diagrams is improved, and the problem that the code diagrams generated in parallel are out of order is avoided.

Description

Code graph generation method and system
Technical Field
The present invention relates to the field of code graph technology, and more particularly, to a code graph generating method and system.
Background
With the development of society, the application approaches of the fortune code are more and more extensive in various scenes. Such as advertisement push, merchandise transaction, e-commerce application, information transfer, etc.
The good fortune code is a two-dimensional code, can contain multiple information, obtains the various information that include in the good fortune code through scanning good fortune code. The code map is generated according to the code value.
In the prior art, the generation process of the code diagram is realized through a single thread, the processing capacity of the single thread is limited, a large amount of time is consumed in the process of generating the code diagram, and the generation efficiency of the code diagram is low.
Disclosure of Invention
In view of this, the present invention provides a code graph generating method and system, where under the condition that hardware is not changed, a plurality of threads execute an operation of generating a code graph by using a code value to be converted, so as to obtain a code graph corresponding to the code value to be converted, thereby achieving the purpose of improving the generation efficiency of the code graph.
In order to achieve the above object, the following solutions are proposed:
the invention discloses a code graph generating method, which is applied to a thread pool comprising at least two threads, wherein each thread executes the following steps:
acquiring code values to be converted according to the arrangement sequence of the code values from first to last;
generating a code graph according to the code value to be converted;
judging whether the code graph corresponding to the previous code value adjacent to the code value to be converted is converted;
and if the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, outputting the code graph corresponding to the code value to be converted.
Optionally, the obtaining the code value to be converted according to the sequence of the code value from small to large includes:
and reading code values with the minimum serial numbers from a pre-constructed code value security queue to determine the code values to be converted, wherein the code values of the un-generated code images which are arranged in the order of the serial numbers from small to large are stored in the code value security queue.
Optionally, after the outputting the code map corresponding to the code value to be converted if the code map corresponding to the previous code value adjacent to the code value to be converted is converted, the method further includes:
and storing the value to be transcoded into a pre-constructed code value historical cache queue, wherein the code value historical cache queue stores code values of which the sequence numbers are arranged from small to large and code image conversion is completed.
Optionally, the determining whether the conversion of the code image corresponding to the previous code value adjacent to the code value to be converted is completed includes:
judging whether a previous code value adjacent to the serial number of the code value to be converted exists in the code value historical cache queue;
if the previous code value adjacent to the serial number of the code value to be converted exists in the code value history cache queue, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is converted;
and if the previous code value adjacent to the serial number of the code value to be converted does not exist in the code value history cache queue, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
Optionally, after outputting the code map corresponding to the code value to be converted if the code map corresponding to the previous code value adjacent to the code value to be converted is converted, the method further includes:
and the thread is switched to an idle state and waits for a new code pattern generation task to be allocated.
Optionally, the method further comprises:
storing the converted code pattern as a picture file, or
And sending the converted code pattern to external equipment.
The second aspect of the present invention discloses a code pattern generation system, including:
the acquiring unit is used for acquiring code values to be converted according to the arrangement sequence of the code values from first to last;
the generating unit is used for generating a code image according to the code value to be converted;
the judging unit is used for judging whether the code graph corresponding to the previous code value adjacent to the code value to be converted is converted;
and the output unit is used for outputting the code graph corresponding to the code value to be converted if the code graph corresponding to the previous code value adjacent to the code value to be converted is converted.
Optionally, the obtaining unit includes:
and the determining module is used for reading the code value with the minimum serial number from a pre-constructed code value security queue and determining the code value as the code value to be converted, wherein the code value security queue stores the code values of the un-generated code images which are arranged according to the sequence of the serial numbers from small to large.
Optionally, the method further comprises:
the first storage unit is used for storing the value to be transcoded into a pre-constructed code value historical cache queue, wherein the code value historical cache queue stores code values of which the sequence numbers are arranged from small to large and code image conversion is completed.
Optionally, the determining unit that determines whether the conversion of the code pattern corresponding to the previous code value adjacent to the code value to be converted is completed is specifically configured to:
judging whether a previous code value adjacent to the serial number of the code value to be converted exists in the code value history cache queue or not, if so, determining that the code map corresponding to the previous code value adjacent to the code value to be converted is converted, and if not, determining that the code map corresponding to the previous code value adjacent to the code value to be converted is not converted.
According to the technical scheme, the code pattern generation method provided by the invention obtains the code values to be converted according to the arrangement sequence of the code values from first to last, generates the code pattern according to the code values to be converted, judges whether the code pattern corresponding to the previous code value adjacent to the code values to be converted is converted, and outputs the code pattern corresponding to the code values to be converted if the conversion is finished. By the method, under the condition of not changing hardware, the process of converting the code values into the code diagrams is executed in parallel by the threads, and the corresponding code diagrams are output according to the sequence of the code values, so that the problem that the code diagrams are output out of order when the code diagrams are generated in parallel by multiple threads is avoided, the generation efficiency of the code diagrams is improved, and the problem that the code diagrams generated in parallel are out of order is avoided.
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, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a code pattern generation method disclosed in the embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a process of determining whether a previous code value adjacent to a code value serial number to be converted exists in a code value history buffer queue and whether conversion of a code graph corresponding to the previous code value adjacent to the code value to be converted is completed according to the embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a code pattern generation system according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another code pattern generation system disclosed in the embodiment of the present invention;
fig. 5 is a schematic structural diagram of another code pattern generation system disclosed in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
In the prior art, the generation process of the code diagram is realized through a single thread, the processing capacity of the single thread is limited, a large amount of time is consumed in the process of generating the code diagram, and the generation efficiency of the code diagram is low.
In order to solve the problem, the code pattern generation method and system disclosed in the embodiments of the present invention adopt multiple threads to execute the code pattern generation process in parallel without changing hardware, thereby improving the code pattern generation efficiency.
As shown in fig. 1, which is a schematic flow chart of a code pattern generating method disclosed in the embodiment of the present invention, the method may be applied to a terminal or a server, and the method may specifically include the following steps:
s101: and acquiring code values to be converted according to the arrangement sequence of the code values from first to last.
In the process of executing S101, a sequence number may be added to the code value according to the sequence of the code value, so that the code value may be directly read according to the sequence of the sequence numbers from small to large, where the sequence number added to the code value may be a virtual signal.
It should be noted that the number of code values is N, and the value of N is a positive integer greater than or equal to 1.
The code pattern can be a two-dimensional code, a bar code or other special codes, and the specific type of the code pattern is not limited in any way in the application and is determined according to actual conditions.
For example, the code value may be a URL (uniform resource Locator) link, and the image generated according to the URL link is a code map.
It should be noted that, the amount of information included in the code map may be more or less, and the information included in the code map may be determined according to actual requirements. The types of information contained in the code diagrams may be the same or different, and this is not limited in this application.
In an application scenario of the invention, a code value security queue is constructed in advance, and the code value security queue is used for storing code values to be converted of an un-generated code pattern.
It should be noted that the code value secure queue is a set of code values arranged in order from small to large.
In the application scenario, the process of obtaining the code value to be converted according to the sequence of the code value from small to large specifically comprises the following steps:
reading a code value with the minimum sequence number from a pre-constructed code value security queue to determine the code value to be converted, wherein the code value security queue stores code values of non-generated code patterns which are arranged according to the sequence of the sequence numbers from small to large.
It should be noted that the read-write rule of the code value security queue is first in first out, that is, the code value written into the code value security queue first reads first.
With regard to the above-described process of acquiring a code value to be converted, an example is described here:
the code values are stored in the code value security queue in sequence, for example, according to the serial number, number 1, number 2 and number 3 values of the code values. According to the first-in first-out reading and writing rule of the code value security queue, the code value of the number 1 is obtained through first reading, the number 2 is obtained through second reading, and the code value of the number 3 is obtained through third reading.
S102: and generating a code graph according to the code value to be converted.
In the process of executing S102, a code map is generated from the code value to be converted by calling a code map generation algorithm.
It should be noted that the code map generation algorithm may be a good code generation algorithm, a two-dimensional barcode QR (quick response) generation algorithm, or other generation algorithms, and the determination of the specific code map generation algorithm is set by a technician according to actual situations.
And adding virtual serial numbers to the code values according to the arrangement sequence of the code values to obtain serial numbers corresponding to the code values to be converted, wherein the code values and the serial numbers corresponding to the code values form a code value object code. And constructing code value object codes corresponding to the code value serial numbers on the basis of the code value serial numbers, wherein each 1 code value serial number corresponds to 1 code value object code.
In one embodiment of the invention, a scheduling thread is created, and the scheduling thread allocates a corresponding code pattern generation task to each idle thread in the thread pool. And for each code pattern generation task, the scheduling thread takes out an idle thread from the thread pool, sends the corresponding code value object code to the thread, and calls a code pattern generation algorithm to generate a code pattern from the code value to be converted. And an idle thread is issued from the thread Chi Zhongqu based on the scheduling thread by creating a scheduling thread, so that the operation of generating a code map from the code value to be converted by executing a code map generation algorithm is performed.
In order to reduce resource loss of thread creation and thread destruction, the number of available threads in a thread pool is set to be M, and the value of M is a positive integer greater than or equal to 1.
When a thread finishes the process of generating the code graph, the thread is converted into an idle state again and returns to the thread pool to wait for other code graph generating tasks to be allocated.
S103: and judging whether the code graph corresponding to the previous code value adjacent to the code value to be converted is converted. If yes, go to step S104, otherwise go to step S105.
In an application scenario, a code value history buffer queue is constructed to record a code value corresponding to an output code pattern. And storing the code values to be converted into a pre-constructed code value historical cache queue, wherein the code value historical cache queue stores code values of which the sequence numbers are arranged from small to large and the code image conversion is completed.
The code values are stored in the code value history buffer queue, the sequence numbers of the code values are arranged from small to large, and the code value after code image conversion is completed.
In the application scene, when a previous code value adjacent to the serial number of the code value to be converted exists in the code value historical cache queue, the conversion of the code graph corresponding to the previous code value adjacent to the code value to be converted is indicated to be completed; when the code value history cache queue does not have the previous code value adjacent to the serial number of the code value to be converted, indicating that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
In another application scenario, a code graph security queue is constructed, and the converted code graphs are stored in the code graph security queue according to the sequence of the code values corresponding to the code graphs from small to large.
It should be noted that, after the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, the code graph corresponding to the code value to be converted is stored in the code graph security queue, and the code value corresponding to the code graph is stored in the code value history buffer queue, so that the code graph conversion task is completed. The current thread enters a thread pool and waits for a new code pattern generation task to be allocated.
The code graph safety queue is used for storing the code graphs generated by all threads.
S104: and outputting the code graph corresponding to the code value to be converted.
In an application scenario, if the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, the code graph corresponding to the code value to be converted can be directly output. For example, the code map corresponding to the code value to be converted may be directly stored as a file, or the code map may be sent to an external device.
It should be noted that the format of the picture file may be a JPG format, a BMP format, or another format, and the specific format for generating the picture file is set by a technician according to actual situations.
The external device can be a printing machine, a display screen or other external devices, and the specific type of the external device is set by a technician according to actual conditions.
In another application scenario, the code pattern corresponding to the code value to be converted may be stored in a code pattern security queue first. And when the code graph can be taken out from the code graph safety queue, taking out the code graph from the code graph safety queue, and then storing the taken out code graph as a file or outputting the code graph to external equipment.
It should be noted that, after the code graph corresponding to the code value to be converted is generated, the code graph is stored in the code graph security queue according to the arrangement sequence of the code values from first to last, so that the phenomenon of generating the code graph out of order is avoided.
S105: and continuing to wait until the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, and outputting the code graph corresponding to the code value to be converted.
And if the code image corresponding to the previous code value adjacent to the code value to be converted is not successfully converted, continuing to wait until the code image corresponding to the previous code value adjacent to the code value to be converted is successfully converted, and outputting the code image corresponding to the code value to be converted.
And if the converted code pattern is stored as a picture, storing the converted code pattern into a file, and if the code pattern needs to be subjected to jet printing, sending the converted code pattern into a printing machine for jet printing.
The code pattern generating method disclosed by the embodiment of the invention acquires code values to be converted according to the arrangement sequence of the code values from first to last, generates a code pattern according to the code values to be converted, judges whether the conversion of the code pattern corresponding to the previous code value adjacent to the code values to be converted is finished, and outputs the code pattern corresponding to the code values to be converted if the conversion of the code pattern corresponding to the previous code value adjacent to the code values to be converted is finished. By the method, under the condition of not changing hardware, the process of converting the code values into the code diagrams is executed in parallel by the threads, and the corresponding code diagrams are output according to the sequence of the code values, so that the problem that the code diagrams are output out of order when the code diagrams are generated in parallel by multiple threads is avoided, the generation efficiency of the code diagrams is improved, and the problem that the code diagrams generated in parallel are out of order is avoided.
Based on the above process related to determining whether the conversion of the code graph corresponding to the previous code value adjacent to the code value to be converted is completed, as shown in fig. 2, a schematic flow chart illustrating the determination of whether the previous code value adjacent to the serial number of the code value to be converted exists in the code value history buffer queue and whether the conversion of the code graph corresponding to the previous code value adjacent to the code value to be converted is completed is shown, which specifically includes the following steps:
s201: and judging whether the previous code value adjacent to the serial number of the code value to be converted exists in the code value history buffer queue. If yes, then S202 is executed, and if not, then S203 is executed.
In the process of executing S201, it is determined whether a difference value between a code value serial number corresponding to the code map and a code value serial number (e.g., I0) added last in the code value history buffer queue is 1.
S202: and determining that the code image corresponding to the previous code value adjacent to the code value to be converted is converted.
In the process of executing S202, if the difference between the code value serial number corresponding to the code map and the code value serial number I0 added last in the code value history buffer queue is 1, it is determined that the code map conversion corresponding to the previous code value adjacent to the code value to be converted is completed.
S203: and determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
In the process of executing S203, if the difference between the code value serial number corresponding to the code pattern and the code value serial number I0 added last in the code value history buffer queue is not 1, it is determined that the code pattern corresponding to the previous code value adjacent to the code value to be converted is not converted.
Judging whether a previous code value adjacent to the serial number of the code value to be converted exists in the code value history cache queue or not through S201-S203, if the previous code value adjacent to the serial number of the code value to be converted exists in the code value history cache queue, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, and if the previous code value adjacent to the serial number of the code value to be converted does not exist in the code value history cache queue, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
Optionally, after the code graph corresponding to the code value to be converted is output if the conversion of the code graph corresponding to the previous code value adjacent to the code value to be converted is completed, the value to be transcoded is stored into a pre-constructed code value history cache queue, where the code value history cache queue stores code values whose sequence numbers are arranged from small to large and whose code graph conversion is completed.
Optionally, after the code map corresponding to the code value to be converted is output if the conversion of the code map corresponding to the previous code value adjacent to the code value to be converted is completed, the thread switches to an idle state and waits for a new code map generation task to be allocated.
It should be noted that the thread entering the thread pool waiting for allocation of a new code pattern generation task is a thread that has already completed the current code pattern generation task.
The thread which finishes the current code pattern generating task enters the thread pool to wait for the allocation of a new code pattern generating task, so that the waste of idle threads is avoided, and the utilization rate of the idle threads is improved.
Based on the code pattern generation method described above, the following description will be given by way of example:
and creating a scheduling thread, taking the thread from the thread pool, reading the code value with the minimum sequence number (for example, the 3-number code value) from the code value security queue in the thread, and generating a corresponding code map according to the 3-number value. And if the previous 2-number code value adjacent to the 3-number code value exists in the code value history buffer queue, determining that the code graph corresponding to the previous 2-number code value adjacent to the 3-number code value is converted, and outputting the code graph corresponding to the 3-number code value. The code image corresponding to the 3 code value can be sent to a printing machine for spray printing, or the code image corresponding to the 3 code value is stored as a picture piece. After the thread completes the task of generating the code map by the code value, the thread is switched to an idle state and waits for a new code map generation task to be allocated.
Based on the code pattern generation method disclosed in the embodiment of the present invention, the embodiment of the present invention also correspondingly discloses a code pattern generation system, as shown in fig. 3, the code pattern generation system 300 mainly includes:
the obtaining unit 301 is configured to obtain code values to be converted according to an arrangement order of the code values from first to last.
A generating unit 302, configured to generate a code map according to the code value to be converted.
And the judging unit 303 is configured to judge whether conversion of a code pattern corresponding to a previous code value adjacent to the code value to be converted is completed.
And an output unit 304, configured to output a code pattern corresponding to the code value to be converted when the code pattern corresponding to a previous code value adjacent to the code value to be converted is converted.
In an application scenario of the present invention, the output unit 304 sends the code pattern corresponding to the code value to be converted to an external device.
The external equipment can be a printer, a display screen or other external equipment, and the specific type of the external equipment is set by a technician according to the actual situation.
Further, the obtaining unit 301 includes:
and the determining module is used for reading the code value with the minimum serial number from a pre-constructed code value security queue to determine the code value to be converted, and the code value security queue stores the code values of the un-generated code images which are arranged according to the sequence of the serial numbers from small to large.
And after the thread finishes the current code graph generating task, switching to an idle state, and waiting for allocating a new code graph generating task.
As shown in fig. 4, a block diagram of another code pattern generation system provided in the embodiment of the present invention is shown, where the system further includes, on the basis of the embodiment shown in fig. 3: a first memory cell 401.
The first storage unit 401 is configured to store a value to be transcoded into a pre-constructed code value history cache queue.
The code value history cache queue stores code values of which the sequence numbers are arranged from small to large and code image conversion is completed.
In this embodiment, the determining unit 303 is specifically configured to:
judging whether a previous code value adjacent to the serial number of the code value to be converted exists in a code value history cache queue, if so, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, and if not, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
As shown in fig. 5, a block diagram of another code pattern generating system provided in the embodiment of the present invention is further provided, where the system further includes, on the basis of the embodiment shown in fig. 3: a second storage unit 501;
a second storage unit 501, configured to store the converted code pattern as a picture file.
Further, the code image in the form of the picture file corresponding to the code value may be output in the order of the code value from first to last.
The specific principle and the implementation process of each unit and each module in the code pattern generation system disclosed in the embodiment of the present invention are the same as those of the code pattern generation method disclosed in the embodiment of the present invention, and reference may be made to corresponding parts in the code pattern generation method disclosed in the embodiment of the present invention, which are not described herein again.
The invention discloses a code map generation system, which is characterized in that code values to be converted are obtained according to the arrangement sequence of the code values from first to last, a code map is generated according to the code values to be converted, whether the conversion of the code map corresponding to the previous code value adjacent to the code values to be converted is completed or not is judged, and if the conversion of the code map corresponding to the previous code value adjacent to the code values to be converted is completed, the code map corresponding to the code values to be converted is output. Through the system, under the condition of not changing hardware, the process of converting code values into code graphs is executed in parallel by adopting a plurality of threads, and the corresponding code graphs are output according to the sequence of the code values, so that the problem that the code graphs output out-of-order when the code graphs are generated in parallel by multiple threads is avoided, the generation efficiency of the code graphs is improved, and the problem that the code graphs generated in parallel are out-of-order is avoided.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A code pattern generation method is applied to equipment comprising at least two code pattern generation threads, and each code pattern generation thread executes the following steps:
acquiring code values to be converted according to the arrangement sequence of the code values from first to last;
generating a code graph according to the code value to be converted;
judging whether the code graph corresponding to the previous code value adjacent to the code value to be converted is converted;
if the code graph corresponding to the previous code value adjacent to the code value to be converted is converted, outputting the code graph corresponding to the code value to be converted;
storing the code values to be converted into a pre-constructed code value historical cache queue, wherein the code value historical cache queue stores code values of which the sequence numbers are arranged from small to large and code image conversion is completed;
the judging whether the conversion of the code image corresponding to the previous code value adjacent to the code value to be converted is completed includes:
judging whether a previous code value adjacent to the serial number of the code value to be converted exists in the code value historical cache queue;
if the code value history cache queue has a previous code value adjacent to the serial number of the code value to be converted, determining that the code image conversion corresponding to the previous code value adjacent to the code value to be converted is completed;
and if the code value history cache queue does not have the previous code value adjacent to the serial number of the code value to be converted, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
2. The method of claim 1, wherein obtaining the code values to be converted according to the order of the code values from first to last comprises:
reading a code value with the minimum sequence number from a pre-constructed code value security queue to determine the code value to be converted, wherein the code value security queue stores code values of non-generated code patterns which are arranged according to the sequence of the sequence numbers from small to large.
3. The method according to claim 1, further comprising, after outputting the code pattern corresponding to the code value to be converted if the code pattern corresponding to the previous code value adjacent to the code value to be converted is converted, further:
and the thread is switched to an idle state and waits for a new code pattern generation task to be allocated.
4. The method of claim 1, further comprising:
storing the converted code pattern as a picture file, or
And sending the converted code pattern to external equipment.
5. A code pattern generation system for performing the method of any of claims 1-4, comprising:
the acquiring unit is used for acquiring code values to be converted according to the arrangement sequence of the code values from first to last;
the generating unit is used for generating a code image according to the code value to be converted;
the judging unit is used for judging whether the code graph corresponding to the previous code value adjacent to the code value to be converted is converted;
and the output unit is used for outputting the code graph corresponding to the code value to be converted if the code graph corresponding to the previous code value adjacent to the code value to be converted is converted.
6. The system of claim 5, wherein the obtaining unit comprises:
and the determining module is used for reading the code value with the minimum serial number from a pre-constructed code value security queue to determine the code value to be converted, and the code value security queue stores the code values of the un-generated code images which are arranged according to the sequence of the serial numbers from small to large.
7. The system of claim 5, further comprising:
the first storage unit is used for storing the code values to be converted into a pre-constructed code value historical cache queue, and the code value historical cache queue stores code values of which the sequence numbers are arranged from small to large and code image conversion is completed.
8. The system according to claim 7, wherein the determining unit is configured to, when determining whether the conversion of the code pattern corresponding to the previous code value adjacent to the code value to be converted is completed, specifically:
judging whether a previous code value adjacent to the serial number of the code value to be converted exists in the code value historical cache queue, and if the previous code value adjacent to the serial number of the code value to be converted exists in the code value historical cache queue, determining that code image conversion corresponding to the previous code value adjacent to the code value to be converted is completed; and if the previous code value adjacent to the serial number of the code value to be converted does not exist in the code value history cache queue, determining that the code graph corresponding to the previous code value adjacent to the code value to be converted is not converted.
CN201910553915.8A 2019-06-25 2019-06-25 Code graph generation method and system Active CN110263895B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910553915.8A CN110263895B (en) 2019-06-25 2019-06-25 Code graph generation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910553915.8A CN110263895B (en) 2019-06-25 2019-06-25 Code graph generation method and system

Publications (2)

Publication Number Publication Date
CN110263895A CN110263895A (en) 2019-09-20
CN110263895B true CN110263895B (en) 2023-02-17

Family

ID=67921209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910553915.8A Active CN110263895B (en) 2019-06-25 2019-06-25 Code graph generation method and system

Country Status (1)

Country Link
CN (1) CN110263895B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005301939A (en) * 2004-04-16 2005-10-27 Ricoh Printing Systems Ltd Bar code pattern generation means
CN1996958A (en) * 2006-12-30 2007-07-11 华为技术有限公司 Method and device for guaranteeing message sequence
CN103559285A (en) * 2013-11-07 2014-02-05 大连东方之星信息技术有限公司 Method for monitoring file folder in real time and supporting conversion of multi-format files
CN105162863A (en) * 2015-09-01 2015-12-16 北京皮尔布莱尼软件有限公司 Picture uploading device and method and computing equipment
CN106570547A (en) * 2016-10-18 2017-04-19 网易(杭州)网络有限公司 Code pattern generation method, encoding pattern recognition method and devices
CN106779000A (en) * 2016-12-07 2017-05-31 北京慧眼智行科技有限公司 A kind of code figure editor and generation method and system
CN107368872A (en) * 2016-05-13 2017-11-21 腾讯科技(深圳)有限公司 A kind of method and apparatus for generating bar code image
CN107832824A (en) * 2017-11-28 2018-03-23 广州真知码信息科技有限公司 It is a kind of to show the method, system and device and Method of printing for closing source Quick Response Code

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4915125B2 (en) * 2006-04-10 2012-04-11 富士ゼロックス株式会社 Image generating apparatus, information reading apparatus, image generating method, and program
US8411734B2 (en) * 2007-02-06 2013-04-02 Microsoft Corporation Scalable multi-thread video decoding
JP5995583B2 (en) * 2012-07-26 2016-09-21 キヤノン株式会社 Image encoding device, image decoding device, image encoding method, image decoding method, and program
CN103413160A (en) * 2013-08-30 2013-11-27 北京慧眼智行科技有限公司 Method, device and system for encoding and decoding
CN103678526A (en) * 2013-11-29 2014-03-26 贝壳网际(北京)安全技术有限公司 Method and device for decoding images of browser and client
CN105635740B (en) * 2014-10-27 2019-05-28 阿里巴巴集团控股有限公司 The method and device that image is decoded
CN109726786B (en) * 2017-10-31 2023-09-26 北京京东尚科信息技术有限公司 Two-dimensional code information reading and generating method and device
CN109544439B (en) * 2018-10-23 2021-06-08 百富计算机技术(深圳)有限公司 Decoding method based on multi-core processor, terminal equipment and storage medium
CN109858588B (en) * 2019-01-08 2022-10-18 哈尔滨理工大学 Chaos mapping-based two-dimensional code parallel generation method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005301939A (en) * 2004-04-16 2005-10-27 Ricoh Printing Systems Ltd Bar code pattern generation means
CN1996958A (en) * 2006-12-30 2007-07-11 华为技术有限公司 Method and device for guaranteeing message sequence
CN103559285A (en) * 2013-11-07 2014-02-05 大连东方之星信息技术有限公司 Method for monitoring file folder in real time and supporting conversion of multi-format files
CN105162863A (en) * 2015-09-01 2015-12-16 北京皮尔布莱尼软件有限公司 Picture uploading device and method and computing equipment
CN107368872A (en) * 2016-05-13 2017-11-21 腾讯科技(深圳)有限公司 A kind of method and apparatus for generating bar code image
CN106570547A (en) * 2016-10-18 2017-04-19 网易(杭州)网络有限公司 Code pattern generation method, encoding pattern recognition method and devices
CN106779000A (en) * 2016-12-07 2017-05-31 北京慧眼智行科技有限公司 A kind of code figure editor and generation method and system
CN107832824A (en) * 2017-11-28 2018-03-23 广州真知码信息科技有限公司 It is a kind of to show the method, system and device and Method of printing for closing source Quick Response Code

Also Published As

Publication number Publication date
CN110263895A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
JP4540495B2 (en) Data processing apparatus, data processing method, data processing program, and recording medium
CN108647104B (en) Request processing method, server and computer readable storage medium
CN111274019B (en) Data processing method, device and computer readable storage medium
CN111553699B (en) Resource scheduling method and device
CN111899011A (en) Medical bill reconciliation system, computer equipment and storage medium
US9542127B2 (en) Image processing method and image processing apparatus
CN110263895B (en) Code graph generation method and system
CN111338769A (en) Data processing method and device and computer readable storage medium
CN101446906A (en) Dispatching method for multi-batch processing tasks and system thereof
CN111210340A (en) Automatic task processing method and device, server and storage medium
CN113656180A (en) System and method for batch processing files under unitized architecture and related products
CN111598988B (en) D3-based method and system for rendering knowledge graph data nodes
JP5471681B2 (en) Image processing apparatus and image processing program
CN107493312B (en) Service calling method and device
CN112306827A (en) Log collection device, method and computer readable storage medium
JP5750018B2 (en) Image processing system, printing system, control device, image processing method and program
CN112380040B (en) Message processing method and device, electronic equipment and storage medium
CN101907979B (en) Image forming apparatus
CN115509704A (en) Task scheduling method, device, equipment and storage medium
JP2009181213A (en) Memory management device
CN113296923A (en) Memory merging method, device and computer readable medium
US7145578B2 (en) Scalable object recognition architecture
CN102253940B (en) Method and device for processing data by tree view
CN111292143A (en) Electronic invoice issuing method, device and computer system
CN107967549B (en) Multi-process task processing device and method

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