Code scanning method and device, intelligent equipment and storage medium

By obtaining and decoding the keyboard layout code and generating and transmitting keyboard protocol data, the problem of poor keyboard layout flexibility of scanning code devices is solved, and the rapid update and maintenance optimization of the device are achieved.

CN119091545APending Publication Date: 2024-12-06SHENZHEN EXCELSECU DATA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310665674.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The keyboard layout of the existing code scanning device has been configured before leaving the factory, and it has poor flexibility and cannot be flexibly updated, resulting in poor maintenance. The firmware needs to be modified to suit different keyboard models and manufacturers.

Method used

By obtaining the scanning data of the keyboard layout code, decoding and generating keyboard protocol data, and transmitting it to the host, it realizes flexible updates of the keyboard layout that the code scanning device can support without modifying the firmware.

Benefits of technology

It realizes rapid update and maintenance optimization of the keyboard layout of the scanning code device, avoiding the influence of the use of the keyboard model and manufacturer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091545A_ABST
    Figure CN119091545A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of intelligent terminals, and provides a code scanning method and device, intelligent equipment and a storage medium, and the method comprises the steps: obtaining first code scanning data which is code scanning data of a keyboard layout code, and the first code scanning data comprises a keyboard layout information table corresponding to the keyboard layout code; second code scanning data are obtained, the second code scanning data are decoded to obtain decoded data, and the second code scanning data are code scanning data of a target code; generating keyboard protocol data corresponding to the decoding data according to the keyboard layout information table; and transmitting the keyboard protocol data to a host. According to the invention, the keyboard layout supported by the code scanning equipment can be flexibly updated, and the maintainability of the code scanning equipment is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart terminal technology, and in particular to a code scanning method, apparatus, smart device and storage medium. Background Art

[0002] With the development of mobile payment and smart devices, there are more and more types and applications of code scanning devices. Code scanning has become very common in daily life. Commonly used code scanning devices on the market, such as code scanning boxes and code scanning guns, usually upload the data obtained after scanning barcodes or QR codes to the host by simulating keyboard keys. Generally, the keyboard layout supported by the code scanning device is configured in the firmware of the code scanning device before leaving the factory. The code scanning device can only support the keyboard layout built into the firmware, which has poor flexibility. When the keyboard layout is not parsed correctly, the firmware needs to be modified, and the maintainability is poor.

[0003] In view of this, how to flexibly update the keyboard layout supported by the scanning device and optimize the maintainability of the scanning device is an issue that needs to be considered at present. Summary of the invention

[0004] The embodiments of the present application provide a code scanning method, apparatus, smart device and storage medium, which can flexibly update the keyboard layout supported by the code scanning device and optimize the maintainability of the code scanning device.

[0005] In a first aspect, an embodiment of the present application provides a code scanning method, including:

[0006] Acquire first code scanning data, where the first code scanning data is code scanning data of a keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code;

[0007] Acquire second scanned code data, and decode the second scanned code data to obtain decoded data, where the second scanned code data is the scanned code data of the target code;

[0008] Generating keyboard protocol data corresponding to the decoded data according to the keyboard layout information table;

[0009] The keyboard protocol data is transmitted to a host.

[0010] In a possible implementation manner of the first aspect, the step of generating keyboard protocol data corresponding to the decoded data according to the keyboard layout information table includes:

[0011] According to the encoding of the character corresponding to the decoded data, querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table;

[0012] According to the mapping relationship, keyboard protocol data corresponding to the decoded data is generated.

[0013] In a possible implementation manner of the first aspect, the step of querying, from the keyboard layout information table, a mapping relationship corresponding to the encoding of the character according to the encoding of the character corresponding to the decoded data, includes:

[0014] Determine the encoding combination type according to the encoding of the character corresponding to the decoded data;

[0015] According to the encoding combination type, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

[0016] In a possible implementation manner of the first aspect, the step of querying, from the keyboard layout information table, a mapping relationship corresponding to the encoding of the character according to the encoding combination type includes:

[0017] If the encoding combination type is a non-character encoding combination, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

[0018] In a possible implementation manner of the first aspect, the step of querying, from the keyboard layout information table, a mapping relationship corresponding to the encoding of the character according to the encoding combination type further includes:

[0019] If the encoding combination type is a character encoding combination, decomposing the character into its component characters;

[0020] The mapping relationship corresponding to the encoding of the component characters is queried from the keyboard layout information table.

[0021] In a possible implementation manner of the first aspect, the encoding of the character is a data structure of a specified type, and the step of determining the encoding combination type according to the encoding of the character corresponding to the decoded data includes:

[0022] Obtaining the value of the specified position of the encoding data structure of the character;

[0023] If the value is a preset value, determining that the encoding combination type is a non-character encoding combination;

[0024] If the value is not a preset value, it is determined that the encoding combination type is a character encoding combination.

[0025] In a second aspect, an embodiment of the present application provides a code scanning device, including:

[0026] A first code scanning unit, used to obtain first code scanning data, where the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code;

[0027] A second code scanning unit, used for acquiring second code scanning data and decoding the second code scanning data to obtain decoded data, wherein the second code scanning data is the code scanning data of the target code;

[0028] A protocol data generating unit, configured to generate keyboard protocol data corresponding to the decoded data according to the keyboard layout information table;

[0029] The data transmission unit is used to transmit the keyboard protocol data to the host.

[0030] In a possible implementation manner of the second aspect, the protocol data generating unit includes:

[0031] A mapping relationship query module, used for querying the mapping relationship corresponding to the character encoding from the keyboard layout information table according to the encoding of the character corresponding to the decoded data;

[0032] The protocol data generating module is used to generate keyboard protocol data corresponding to the decoded data according to the mapping relationship.

[0033] In a possible implementation manner of the second aspect, the mapping relationship query module includes:

[0034] The type acquisition submodule is used to determine the encoding combination type according to the encoding of the characters corresponding to the decoded data;

[0035] The relationship query submodule is used to query the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type.

[0036] In a possible implementation manner of the second aspect, the relationship query submodule is specifically used to:

[0037] If the encoding combination type is a non-character encoding combination, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

[0038] In a possible implementation manner of the second aspect, the relationship query submodule is further specifically configured to:

[0039] If the encoding combination type is a character encoding combination, decomposing the character into its component characters;

[0040] The mapping relationship corresponding to the encoding of the component characters is queried from the keyboard layout information table.

[0041] In a possible implementation manner of the second aspect, the encoding of the character is a data structure of a specified type, and the type acquisition submodule is specifically used to:

[0042] Obtaining the value of the specified position of the encoding data structure of the character;

[0043] If the value is a preset value, determining that the encoding combination type is a non-character encoding combination;

[0044] If the value is not a preset value, it is determined that the encoding combination type is a character encoding combination.

[0045] In a third aspect, an embodiment of the present application provides a smart device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the code scanning method described in the first aspect above is implemented.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the code scanning method described in the first aspect above is implemented.

[0047] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a smart device, the smart device executes the code scanning method described in the first aspect above.

[0048] In an embodiment of the present application, by acquiring the first code scanning data, the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes the keyboard layout information table corresponding to the keyboard layout code, the keyboard layout supported by the extended code scanning device can be flexibly updated, and then the second code scanning data is acquired, and the second code scanning data is decoded to obtain the decoded data, the second code scanning data is the code scanning data of the target code, and the keyboard protocol data corresponding to the decoded data is generated according to the keyboard layout information table, and the keyboard protocol data is transmitted to the host, thereby effectively completing the code scanning. The present application scheme can quickly update the keyboard layout supported by the extended code scanning device without modifying the firmware of the code scanning device, and can minimize the use of the code scanning device from being affected by the keyboard model and manufacturer, and can optimize the maintainability of the code scanning device. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0050] Figure 1 It is a flowchart of the implementation of the code scanning method provided in the embodiment of the present application;

[0051] Figure 2 It is a specific implementation flow chart of step S103 in the code scanning method provided in the embodiment of the present application;

[0052] Figure 3 It is a specific implementation flow chart of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table in the code scanning method provided in the embodiment of the present application;

[0053] Figure 4 This is a specific implementation flow chart of determining the code combination type in the code scanning method provided in the embodiment of the present application;

[0054] Figure 5 It is a specific implementation flow chart of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type in the code scanning method provided in the embodiment of the present application;

[0055] Figure 6 is a structural block diagram of a code scanning device provided in an embodiment of the present application;

[0056] Figure 7 It is a schematic diagram of a smart device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0058] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0059] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0060] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0061] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0062] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0063] A barcode scanning device is a barcode scanner, also known as a barcode reader, barcode scanner, barcode scanner, barcode scanner and barcode reader. It is a reading device used to read the information contained in the barcode. It uses optical principles to decode the content of the barcode and transmit it to a computer or other device through a data line or wirelessly. The barcode scanning device can support multiple interfaces to transmit the decoded data to the host of the independent device. The most commonly used is the keyboard interface. When the decoded data is transmitted to the host through the keyboard, the barcode scanning device becomes a virtual keyboard, simulating the keyboard protocol data corresponding to the decoded data on the keyboard keys, and then sending the keyboard protocol data to the host. For example, the decoded data is the three characters "123", and the barcode scanning device simulates the three keys 1, 2, and 3 on the keyboard in sequence, and sends the corresponding keyboard protocol data to the host in sequence.

[0064] The keyboard layout supported by existing code scanning devices is configured in the firmware before leaving the factory. If the keyboard layout configured in the firmware is incompatible with the keyboard connected in the application scenario of the code scanning device, or the keyboard layout is not parsed correctly, the firmware needs to be modified, which is cumbersome to operate and has poor maintainability.

[0065] In order to solve the above problems, the embodiments of the present application provide a code scanning method, apparatus, smart device and storage medium, which are described below for details.

[0066] The code scanning method provided in the embodiment of the present application can be applied to various types of smart devices that need to scan codes, specifically including smart code scanning devices such as code scanning guns, code scanning boxes, and POS machines.

[0067] Figure 1 The implementation process of the code scanning method provided in the embodiment of the present application is shown, and the method flow includes steps S101 to S104. The specific implementation principle of each step is as follows:

[0068] S101: Acquire first code scanning data, where the first code scanning data is code scanning data of a keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code.

[0069] The keyboard layout barcode may be a barcode, a QR code, or other graphic codes that can be scanned. For example, the keyboard layout barcode may be an OR QR code.

[0070] In a possible implementation, if the firmware of the code scanning device has built-in keyboard layout information, the keyboard layout information table includes layout information of at least one type of keyboard that is different from the keyboard layout built into the firmware.

[0071] In the embodiment of the present application, the keyboard layout information table includes the mapping relationship between characters and keys and key combinations. Specifically, it is the mapping relationship between character encoding and keys and key combinations. The character encoding is ANSI, UNICODE, UTF8, etc. The keyboard layout information table corresponding to the above keyboard layout code includes layout information of at least one type of keyboard.

[0072] A key contains the key value information of the keyboard key position where the character is located, and a key combination contains the control key information and the key value information of the keyboard key position where the character is located. For example, the German keyboard layout information table contains the mapping relationship between the character codes of characters a, A, b, B, c, and C and keys / key combinations: a (61 00 04), A (41 02 04), b (62 00 05), B (42 02 05), c (63 00 06), C (43 02 06). The numbers in brackets are hexadecimal numbers. For the character a, 61 is the character code of a, 00 means directly pressing the key without combination, and 04 is the specific key value; for the character A, 41 is the character code of A, 02 means that the Shift combination key is required, and 04 is the specific key value; because a and A are the same key on the keyboard, the key values ​​are the same, and the same applies to characters b, B and c, C. Key combinations can also include composite character code combinations. For example, German contains the characters This character has no corresponding key on the German keyboard. Instead, it is composed of the characters ^ and a. The characters ^ and a have corresponding keys on the keyboard. You can add the character The mapping relationship with the character ^ and the character a combination is: (C3A2 5E 61), where C3A2 is the character 5E and 61 are the UTF8 encodings of the character ^ and the character a respectively.

[0073] In a possible implementation, the mapping relationships in the keyboard layout information table are concatenated to generate a keyboard layout code.

[0074] Exemplarily, keyboard layouts of types a, A, b, B, c, and C are directly spliced ​​into 61 00 04 41 02 04 6200 05 42 02 05 63 00 06 43 02 06, etc. (the splicing processing method for other characters on the keyboard is the same) as the keyboard layout code.

[0075] In a possible implementation, the keyboard layout code is generated by splicing the mapping relationships according to the order of the character encodings in the keyboard layout information table.

[0076] In a possible implementation manner, after processing the above-mentioned spliced ​​mapping relationship, a keyboard layout code is generated.

[0077] Exemplarily, the concatenated mapping relationship is encrypted or compressed. Encryption can be a symmetric algorithm or an asymmetric algorithm; compression can be specifically classified according to the coding combination type, for example, the mapping relationship in the keyboard layout information table can be represented by a TLV structure, T represents the control key type, L represents the length of V, and V represents the mapping relationship of the characters of the same control key, for example, the above a, A, b, B, c, C, The keyboard layout can be represented using TLV as 00 06 61 04 62 05 63 0602 06 41 04 42 05 43 06 5E 03 C3 A2 61.

[0078] In this embodiment, the code scanning device obtains the first code scanning data by scanning the keyboard layout code, that is, the keyboard layout information table can be obtained by scanning the keyboard layout code.

[0079] S102: Acquire second scanned code data, and decode the second scanned code data to obtain decoded data, where the second scanned code data is the scanned code data of the target code.

[0080] The target code may be a barcode or a QR code or other graphic code that can be scanned, for example, a product barcode.

[0081] S103: Generate keyboard protocol data corresponding to the decoded data according to the keyboard layout information table.

[0082] In an embodiment of the present application, when the code scanning device is connected to the keyboard for the first time, the first code scanning data is obtained. Alternatively, when the code scanning data obtains the second code scanning data, if the keyboard protocol data corresponding to the decoded data cannot be generated according to the keyboard layout information built into the firmware of the code scanning device, the first code scanning data is obtained, and the keyboard layout information table is stored. Based on the keyboard layout information table, the keyboard protocol data corresponding to the decoded data of the second code scanning data can be generated, without modifying the firmware of the code scanning device. The operation is simple and flexible, and the keyboard layout that the code scanning device can support can be effectively expanded, and the maintainability of the code scanning device can be optimized.

[0083] As a possible implementation of this application, Figure 2 A specific implementation process of generating keyboard protocol data corresponding to the decoded data according to the keyboard layout information table in an embodiment of the present application is shown, and is described in detail as follows:

[0084] A1: According to the encoding of the character corresponding to the decoded data, query the mapping relationship corresponding to the encoding of the character from the keyboard layout information table.

[0085] A2: Generate keyboard protocol data corresponding to the decoded data according to the mapping relationship.

[0086] Exemplarily, the decoded data includes character A. According to the character code of character A, the mapping relationship (41 02 04) is obtained from the keyboard layout information table. The keyboard protocol data generated according to the mapping relationship is: 0200 04 00 00 00 0000 and 00 00 00 00 00 00 00, where 02 00 04 00 00 00 00 00 represents pressing the Shift key and the character A key, and 00 00 00 00 00 00 00 00 represents releasing the Shift key and the character A key.

[0087] As a possible implementation of this application, Figure 3 A specific implementation process of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding of the character corresponding to the decoded data in the embodiment of the present application is shown, and the details are as follows:

[0088] B1: Determine the encoding combination type according to the encoding of the character corresponding to the decoded data, wherein the encoding combination type includes a character encoding combination and a non-character encoding combination.

[0089] As a possible implementation of the present application, the encoding of the character is a data structure of a specified type, such as a TLV structure, such as Figure 4 As shown, the step of determining the encoding combination type according to the encoding of the character corresponding to the decoded data includes:

[0090] B11: Obtain the value of the specified position of the encoding data structure of the character, for example, determine the value of T in the TLV structure.

[0091] B12: If the value is a preset value, determine that the encoding combination type is a non-character encoding combination.

[0092] B13: If the value is not a preset value, determining that the encoding combination type is a character encoding combination.

[0093] Exemplarily, if the value of T in the character corresponding encoding data structure is a preset control key value, such as the above 00 no control key, 02 Shift key, then the encoding combination type is determined to be a non-character encoding combination.

[0094] If the value of T in the character corresponding encoding data structure is not a preset value, the encoding combination type is determined to be a character encoding combination.

[0095] B2: According to the encoding combination type, query the mapping relationship corresponding to the encoding of the character from the keyboard layout information table.

[0096] In a possible implementation, if the encoding combination type is a non-character encoding combination, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

[0097] In a possible implementation, Figure 5 As shown, the step of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type also includes:

[0098] B21: If the encoding combination type is a character encoding combination, decompose the character into component characters.

[0099] B22: Query the mapping relationship corresponding to the encoding of the component characters from the keyboard layout information table.

[0100] In this embodiment, for a character encoding combination, the corresponding mapping relationship is queried from the keyboard layout information table according to the encoding of the constituent characters, and keyboard protocol data is generated according to the mapping relationship. According to the mapping relationship, it is decomposed into character ^ and character a, and the mapping relationship corresponding to the code 5E of the character ^ and the mapping relationship corresponding to the code 61 of the character a are queried from the keyboard layout information table respectively, and the keyboard protocol data of the character ^ and the keyboard protocol data of the character a are generated according to the queried mapping relationship.

[0101] S104: Transmit the keyboard protocol data to the host.

[0102] In this embodiment, the code scanning device communicates with the host in a simulated keyboard mode, and converts the target code data into keyboard protocol data corresponding to the keyboard layout by simulating keyboard keys and transmits it to the host.

[0103] As can be seen from the above, in the embodiment of the present application, by obtaining the first code scanning data, the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes the keyboard layout information table corresponding to the keyboard layout code, the keyboard layout supported by the extended code scanning device can be flexibly updated, and then the second code scanning data is obtained, and the second code scanning data is decoded to obtain the decoded data, the second code scanning data is the code scanning data of the target code, and the keyboard protocol data corresponding to the decoded data is generated according to the keyboard layout information table, and the keyboard protocol data is transmitted to the host, thereby effectively completing the code scanning. The present application scheme can quickly update the keyboard layout supported by the extended code scanning device without modifying the firmware of the code scanning device, and can minimize the use of the code scanning device from being affected by the keyboard model and manufacturer, and can optimize the maintainability of the code scanning device.

[0104] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0105] Corresponding to the code scanning method described in the above embodiment, Figure 6 A structural block diagram of a code scanning device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0106] Reference Figure 6 The code scanning device includes: a first code scanning unit 61, a second code scanning unit 62, a protocol data generating unit 63, and a data transmitting unit 64, wherein:

[0107] A first code scanning unit 61 is used to obtain first code scanning data, where the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code;

[0108] The second code scanning unit 62 is used to obtain second code scanning data and decode the second code scanning data to obtain decoded data, where the second code scanning data is the code scanning data of the target code;

[0109] A protocol data generating unit 63, configured to generate keyboard protocol data corresponding to the decoded data according to the keyboard layout information table;

[0110] The data transmission unit 64 is used to transmit the keyboard protocol data to the host.

[0111] As a possible implementation manner of the present application, the protocol data generating unit 63 includes:

[0112] A mapping relationship query module, used for querying the mapping relationship corresponding to the character encoding from the keyboard layout information table according to the encoding of the character corresponding to the decoded data;

[0113] The protocol data generating module is used to generate keyboard protocol data corresponding to the decoded data according to the mapping relationship.

[0114] As a possible implementation of the present application, the mapping relationship query module includes:

[0115] The type acquisition submodule is used to determine the encoding combination type according to the encoding of the characters corresponding to the decoded data;

[0116] The relationship query submodule is used to query the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type.

[0117] As a possible implementation of the present application, the relationship query submodule is specifically used for:

[0118] If the encoding combination type is a non-character encoding combination, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

[0119] As a possible implementation manner of the present application, the relationship query submodule is further specifically used for:

[0120] If the encoding combination type is a character encoding combination, decomposing the character into its component characters;

[0121] The mapping relationship corresponding to the encoding of the component characters is queried from the keyboard layout information table.

[0122] As a possible implementation of the present application, the encoding of the character is a data structure of a specified type, and the type acquisition submodule is specifically used for:

[0123] Obtaining the value of the specified position of the encoding data structure of the character;

[0124] If the value is a preset value, determining that the encoding combination type is a non-character encoding combination;

[0125] If the value is not a preset value, it is determined that the encoding combination type is a character encoding combination.

[0126] As can be seen from the above, in the embodiment of the present application, by obtaining the first code scanning data, the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes the keyboard layout information table corresponding to the keyboard layout code, the keyboard layout supported by the extended code scanning device can be flexibly updated, and then the second code scanning data is obtained, and the second code scanning data is decoded to obtain the decoded data, the second code scanning data is the code scanning data of the target code, and the keyboard protocol data corresponding to the decoded data is generated according to the keyboard layout information table, and the keyboard protocol data is transmitted to the host, thereby effectively completing the code scanning. The present application scheme can quickly update the keyboard layout supported by the extended code scanning device without modifying the firmware of the code scanning device, and can minimize the use of the code scanning device from being affected by the keyboard model and manufacturer, and can optimize the maintainability of the code scanning device.

[0127] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0128] The present application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, Figures 1 to 5 The steps of any scanning method are shown.

[0129] The embodiment of the present application also provides an intelligent device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, Figures 1 to 5 The steps of any scanning method are shown.

[0130] The embodiment of the present application also provides a computer program product, when the computer program product is run on a smart device, the smart device executes the following Figures 1 to 5 The steps of any scanning method are shown.

[0131] Figure 7 Schematic diagram of a smart device provided by an embodiment of the present application. Figure 7 As shown, the smart device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned scanning method embodiments are implemented, for example Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The functions of the units 61 to 64 are shown.

[0132] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the smart device 7.

[0133] The smart device 7 may be a smart code scanning device. The smart device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the smart device 7 and does not constitute a limitation of the smart device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the smart device 7 may also include input and output devices, network access devices, buses, etc.

[0134] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0135] The memory 71 may be an internal storage unit of the smart device 7, such as a hard disk or memory of the smart device 7. The memory 71 may also be an external storage device of the smart device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the smart device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the smart device 7. The memory 71 is used to store the computer program and other programs and data required by the smart device. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0136] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0137] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0139] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0140] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A code scanning method, It is characterized in that The method comprises: Acquire first code scanning data, where the first code scanning data is code scanning data of a keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code; Acquire second scanned code data, and decode the second scanned code data to obtain decoded data, wherein the second scanned code data is the scanned code data of the target code; Generating keyboard protocol data corresponding to the decoded data according to the keyboard layout information table; The keyboard protocol data is transmitted to a host.

2. The method according to claim 1, It is characterized in that The step of generating keyboard protocol data corresponding to the decoded data according to the keyboard layout information table comprises: According to the encoding of the character corresponding to the decoded data, querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table; According to the mapping relationship, keyboard protocol data corresponding to the decoded data is generated.

3. The method according to claim 2, It is characterized in that The step of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding of the character corresponding to the decoded data includes: Determine the encoding combination type according to the encoding of the character corresponding to the decoded data; According to the encoding combination type, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

4. The method according to claim 3, It is characterized in that The step of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type comprises: If the encoding combination type is a non-character encoding combination, a mapping relationship corresponding to the encoding of the character is queried from the keyboard layout information table.

5. The method according to claim 3, It is characterized in that The step of querying the mapping relationship corresponding to the encoding of the character from the keyboard layout information table according to the encoding combination type also includes: If the encoding combination type is a character encoding combination, decomposing the character into its component characters; The mapping relationship corresponding to the encoding of the component characters is queried from the keyboard layout information table.

6. The method according to claim 3, It is characterized in that The encoding of the character is a data structure of a specified type, and the step of determining the encoding combination type according to the encoding of the character corresponding to the decoded data includes: Obtaining the value of the specified position of the encoding data structure of the character; If the value is a preset value, determining that the encoding combination type is a non-character encoding combination; If the value is not a preset value, it is determined that the encoding combination type is a character encoding combination.

7. A code scanning device, It is characterized in that include: A first code scanning unit, used to obtain first code scanning data, where the first code scanning data is the code scanning data of the keyboard layout code, and the first code scanning data includes a keyboard layout information table corresponding to the keyboard layout code; A second code scanning unit, used for acquiring second code scanning data and decoding the second code scanning data to obtain decoded data, wherein the second code scanning data is the code scanning data of the target code; A protocol data generating unit, configured to generate keyboard protocol data corresponding to the decoded data according to the keyboard layout information table; The data transmission unit is used to transmit the keyboard protocol data to the host.

8. The device according to claim 7, It is characterized in that The protocol data generating unit comprises: A mapping relationship query module, used for querying the mapping relationship corresponding to the character encoding from the keyboard layout information table according to the encoding of the character corresponding to the decoded data; The protocol data generating module is used to generate keyboard protocol data corresponding to the decoded data according to the mapping relationship.

9. An intelligent device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the code scanning method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the code scanning method according to any one of claims 1 to 6 is implemented.