A method, device and storage medium for data transmission by scanning code
Through the communication connection between the scanning device and the host, the scanning data is obtained and packaged, which solves the problem of poor data transmission of barcode scanners in Chinese scenarios and achieves high-quality data transmission effects.
Patent Information
- Application Number
- CN202310900941.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-07-20
AI Technical Summary
Existing barcode scanners have difficulty effectively identifying and transmitting Chinese data in Chinese scenarios, resulting in poor data transmission.
By establishing a communication connection between the scanning device and the host, the scanning data is obtained, and the target key value is generated according to the working mode, and the data is packaged and transmitted. The host recognizes and generates the corresponding character data in the preset window, supporting a variety of scanning High-quality data transmission in coding scenarios.
It achieves high-quality data transmission in a variety of QR code scanning scenarios and is suitable for complex application scenarios, especially the accurate recognition and display of Chinese data.
Smart Images

Figure CN117114032B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of code scanning data transmission, and more specifically, to a code scanning data transmission method, device and storage medium. Background Art
[0002] Barcode scanners are reading devices used to read barcode information. The working principle is to use optical principles to decode the content of the barcode and then transmit it to a computer or other host device for display through wired or wireless means. At the same time, barcode scanning industry technology has been used in many fields and industries, such as retail industry, manufacturing industry, logistics, medical care, warehousing and security and other industries. Barcode scanners are also used in commercial POS cash register systems, express warehousing logistics, books, clothing, medicine, banking, insurance, communications and other fields.
[0003] As barcode scanners are used in more and more scenarios, their application scenarios are becoming more and more complex. For example, in some Chinese scenarios, the current barcode scanner transmission process cannot well realize the transmission of Chinese data. That is, the host cannot well recognize Chinese data and display it accordingly in many cases. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method, device and storage medium for data transmission by scanning code in view of some of the above-mentioned technical defects of the prior art.
[0005] The technical solution adopted by the present invention to solve the technical problem is: construct a code scanning data transmission method, which is applied between a code scanning device and a host, and the method comprises the following steps:
[0006] S1. When the code scanning device establishes a communication connection with the host, obtaining the code scanning data generated by the code scanning device during the code scanning process;
[0007] S2. Acquire the target key value of the scanned code data based on the working mode of the scanned code device;
[0008] S3, acquiring a corresponding data packaging format according to the working mode of the code scanning device and generating valid data corresponding to the target key value, so as to package the valid data to generate key-value package data;
[0009] S4, sending the key-value package data to the host through the communication connection, and the host identifies the key-value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window.
[0010] Preferably, in the code scanning data transmission method of the present invention, the key-value package data includes a first data segment, a second data segment and a third data segment;
[0011] The first data segment is used to set the data length in the valid data;
[0012] The second data segment is used to set the data packaging format;
[0013] The third data segment is used to set the valid data, wherein the valid data includes the target key value.
[0014] Preferably, in the code scanning data transmission method of the present invention, when the data packaging format is the first preset format, the key-value package data further includes a fourth data segment;
[0015] The fourth data segment is used to set the specific process of the host executing the target key value.
[0016] Preferably, in the code scanning data transmission method described in the present invention, the fourth data segment is between the second data segment and the third data segment.
[0017] Preferably, in the code scanning data transmission method of the present invention, the host identifies the key-value packet data to obtain the corresponding target key value and generates corresponding character data in a preset window, including:
[0018] When the host recognizes that the fourth data segment is a first preset value, pressing and releasing actions are sequentially performed on each key value in the target key value to generate a character corresponding to the target key value in the preset window;
[0019] When the host recognizes that the fourth data segment is a second preset value, a pressing action is performed on each key value in the target key value in sequence and a releasing action is performed on the last key value to generate a character corresponding to the target key value in the preset window.
[0020] Preferably, in the code scanning data transmission method of the present invention, when the data packaging format is the first preset format, the valid data further includes a character definition data segment;
[0021] The character definition data segment corresponds to the target key value and is used to indicate the character type corresponding to the target key value.
[0022] Preferably, in the code scanning data transmission method of the present invention, when the data packaging format is any one of the second preset format and the third preset format, the valid data further includes a delay setting data segment, and the delay setting data segment is used to set the delay time between the triggering and the releasing of the target key value;
[0023] And when the data packaging format is the third preset format, the valid data also includes a release instruction generation data segment, and the release instruction generation data segment is used to generate a trigger instruction to trigger the release of the target key value.
[0024] Preferably, the code scanning data transmission method of the present invention further includes:
[0025] Get the current key value mode of the host;
[0026] The target key value corresponding to the scanned code data is generated according to the current key value mode of the host and the working mode of the scanned code device.
[0027] The present invention also constructs a code scanning data transmission device, which is applied between a code scanning device and a host, and the device includes:
[0028] A first processing module, configured to obtain scanning data generated by the scanning device during the scanning process when the scanning device establishes a communication connection with the host;
[0029] A second processing module, configured to obtain a target key value of the scanned code data based on a working mode of the scanned code device;
[0030] A third processing module is used to obtain a corresponding data packaging format according to the working mode of the code scanning device and generate valid data corresponding to the target key value, so as to package the valid data to generate key-value package data;
[0031] The fourth processing module is used to send the key-value package data to the host through the communication connection, and the host identifies the key-value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window.
[0032] The present invention also constructs a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the code scanning data transmission method as described in any one of the above items is implemented.
[0033] The method, device and storage medium for transmitting data by scanning a code according to the present invention have the following beneficial effects: they can be applied to a variety of different scanning scenarios and achieve high-quality data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0035] Figure 1 This is a program flow chart of an embodiment of a code scanning data transmission method of the present invention;
[0036] Figure 2 It is a program flow chart of another embodiment of a code scanning data transmission method of the present invention;
[0037] Figure 3 It is a logic block diagram of an embodiment of a code scanning data transmission device of the present invention. DETAILED DESCRIPTION
[0038] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, the specific implementation methods of the present invention are now described in detail with reference to the accompanying drawings.
[0039] like Figure 1 As shown, in a first embodiment of a code scanning data transmission method of the present invention, the method is applied between a code scanning device and a host, and includes the following steps: S1. When the code scanning device establishes a communication connection with the host, the code scanning data generated by the code scanning device during the code scanning process is obtained; S2. The target key value of the code scanning data is obtained based on the working mode of the code scanning device; S3. According to the working mode of the code scanning device, the corresponding data packaging format is obtained and valid data corresponding to the target key value is generated, so as to package the valid data to generate key value package data; S4. The key value package data is sent to the host through the communication connection, and the key value package data is identified by the host to obtain the corresponding target key value, and the corresponding character data is generated in the preset window.
[0040] Specifically, the code scanning device establishes a communication connection with the host through a first communication connection end and a second communication connection end, wherein the first communication connection end is provided in the code scanning device, and the second communication connection end is provided in the host. In one embodiment, the first communication connection end may be a first Bluetooth module externally or internally disposed in the code scanning device, and the second communication connection end may be a second Bluetooth module externally or internally disposed in the host. When the first Bluetooth module and the second Bluetooth module are paired and connected, the code scanning device establishes a Bluetooth communication connection with the host. The code scanning device obtains the code scanning data when the code scanning device is working. It can be understood that the process of obtaining the code scanning data by the code scanning device is defined by the code scanning device itself, and different code scanning devices may have different processing processes. For example, the code scanning information or image is decoded according to a preset rule to obtain the code scanning data. The code scanning data here can be understood as obtaining data information corresponding to the scanned barcode. When the code scanning data corresponding to the scanned barcode is obtained, the working mode of the current code scanning device is obtained, and the code scanning data is processed according to the working mode of the code scanning device to obtain the target key value corresponding to the code scanning data. It can be understood that multiple scanned code data correspond to multiple target key values. For example, when the scanned code device works in a letter recognition working mode, a target key value of a keyboard mode corresponding to the letter is generated for the scanned code data obtained therein. After obtaining the target key value, the required data packaging format is further confirmed according to the working mode of the scanned code device, and the target key value needs to be packaged and transmitted in what format according to the packaging format. For example, valid data containing the target key value is generated, and the valid data is packaged and encapsulated in a data packaging format to obtain key value package data. After obtaining the key value package data, the key value package data is transmitted based on the communication data transmission protocol between the communication connections. The host receives the key value package data, interprets the key value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window of the host, such as a writing board window. Finally, the correspondence between the scanned code data and the host display is completed.
[0041] Among them, the second communication connection end can perform corresponding actions according to the received key-value package data. For example, after completely receiving the data sent by the first communication connection end. Immediately reply: +0K, if partial data is received, but the data verification fails, or any other errors, immediately reply: +ERROR. If the data is normal, after the data is completely transmitted to the host and confirmed that the host has completely processed it, reply to the barcode gun again +HIDSENDOK, if the computer fails to process the data correctly, or the connection between the first communication connection end and the second communication connection end is abnormally disconnected midway, reply +HIDSENDERROR.
[0042] Optionally, the key-value package data includes a first data segment, a second data segment and a third data segment; the first data segment is used to set the data length in the valid data; the second data segment is used to set the data packaging format; the third data segment is used to set the valid data. Specifically, in the process of packaging the valid data, the first data segment can be set, and the value of the first data segment is used to set the data length in the valid data. That is, according to the value of the first data segment, the data length of the valid data can be obtained so that all valid data can be accurately obtained when reading the key-value package data. At the same time, the value of the second data segment can be set to set the data packaging format, that is, it can be understood that when the second preset value is set to a different value, it corresponds to a different data packaging format. Therefore, the generation format of the valid data in the key-value package data can be obtained by obtaining the value of the second data segment in the key-value package data, and the valid data can be accurately interpreted to perform the corresponding operation. Among them, the valid data is the data including the target key value. The third data segment is set to store valid data, wherein the starting point of the third data segment can be confirmed according to the value of the second data segment, and then the starting position of the valid data is obtained, and the ending position of the valid data is obtained according to the value of the first data segment, and finally the entire valid data is obtained. Among them, the key-value packet data can also set the data segment to set the fixed header.
[0043] Optionally, when the data packaging format is the first preset format, the key-value package data also includes a fourth data segment, and the fourth data segment is used to set the specific process of the host executing the target key value. Specifically, when the data packaging format is the first preset format, that is, when the value of the second data segment is set to correspond to the first preset format, the generated key-value package data also includes a fourth data segment. The fourth data segment is used to set the specific operation process that needs to be performed when the host executes the target key value. For example, in addition to operating the keyboard corresponding to the target key value, other actions need to be performed in coordination. Here, the first preset format can be a HEX character package format.
[0044] Optionally, the fourth data segment is between the second data segment and the third data segment. Specifically, the fourth data segment in the key-value package data is set after the second data segment and before the third data segment, that is, when the current data packaging format is obtained as the first preset format according to the second data segment, the data of the preset length after the second data segment is obtained as the fourth data segment.
[0045] Optionally, the host identifies the key-value package data to obtain the corresponding target key value, and generates the corresponding character data in the preset window, including: when the host identifies that the fourth data segment is the first preset value, each key value in the target key value is pressed and released in turn to generate the character corresponding to the target key value in the preset window; when the host identifies that the fourth data segment is the second preset value, each key value in the target key value is pressed in turn and the last key value is released to generate the character corresponding to the target key value in the preset window. Specifically, in the process of the host identifying the key-value package data, if the first data segment is obtained as the first preset value, then in the process of identifying the target key value of the third data segment, the action of pressing and releasing the keypad key is performed once for each key value in the target key value, that is, the number of times the number of key values in the target key value is the number of times the action of pressing and releasing the keypad is performed. If the first data segment is obtained as the second preset value, the release action is only performed once for the target key value corresponding to the scanned code data, that is, the pressing action corresponding to each key value in the target key value is executed in turn, and when the pressing action of all key values is completed, the release action is performed on the last key value.
[0046] Optionally, when the data packaging format is the first preset format, the valid data also includes a character definition data segment, which corresponds to the target key value and is used to indicate the character type corresponding to the target key value. Specifically, when the data packaging format is the first preset format, the valid data also includes a character definition data segment corresponding to the target key value. It can be understood that each target key value corresponds to a character definition data segment, and the character type of the target key value is defined by setting the value of the character definition data segment, for example, distinguishing whether it is a hexadecimal UNICODE character, so that when generating display characters according to the target key value, the UNICODE character is used to encode and obtain the character output. For example, the Chinese character "Spring" is 0x66, 0x25 in the UNICODE encoding in hexadecimal. In the data processing process, this hexadecimal number is converted into a decimal number, which is 46266, and then converted into a key value, alt+keypad 4, alt+keypad 6, alt+keypad 2..., and the Chinese character "Spring" is output on the host in this way.
[0047] In a specific embodiment, when the acquired data packaging format is the first preset format, the generated communication data may be: 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D 0x36 0x2C0x32 0x2C 0x00 0x2C 0x00 0x66 0x25 0x01 0x00 0x04. According to the data sequence, the first to eleventh bytes, namely bytes 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D, define the data string type as key-value package data, the twelfth byte, namely byte 0x36 (corresponding to the first data segment), is used to define the length of the valid data in the key-value package data as 6, the fourteenth byte, namely byte 0x32 (corresponding to the second data segment), is used to define the data packaging format as the first preset format, and the sixteenth byte, namely byte 0x00 (corresponding to the fourth data segment), is used to define the operation process of the host generating the target key value as not reducing the key value operation, generating the key and release package in the way of manually typing on the keyboard, and defining that the decimal number in the data of the target key value does not add 0 at the beginning. When the value of this byte is replaced with 0x01, it is defined that the operation process of the host generating the target key value is to reduce redundant release operations, and it is defined that the decimal number in the data of the target key value does not add 0 at the beginning. Valid data is defined starting from the eighteenth byte (corresponding to the third data segment). The valid data may include multiple target key values, and each target key value corresponds to a character definition data segment. For example, the eighteenth byte 0x00 is the character definition data segment corresponding to the target key value 0x66 0x25 that follows it. The eighteenth byte is 0, indicating that the next two bytes of data are hex characters, indicating that the port needs to output a UNICODE encoded character of 0x66 0x25. The twentieth byte 0x01 is the character definition data segment corresponding to the target key value 0x00 0x04 that follows it. The twentieth byte is 1, indicating that the next two bytes are a key-value pair, indicating that the port needs to output the character 'a'. At the same time, a delay setting data segment is also set, and the value of the delay setting data segment is generated to be 2, and the delay time length data is set in the delay setting data segment. The time between pressing and releasing the key is set by the delay time.
[0048] Optionally, when the data packaging format is any one of the second preset format and the third preset format, the effective data also includes a delay setting data segment, which is used to set the delay time between the target key value from triggering to releasing; and when the data packaging format is the third preset format, the effective data also includes a release instruction generation data segment, which is used to generate a trigger instruction to trigger the release of the target key value. Specifically, when the value of the second data segment is set to correspond to the second preset format, the delay setting data segment can also be set in the generated effective data, that is, the delay time from the host triggering the target key value to releasing the key can be set by setting the value of the delay setting data segment, and the host executes character output and delays the release of the corresponding key according to the delay time. When the value of the second data segment is set to correspond to the second preset format, the corresponding key value key can be automatically released directly after the delay corresponding time. When the value of the second data segment is set to correspond to the third preset format, it is necessary to set the release instruction generation data segment in the generated effective data to trigger the release action of the corresponding key according to the value of the release instruction generation data segment after the delay corresponding time. That is, it can be understood that when the value of the second data segment is set to correspond to the second preset format, the host triggers the release instruction, and when the value of the second data segment is set to correspond to the third preset format, the scanning device generates the release instruction to generate the data segment.
[0049] In one embodiment, when the acquired data packaging format is the second preset format, the generated communication data may be: 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D 0x34 0x2C 0x31 0x2C 0x00 0x04 0xFF 0x30. According to the data sequence, from the first to the eleventh byte, that is, byte 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D defines the data string type as key-value package data. The twelfth byte, byte 0x34 (corresponding to the first data segment), is used to define the length of the valid data in the key-value packet data as 4. The fourteenth byte, byte 0x31 (corresponding to the second data segment), is used to define the data packaging format as the second preset format. The sixteenth and seventeenth bytes, bytes 0x00 0x04, are used to define the host's output of the target key value, that is, the port needs to output the character 'a'. When the eighteenth byte (corresponding to the delay setting data segment) is 0xFF, it indicates that the byte is used to set the delay time, and the corresponding data value is set to set the specific delay time. For example, the corresponding byte 0X30 after setting 0xFF is used to indicate that a delay of 48ms is required.
[0050] In one embodiment, when the acquired data packaging format is the third preset format, the generated communication data may be: 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D 0x36 0x2C 0x300x2C 0x00 0x04 0xFF 0x30 0x00 0x00. According to the data sequence, from the first to the eleventh byte, that is, byte 0x41 0x54 0x2B 0x48 0x49 0x44 0x53 0x45 0x4E 0x44 0x3D defines the data string type as key-value package data. The twelfth byte, byte 0x36 (corresponding to the first data segment), is used to define the length of the valid data in the key-value packet data as 6. The fourteenth byte, byte 0x32 (corresponding to the second data segment), is used to define the data packaging format as the third preset format. The sixteenth and seventeenth bytes (corresponding to the third data segment), byte 0x00 0x04, are used to define the host's output process for the target key value, that is, the port needs to output the character 'a'. When the eighteenth byte (corresponding to the delay setting data segment) is 0xFF, it indicates that the byte is used to set the delay time, and the corresponding data value is set to set the specific delay time. For example, the corresponding byte 0X30 after setting 0xFF is used to indicate that a delay of 48ms is required. After obtaining the delay identifier, according to the release trigger identifier 0x00 0x00, the output release button is triggered.
[0051] Optional, such as Figure 2 As shown, in the code scanning data transmission method of the present invention, it also includes: S21, obtaining the current key value mode of the host, and generating the target key value corresponding to the code scanning data according to the current key value mode of the host and the working mode of the code scanning device. Specifically, in the valid data, the target key value can be set to a data group consisting of two bytes, one of which is used to set the key value output mode corresponding to the code scanning data according to the current key value mode of the host. For example, when the character "A" in the original data is generated, the Caps Lock state of the host is first obtained when the target key value is generated. If the state of Caps Lock is 1, the corresponding target key value is 0x00 0x04. If the state of Caps Lock is 0, the corresponding target key value is 0x020x04. Among them, 0x02 represents the shift key, that is, the combination key of shift+a. Finally, the target key value is adjusted according to the host state, and the character output corresponding to the code scanning data is finally obtained.
[0052] like Figure 3 As shown, a code scanning data transmission device of the present invention is applied between a code scanning device and a host, and includes:
[0053] The first processing module 110 is used to obtain the scanning data generated by the scanning device during the scanning process when the scanning device establishes a communication connection with the host;
[0054] The second processing module 120 is used to obtain the target key value of the scanned code data based on the working mode of the scanned code device;
[0055] The third processing module 130 is used to obtain a corresponding data packaging format according to the working mode of the code scanning device and generate valid data corresponding to the target key value, so as to package the valid data to generate key value package data;
[0056] The fourth processing module 140 is used to send the key-value package data to the host through the communication connection, and the host recognizes the key-value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window.
[0057] Specifically, the specific coordination operation process between the various units of the code scanning data transmission device here can refer to the above-mentioned code scanning data transmission method, which will not be repeated here.
[0058] In addition, a computer storage medium of the present invention stores a computer program thereon, and when the computer program is executed by a processor, a method for transmitting data by scanning a code is implemented. Specifically, it should be noted that the above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0059] It can be understood that the above embodiments only express the preferred implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the patent scope of the present invention. It should be pointed out that, for ordinary technicians in this field, without departing from the concept of the present invention, the above technical features can be freely combined, and several deformations and improvements can be made, which all belong to the protection scope of the present invention. Therefore, all equivalent changes and modifications made to the scope of the claims of the present invention should belong to the scope covered by the claims of the present invention.
Claims
1. A method for scanning code data transmission, characterized in that: Applied between a code scanning device and a host, the method comprises the following steps: S1. When the code scanning device establishes a communication connection with the host, obtaining the code scanning data generated by the code scanning device during the code scanning process; S21, obtaining the current key value mode of the host, and generating a target key value corresponding to the scanned code data according to the current key value mode of the host and the working mode of the code scanning device; wherein the current key value mode of the host includes the Caps Lock state of the host; S3, acquiring a corresponding data packaging format according to the working mode of the code scanning device and generating valid data corresponding to the target key value, so as to package the valid data to generate key-value package data; S4, sending the key-value package data to the host through the communication connection, and the host identifies the key-value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window.
2. The code scanning data transmission method according to claim 1, characterized in that: The key-value packet data includes a first data segment, a second data segment and a third data segment; The first data segment is used to set the data length in the valid data; The second data segment is used to set the data packaging format; The third data segment is used to set the valid data, wherein the valid data includes the target key value.
3. The code scanning data transmission method according to claim 2, characterized in that: When the data packaging format is the first preset format, the key-value package data further includes a fourth data segment; The fourth data segment is used to set the host to execute the target key value to generate an auxiliary action of the character corresponding to the target key value in the preset window.
4. The code scanning data transmission method according to claim 3, characterized in that: The fourth data segment is between the second data segment and the third data segment.
5. The code scanning data transmission method according to claim 3, characterized in that: The host recognizes the key-value packet data to obtain the corresponding target key value, and generates corresponding character data in a preset window, including: When the host recognizes that the fourth data segment is a first preset value, pressing and releasing actions are sequentially performed on each key value in the target key value to generate a character corresponding to the target key value in the preset window; When the host recognizes that the fourth data segment is a second preset value, a pressing action is performed on each key value in the target key value in sequence and a releasing action is performed on the last key value to generate a character corresponding to the target key value in the preset window.
6. The code scanning data transmission method according to claim 3, characterized in that: When the data packaging format is the first preset format, the valid data further includes a character definition data segment; The character definition data segment corresponds to the target key value and is used to define the character type corresponding to the target key value.
7. The code scanning data transmission method according to claim 2, characterized in that: When the data packaging format is any one of the second preset format and the third preset format, the valid data further includes a delay setting data segment, and the delay setting data segment is used to set the delay time between the triggering and the releasing of the target key value; And when the data packaging format is the third preset format, the valid data also includes a release instruction generation data segment, and the release instruction generation data segment is used to generate a trigger instruction to trigger the release of the target key value.
8. A device for transmitting data by scanning a code, characterized in that: Applied between a code scanning device and a host, and used to implement the code scanning data transmission method according to any one of claims 1 to 7, the device comprises: A first processing module, configured to obtain scanning data generated by the scanning device during the scanning process when the scanning device establishes a communication connection with the host; A second processing module, configured to obtain a target key value of the scanned code data based on a working mode of the scanned code device; A third processing module is used to obtain a corresponding data packaging format according to the working mode of the code scanning device and generate valid data corresponding to the target key value, so as to package the valid data to generate key-value package data; The fourth processing module is used to send the key-value package data to the host through the communication connection, and the host identifies the key-value package data to obtain the corresponding target key value, and generates corresponding character data in a preset window.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the code scanning data transmission method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Audio signal transmitting method, mobile terminal and intelligent secret key device
CN103795544A
A method and system for barcode reading
CN109543485A
TCP communication data packet and packaging method, verification system and verification method thereof
CN109995473A
Code scanning recognition method and device, electronic equipment and readable storage medium
CN111950233A
Key detection method, device and equipment and storage medium
CN113422610A
