A method and system for configuration and management of code scanning attributes
By using reflection and Java Native Interface methods, efficient configuration management of code types is achieved, solving the problem of low reflection reading speed caused by too many code type menus, and improving configuration efficiency and the convenience of adapter files.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, when there are too many coded menus, the reflection reading speed is inefficient, resulting in slow refresh rates.
By using reflection, filenames are converted into code types, code type attributes are converted into layout menus, and code type attributes are converted into corresponding parameter attributes of the driver. The list of code value parameters is stored using Java Native Interface methods to achieve configuration management of scanning types.
It enables convenient management of code system configuration, allowing for quick addition and removal of code system types and attributes, thus improving configuration efficiency. Adapter file adjustments are also relatively convenient.
Smart Images

Figure CN112101055B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of methods and systems for configuring and managing barcode attributes, and specifically to a method and system for configuring and managing barcode attributes. Background Technology
[0002] Different industries, businesses, and countries have different rules, and the types of coding schemes also vary, with an increasing number of coding schemes. Therefore, the systematic classification and management of coding schemes has become an essential solution. Although coding schemes differ, most of their attributes and functions are basically the same or have only minor differences. Furthermore, the driver interface can be completely normalized. In order to quickly manage the attributes and configurations of coding schemes, methods for managing coding scheme attributes and configurations are indispensable.
[0003] Java Native Interface (JNI) is a standard mechanism in the Java language that allows Java code to interact with C and C++ code. Summary of the Invention
[0004] The technical problem this invention aims to solve is the inefficiency of reflection-based reading in current methods. If there are too many code type menus, slow refresh rates may occur. This invention provides a method for configuring and managing barcode attributes. It uses reflection to convert filenames into code type types, code type attributes into layout menus, and code type attributes into corresponding driver parameter attributes. After these conversions, barcode type configuration can be directly managed through filename member variables. Adding or removing code type menus only requires adding or removing some member variables in the code type menu list. Adding or removing code type attributes only requires adding or removing some member variables for the code type attribute and updating the complete adapter file to change the code type layout. Based on the naming of the code type attribute parameters, the code type and its parameters can be directly converted into driver-usable parameter attributes through the adapter. Although adding entirely new attributes requires adjusting the adapter file, the operation of code type attributes and configuration management is relatively convenient, thus overcoming the shortcomings of existing technologies.
[0005] The present invention also provides a configuration and management system for barcode scanning attributes.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solutions:
[0007] Firstly, a method for configuring and managing QR code attributes, comprising the following steps:
[0008] Step 1: Create multiple Java files, each containing member variables;
[0009] Step 2: Use reflection to find the member variables of the corresponding code type menu in the Java file. Each member variable maps to a code type, resulting in a code type list.
[0010] Step 3: Obtain the code type attribute file corresponding to the member variables through reflection;
[0011] Step 4: The code attribute file obtains the attributes of the code menu through reflection, and maps the attribute menu to the layout file and displays it in the form of a UI, which can be used by users to set UI interaction.
[0012] Step 5: Use reflection to combine the attributes and member variables of the code menu into parameter attributes;
[0013] Step 6: Combine the code system with the member variables to convert it into code system parameters, and obtain a list of code value parameters;
[0014] Step 7: Store the code value parameter list to the driver algorithm layer through Java Native Interface methods. After configuring the decoding algorithm, the scanning APP calls the configured scanning algorithm to scan the one-dimensional or two-dimensional code image to obtain the corresponding code and outputs the scanning result.
[0015] Step 8: Modify the member variables of the Java file encoding type menu in Step 2. The encoding list will be updated in real time according to the modification of the member variables.
[0016] Step 9: Modify the member variables of the code attribute file in Step 3. The attribute menu will be updated in real time according to the modification of the member variables.
[0017] The above-mentioned method for configuring and managing QR code attributes requires initializing the code attribute list before creating multiple Java files in step one, and then performing QR code scanning.
[0018] In the above-described method for configuring and managing QR code attributes, the member variable corresponding to the code system in step two contains the attribute value of that code system.
[0019] In the above-described method for configuring and managing barcode attributes, the format of the barcode parameter is either a key value or an attribute.
[0020] The above-described method for configuring and managing QR code attributes, wherein the parameter attributes are parameter attributes available to the driver.
[0021] Secondly, a configuration and management system for barcode scanning attributes, comprising a barcode scanning module, a barcode type member variable acquisition module, a barcode list generation module, a barcode attribute acquisition module, an attribute menu mapping module, a parameter attribute generation module, a barcode value parameter list generation module, a driver module, an upper-layer software module, and a parameter modification module.
[0022] The scanning module is used to call the driver algorithm layer with configured scanning parameters during the scanning operation;
[0023] The code type member variable acquisition module is used to acquire member variables in the code type menu through reflection;
[0024] The code list generation module maps the code system to the member variable to obtain the code list;
[0025] The code type attribute acquisition module obtains the code type attributes based on the member variables, and obtains the attribute menu;
[0026] The attribute menu mapping module is used to map the attribute menu to the layout file;
[0027] The parameter attribute generation module is used to combine the attributes of the code system with the member variables through reflection and convert them into parameter attributes.
[0028] The code value parameter list generation module is used to combine the code system with the member variable to convert it into code system parameters, thereby obtaining a code value parameter list;
[0029] The driver module is used to acquire and store the code value parameter list;
[0030] The upper-layer software module calls the code value parameter list within the driver module through Java Native Interface methods;
[0031] The parameter modification module is used to modify the member variables in the code type list based on the member variables of the code type menu, and the code type menu is updated in real time according to the parameter modification; the member variables in the code type attribute file are used to modify the member variables in the code type list, and the code type attribute menu is updated in real time according to the parameter modification.
[0032] The technical solution provided by the present invention, which describes a method and system for configuring and managing barcode scanning attributes, has the following technical effects:
[0033] By using reflection to convert filenames to code types, converting code type attributes to layout menus, and converting code type attributes to corresponding driver parameter attributes, the configuration of barcode types can be directly managed through the member variables of filenames.
[0034] To add or remove code type menu items, simply add or remove some member variables from the code type menu list to complete the code type addition or deletion operation;
[0035] Adding or removing code type attributes only requires adding or removing some member variables to the code type attribute, while updating the complete adapter file to complete the code type layout change;
[0036] Based on the naming of the attribute parameters of the code system, the code system and the parameters of the code system attributes can be directly converted into parameter attributes usable by the driver through the adapter;
[0037] Although the adapter file needs to be adjusted when adding new attributes, the operation of code type attributes and configuration management is relatively convenient. Attached Figure Description
[0038] Figure 1 This is a flowchart of a method for configuring and managing QR code attributes according to the present invention;
[0039] Figure 2 This is a flowchart illustrating the method for configuring and managing barcode attributes according to the present invention, which obtains the barcode system parameters.
[0040] Figure 3 This is a schematic diagram of the configuration and management system for barcode scanning attributes according to the present invention.
[0041] The accompanying figure is labeled as follows:
[0042] Modules for scanning codes: 101; Module for obtaining code type member variables: 102; Module for generating code list: 103; Module for obtaining code attributes: 104; Module for mapping attribute menus: 105; Module for generating parameter attributes: 106; Module for generating code value parameter list: 107; Driver module: 108; Upper-level software module: 109; Parameter modification module: 110. Detailed Implementation
[0043] In order to make the technical means, inventive features, objectives and effects of the invention easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to specific illustrations. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0044] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0046] Furthermore, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are merely for clarity of description and are not intended to limit the scope of the invention. Any changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.
[0047] A preferred embodiment of the present invention provides a method and system for configuring and managing barcode scanning attributes. The purpose is to convert filenames into barcode types using reflection, convert barcode attributes into layout menus using reflection, and convert barcode attributes into corresponding parameter attributes for the driver using reflection. After these conversion steps, the configuration of barcode types can be directly managed through the member variables of the filename. Adding or removing barcode type menus only requires adding or removing some member variables in the barcode type menu list to complete the addition or deletion operation. Adding or removing barcode attributes only requires adding or removing some member variables for the barcode attribute and updating the complete adapter file to complete the barcode layout change. Based on the naming of the barcode attribute parameters, the barcode and barcode attribute parameters can be directly converted into driver-usable parameter attributes through the adapter. Although the adapter file needs to be adjusted when adding a completely new attribute, the operation of barcode attributes and configuration management is relatively convenient.
[0048] like Figure 1-2 As shown, in the first aspect, a method for configuring and managing QR code attributes includes the following steps:
[0049] Step 1: Create multiple Java files, each containing member variables;
[0050] Step 2: Use reflection to find the member variables of the corresponding code type menu in the Java file. Each member variable maps to a code type, resulting in a code type list.
[0051] Step 3: Obtain the code type attribute file corresponding to the member variables through reflection;
[0052] Step 4: The code attribute file obtains the attributes of the code menu through reflection, and maps the attribute menu to the layout file and displays it in the form of a UI, which can be used by users to set UI interaction.
[0053] Step 5: Use reflection to combine the attributes and member variables of the code menu into parameter attributes;
[0054] Step 6: Combine the code system with the member variables to convert it into code system parameters, and obtain a list of code value parameters;
[0055] Step 7: Store the code value parameter list to the driver algorithm layer through Java Native Interface methods. After configuring the decoding algorithm, the scanning APP calls the configured scanning algorithm to scan the one-dimensional or two-dimensional code image to obtain the corresponding code and outputs the scanning result.
[0056] Step 8: Modify the member variables of the Java file encoding type menu in Step 2. The encoding list will be updated in real time according to the modification of the member variables.
[0057] Step 9: Modify the member variables of the code attribute file in Step 3. The attribute menu will be updated in real time according to the modification of the member variables.
[0058] In step one, before creating multiple Java files, the code attribute list needs to be initialized before scanning.
[0059] In step two, the member variable corresponding to the code system contains the attribute value of that code system.
[0060] The format of the code parameter is either a key or an attribute.
[0061] Among them, the parameter attributes are the parameter attributes available to the driver.
[0062] like Figure 3 As shown, in a second aspect, a configuration and management system for barcode scanning attributes includes a barcode scanning module 101, a barcode type member variable acquisition module 102, a barcode list generation module 103, a barcode attribute acquisition module 104, an attribute menu mapping module 105, a parameter attribute generation module 106, a barcode value parameter list generation module 107, a driver module 108, an upper-layer software module 109, and a parameter modification module 110.
[0063] The scanning module 101 is used to call the driver algorithm layer with configured scanning parameters during the scanning operation;
[0064] The code type member variable acquisition module 102 is used to acquire member variables in the code type menu via reflection;
[0065] The code list generation module 103 obtains a code list by mapping the code system to the member variables.
[0066] The code type attribute acquisition module 104 obtains the code type attribute based on the member variable and gets the attribute menu;
[0067] The attribute menu mapping module 105 is used to map the attribute menu to the layout file;
[0068] The parameter attribute generation module 106 is used to combine the code-based attributes with member variables and convert them into parameter attributes through reflection;
[0069] The code value parameter list generation module 107 is used to combine the code system with the member variables and convert them into code system parameters to obtain the code value parameter list;
[0070] The driver module 108 is used to acquire and store the code value parameter list;
[0071] Upper-layer software module 109 calls the code value parameter list in driver module 108 through Java Native Interface methods;
[0072] The parameter modification module 110 is used to modify the member variables in the code type list of the code type menu, and the code type menu is updated in real time according to the parameter modification; the member variables in the code type attribute file are used to modify the member variables in the code type list, and the code type attribute menu is updated in real time according to the parameter modification.
[0073] In summary, the present invention provides a method and system for configuring and managing barcode scanning attributes. Through reflection, it converts filenames into barcode types, barcode attributes into layout menus, and barcode attributes into corresponding driver parameter attributes. After these conversion steps, barcode type configuration can be directly managed through the member variables of the filename. Adding or removing barcode type menu items only requires adding or removing some member variables from the barcode type menu list. Adding or removing barcode attributes only requires adding or removing some member variables from the barcode attribute and updating the complete adapter file to change the barcode layout. Based on the naming of the barcode attribute parameters, the barcode and its parameters can be directly converted into driver-usable parameter attributes through the adapter. Although adjusting the adapter file is necessary when adding entirely new attributes, the operation of barcode attributes and configuration management is relatively convenient.
[0074] The specific embodiments of the invention have been described above. It should be understood that the invention is not limited to the specific embodiments described above, and the devices and structures not described in detail should be understood to be implemented in a manner common to the art; those skilled in the art can make various modifications or alterations within the scope of the claims, and make several simple deductions, variations or substitutions, which do not affect the substantive content of the invention.
Claims
1. A method for configuring and managing barcode scanning attributes, characterized in that, The method comprises the following steps: Step 1: creating multiple Java files, each of which contains member variables; Step 2: obtaining member variables corresponding to code type menus through reflection of Java files, each member variable mapping a code type to obtain a code list; Step 3: obtaining code attribute files corresponding to member variables through reflection; Step 4: obtaining attribute menus through reflection of code attribute files, mapping the attribute menus to layout files and displaying them in the form of UI for user interaction; Step 5: combining and converting the attributes of code menus and member variables into parameter attributes through reflection; Step 6: combining and converting codes and member variables into code parameters to obtain a code value parameter list; Step 7: storing the code value parameter list to the driving algorithm layer through the Java Native Interface method; Step 8: modifying the member variables of the code type menu in step 2, and updating the code list in real time according to the modification of the member variables; Step 9: modifying the member variables of the code attribute file in step 3, and updating the attribute menu in real time according to the modification of the member variables.
2. The method of claim 1, wherein the method further comprises: Before creating multiple Java files in step 1, the code attribute list needs to be initialized, and then the code is scanned.
3. The method of claim 2, wherein the method further comprises: The member variables corresponding to the code types in step 2 contain attribute values of the code types.
4. The method of claim 3, wherein the method further comprises: The format of the code parameters is key value or attribute.
5. The method of claim 4, wherein the method further comprises: The parameter attributes are available parameters for driving.
6. A configuration and management system of a code scanning attribute, characterized by, The method comprises a code scanning module, a code type member variable acquisition module, a code list generation module, a code attribute acquisition module, an attribute menu mapping module, a parameter attribute generation module, a code value parameter list generation module, a driving module, an upper software module, and a parameter modification module. The code scanning module is used to call the driving algorithm layer with configured scanning parameters when scanning the code. The code type member variable acquisition module is used to acquire member variables in the code type menu through reflection. The code list generation module maps codes according to the member variables to obtain a code list. The code attribute acquisition module acquires attributes of the codes according to the member variables to obtain an attribute menu. The attribute menu mapping module is used to map the attribute menu to the layout file. The parameter attribute generation module is used to combine and convert the attributes of the codes and the member variables into parameter attributes through reflection. The code value parameter list generation module is used to combine and convert the codes and the member variables into code parameters to obtain a code value parameter list. The driving module is used to acquire and store the code value parameter list. The upper software module calls the code value parameter list in the driving module through the Java Native Interface method. The parameter modification module is used to modify the member variables in the code type list according to the member variables of the code type menu, and the code menu is updated in real time according to the parameter modification; the member variables in the code list are modified according to the member variables of the code attribute file, and the code attribute menu is updated in real time according to the parameter modification.
Citation Information
Patent Citations
Interface creating method and platform based on XML document description
CN101334728A
Laser barcode scanning system and method based on mobile intelligent terminal
CN105550621A