A thermal printer label instruction parsing method and system
Through thermal printer label instruction parsing methods and systems, the problem of low cross-platform and cross-enterprise data query efficiency is solved. Through adaptive data processing and optimized storage rules, data transmission and storage performance is improved, and cost reduction and efficiency increase are achieved. Availability of important data.
Patent Information
- Application Number
- CN202410881123.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Existing data query methods cannot fully utilize hardware resources in cross-platform and cross-enterprise environments, resulting in low transmission efficiency and a lack of effective data query and management methods.
A method and system for parsing thermal printer label instructions is proposed. Through the multi-source database access module, data storage module, task scheduling module and console module, adaptive data processing is based on thermal printing instructions and the distribution rules of the storage pool are set. , redundancy rules, data aggregation rules and reconstruction scheduling rules, sensing thermal printing instructions for data aggregation and priority scheduling.
It improves data transmission efficiency and storage system performance, reduces system overhead, achieves cost reduction and efficiency improvement, and effectively improves data reconstruction time and the availability of important data.
Smart Images

Figure CN118410108B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of distributed data technology, and in particular relates to a thermal printer label instruction parsing method and system. Background Art
[0002] With the rapid development of the Internet, users have higher and higher requirements for network performance. For file transmission, the transmission of large files has become more and more frequent. The efficiency of transmission is what we are more concerned about. For most servers in enterprises, dozens of CPU cores and more than 100 gigabytes of memory are already standard. Most of them also support hyperthreading, and the network card can support more than 1000 megabits. Therefore, it is ideal to make full use of various hardware resources to achieve the most efficient transmission method. Concurrency and breakpoint resumable transmission can greatly improve transmission performance.
[0003] In metadata governance, information resources can only be fully developed and utilized through exchange and query. Data exchange and query are key links in realizing the value of data throughout its entire life cycle. However, related technologies can only perform data queries under specific conditions, and there are no relevant query methods for cross-platform and cross-enterprise operations. Summary of the invention
[0004] According to a first aspect of the present invention, a method for parsing a label instruction of a thermal printer is provided, comprising:
[0005] The system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console;
[0006] The application initiates a query request to the multi-source database through the object storage gateway, which selects a specified storage pool and carries a suitable thermal print label for query;
[0007] Authenticate the query request of the object storage gateway, check whether the available data block groups are sufficient, select the data block groups according to the thermal printing label and the storage pool data aggregation rules if sufficient, and request the relevant mapping relationship of the data block groups, otherwise apply for a batch of new available data block groups;
[0008] Verify the query request for querying the data block group, return a successful result after all data blocks are successfully queried, and update the thermal printing label statistics of the corresponding data block group;
[0009] The multi-source database is regularly tested for faults. When a node failure is found and data reconstruction is required, a new node or disk is found as the target node or disk for reconstruction, a data reconstruction request is initiated for the specified node, reconstruction tasks are issued according to different rules, and after the reconstruction is completed, the relevant routing information is updated.
[0010] Furthermore, the system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console, which also includes:
[0011] When creating a storage pool, redundancy rules, distribution rules, data aggregation rules, and reconstruction scheduling rules of the storage pool are specified.
[0012] Furthermore, after specifying the redundancy rule, distribution rule, data aggregation rule and reconstruction scheduling rule of the storage pool when creating the storage pool, it also includes:
[0013] After receiving the storage pool creation request from the system administrator, the console forwards the request to the multi-source database management module;
[0014] After receiving the storage pool creation request, the multi-source database management module checks the request parameters of the creation request, allocates a storage pool ID, and records the rule configuration information of the storage pool;
[0015] The multi-source database management module calls the interface of the data storage module to create a batch of data block groups according to the basic configuration information of the storage pool to be created and the configuration information of the multi-source database management module itself;
[0016] The data block group is composed of multiple data blocks from different positions according to redundancy and distribution rules, and the data block group records the length or percentage of data stored in each thermal printing label as thermal printing label statistical information of the data block group;
[0017] After the creation is complete, the multi-source database management module records the relevant mapping information and returns the ID of the successfully created storage pool to the console;
[0018] The basic configuration information of the storage pool to be created includes at least a redundancy rule.
[0019] Further, the application initiates a query request to the multi-source database through the object storage gateway, the object storage gateway selects a specified storage pool and carries a suitable thermal print label for query, and also includes:
[0020] The object storage gateway obtains the information of the storage pool through an interface, and after receiving a query request from the application, selects a designated storage pool according to a thermal printing instruction;
[0021] According to the data aggregation rules and reconstruction scheduling rules of the storage pool, a suitable thermal printing label is selected and carried for query, and a query request is initiated to the multi-source database access module, the request including the storage pool ID, the data to be queried and the content of the thermal printing label.
[0022] Further, checking whether the available data block groups are sufficient, if sufficient, selecting the data block groups according to the thermal printing label and the storage pool data aggregation rule, and requesting the relevant mapping relationship of the data block groups, otherwise applying for a batch of new available data block groups, further comprising:
[0023] Under the first data aggregation rule, the data with the same thermal printing label are queried into the same data block group;
[0024] Or, under the second data aggregation rule, data of thermal printing labels with the same label or similar priority are queried into the same data block group.
[0025] Further, the query request for querying the data block group is verified, and after all data blocks are successfully queried, a success result is returned, and the thermal printing label statistical information of the corresponding data block group is updated, and further includes:
[0026] After obtaining the available data block group, the multi-source database access module checks other contents, requests the routing information of the data block group from the multi-source database management module, and initiates a write request to the data storage module according to the routing information;
[0027] After receiving the write request, the data storage module performs verification and then queries each data block in the data block group according to the redundancy and distribution rules;
[0028] When all data blocks are queried successfully, the data storage module returns a successful result to the multi-source database access module, otherwise it returns a failed result;
[0029] After receiving the successful query result from the data storage module, the multi-source database access module updates the thermal printing label statistical information of the corresponding data block group.
[0030] Furthermore, the method further comprises:
[0031] If a query failure result is received, the multi-source database access module records the relevant query information and selects other available data block groups to retry.
[0032] Furthermore, the method of periodically performing fault detection on the multi-source database and finding a new node or disk as a target node or disk for reconstruction when a node fault is found and data reconstruction is required, initiating a data reconstruction request for the designated node, issuing reconstruction tasks according to different rules and updating relevant routing information after the reconstruction is completed, further includes:
[0033] After receiving the data reconstruction request, the task scheduling module generates a data block reconstruction task queue for the node according to the thermal printing label statistics of the data block group to which each data block to be reconstructed belongs and the reconstruction scheduling rules of the storage pool;
[0034] Different thermal printing types adopt different scheduling rules, and adaptive selection is made for thermal printing types;
[0035] After the task scheduling module completes the construction of the reconstruction task queue, it sends the reconstruction task to the data storage module according to different rules;
[0036] After the reconstruction is completed, the relevant routing information in the multi-source database management module is updated.
[0037] Furthermore, the reconstruction scheduling rule further includes:
[0038] The first reconstruction scheduling rule is to reconstruct data with higher priority tags as absolute priority;
[0039] The second reconstruction scheduling rule is to reconstruct data with higher priority tags as a relative priority;
[0040] The third reconstruction scheduling rule: On the basis of the first reconstruction scheduling rule and the second reconstruction scheduling rule, if the task scheduling module evaluates that the data reconstruction time may have been longer than the expiration time of the low-priority thermal printing data, the data blocks of the low-priority thermal printing data will not participate in the sorting of constructing the reconstruction queue.
[0041] According to a second aspect of the present invention, the present invention claims protection for a thermal printer label instruction parsing system, comprising a multi-source database access module, a data storage module, a task scheduling module, a multi-source database management module, and a console module;
[0042] Multi-source database access module, receiving external requests and performing authentication;
[0043] Data storage module, which stores data and performs data replication or erasure code calculation according to redundancy strategy;
[0044] The task scheduling module schedules and manages the background tasks of the distributed storage multi-source database. The background tasks include at least data reconstruction, data balancing, and garbage collection. The tasks are scheduled according to the priority and concurrency scale according to the management strategy.
[0045] Multi-source database management module manages node views, saves configuration information, and provides data routing information for multi-source database access modules;
[0046] The console module is the management and control plane of the distributed storage system, providing multi-source database creation, configuration management, and operation and maintenance functions;
[0047] The thermal printer label instruction parsing system is used to execute the thermal printer label instruction parsing method.
[0048] The beneficial effects of the present invention are as follows:
[0049] 1. A distributed storage system with thermal printing perception is proposed, which can process data adaptively according to thermal printing instructions through multi-source database access module, data storage module, task scheduling module, multi-source database management module and console module. It can be adjusted and optimized for different thermal printing instructions to meet the needs of different thermal printing instructions.
[0050] 2. Set the distribution rules, redundancy rules, data aggregation rules, and reconstruction scheduling rules of the storage pool before thermal printing begins. This method can improve the thermal printing performance in a targeted manner, improve the efficiency of the storage pool, and maximize the utility of the storage pool.
[0051] 3. Sense thermal printing instructions, aggregate and reconstruct data according to thermal printing labels, adjust and optimize different thermal printing instructions, and adapt to the needs of different thermal printing instructions. This can improve storage system performance and reduce system overhead, thereby achieving the goal of reducing costs and increasing efficiency.
[0052] 4. Use bucket sorting to define priorities. At the same time, use weighted average to calculate the comprehensive priority of the thermal printing label of the data block based on the data proportion and priority. You can choose the priority scheduling method according to different thermal printing instructions and needs, which can effectively improve the data reconstruction time and ensure the availability of important data. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0054] Figure 1 A flowchart of a method for parsing label instructions of a thermal printer as claimed in an embodiment of the present invention;
[0055] Figure 2 This is a structural module diagram of a thermal printer label instruction parsing system claimed for protection in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0057] The relevant terms in the present invention are explained as follows:
[0058] Data reconstruction: The process of supplementing when redundancy is insufficient. Data reconstruction occurs after a server or disk failure, and the failed device cannot be restored. The number of replicas / shards is reduced, and supplementation is required to ensure reliability. For the multi-copy mode, reconstruction is the data replication of the data block, while the erasure code mode requires traversing each shard, calculating the erasure code one by one, and then querying the new data block file.
[0059] The object storage in the prior art logically includes three components: object storage protocol gateway, metadata storage and data storage. The object storage protocol gateway implements storage protocols such as s3 and provides interfaces for client applications to call. Metadata storage usually stores user accounts, storage buckets and bucket index information, and data storage stores object data. In specific implementation, metadata storage and data storage may be the same set of programs. For example, Ceph object storage data and metadata are stored in the RADOS multi-source database.
[0060] The data storage is usually a distributed multi-source database. The object storage gateway slices the data and stores it in the distributed storage multi-source database. The data storage multi-source database distributes the received data shards to different devices in the multi-source database according to certain rules or algorithms. In order to ensure the reliability of the data, multiple copies or erasure coding technology are often used. In this layered architecture, the upper layer usually treats the underlying distributed storage multi-source database as a large disk with expandable capacity, and the lower layer does not perceive the specific thermal printing data of the upper layer.
[0061] According to a first embodiment of the present invention, a method for parsing a label instruction of a thermal printer is proposed. Figure 1 ,include:
[0062] The system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console;
[0063] The application initiates a query request to the multi-source database through the object storage gateway, which selects a specified storage pool and carries a suitable thermal print label for query;
[0064] Authenticate the query request of the object storage gateway, check whether the available data block groups are sufficient, select the data block groups according to the thermal printing label and the storage pool data aggregation rules if sufficient, and request the relevant mapping relationship of the data block groups, otherwise apply for a batch of new available data block groups;
[0065] Verify the query request for querying the data block group, return a successful result after all data blocks are successfully queried, and update the thermal printing label statistics of the corresponding data block group;
[0066] The multi-source database is regularly tested for faults. When a node failure is found and data reconstruction is required, a new node or disk is found as the target node or disk for reconstruction, a data reconstruction request is initiated for the specified node, reconstruction tasks are issued according to different rules, and after the reconstruction is completed, the relevant routing information is updated.
[0067] Among them, in this embodiment, the system administrator first creates a storage pool on the management console, and specifies the distribution rules of the storage pool (which racks, servers, disks are distributed), redundancy rules (replicas or erasure codes), data aggregation rules, reconstruction scheduling rules, etc. The upper-level module (such as the object gateway) selects the specified storage pool according to the thermal printing needs, and when querying data, according to the data aggregation rules and reconstruction scheduling rules of the storage pool, the corresponding thermal printing label is transferred to the storage multi-source database; after receiving the data query request, the storage multi-source database selects the corresponding data block query according to the data aggregation rules; the upper-level module (such as the object gateway) deletes the expired data according to its own life cycle rules, and the distributed storage multi-source database marks the corresponding space as recyclable; the scheduling node performs garbage collection according to the data aggregation rules, and for the data aggregated according to the life cycle rules, checks whether the latest modification time of the data block is expired. If it is expired, the entire block is recycled; when data reconstruction is required after the node fails and goes offline, the scheduling node reconstructs the data block according to the specified priority according to the reconstruction rules.
[0068] The present invention can adjust and optimize different thermal printing instructions, adapt to the needs of different thermal printing instructions, improve thermal printing performance, and improve the efficiency of storage pool use. It can maximize the utility of the storage pool, effectively shorten data reconstruction time, ensure the availability of important data, improve storage system performance and reduce system overhead.
[0069] Furthermore, the system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console, which also includes:
[0070] When creating a storage pool, redundancy rules, distribution rules, data aggregation rules, and reconstruction scheduling rules of the storage pool are specified.
[0071] In this embodiment, the redundancy rule refers to multiple copies or erasure code sharding rules.
[0072] The distribution rule refers to which racks, servers, and disks the data blocks of the storage pool should be distributed on. Preferably, the data blocks should be distributed on different racks, then on different servers, and finally on different disks.
[0073] Data aggregation rules refer to the standards by which data is aggregated or not. Aggregated data will be queried on the same data block as much as possible. For example, you can specify aggregation according to thermal printing labels. At this time, you should agree on the thermal printing label type and determine the weights or priorities of different thermal printing labels.
[0074] Reconstruction scheduling rules can specify whether to use priority scheduling in an aggregated manner or use other scheduling methods when data needs to be rebuilt.
[0075] Furthermore, after specifying the redundancy rule, distribution rule, data aggregation rule and reconstruction scheduling rule of the storage pool when creating the storage pool, it also includes:
[0076] After receiving the storage pool creation request from the system administrator, the console forwards the request to the multi-source database management module;
[0077] After receiving the storage pool creation request, the multi-source database management module checks the request parameters of the creation request, allocates a storage pool ID, and records the rule configuration information of the storage pool;
[0078] The multi-source database management module calls the interface of the data storage module to create a batch of data block groups according to the basic configuration information of the storage pool to be created and the configuration information of the multi-source database management module itself;
[0079] The data block group is composed of multiple data blocks from different positions according to redundancy and distribution rules, and the data block group records the length or percentage of data stored in each thermal printing label as thermal printing label statistical information of the data block group;
[0080] After the creation is complete, the multi-source database management module records the relevant mapping information and returns the ID of the successfully created storage pool to the console;
[0081] The basic configuration information of the storage pool to be created includes at least a redundancy rule.
[0082] Further, the application initiates a query request to the multi-source database through the object storage gateway, the object storage gateway selects a specified storage pool and carries a suitable thermal print label for query, and also includes:
[0083] The object storage gateway obtains the information of the storage pool through an interface, and after receiving a query request from the application, selects a designated storage pool according to a thermal printing instruction;
[0084] According to the data aggregation rules and reconstruction scheduling rules of the storage pool, a suitable thermal printing label is selected and carried for query, and a query request is initiated to the multi-source database access module, the request including the storage pool ID, the data to be queried and the content of the thermal printing label.
[0085] Among them, in this embodiment, the data upload method process is: when the application queries data, it initiates a query to the multi-source database through the object storage gateway.
[0086] The object storage gateway obtains the storage pool information through the interface. After receiving the query request from the application, it selects the specified storage pool according to the thermal printing instruction, and selects and carries the appropriate thermal printing label for query according to the data aggregation rules and reconstruction scheduling rules of the storage pool, and initiates a query request to the multi-source database access module. The request includes the storage pool ID, the data to be queried, and the thermal printing label.
[0087] The multi-source database access module receives the query request from the object storage gateway and performs authentication. After the authentication is passed, the multi-source database access module checks whether there is an available data block group according to the data aggregation rules, so as to achieve: under strict data aggregation rules, the data with the same thermal printing label is queried into the same data block group; or under relatively loose data aggregation rules, the data with the same label or thermal printing label with similar priority is queried into the same data block group as much as possible. When there is no available data block group, the multi-source database access module applies to the multi-source database management module for a batch of new queryable data block groups.
[0088] After obtaining the available data block group, the multi-source database access module checks other contents, and then requests the multi-source database management module for the relevant mapping relationship (routing information) of the data block group, and initiates a write request to the data storage module according to the routing information.
[0089] After receiving the write request, the data storage module first performs verification, and then queries each data block in the data block group according to the redundancy and distribution rules. After all data blocks are successfully queried, the data storage module returns a successful result to the multi-source database access module; otherwise, it returns a failed result.
[0090] After receiving the successful query result from the data storage module, the multi-source database access module updates the thermal printing label statistics of the corresponding data block group; if a failed query result is received, the multi-source database access module records the relevant query information and selects other available data block groups for retry.
[0091] Through the storage pool creation method and data uploading method of the system, data can be aggregated according to thermal printing labels for different specific thermal printings.
[0092] Further, checking whether the available data block groups are sufficient, if sufficient, selecting the data block groups according to the thermal printing label and the storage pool data aggregation rule, and requesting the relevant mapping relationship of the data block groups, otherwise applying for a batch of new available data block groups, further comprising:
[0093] Under the first data aggregation rule, the data with the same thermal printing label are queried into the same data block group;
[0094] Or, under the second data aggregation rule, data of thermal printing labels with the same label or similar priority are queried into the same data block group.
[0095] Among them, in this embodiment, the multi-source database access module receives the query request from the object storage gateway and performs authentication. After the authentication is passed, the multi-source database access module checks whether there is an available data block group according to the data aggregation rule, so as to achieve: under strict data aggregation rules, the data with the same thermal printing label is queried into the same data block group; or under relatively loose data aggregation rules, the data with the same label or thermal printing label with similar priority is queried into the same data block group as much as possible. When there is no available data block group, the multi-source database access module applies to the multi-source database management module for a batch of new queryable data block groups.
[0096] Further, the query request for querying the data block group is verified, and after all data blocks are successfully queried, a success result is returned, and the thermal printing label statistical information of the corresponding data block group is updated, and further includes:
[0097] After obtaining the available data block group, the multi-source database access module checks other contents, requests the routing information of the data block group from the multi-source database management module, and initiates a write request to the data storage module according to the routing information;
[0098] After receiving the write request, the data storage module performs verification and then queries each data block in the data block group according to the redundancy and distribution rules;
[0099] When all data blocks are queried successfully, the data storage module returns a successful result to the multi-source database access module, otherwise it returns a failed result;
[0100] After receiving the successful query result from the data storage module, the multi-source database access module updates the thermal printing label statistical information of the corresponding data block group.
[0101] Furthermore, the method further comprises:
[0102] If a query failure result is received, the multi-source database access module records the relevant query information and selects other available data block groups to retry.
[0103] Furthermore, in the data reconstruction scheduling process, the multi-source database is regularly detected for faults. When a node fault is found and data reconstruction is required, a new node or disk is found as a target node or disk for reconstruction, a data reconstruction request for the specified node is initiated, and reconstruction tasks are issued according to different rules. After the reconstruction is completed, the relevant routing information is updated, which also includes:
[0104] After receiving the data reconstruction request, the task scheduling module generates a data block reconstruction task queue for the node according to the thermal printing label statistics of the data block group to which each data block to be reconstructed belongs and the reconstruction scheduling rules of the storage pool;
[0105] Different thermal printing types adopt different scheduling rules, and adaptive selection is made for thermal printing types;
[0106] After the task scheduling module completes the construction of the reconstruction task queue, it sends the reconstruction task to the data storage module according to different rules;
[0107] After the reconstruction is completed, the relevant routing information in the multi-source database management module is updated.
[0108] Furthermore, the reconstruction scheduling rule further includes:
[0109] The first reconstruction scheduling rule is to reconstruct data with higher priority tags as absolute priority;
[0110] The second reconstruction scheduling rule is to reconstruct data with higher priority tags as a relative priority;
[0111] The third reconstruction scheduling rule: On the basis of the first reconstruction scheduling rule and the second reconstruction scheduling rule, if the task scheduling module evaluates that the data reconstruction time may have been longer than the expiration time of the low-priority thermal printing data, the data blocks of the low-priority thermal printing data will not participate in the sorting of constructing the reconstruction queue.
[0112] In this embodiment, the reconstruction scheduling rules of the data reconstruction scheduling process of this system are described:
[0113] The distribution rules, redundancy rules (replicas or erasure codes), data aggregation rules, and reconstruction scheduling rules of the storage pool are defined by the thermal printing type to better adapt to different thermal printing instructions and thermal printing requirements and maximize the effectiveness of the storage pool.
[0114] When querying data, according to the thermal printing instructions, the data reconstruction rules are adaptively selected. The specific rules are as follows:
[0115] Rule 1: Reconstruction is based on data with higher priority tags. That is, as long as a data block contains data corresponding to a higher priority tag, it must take precedence over other data blocks that do not have data corresponding to this higher weight tag. In this case, a method similar to bucket sorting can be used to obtain the reconstruction task queue, so that: data blocks with a large amount of data of the highest priority tag are ranked before data blocks with a small amount of data; for data blocks with equal data amounts of the highest priority tag, data blocks with a large amount of data of the next priority tag are ranked before data blocks with a small amount of data, and so on, until the lowest priority tag.
[0116] Rule 2: Reconstruction is relatively prioritized over data of higher priority labels. It is acceptable that data of high-weight labels is reconstructed later. In this case, the comprehensive priority of the thermal printing labels of the data block can be calculated by weighted average according to the data proportion and priority of each thermal printing label in the data block. After obtaining the comprehensive priority of each data block on the node, the reconstruction task queue can be obtained by sorting according to the priority.
[0117] Rule 3: Based on rules 1 and 2, if the task scheduling module evaluates that the data reconstruction time may have been longer than the expiration time of some low-priority data, only the data blocks corresponding to these low-priority thermal printing labels will not participate in the sorting of the reconstruction queue.
[0118] According to a second embodiment of the present invention, the present invention claims a thermal printer label instruction parsing system, referring to Figure 2 , including multi-source database access module, data storage module, task scheduling module, multi-source database management module, and console module;
[0119] Multi-source database access module, receiving external requests and performing authentication;
[0120] Data storage module, which stores data and performs data replication or erasure code calculation according to redundancy strategy;
[0121] The task scheduling module schedules and manages the background tasks of the distributed storage multi-source database. The background tasks include at least data reconstruction, data balancing, and garbage collection. The tasks are scheduled according to the priority and concurrency scale according to the management strategy.
[0122] Multi-source database management module manages node views, saves configuration information, and provides data routing information for multi-source database access modules;
[0123] The console module is the management and control plane of the distributed storage system, providing multi-source database creation, configuration management, and operation and maintenance functions;
[0124] The thermal printer label instruction parsing system is used to execute the thermal printer label instruction parsing method.
[0125] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for parsing label instructions for a thermal printer. It is characterized in that include: The system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console; The application initiates a query request to the multi-source database through the object storage gateway, which selects a specified storage pool and carries a suitable thermal print label for query; Authenticate the query request of the object storage gateway, check whether the available data block groups are sufficient, select the data block groups according to the thermal printing label and the storage pool data aggregation rules if sufficient, and request the relevant mapping relationship of the data block groups, otherwise apply for a batch of new available data block groups; Verify the query request for querying the data block group, return a successful result after all data blocks are successfully queried, and update the thermal printing label statistics of the corresponding data block group; Perform fault detection on the multi-source database regularly, and when a node failure is found and data reconstruction is required, find a new node or disk as the target node or disk for reconstruction, initiate a data reconstruction request for the specified node, issue reconstruction tasks according to different rules, and update relevant routing information after the reconstruction is completed; The system administrator creates a storage pool through the console, records relevant mapping information after the creation is completed, and returns the ID of the successfully created storage pool to the console, further comprising: When creating a storage pool, specifying redundancy rules, distribution rules, data aggregation rules and reconstruction scheduling rules of the storage pool; When creating a storage pool, after specifying the redundancy rule, distribution rule, data aggregation rule and reconstruction scheduling rule of the storage pool, it also includes: After receiving the storage pool creation request from the system administrator, the console forwards the request to the multi-source database management module; After receiving the storage pool creation request, the multi-source database management module checks the request parameters of the creation request, allocates a storage pool ID, and records the rule configuration information of the storage pool; The multi-source database management module calls the interface of the data storage module to create a batch of data block groups according to the basic configuration information of the storage pool to be created and the configuration information of the multi-source database management module itself; The data block group is composed of multiple data blocks from different positions according to redundancy and distribution rules, and the data block group records the length or percentage of data stored in each thermal printing label as thermal printing label statistical information of the data block group; After the creation is complete, the multi-source database management module records the relevant mapping information and returns the ID of the successfully created storage pool to the console; The basic configuration information of the storage pool to be created includes at least a redundancy rule; Check whether the available data block groups are sufficient, if sufficient, select the data block groups according to the thermal printing label and storage pool data aggregation rules, and request the relevant mapping relationship of the data block groups, otherwise apply for a batch of new available data block groups, and also include: Under the first data aggregation rule, the data with the same thermal printing label are queried into the same data block group; Or, under the second data aggregation rule, data of thermal printing labels with the same label or similar priority are queried into the same data block group.
2. A thermal printer label instruction parsing method according to claim 1, It is characterized in that The application initiates a query request to the multi-source database through the object storage gateway, the object storage gateway selects a specified storage pool and carries a suitable thermal print label for query, and also includes: The object storage gateway obtains the information of the storage pool through an interface, and after receiving a query request from the application, selects a designated storage pool according to a thermal printing instruction; According to the data aggregation rules and reconstruction scheduling rules of the storage pool, a suitable thermal printing label is selected and carried for query, and a query request is initiated to the multi-source database access module, the request including the storage pool ID, the data to be queried and the content of the thermal printing label.
3. A thermal printer label instruction parsing method according to claim 1, It is characterized in that The query request for querying the data block group is verified, and after all data blocks are successfully queried, a success result is returned, and the thermal printing label statistical information of the corresponding data block group is updated, and the following further includes: After obtaining the available data block group, the multi-source database access module checks other contents, requests the routing information of the data block group from the multi-source database management module, and initiates a write request to the data storage module according to the routing information; After receiving the write request, the data storage module performs verification and then queries each data block in the data block group according to the redundancy and distribution rules; When all data blocks are queried successfully, the data storage module returns a successful result to the multi-source database access module, otherwise it returns a failed result; After receiving the successful query result from the data storage module, the multi-source database access module updates the thermal printing label statistical information of the corresponding data block group.
4. A thermal printer label instruction parsing method according to claim 1, It is characterized in that Also includes: If a query failure result is received, the multi-source database access module records the relevant query information and selects other available data block groups to retry.
5. A thermal printer label instruction parsing method according to claim 1, It is characterized in that The method of periodically performing fault detection on the multi-source database and finding a new node or disk as a target node or disk for reconstruction when a node fault is found and data reconstruction is required, initiating a data reconstruction request for the designated node, issuing reconstruction tasks according to different rules and updating relevant routing information after the reconstruction is completed, further includes: After receiving the data reconstruction request, the task scheduling module generates a data block reconstruction task queue for the node according to the thermal printing label statistics of the data block group to which each data block to be reconstructed belongs and the reconstruction scheduling rules of the storage pool; Different thermal printing types adopt different scheduling rules, and adaptive selection is made for thermal printing types; After the task scheduling module completes the construction of the reconstruction task queue, it sends the reconstruction task to the data storage module according to different rules; After the reconstruction is completed, the relevant routing information in the multi-source database management module is updated.
6. A thermal printer label instruction parsing method according to claim 5, It is characterized in that The reconstruction scheduling rule further includes: The first reconstruction scheduling rule is to reconstruct data with higher priority tags as absolute priority; The second reconstruction scheduling rule is to reconstruct data with higher priority tags as a relative priority; Third reconstruction scheduling rule: based on the first reconstruction scheduling rule and the second reconstruction scheduling rule, if the task scheduling module evaluates that the data reconstruction time may be longer than the expiration time of the low-priority thermal printing data, the data blocks of the low-priority thermal printing data will not participate in the sorting of the reconstruction queue; The first reconstruction scheduling rule uses a bucket sorting method to obtain a reconstruction task queue, so that: data blocks with a large data volume of the highest priority tag are arranged in front of data blocks with a small data volume; for data blocks with equal data volumes of the highest priority tag, data blocks with a large data volume of the next priority tag are arranged in front of data blocks with a small data volume, and so on, until the lowest priority tag; The second reconstruction scheduling rule calculates the comprehensive priority of the thermal printing labels of the data block by weighted average according to the data proportion and priority of each thermal printing label in the data block. After obtaining the comprehensive priority of each data block on the node, it sorts them according to the priority to obtain the reconstruction task queue.
7. A thermal printer label instruction parsing system, It is characterized in that It includes multi-source database access module, data storage module, task scheduling module, multi-source database management module and console module; Multi-source database access module, receiving external requests and performing authentication; Data storage module, which stores data and performs data replication or erasure code calculation according to redundancy strategy; The task scheduling module schedules and manages the background tasks of the distributed storage multi-source database. The background tasks include at least data reconstruction, data balancing, and garbage collection. The tasks are scheduled according to the priority and concurrency scale according to the management strategy. Multi-source database management module manages node views, saves configuration information, and provides data routing information for multi-source database access modules; The console module is the management and control plane of the distributed storage system, providing multi-source database creation, configuration management, and operation and maintenance functions; The thermal printer label instruction parsing system is used to execute the thermal printer label instruction parsing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Lattice instruction analysis method for micro-printer
CN109799963A
Data integrity auditing method supporting tag block chain storage and query
CN111898164A
Full-automatic performance testing method and system for thermal printer
CN115635778A
Device for fixing platen roller for printing apparatus and printing apparatus including the same
US20210331493A1
