CN113095450A - Two-dimensional code data acquisition method and system, electronic device and storage medium - Google Patents
Two-dimensional code data acquisition method and system, electronic device and storage medium Download PDFInfo
- Publication number
- CN113095450A CN113095450A CN202110314294.5A CN202110314294A CN113095450A CN 113095450 A CN113095450 A CN 113095450A CN 202110314294 A CN202110314294 A CN 202110314294A CN 113095450 A CN113095450 A CN 113095450A
- Authority
- CN
- China
- Prior art keywords
- key information
- dimensional code
- real data
- piece
- simulation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000004088 simulation Methods 0.000 claims abstract description 65
- 238000004590 computer program Methods 0.000 claims abstract description 26
- 238000012544 monitoring process Methods 0.000 claims abstract description 12
- 238000012545 processing Methods 0.000 claims description 7
- 238000013524 data verification Methods 0.000 claims description 3
- 238000012795 verification Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 13
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000004075 alteration Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0489—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using dedicated keyboard keys or combinations thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1417—2D bar codes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
The invention provides a two-dimensional code data acquisition method, a system, an electronic device and a storage medium, wherein the method comprises the following steps: a system keyboard hook is arranged in an upper computer program and used for monitoring all key information; identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer. According to the invention, by arranging the system keyboard hook in the program background, all key information can be automatically acquired under the condition of no text input box, the two-dimension code simulation key information is identified from the key information, the corresponding real data is analyzed, and manual operation is not needed in the whole process.
Description
Technical Field
The invention relates to the field of two-dimensional code data scanning, in particular to a two-dimensional code data acquisition method, a two-dimensional code data acquisition system, an electronic device and a storage medium.
Background
The two-dimensional code data acquired by the code scanning gun is generally key data of a simulated keyboard, so that an upper computer program at a PC (personal computer) end needs to be provided with a text input box, a focus needs to be in the input box, the scanned data is automatically displayed in the text box, and a user writes an application layer according to the data content of the text box. Three inconveniences are brought about in the above-mentioned operation process:
1. most of the analog key data of the two-dimensional code has TAB keys or ENTER keys, so that the focus can be moved to other places, and the focus needs to be manually placed in the original text input box again through mouse or keyboard operation.
2. The text input box is required to be arranged on a top interface, and a program cannot be arranged in the background, otherwise, the input box cannot acquire the simulation key data. If other interfaces need to be displayed during operation, the interfaces need to be switched back and forth manually through keys or a speedometer.
3. Because the manual operation can use keys and a mouse, if the corresponding two-dimensional code data in the input text box is easily modified due to improper operation, the safety of the data cannot be guaranteed, and thus the application layer code can cause unexpected problems due to data input errors.
Disclosure of Invention
The present invention provides a two-dimensional code data acquisition method, system, electronic device and storage medium that overcome the above-mentioned problems or at least partially solve the above-mentioned problems.
According to a first aspect of the present invention, there is provided a two-dimensional code data acquisition method including:
setting a system keyboard hook in an upper computer program, wherein the system keyboard hook is used for monitoring all key information;
identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information;
analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information;
and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer.
On the basis of the above technical solutions, the embodiments of the present invention may be further improved as follows.
Optionally, the key information monitored by the system keyboard hook is stored in a cache queue.
Optionally, the all key information includes manual key information and simulated key information corresponding to the two-dimensional code acquired by the scanning gun;
the step of identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information comprises the following steps:
acquiring a time difference between any two adjacent pieces of key information from the cache queue, and when the time difference between any two adjacent pieces of key information is smaller than a preset time threshold, judging that the any two adjacent pieces of key information are analog keys corresponding to the two-dimensional codes acquired by the scanning gun;
and when the time difference between any two adjacent key information is greater than a preset time threshold value, judging that any two adjacent keys are artificial key information.
Optionally, after determining that any two adjacent keys are the manual key information, the method further includes:
and if the manual key information is judged to exist in the cache queue, clearing the key information in the cache queue.
Optionally, the analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring the real data corresponding to each piece of simulation key information includes:
for any piece of simulation key information, analyzing real data corresponding to any piece of simulation key information according to the state of the CapsLock key and the state of the combination key.
Optionally, the specific end symbol of the two-dimensional code is a TAB key or an ENTER key;
the method for acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol by taking the specific end symbol of the two-dimensional code as the end symbol and sending the real data to the application layer includes:
acquiring a plurality of pieces of simulation key information before the two-dimensional code end symbol, and analyzing each piece of simulation key information to obtain corresponding real data;
and caching the real data corresponding to each piece of simulation key information in an array, and sending the real data corresponding to the simulation key information cached in the array to the application layer.
Optionally, the sending the real data corresponding to the simulation key information cached in the array to the application layer includes:
and carrying out data verification on the real data corresponding to each piece of simulated key information, and sending the real data passing the verification to the application layer.
According to a second aspect of the present invention, there is provided a two-dimensional code data acquisition system including:
the system comprises a setting module, a processing module and a display module, wherein the setting module is used for setting a system keyboard hook in an upper computer program, and the system keyboard hook is used for monitoring all key information;
the identification module is used for identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information;
the analysis module is used for analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun and restoring real data corresponding to each piece of simulation key information;
and the sending module is used for acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol by taking the specific end symbol of the two-dimensional code as an end mark and sending the real data to the application layer.
According to a third aspect of the present invention, there is provided an electronic device comprising a memory, a processor for implementing the steps of the two-dimensional code data acquisition method when executing a computer management-like program stored in the memory.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having stored thereon a computer management-like program which, when executed by a processor, implements the steps of the two-dimensional code data acquisition method.
The invention provides a two-dimensional code data acquisition method, a system, electronic equipment and a storage medium, wherein a system keyboard hook is arranged in an upper computer program and used for monitoring all key information; identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer. According to the invention, by arranging the system keyboard hook in the program background, all key information can be automatically acquired under the condition of no text input box, the two-dimension code simulation key information is identified from the key information, the corresponding real data is analyzed, and manual operation is not needed in the whole process.
Drawings
Fig. 1 is a flowchart of a two-dimensional code data acquisition method according to the present invention;
fig. 2 is a structural diagram of a two-dimensional code data acquisition system provided by the present invention;
FIG. 3 is a schematic diagram of a hardware structure of a possible electronic device provided in the present invention;
fig. 4 is a schematic diagram of a hardware structure of a possible computer-readable storage medium according to the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of a two-dimensional code data acquiring method according to an embodiment of the present invention, as shown in fig. 1, the method includes: 101. setting a system keyboard hook in an upper computer program, wherein the system keyboard hook is used for monitoring all key information; 102. identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; 103. analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; 104. and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer.
It can be understood that, based on the defects in the background art, in order to solve the above problems, the upper computer program preferably can automatically acquire the real data corresponding to the two-dimensional code without manual operation, so as to avoid the problems of complexity in manual operation and occurrence of manual operation.
The embodiment of the invention is specifically realized in such a way that a system keyboard hook is installed in an upper computer program to monitor all keyboard data, simulated key information corresponding to the two-dimensional code is identified from all keyboard key information, a specific end symbol of the two-dimensional code is used as an end mark, and the obtained two-dimensional code simulated key data is transmitted to an application layer code.
According to the embodiment of the invention, the system keyboard hook is arranged on the program background, so that all key information can be automatically acquired under the condition of no text input box, the two-dimension code simulation key information is identified from the key information, the corresponding real data is analyzed, manual operation is not needed in the whole process, and the problems caused by the manual operation or caused by the manual operation can be reduced.
In one possible embodiment, each key information monitored by the system keyboard hook is stored in a buffer queue.
It can be understood that a system keyboard hook is installed in the upper computer program, and the system keyboard hook can monitor and acquire each piece of key information and store each piece of key information acquired through monitoring in a cache queue. For example, for data in the two-dimensional code 123456789, 9 pieces of key information are monitored, and the 9 pieces of key information are stored in the cache queue, where the two-dimensional code data are directly scanned by the scanning gun, for manual key information, the system keyboard hook may also monitor, and similarly, for manual key information, the manual key information is also stored in the cache queue. And for all the key information, sequentially storing each piece of key information in a cache queue.
In a possible embodiment mode, all the key information comprises manual key information and simulated key information corresponding to the two-dimensional code acquired by the scanning gun; based on the key information, identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun from the key information, and the method comprises the following steps: acquiring a time difference between any two adjacent pieces of key information from the cache queue, and when the time difference between any two adjacent pieces of key information is smaller than a preset time threshold, judging that the any two adjacent pieces of key information are analog keys corresponding to the two-dimensional codes acquired by the scanning gun; and when the time difference between any two adjacent key information is greater than a preset time threshold value, judging that any two adjacent keys are artificial key information.
It can be understood that, for the key information cached in the cache queue in sequence, the time difference between any one pair of adjacent two key information in the cache queue is obtained, and if the time difference is smaller than the preset time threshold, the two adjacent key information is considered as the simulated key information corresponding to the two-dimensional code data obtained by the scanning gun; and if the time difference is greater than a preset time threshold value, the two adjacent key information are considered as manual key information.
And by utilizing the principle that the time difference between the analog keys corresponding to the two-dimensional code is generally small, setting the key interval to be less than 100ms is the analog key of the two-dimensional code, and otherwise, setting the key interval to be a manual key.
After each piece of key information is judged to be analog key information or manual key information, if the manual key information is judged to exist in the cache queue, the manual key insertion indicates that the original data is interfered and needs to be discarded, the key information in the cache queue is cleared, and the analog key information corresponding to the two-dimensional code needs to be processed in the middle value.
In a possible embodiment, analyzing each piece of simulated key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulated key information includes: for any piece of simulation key information, analyzing real data corresponding to any piece of simulation key information according to the state of the CapsLock key and the state of the combination key.
It can be understood that, each piece of identified simulated key information is analyzed, and specifically, according to the state of the CapsLock key and the state of the Shift key, real data corresponding to the simulated key information is restored. For example, if the acquired simulated key information is a Shift + a key, the restored real data is a; similarly, if the acquired simulated key information is a CapsLock + A key, the restored real data is A, and the original real data can be restored by analyzing the key information according to the captured key information or the combined key information.
In a possible embodiment mode, the specific end symbol of the two-dimensional code is a TAB key or an ENTER key; the method for acquiring the real data corresponding to the plurality of pieces of simulated key information before the two-dimensional code end symbol by taking the specific end symbol of the two-dimensional code as the end symbol and sending the real data to the application layer comprises the following steps: acquiring a plurality of pieces of simulation key information before the two-dimensional code end symbol, and analyzing each piece of simulation key information to obtain corresponding real data; and caching the real data corresponding to each piece of simulation key information in an array, and sending the real data corresponding to the simulation key information cached in the array to the application layer.
It can be understood that, for each piece of simulated key information, corresponding real data can be restored, data included in one two-dimensional code may correspond to a plurality of pieces of simulated key information, and then how many pieces of simulated key information correspond to one two-dimensional code, and a plurality of pieces of simulated key information before the two-dimensional code end symbol can be obtained according to a specific end symbol of the two-dimensional code as an end mark, that is, the simulated key information included in one two-dimensional code.
And acquiring a plurality of pieces of simulation key information before the end character, analyzing each piece of simulation key information to obtain corresponding real data, caching the real data corresponding to each piece of simulation key information in an array, and sending the real data corresponding to the simulation key information cached in the array to an application layer for subsequent processing of the application layer. In a possible embodiment, sending real data corresponding to the simulated key information cached in the array to the application layer includes: and carrying out data verification on the real data corresponding to each piece of simulated key information, and sending the real data passing the verification to the application layer.
It can be understood that, in the process of sending the restored real data of the simulated key information to the application layer, the real data is verified, for example, the real data corresponding to the two-dimensional code is usually of a fixed length, if the length of the analyzed real data is not of a fixed length, it indicates that the real data is incorrect, and the real data is discarded, or the real data corresponding to the two-dimensional code is provided with a check code, which can ensure the correctness of the data through the check code, and only the real data that passes the check is sent to the application layer.
Fig. 2 is a structural diagram of a two-dimensional code data acquiring system according to an embodiment of the present invention, and as shown in fig. 2, the two-dimensional code data acquiring system includes a setting module 21, an identifying module 22, an analyzing module 23, and a sending module 24, where:
the setting module 21 is used for setting a system keyboard hook in an upper computer program, and the system keyboard hook is used for monitoring all key information; the identification module 22 is configured to identify, based on the key information, each piece of simulated key information corresponding to the two-dimensional code acquired by the scanning gun; the analysis module 23 is configured to analyze each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restore real data corresponding to each piece of simulation key information; and the sending module 24 is configured to obtain real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol by using the specific end symbol of the two-dimensional code as an end symbol, and send the real data to the application layer.
It can be understood that the two-dimensional code data acquiring system provided by the embodiment of the present invention corresponds to the two-dimensional code data acquiring methods provided by the foregoing embodiments, and the relevant technical features of the two-dimensional code data acquiring system may refer to the relevant technical features of the two-dimensional code data acquiring method, which are not described herein again.
Referring to fig. 3, fig. 3 is a schematic view of an embodiment of an electronic device according to an embodiment of the present disclosure. As shown in fig. 3, an electronic device according to an embodiment of the present application includes a memory 310, a processor 320, and a computer program 311 stored in the memory 320 and executable on the processor 320, where the processor 320 executes the computer program 311 to implement the following steps: setting a system keyboard hook in an upper computer program, wherein the system keyboard hook is used for monitoring all key information; identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium according to the present application. As shown in fig. 4, the present embodiment provides a computer-readable storage medium 400, on which a computer program 411 is stored, the computer program 411 implementing the following steps when executed by a processor: setting a system keyboard hook in an upper computer program, wherein the system keyboard hook is used for monitoring all key information; identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer.
According to the scanning gun two-dimensional data acquisition method, the scanning gun two-dimensional data acquisition system, the electronic equipment and the storage medium, the system keyboard hook is arranged in the upper computer program and used for monitoring all key information; identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information; analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information; and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer. By arranging the system keyboard hook at the program background, all key information can be automatically acquired under the condition of having/not having a text input box, two-dimension code simulation key information is identified from the key information, corresponding real data is analyzed, and manual operation is not needed in the whole process. It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include such modifications and variations.
Claims (10)
1. A two-dimensional code data acquisition method is characterized by comprising the following steps:
setting a system keyboard hook in an upper computer program, wherein the system keyboard hook is used for monitoring all key information;
identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information;
analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun, and restoring real data corresponding to each piece of simulation key information;
and taking the specific end symbol of the two-dimensional code as an end mark, acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol, and sending the real data to the application layer.
2. The method of claim 1,
and storing each key information monitored by the system keyboard hook in a cache queue.
3. The method according to claim 2, wherein the all key information includes manual key information and simulated key information corresponding to the two-dimensional code acquired by the scanning gun;
the step of identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information comprises the following steps:
acquiring a time difference between any two adjacent pieces of key information from the cache queue, and when the time difference between any two adjacent pieces of key information is smaller than a preset time threshold, judging that the any two adjacent pieces of key information are analog keys corresponding to the two-dimensional codes acquired by the scanning gun;
and when the time difference between any two adjacent key information is greater than a preset time threshold value, judging that any two adjacent keys are artificial key information.
4. The method according to claim 1 or 2, wherein after determining that any two adjacent keys are manual key information, the method further comprises:
and if the manual key information is judged to exist in the cache queue, clearing the key information in the cache queue.
5. The method according to claim 1, wherein the analyzing each piece of simulated key information corresponding to the two-dimensional code obtained by the identified scanning gun to restore the real data corresponding to each piece of simulated key information includes:
for any piece of simulation key information, analyzing real data corresponding to any piece of simulation key information according to the state of the CapsLock key and the state of the combination key.
6. The method according to claim 1 or 5, characterized in that the two-dimensional code specific end symbol is a TAB key or an ENTER key;
the method for acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol by taking the specific end symbol of the two-dimensional code as the end symbol and sending the real data to the application layer includes:
acquiring a plurality of pieces of simulation key information before the two-dimensional code end symbol, and analyzing each piece of simulation key information to obtain corresponding real data;
and caching the real data corresponding to each piece of simulation key information in an array, and sending the real data corresponding to the simulation key information cached in the array to the application layer.
7. The method of claim 6, wherein sending the real data corresponding to the simulated key information cached in the array to the application layer comprises:
and carrying out data verification on the real data corresponding to each piece of simulated key information, and sending the real data passing the verification to the application layer.
8. A two-dimensional code data acquisition system characterized by comprising:
the system comprises a setting module, a processing module and a display module, wherein the setting module is used for setting a system keyboard hook in an upper computer program, and the system keyboard hook is used for monitoring all key information;
the identification module is used for identifying each piece of simulation key information corresponding to the two-dimensional code acquired by the scanning gun based on the key information;
the analysis module is used for analyzing each piece of simulation key information corresponding to the two-dimensional code acquired by the identified scanning gun and restoring real data corresponding to each piece of simulation key information;
and the sending module is used for acquiring real data corresponding to a plurality of pieces of simulated key information before the two-dimensional code end symbol by taking the specific end symbol of the two-dimensional code as an end mark and sending the real data to the application layer.
9. An electronic device, comprising a memory, a processor for implementing the steps of the two-dimensional code data acquisition method as claimed in any one of claims 1-7 when executing a computer management-like program stored in the memory.
10. A computer-readable storage medium, having stored thereon a computer management-like program, which when executed by a processor, implements the steps of the two-dimensional code data acquisition method as recited in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110314294.5A CN113095450A (en) | 2021-03-24 | 2021-03-24 | Two-dimensional code data acquisition method and system, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110314294.5A CN113095450A (en) | 2021-03-24 | 2021-03-24 | Two-dimensional code data acquisition method and system, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113095450A true CN113095450A (en) | 2021-07-09 |
Family
ID=76669899
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110314294.5A Pending CN113095450A (en) | 2021-03-24 | 2021-03-24 | Two-dimensional code data acquisition method and system, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113095450A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116185268A (en) * | 2023-02-17 | 2023-05-30 | 深圳市和风科技有限公司 | Interaction method, system, medium and computer of code scanning gun and terminal equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090205045A1 (en) * | 2008-02-12 | 2009-08-13 | Mcafee, Inc. | Bootstrap OS protection and recovery |
CN104700305A (en) * | 2013-12-05 | 2015-06-10 | 航天信息股份有限公司 | Method for acquiring two-dimensional code from optional input frame of Android platform |
CN109544134A (en) * | 2018-11-29 | 2019-03-29 | 银联商务股份有限公司 | Convenient payment service method and system |
-
2021
- 2021-03-24 CN CN202110314294.5A patent/CN113095450A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090205045A1 (en) * | 2008-02-12 | 2009-08-13 | Mcafee, Inc. | Bootstrap OS protection and recovery |
CN104700305A (en) * | 2013-12-05 | 2015-06-10 | 航天信息股份有限公司 | Method for acquiring two-dimensional code from optional input frame of Android platform |
CN109544134A (en) * | 2018-11-29 | 2019-03-29 | 银联商务股份有限公司 | Convenient payment service method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116185268A (en) * | 2023-02-17 | 2023-05-30 | 深圳市和风科技有限公司 | Interaction method, system, medium and computer of code scanning gun and terminal equipment |
CN116185268B (en) * | 2023-02-17 | 2024-01-30 | 深圳市和风科技有限公司 | Interaction method, system, medium and computer of code scanning gun and terminal equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108595583B (en) | Dynamic graph page data crawling method, device, terminal and storage medium | |
US8549478B2 (en) | Graphical user interface input element identification | |
KR102047568B1 (en) | Measuring web page rendering time | |
CN108986169B (en) | Method and apparatus for processing image | |
WO2019019628A1 (en) | Test method, apparatus, test device and medium for mobile application | |
CN108920380A (en) | Test method, device, server, equipment and the storage medium of the software compatibility | |
CN108235004B (en) | Video playing performance test method, device and system | |
CN103389937A (en) | Interface testing method and device | |
CN111783812B (en) | Forbidden image recognition method, forbidden image recognition device and computer readable storage medium | |
CN110070076B (en) | Method and device for selecting training samples | |
CN110659569A (en) | Electronic signature method, device, storage medium and electronic equipment | |
CN112929695A (en) | Video duplicate removal method and device, electronic equipment and storage medium | |
KR101110241B1 (en) | Program test device and program | |
CN108921138B (en) | Method and apparatus for generating information | |
CN113095450A (en) | Two-dimensional code data acquisition method and system, electronic device and storage medium | |
CN112882957B (en) | Test task validity checking method and device | |
CN110490056A (en) | The method and apparatus that image comprising formula is handled | |
CN113095203A (en) | Client signature detection method and device in double-record data quality inspection | |
CN105374131A (en) | Method and device for automatic testing | |
CN110362470B (en) | Test data collection method and device, electronic equipment and storage medium | |
CN115358914B (en) | Data processing method and device for visual detection, computer equipment and medium | |
CN108985059B (en) | Webpage backdoor detection method, device, equipment and storage medium | |
CN110716778A (en) | Application compatibility testing method, device and system | |
US20230063608A1 (en) | Measure gui response time | |
CN110471850B (en) | Code coverage rate testing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210709 |