Cigarette two-dimensional code associated data difference analysis method and device

By adopting independent thread and memory queue technology in tobacco industry enterprises, efficient parallel collection and real-time comparison of cigarette QR code data are achieved, solving the problems of insufficient adaptability and long time consumption in existing technologies, and improving production efficiency and real-time decision-making.

CN120670448APending Publication Date: 2025-09-19CHONGQING CHINA TOBACCO IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510582979.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies in tobacco industry enterprises have problems such as insufficient adaptability, lack of real-time performance, and time-consuming data collection. They are difficult to quickly adapt to business needs, resulting in delayed decision-making and low production efficiency.

Method used

The first independent thread and the second independent thread are used to execute asynchronous tasks respectively, extract the original data from the coding database and the scanning database, and determine the difference results through the preset comparison strategy. The memory queue is used to cache the data to achieve efficient parallel collection and real-time comparison of data.

Benefits of technology

It improves data collection efficiency and response speed, reduces data preparation time, and realizes real-time monitoring of the production process and rapid decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670448A_ABST
    Figure CN120670448A_ABST
Patent Text Reader

Abstract

The invention provides a cigarette two-dimensional code associated data difference analysis method and device.The method comprises the steps that a first independent thread and a second independent thread are called, the first independent thread and the second independent thread are used for executing a first asynchronous task and a second asynchronous task respectively, the first asynchronous task is used for extracting all first original data in a code printing database, and the second asynchronous task is used for extracting all second original data in a code scanning database; and obtaining a difference result between the first original data and the second original data based on a preset comparison strategy. According to the technical scheme provided by the invention, the time consumption for collecting the first original data and the second original data is reduced, and the data collection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for analyzing differences in cigarette QR code associated data. Background Art

[0002] The prior art proposes a data comparison method, device, system and medium for cross-database migration, the method including S100, pulling the data to be verified through a big data component; S200, classifying the data to be verified according to the table type, and executing the query operation by splicing the corresponding query statement according to the table type; S300, performing data level-by-level comparison in units of tables according to the query results to obtain differentiated data; S400, repairing the differentiated data through a preset correction strategy according to the properties of the full data and the incremental data.

[0003] The existing technology has the following problems:

[0004] 1. Lack of adaptability: Existing solutions often use fixed architectures, which make it difficult to quickly adapt to the business needs of different tobacco industry enterprises and have poor replicability.

[0005] 2. Lack of real-time performance: Existing systems usually use offline manual processing to compare data, which makes it difficult to respond to dynamic changes in the production process in a timely manner, resulting in delayed decision-making, affecting production efficiency and product quality.

[0006] 3. The existing technology collects data from different databases one by one through big data components, resulting in long waiting time and a large total time consumption. Summary of the Invention

[0007] In view of this, one of the purposes of the embodiments of the present application is to provide a method for analyzing differences in cigarette QR code associated data, which can improve the problems of long waiting time and large total time consumption.

[0008] To achieve the above technical objectives, the technical solutions adopted in this application are as follows:

[0009] In a first aspect, an embodiment of the present application provides a method for analyzing differences in cigarette QR code-related data, the method comprising:

[0010] Calling a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all first original data from the coding database, and the second asynchronous task is used to extract all second original data from the scanning database;

[0011] Based on a preset comparison strategy, a difference result between the first original data and the second original data is obtained.

[0012] Furthermore, obtaining a difference result between the first original data and the second original data based on a preset comparison strategy includes:

[0013] extracting a first designated field of the first original data and a second designated field of the second original data;

[0014] Comparing all the second designated fields by using the first designated field, and / or comparing all the first designated fields by using the second designated field, to obtain a first comparison result;

[0015] The difference result is determined based on the first comparison result.

[0016] Furthermore, obtaining the difference result based on the first comparison result includes:

[0017] When the first comparison result indicates the existence of a second designated field that is identical to the first designated field, the difference result includes first prompt information, wherein the first prompt information indicates that a first QR code corresponding to the first designated field is different from a second QR code corresponding to the identical second designated field, or the first prompt information indicates that the first QR code does not exist and / or the second QR code does not exist;

[0018] When the first comparison result indicates that there is no second designated field that is identical to the first designated field, the difference result includes second prompt information, and the second prompt information indicates that the scanning database lacks the second designated field, or the printing database lacks the first designated field.

[0019] Furthermore, obtaining a difference result between the first original data and the second original data based on a preset comparison strategy includes:

[0020] Extracting a first two-dimensional code of the first original data and a second two-dimensional code of the second original data;

[0021] Comparing the first two-dimensional code with all the second two-dimensional codes, and / or comparing the second two-dimensional code with all the first two-dimensional codes to obtain a second comparison result;

[0022] Based on the second comparison result, the difference result is determined.

[0023] Furthermore, determining the difference result based on the second comparison result includes:

[0024] When the second comparison result indicates the presence of a second two-dimensional code identical to the first two-dimensional code, the difference result includes third prompt information, wherein the third prompt information indicates that a first designated field corresponding to the first two-dimensional code is different from a second designated field corresponding to the identical second two-dimensional code, or the third prompt information indicates that the first designated field and / or the second designated field do not exist;

[0025] When the second comparison result indicates that there is no second QR code identical to the first QR code, the difference result includes fourth prompt information, and the second prompt information indicates that the second QR code is missing from the scanning database, or the first QR code is missing from the printing database.

[0026] Furthermore, the first designated field includes a first timestamp and a first cigarette brand number, and the second designated field includes a second timestamp and a second cigarette brand number.

[0027] Furthermore, between executing the first asynchronous task and the second asynchronous task respectively by the first independent thread and the second independent thread, and obtaining a difference result between the first original data and the second original data based on a preset comparison strategy, the method further includes:

[0028] All of the first original data and the second original data are cached in a memory queue.

[0029] Furthermore, between calling the first independent thread and the second independent thread and obtaining the difference result between the first original data and the second original data based on the preset comparison strategy, the method further includes:

[0030] performing standardization processing on the first original data and the second original data so that a first designated field of the first original data and a second designated field of the second original data are aligned, and a first two-dimensional code of the first original data and a second two-dimensional code of the second original data are aligned;

[0031] After obtaining a difference result between the first original data and the second original data based on the preset comparison strategy, the method further includes:

[0032] Displaying the difference result in a preset format, where the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field;

[0033] The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.

[0034] In a second aspect, the present application also provides a device for analyzing differences in cigarette QR code-related data, comprising:

[0035] a data acquisition module configured to call a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all first original data from a code scanning database, and the second asynchronous task is used to extract all second original data from a code printing database;

[0036] The comparison and analysis module is configured to obtain a difference result between the first original data and the second original data based on a preset comparison strategy.

[0037] Furthermore, it also includes:

[0038] The data processing module is configured to perform standardization processing on the first original data and the second original data so that the first designated field of the first original data and the second designated field of the second original data are aligned, and the first two-dimensional code of the first original data and the second two-dimensional code of the second original data are aligned.

[0039] a display module configured to display the difference result in a preset format, wherein the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field;

[0040] The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.

[0041] The invention adopting the above technical solution has the following advantages:

[0042] In the technical solution provided in the present application, the first asynchronous task and the second asynchronous task are executed synchronously by calling the first independent thread and the second independent thread, ensuring that the first asynchronous task and the second asynchronous task do not conflict or block each other, thereby synchronously collecting the first original data and the second original data, reducing the time consumption for collecting the first original data and the second original data, and improving data collection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present application may be further illustrated by the non-limiting embodiments provided in the accompanying drawings. It should be understood that the following drawings illustrate only certain embodiments of the present application and are therefore not to be construed as limiting the scope of the present application. It is understood that a person skilled in the art can derive other relevant drawings from these drawings without inventive effort.

[0044] Figure 1 This is a flowchart of the method provided in Example 1 of the present application.

[0045] Figure 2 This is one of the sub-flowcharts of S200 provided in Example 1 of the present application.

[0046] Figure 3 This is another sub-flowchart of S200 provided in Example 1 of the present application.

[0047] Figure 4 This is a block diagram of the device provided in Example 2 of the present application.

[0048] Icon: 300 - cigarette QR code associated data difference analysis device; 310 - data acquisition module; 320 - data processing module; 330 - comparison and analysis module; 340 - display module. DETAILED DESCRIPTION

[0049] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts in the drawings or descriptions are numbered the same. Implementations not shown or described in the drawings are known to those of ordinary skill in the art. In the description of this application, the terms "first," "second," etc. are used solely to distinguish descriptions and are not to be construed as indicating or implying relative importance.

[0050] Example 1

[0051] Please refer to Figure 1 The present application also provides a method for analyzing differences in cigarette QR code-related data. The method may include the following steps:

[0052] S100: Calling a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all first original data from a coding database, and the second asynchronous task is used to extract all second original data from a coding database;

[0053] S200: Obtain a difference result between the first original data and the second original data based on a preset comparison strategy.

[0054] The following is a detailed description of the steps in the method for analyzing the differences in cigarette QR code-related data:

[0055] In S110, an independent thread refers to the smallest unit capable of independent execution in an operating system. It is contained in a process. A process can contain multiple independent threads, each of which can independently execute different tasks. In this embodiment, the first independent thread and the second independent thread are respectively used to execute different tasks. The first independent thread and the second independent thread can belong to the same process, which is used to collect database data.

[0056] In this embodiment, the first independent thread and the second independent thread can be used to execute different tasks simultaneously. The first independent thread is used to execute the first asynchronous task, and the second independent thread is used to execute the second asynchronous task.

[0057] The first asynchronous task is encapsulated in a first independent thread and is used to extract all the first original data in the code scanning database. The second asynchronous task is encapsulated in a second independent thread and is used to extract all the second original data in the code printing database.

[0058] In this embodiment, a first independent thread and a second independent thread are called to retrieve data from different databases based on a first asynchronous task and a second asynchronous task, respectively. This allows the first and second asynchronous tasks to be executed simultaneously, eliminating the need to wait for the completion of one of the first and second raw data before retrieval of the other. This improves the system's data collection efficiency and response speed, and uses an asynchronous method to retrieve data from two independent MySQL databases. The system queries the target databases separately through asynchronous threads or task queues, avoiding blocking the overall process due to response delays from a single data source.

[0059] Exemplarily, upon receiving a query signal, the steps of calling the first independent thread and the second independent thread are executed. The query signal may be sent by a user, for example, by clicking a virtual button on the host for sending a query signal.

[0060] After calling the first independent thread and the second independent thread, the first asynchronous task and the second asynchronous task independently execute corresponding SQL query statements to extract the first original data and the second original data.

[0061] Exemplarily, both the first original data and the second original data include a QR code and corresponding business fields, and the business fields include a primary key, cigarette brand, production time, QR code information, and the like.

[0062] In this embodiment, the coding database is used to store the QR code data at the time of production completion. That is, the QR code is attached to the product packaging box upon production completion. Therefore, the first original data includes the QR code, timestamp, and cigarette brand. The scanning database is used to store the information obtained by scanning the QR code of the second original data during warehousing and packaging. Therefore, the second original data should also include the QR code, timestamp, and cigarette brand.

[0063] Between S100 and S200, the following steps are also included:

[0064] All the first original data and the second original data are cached in a memory queue, and S200 is executed in the memory queue. According to this step, S200 can be executed while the first original data and the second original data are extracted, without causing data congestion.

[0065] This step significantly improves data transfer efficiency due to the memory queue's advantages in read and write speeds. Furthermore, the memory queue acts as a buffer, preventing data loss and system overload. After the first and second raw data are cached in the memory queue, there's no need to repeatedly query the database, reducing database load.

[0066] After the first original data and the second original data enter the memory queue, the consumer can immediately trigger the logic of S200 to compare the first original data and the second original data without waiting for the full data loading to be completed, which has better real-time performance.

[0067] If the amount of the first original data and the second original data is large, they can be automatically queried in batches and pages, and asynchronous calls can be managed in the task thread pool to improve concurrency performance and stability.

[0068] Through the above asynchronous data acquisition mechanism, the system can realize efficient parallel collection of multi-source data, effectively shorten the data preparation time, and provide support for subsequent data difference comparison.

[0069] It is understandable that the first original data and the second original data may share the same memory queue, or the first original data and the second original data may be cached in independent memory queues respectively.

[0070] Before the step of "caching all the first original data and the second original data into the memory queue", the extracted first original data and the second original data are standardized, including field unification, format conversion, duplicate value cleaning, etc., to ensure that the first original data and the second original data can be aligned in field.

[0071] Between S100 and S200, the following steps are also included: standardizing the first original data and the second original data so that the first designated field of the first original data and the second designated field of the second original data are aligned, and the first two-dimensional code of the first original data and the second two-dimensional code of the second original data are aligned

[0072] In S200, the preset comparison strategy can be understood as a strategy for comparing the first original data and the second original data to see if there are any differences. For example, a first hash table is established based on all the first original data, and a second hash table is established based on all the second original data. Based on a bidirectional hash mapping, the first original data is traversed through the second hash table, and then the second original data is traversed through the first hash table to determine the difference results. Figure 2 As shown, in at least one embodiment, S200 may include the following steps:

[0073] S210: Extracting a first designated field of the first original data and a second designated field of the second original data;

[0074] S220: Compare all the second designated fields using the first designated field, and / or compare all the first designated fields using the second designated field to obtain a first comparison result;

[0075] S230: Determine the difference result based on the first comparison result.

[0076] It can be understood that in the first hash table, the first designated field is the first primary key, the first QR code is the first hash value, the first primary key and the first hash value are in a corresponding relationship, and the first hash table includes multiple sets of mapping relationships between the first primary keys and the first hash values.

[0077] In the second hash table, the first designated field is the second primary key, the first QR code is the second hash value, the second primary key and the second hash value are in a corresponding relationship, and the second hash table includes multiple sets of mapping relationships between the second primary keys and the second hash values.

[0078] In at least one embodiment, S230 may be expressed as:

[0079] When the first comparison result indicates the existence of a second designated field that is identical to the first designated field, the difference result includes first prompt information, wherein the first prompt information indicates that a first QR code corresponding to the first designated field is different from a second QR code corresponding to the identical second designated field, or the first prompt information indicates that the first QR code does not exist and / or the second QR code does not exist;

[0080] When the first comparison result indicates that there is no second designated field that is identical to the first designated field, the difference result includes second prompt information, and the second prompt information indicates that the scanning database lacks the second designated field, or the printing database lacks the first designated field.

[0081] In the above steps, each second primary key can be traversed in the second hash table using the first primary key of each first original data.

[0082] If a second primary key is identical to the first primary key, it indicates that the two products are from the same batch. If the first QR code corresponding to the first primary key is different from the second QR code corresponding to the second primary key, it indicates that the first and second original data are conflicting items. If the first or second QR code does not exist, it indicates that there is a missing item.

[0083] The difference result should include a first prompt information, which includes conflicting items and missing items.

[0084] When there is no second primary key that is the same as the first primary key, it indicates that there is a problem of missing code scanning. The difference result includes a second prompt information, which indicates that the code scanning database lacks the second primary key, or the code printing database lacks the first primary key.

[0085] In at least one embodiment, Figure 3 As shown, S200 includes the following steps:

[0086] S240: Extracting a first two-dimensional code of the first original data and a second two-dimensional code of the second original data;

[0087] S250: Compare the first two-dimensional code with all the second two-dimensional codes, and / or compare the second two-dimensional code with all the first two-dimensional codes to obtain a second comparison result;

[0088] S260: Determine the difference result based on the second comparison result.

[0089] Among them, S260 can be interpreted as:

[0090] When the second comparison result indicates the presence of a second two-dimensional code identical to the first two-dimensional code, the difference result includes third prompt information, wherein the third prompt information indicates that a first designated field corresponding to the first two-dimensional code is different from a second designated field corresponding to the identical second two-dimensional code, or the third prompt information indicates that the first designated field and / or the second designated field do not exist;

[0091] When the second comparison result indicates that there is no second QR code identical to the first QR code, the difference result includes fourth prompt information, and the second prompt information indicates that the second QR code is missing from the scanning database, or the first QR code is missing from the printing database.

[0092] Exemplarily, after the first hash table and the second hash table are established, one of the first original data is , by the first primary key Match all the second primary keys in the second hash table, and the second original data exists , the primary keys of the two are the same, but the QR codes are different, so the difference result is displayed in the form of the first prompt information, that is, and Conflict, when the second original data does not contain the QR code information, the difference result is displayed in the form of the second prompt information, that is, it does not exist. or 456.

[0093] S240-S260 are matched through QR codes, the principle is the same as above.

[0094] This embodiment also includes the following steps:

[0095] Displaying the difference result in a preset format, where the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field;

[0096] The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.

[0097] Example 2

[0098] Please refer to Figure 4 This application also provides a device 300 for analyzing differences in cigarette QR code-related data, based on the method described in Example 1. The device includes at least one software function module that can be stored in a storage module in the form of software or firmware, or embedded in an operating system (OS). A processing module is configured to execute executable modules stored in the storage module, such as the software function modules and computer programs included in the device.

[0099] The device for analyzing differences in cigarette QR code-related data includes a data acquisition module 310, a data processing module 320, a comparison and analysis module 330, and a display module 340. The functions of each module may be as follows:

[0100] The data acquisition module 310 is configured to call a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all the first original data in the code scanning database, and the second asynchronous task is used to extract all the second original data in the code printing database;

[0101] The comparison and analysis module 330 is configured to obtain a difference result between the first original data and the second original data based on a preset comparison strategy.

[0102] The data processing module 320 is configured to perform standardization processing on the first original data and the second original data so that the first designated field of the first original data and the second designated field of the second original data are aligned, and the first two-dimensional code of the first original data and the second two-dimensional code of the second original data are aligned.

[0103] The display module 340 is configured to display the difference result in a preset format, wherein the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field;

[0104] The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.

[0105] After collecting the first and second raw data, the data acquisition module 310 caches all of the first and second raw data in a memory queue. A memory table is used to cache intermediate calculation results to avoid repeated database queries. For data volumes of millions, batch and paging comparisons are used to improve response speed. Comparison tasks are processed asynchronously to avoid front-end congestion.

[0106] The comparative analysis module 330 is further configured to:

[0107] extracting a first designated field of the first original data and a second designated field of the second original data;

[0108] Comparing all the second designated fields by using the first designated field, and / or comparing all the first designated fields by using the second designated field, to obtain a first comparison result;

[0109] The difference result is determined based on the first comparison result.

[0110] When the first comparison result indicates the existence of a second designated field that is identical to the first designated field, the difference result includes first prompt information, wherein the first prompt information indicates that a first QR code corresponding to the first designated field is different from a second QR code corresponding to the identical second designated field, or the first prompt information indicates that the first QR code does not exist and / or the second QR code does not exist;

[0111] When the first comparison result indicates that there is no second designated field that is identical to the first designated field, the difference result includes second prompt information, and the second prompt information indicates that the scanning database lacks the second designated field, or the printing database lacks the first designated field.

[0112] The comparative analysis module 330 is further configured to:

[0113] Extracting a first two-dimensional code of the first original data and a second two-dimensional code of the second original data;

[0114] Comparing the first two-dimensional code with all the second two-dimensional codes, and / or comparing the second two-dimensional code with all the first two-dimensional codes to obtain a second comparison result;

[0115] Based on the second comparison result, the difference result is determined.

[0116] The determining the difference result based on the second comparison result includes:

[0117] When the second comparison result indicates the presence of a second two-dimensional code identical to the first two-dimensional code, the difference result includes third prompt information, wherein the third prompt information indicates that a first designated field corresponding to the first two-dimensional code is different from a second designated field corresponding to the identical second two-dimensional code, or the third prompt information indicates that the first designated field and / or the second designated field do not exist;

[0118] When the second comparison result indicates that there is no second QR code identical to the first QR code, the difference result includes fourth prompt information, and the second prompt information indicates that the second QR code is missing from the scanning database, or the first QR code is missing from the printing database.

[0119] In the comparison and analysis module 330, a primary key based on the combination of "QR code + timestamp + cigarette brand" is used as the basis for comparison, and data from two data sources (referred to as the code printing database and the code scanning database) are verified and analyzed one by one. The specific logic is as follows:

[0120] Group and match the data from the two data sources according to the joint primary key field, establish an index structure, and speed up the comparison efficiency;

[0121] For data records that exist in the coding database but not in the scanning database, the system marks the record as "missing item" and records the difference information;

[0122] For data in two systems that match joint primary keys, if the QR code content and other fields are completely identical, it is considered a "match." Under the default configuration, this data is not included in the difference results display and is only counted in the total data volume statistics.

[0123] The system supports total statistics and detailed queries of difference items, and can filter and export difference results based on time dimensions, brand dimensions, etc.

[0124] All difference analysis processes are matched and compared in memory to ensure good processing performance for large batches of data.

[0125] Through the above-mentioned comparison mechanism, problems such as data errors in the two systems can be accurately identified, providing data support for business investigation and quality traceability.

[0126] The device proposed in this embodiment adopts a three-layer distributed architecture based on the B / S model, including:

[0127] Presentation layer: Adopts responsive web design and implements multi-terminal adaptive display based on HTML5+CSS3+JavaScript technology stack.

[0128] Business logic layer: Developed in C#, running on the .NET Framework 4.7 platform, to implement core business processing.

[0129] Data layer: Use memory database technology to achieve high-speed data comparison.

[0130] The core functions of the device are:

[0131] Multi-source heterogeneous data collection: supports real-time collection and standardized processing of multiple data sources such as relational databases, NoSQL, and file systems.

[0132] Exact matching engine: Achieve 100% accurate data comparison based on exact matching algorithm.

[0133] Asynchronous processing mechanism: Use message queues to implement non-blocking data acquisition and processing.

[0134] Deployment implementation plan of the device:

[0135] Hardware configuration: Make full use of the company's existing x86 architecture server resources, with configuration requirements of 4-core CPU and 8GB of memory.

[0136] Software environment: Based on the Windows Server 2016 operating system, deploy the IIS web server.

[0137] Security assurance: Implement transport layer SSL encryption and role-based permission control.

[0138] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented through hardware or by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0139] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of code, and a part of the module, program segment or code includes one or more executable instructions for implementing the specified logical function. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, the functional modules in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.

[0140] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for analyzing differences in cigarette QR code-related data, characterized in that: The method comprises: Calling a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all first original data from the coding database, and the second asynchronous task is used to extract all second original data from the scanning database; Based on a preset comparison strategy, a difference result between the first original data and the second original data is obtained.

2. The method according to claim 1, characterized in that Obtaining a difference result between the first original data and the second original data based on a preset comparison strategy includes: extracting a first designated field of the first original data and a second designated field of the second original data; Comparing all the second designated fields by using the first designated field, and / or comparing all the first designated fields by using the second designated field, to obtain a first comparison result; The difference result is determined based on the first comparison result.

3. The method according to claim 2, characterized in that Obtaining the difference result based on the first comparison result includes: When the first comparison result indicates the existence of a second designated field that is identical to the first designated field, the difference result includes first prompt information, wherein the first prompt information indicates that a first QR code corresponding to the first designated field is different from a second QR code corresponding to the identical second designated field, or the first prompt information indicates that the first QR code does not exist and / or the second QR code does not exist; When the first comparison result indicates that there is no second designated field that is identical to the first designated field, the difference result includes second prompt information, and the second prompt information indicates that the scanning database lacks the second designated field, or the printing database lacks the first designated field.

4. The method according to claim 1, wherein Obtaining a difference result between the first original data and the second original data based on a preset comparison strategy includes: Extracting a first two-dimensional code of the first original data and a second two-dimensional code of the second original data; Comparing the first two-dimensional code with all the second two-dimensional codes, and / or comparing the second two-dimensional code with all the first two-dimensional codes to obtain a second comparison result; Based on the second comparison result, the difference result is determined.

5. The method according to claim 4, characterized in that The determining the difference result based on the second comparison result includes: When the second comparison result indicates the presence of a second two-dimensional code identical to the first two-dimensional code, the difference result includes third prompt information, wherein the third prompt information indicates that a first designated field corresponding to the first two-dimensional code is different from a second designated field corresponding to the identical second two-dimensional code, or the third prompt information indicates that the first designated field and / or the second designated field do not exist; When the second comparison result indicates that there is no second QR code identical to the first QR code, the difference result includes fourth prompt information, and the second prompt information indicates that the second QR code is missing from the scanning database, or the first QR code is missing from the printing database.

6. The method according to claim 3 or 5, characterized in that The first designated field includes a first timestamp and a first cigarette brand number, and the second designated field includes a second timestamp and a second cigarette brand number.

7. The method according to claim 1, characterized in that Between executing the first asynchronous task and the second asynchronous task respectively by the first independent thread and the second independent thread, and obtaining a difference result between the first original data and the second original data based on a preset comparison strategy, the method further includes: All of the first original data and the second original data are cached in a memory queue.

8. The method according to claim 1, characterized in that Between calling the first independent thread and the second independent thread and obtaining a difference result between the first original data and the second original data based on a preset comparison strategy, the method further includes: performing standardization processing on the first original data and the second original data so that a first designated field of the first original data and a second designated field of the second original data are aligned, and a first two-dimensional code of the first original data and a second two-dimensional code of the second original data are aligned; After obtaining a difference result between the first original data and the second original data based on the preset comparison strategy, the method further includes: Displaying the difference result in a preset format, where the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field; The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.

9. A device for analyzing differences in cigarette QR code-related data, characterized in that: include: a data acquisition module configured to call a first independent thread and a second independent thread, wherein the first independent thread and the second independent thread are respectively used to execute a first asynchronous task and a second asynchronous task, wherein the first asynchronous task is used to extract all first original data from a code scanning database, and the second asynchronous task is used to extract all second original data from a code printing database; The comparison and analysis module is configured to obtain a difference result between the first original data and the second original data based on a preset comparison strategy.

10. The device according to claim 9, characterized in that Also includes: a data processing module configured to perform standardization processing on the first original data and the second original data so that a first designated field of the first original data and a second designated field of the second original data are aligned, and a first two-dimensional code of the first original data and a second two-dimensional code of the second original data are aligned; a display module configured to display the difference result in a preset format, wherein the preset format represents displaying the first designated field, the second designated field, a first QR code corresponding to the first designated field, and a second QR code corresponding to the second designated field; The first designated field is the same as the second designated field and is aligned, and the first two-dimensional code is different from the second two-dimensional code and is aligned; or, the first designated field is different from the second designated field and is aligned, and the first two-dimensional code is the same as the second two-dimensional code and is aligned.