[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN107832648A - A kind of continuous scan method and mobile terminal based on zxing - Google Patents

A kind of continuous scan method and mobile terminal based on zxing Download PDF

Info

Publication number
CN107832648A
CN107832648A CN201710998452.7A CN201710998452A CN107832648A CN 107832648 A CN107832648 A CN 107832648A CN 201710998452 A CN201710998452 A CN 201710998452A CN 107832648 A CN107832648 A CN 107832648A
Authority
CN
China
Prior art keywords
scanning
mobile terminal
zxing
camera
acquiring
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
Application number
CN201710998452.7A
Other languages
Chinese (zh)
Inventor
熊雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hive Box Technology Co Ltd
Original Assignee
Shenzhen Hive Box Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Hive Box Technology Co Ltd filed Critical Shenzhen Hive Box Technology Co Ltd
Priority to CN201710998452.7A priority Critical patent/CN107832648A/en
Publication of CN107832648A publication Critical patent/CN107832648A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices

Landscapes

  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of continuous scan method and mobile terminal based on zxing, applied to the mobile terminal for being equiped with camera, method includes:Zxing scanning imaging systems are called, extend zxing scan frequencies, obtain the scan pattern of mobile terminal;When detecting that mobile terminal is in continuous scan pattern, control camera is constantly in scanning mode, and will scan interface display on mobile terminal display screen;The data of scanning are obtained, the data of scanning and scanning interface are included on mobile terminal display screen jointly.Scan data is included on mobile terminal display screen by controlling camera to be constantly in scanning mode, so as to improve the sweep speed continuously scanned, reduces the expense of mobile terminal internal memory, improve scan efficiency by the present invention.

Description

Zxing-based continuous scanning method and mobile terminal
Technical Field
The invention relates to the technical field of scanning, in particular to a zxing-based continuous scanning method and a mobile terminal.
Background
The scanning technology adopted in the logistics industry in the prior art is often in a single scanning mode, and even if the scanning is continuous, the camera equipment is turned on again only after a scanning result is obtained. Under the requirements of speed and accuracy, the camera is closed after the result is obtained every time in the prior art, and opening the camera when the camera is used again wastes a large amount of opening and closing time, so that the scanning speed of a user is reduced, and the working efficiency of the user is reduced.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a zxing-based continuous scanning method and a mobile terminal, which aim to solve the problems of the prior art that continuous scanning consumes a lot of time and the scanning speed is slow.
The technical scheme of the invention is as follows:
a zxing-based continuous scanning method is applied to a mobile terminal provided with a camera, and comprises the following steps:
calling a zxing scanning program, expanding zxing scanning frequency and obtaining a scanning mode of the mobile terminal;
when the mobile terminal is detected to be in a continuous scanning mode, controlling the camera to be in a scanning state all the time, and displaying a scanning interface on a display screen of the mobile terminal;
and acquiring scanned data, and displaying the scanned data and the scanning interface on a display screen of the mobile terminal together.
Optionally, the invoking the zxing scanning program, expanding the zxing scanning frequency, and before acquiring the scanning mode of the mobile terminal, includes:
and performing logic analysis on parameters of the mobile terminal in advance, generating zxing maximum scanning number according to a logic analysis result, exposing the maximum scanning number to a user, and receiving a user instruction to set the maximum scanning number.
Optionally, the expanding zxing scanning frequency comprises:
acquiring parameters of the mobile terminal, and acquiring a default frequency value and a high frequency value of zxing scanning frequency according to the parameters of the mobile terminal; wherein the high frequency value is the scanning frequency of zxing in continuous scanning, and the default frequency value is the scanning frequency of zxing in single scanning.
Optionally, the obtaining the parameter of the mobile terminal, and obtaining the default frequency value and the high frequency value of the zxing scanning frequency according to the parameter of the mobile terminal includes:
and acquiring the equipment model of the mobile terminal, and acquiring a default frequency value and a high frequency value of the zxing scanning frequency according to the equipment model of the mobile terminal.
Optionally, the default frequency value and the high frequency value of the zxing scanning frequency are automatically generated according to parameters of the mobile terminal or generated after receiving user instruction setting.
Optionally, when it is detected that the mobile terminal is in the continuous scanning mode, controlling the camera to be in a scanning state all the time, and displaying a scanning interface on a display screen of the mobile terminal, including:
when the mobile terminal is detected to be in a continuous scanning mode, controlling to start a camera control thread;
controlling the camera to be set to a permanent loop call in the camera control routine;
and displaying the scanning interface on a display screen of the mobile terminal.
Optionally, the acquiring scanned data and displaying the scanned data and the scanning interface on the display screen of the mobile terminal together include:
acquiring a scanning result, analyzing the scanning result and adding the scanning result to a data list;
and updating the scanned data according to the data list, and displaying the updated scanned data and the scanning interface on a display screen of the mobile terminal together.
Optionally, the zxing scanning algorithm includes a global histogram binarization scanning algorithm and a hybrid binarization scanning algorithm, and before the zxing scanning program is called, the method further includes:
and acquiring operating system parameters of the mobile terminal, and selecting a global histogram binarization scanning algorithm and a mixed binarization scanning algorithm according to the system parameters of the mobile terminal.
Another embodiment of the present invention further provides a mobile terminal, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the zxing-based continuous scan method described above.
Yet another embodiment of the present invention also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the zxing-based continuous scan method described above.
Has the advantages that: the invention discloses a zxing-based continuous scanning method and a mobile terminal, wherein scanning data is displayed on a display screen of the mobile terminal by controlling a camera to be in a scanning state all the time, so that the scanning speed of continuous scanning is improved, the memory overhead of the mobile terminal is reduced, and the scanning efficiency is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a preferred embodiment of a continuous scanning method based on zxing in the present invention.
Fig. 2 is a hardware structure diagram of a mobile terminal according to a preferred embodiment of the invention.
Detailed Description
The present invention provides a zxing-based continuous scanning method and a mobile terminal, and the following further describes the present invention in detail in order to make the purpose, technical scheme and effect of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Zxing is an open source, 1D/2D barcode image processing library implemented in Java in a variety of formats, which contains ports for linking to other languages. Zxing can realize that the scanning and decoding of bar codes or two-dimensional codes can be finished by using a camera arranged in the mobile terminal.
Referring to fig. 1, fig. 1 is a flowchart illustrating a zxing-based continuous scanning method according to a preferred embodiment of the present invention. The embodiment of the invention is applied to the mobile terminal provided with the camera. As shown in fig. 1, it includes the steps of:
s100, calling a zxing scanning program, expanding zxing scanning frequency and acquiring a scanning mode of the mobile terminal;
step S200, when the mobile terminal is detected to be in a continuous scanning mode, controlling the camera to be in a scanning state all the time, and displaying a scanning interface on a display screen of the mobile terminal;
and step S300, acquiring scanned data, and displaying the scanned data and a scanning interface on a display screen of the mobile terminal together.
In specific implementation, the mobile terminal in the embodiment of the present invention is introduced by taking a mobile terminal installed with an android system as an example. The mobile terminal includes but is not limited to a smart terminal such as a mobile phone and a tablet computer. Take a mobile phone as an example for introduction. Zxing is selected as a camera bottom layer calling frame in the mobile phone in advance.
If the default camera configuration of zxing is used, it is found that it needs to be very close to the two-dimensional code to be recognized, but this causes a problem of difficulty in focusing. The solution is to adjust the camera preview magnification and reduce the time for the camera to focus. It has been found through testing that the maximum magnification of each handset is nearly different, which may be related to the model of the camera. If set to a fixed value, it may result in excessive amplification on some handsets and insufficient amplification on some handsets. The parameter setting of the camera provides the maximum magnification value for us. To achieve continuous scanning and improve the efficiency of continuous scanning, configuration changes are made to the frequency of calls in the underlying call camera class of zxing. And calling a zxing scanning program to expand the zxing scanning frequency. The problem of adaptation of the mobile phone is perfectly solved by taking the large factor value as the current amplification factor.
The handset can operate in a single scan or in a continuous scan. When the mobile phone works in continuous scanning, the camera is controlled to be in a scanning state all the time, thereby reducing the scanning time,
and controlling the scanned data and the scanning interface to be displayed on the display screen of the mobile terminal together, so that the user can check the scanning result conveniently.
Optionally, step S100 is preceded by:
and performing logic analysis on parameters of the mobile terminal in advance, generating zxing maximum scanning number according to a logic analysis result, exposing the maximum scanning number to a user, and receiving a user instruction to set the maximum scanning number.
In particular, zxing's underlying functional configuration interfaces are often exposed only to internal reformers and to callers of system interfaces. Such configurations tend to have limitations and are not easily modified. Once set in the bottom layer of zxing, all models are used, but different models often have different CPU and memory sizes, and different camera hardware is configured, so such a setting often cannot exert the maximum efficiency of the models, and for this reason, the maximum scan number can be obtained only by analyzing in combination with the models. And performing logic analysis by taking three parameters of the CPU, the memory and the camera as dimensions, thereby obtaining an optimal value, exposing the optimal value to a user in configuration options, and enabling the user to know the setting. When the user is authorized, the user can make a decision of increasing or decreasing the maximum scanning number according to the specific weather condition and various factors at that time, so that the conditions such as the outside world can be fully combined, and the fastest scanning rate is increased.
In the bottom implementation of zxing, because scanning is a time-consuming operation, and occupies a large amount of memory and CPU performance of the mobile phone, in order to improve the utilization rate of the CPU and the memory of the mobile phone, zxing is generally defaulted to set the maximum scanning number. The arrangement is mainly used for preventing the scanning interface from staying in a continuous scanning state under certain unknown special conditions, and at the moment, the continuous scanning occupies a large amount of CPU and memory and consumes a large amount of power supply. Of course, in some cases, since a certain release is necessary in consideration of a large amount of memory resources, such as a long-time calling of a camera, zxing limits the maximum number of scans. Because the scanning frequency is increased, and the camera is not repeatedly turned on and off in the scanning thread, the pressure on a CPU, a memory and power consumption is released to a certain extent, and the maximum scanning number of zxing can be increased.
Optionally, expanding the zxing scanning frequency in step S100 includes: acquiring parameters of the mobile terminal, and acquiring a default frequency value and a high frequency value of zxing scanning frequency according to the parameters of the mobile terminal; wherein the high frequency value is the scanning frequency of zxing in continuous scanning, and the default frequency value is the scanning frequency of zxing in single scanning.
In particular, the scanning frequency is configured to be a default scanning frequency and a scanning high frequency. The default scanning frequency is applied to single scanning, and in single scanning, due to one-time scanning, the default scanning frequency can meet the calling requirement, and meanwhile, the memory consumption can be reduced for the low scanning frequency. For continuous scanning, as data is continuously acquired from a scanning page, the scanning accuracy and the scanning speed can be improved only by high-frequency scanning. Therefore, when the user selects continuous scanning, high frequency setting is performed so as to satisfy the requirement of scanning.
The zxing bottom layer can select the best frequency value according to the models of the camera hardware and the CPU, and then the best frequency value is used as a default value. However, at this time, the default value still needs to be manually set because part of the customization machine cannot recognize the camera and the CPU for setting. The setting of the high frequency value is a dynamic process, and the increment value increment is added on the basis of the default value defaultRate, so as to form the high frequency value.
In the selection of frequency values, the CPU overhead is sacrificed appropriately for successive scans, while the memory overhead is mainly reduced for a single scan.
Optionally, obtaining a parameter of the mobile terminal, and obtaining a default frequency value and a high frequency value of the zxing scanning frequency according to the parameter of the mobile terminal includes:
and acquiring the equipment model of the mobile terminal, and acquiring a default frequency value and a high frequency value of the zxing scanning frequency according to the equipment model of the mobile terminal. Specifically, the parameter of the mobile phone is the device model, and since the configuration of the mobile phone can be obtained according to the device model, the zing scanning frequency can be obtained according to the device model of the mobile phone.
And the default frequency value and the high frequency value of the zxing scanning frequency are automatically generated according to the parameters of the mobile terminal or generated after receiving the user instruction setting.
In specific implementation, zxing bottom layer can select the best frequency value according to the models of the camera hardware and the CPU, so as to be used as a default value. However, at this time, the default value still needs to be manually set because part of the customization machine cannot recognize the camera and the CPU for setting.
Optionally, step S200 specifically includes: when the mobile terminal is detected to be in a continuous scanning mode, controlling to start a camera control thread;
controlling the camera to be set to a permanent loop call in the camera control routine;
and displaying the scanning interface on a display screen of the mobile terminal.
In particular, when the continuous scanning mode is started, the camera thread is started by using the thread. The thread does not end after one scanning call of the camera, but exists all the time, and the mobile phone always displays a scanning interface to show that the mobile phone is still in a scanning state at present. When one-time camera calling is finished and a scanning result is returned, the camera automatically enters the next scanning preparation work to prepare the next scanning.
The permanent circular call refers to a circular call, that is, when the scanning method is called, the scanning method also includes the call of the scanning method, so that the call is ensured to be continuous all the time. When the continuous scanning mode is switched to the single-pass scanning mode, the permanent loop is turned off by the flag.
Sleep () is called when the customer passes the Home key, which process loses the lock on the thread. Wake up through thread is performed when returning to a call.
When the client quits, for the android, the quitting is divided into two modes: an exit button and a physical exit key of the interface. Stop () is called to stop the thread, at which point the memory space is completely freed and the space is reclaimed.
The camera call is realized by utilizing a single sub-thread to realize the control of the camera, meanwhile, the communication with the main thread is also ensured, the change of an interface is controlled, and the frequent call of interface drive is also reduced. Therefore, the scanning efficiency is improved, and the consumption of the memory is saved.
Optionally, step S300 specifically includes: acquiring a scanning result, analyzing the scanning result and adding the scanning result to a data list;
and updating the scanned data according to the data list, and displaying the updated scanned data and the scanning interface on a display screen of the mobile terminal together.
Specifically, the scanning result comprises a bar code and a two-dimensional code, when the bar code and the two-dimensional code are not in accordance with the specification, a specific abnormal code is returned, and the main thread is prompted to scan the abnormal code, so that data statistics can be performed. And (4) continuing to call the camera for scanning, and directly continuing to call the camera for focusing, scanning and acquiring results without closing the thread or the camera actually. Data are transmitted to the main thread, the camera thread is in communication with the main thread substantially, the camera thread captures data through the opened camera, then the data are sent to the main thread, the main thread acquires the data to display the data, the camera thread continues to scan, the efficiency of scanning can be guaranteed to be improved by concurrent operation, and the design initiatives of an android system are met.
And updating data by the Adapter corresponding to the RecycleView. When new data is added, the corresponding list is updated. In order to facilitate the user to view the data, the data display and the scanning are placed on the same interface, which requires that if the interface is displayed for the first time, the display of a data display page is needed, and if the interface is not displayed for the first time, only the data update and display are needed.
Thus, the interval time of continuous scanning is relatively short, and the scanning speed of the user is improved. The generation of the scanning result comprises the identification and the analysis of the two-dimensional code, when the identification is wrong, the specific error _ code 1XX and the specific error _ msg which are 'two-dimensional code/bar code can not be identified' are returned to be processed by the main thread, and the processing is exposed to a user, and the user-defined information prompt can be carried out on the error _ code 1 XX. Meanwhile, for the two-dimension code or bar code analysis exception, specific error _ code which is 3XX and error _ msg which is 'two-dimension code/bar code cannot be analyzed' are returned and are handed to the main thread for processing. The user can carry out specific prompt language prompt according to the service scene. When the two-dimensional code is identified and analyzed without problems, 2XX is returned, and at the moment, the information of the analyzed two-dimensional code/bar code can be obtained. For the android system, this information is passed to the main thread, which processes it. At this time, if the interface is not exited, a perpetual loop is entered, and the camera is continuously called to perform scanning identification.
The data adding comprises the acquisition of data and the adding of data. First, data is acquired, and since data is transmitted from the child thread to the main thread by inter-thread communication, the main thread also receives data. In this process, a Handler mechanism is involved, which is mainly related to four main parts. Namely, Handler, Looper, Message and MessageQueue. The Handler receives and processes. When data is sent to the main thread as a Message, the main thread is provided with a Message queue (Message Q ue), the Message is added, and the messages are sorted by a first-in first-out queue according to the time of the messages. Then a timing passer Looper performs a traversal in a certain time period. The message content is taken. Therefore, the continuous sending and the continuous obtaining of the messages are realized. The four generated relationships: looper is responsible for creating a MessageQueue and then entering an endless loop to read from the MessageQueue on a continuous basis. The creator of the Message is one or more of handle.
Before the Handler can be used, it needs to initialize an instance for updating the UI thread. And initialization is often either directly at declaration time or initializing the Handler instance in onCreate. The construction method of the Handler acquires the Looper instance stored in the current thread, and further associates the Looper instance with the MessageQueue in the Looper instance.
Secondly, data is added, because in android, a List control is used for presentation, and for the List control recycleview, an Adapter is needed, and the Adapter corresponds to a data set List in the List, so that a result of each scanning needs to be placed in the List.
Preferably, the update data includes two cases: first, there is existing data in the Adapter, and the data is also shown in the page. For this case, after adding data, only the notifydatasetcandied () method needs to be called, which can guarantee page refresh. And secondly, another situation is that no data page is displayed, at this time, data addition is needed, and meanwhile, a setAdapter () method of RecyclerView is called to add the adapter and pull up the page for displaying the data. And finishing the addition of the data and the display of the interface.
The zxing scanning algorithm comprises a global histogram binarization scanning algorithm and a mixed binarization scanning algorithm, and the method also comprises the following steps before calling the zxing scanning program:
and acquiring operating system parameters of the mobile terminal, and selecting a global histogram binarization scanning algorithm and a mixed binarization scanning algorithm according to the system parameters of the mobile terminal.
In the specific implementation, the graphic code image algorithm is selected, the graphic code scanning precision is related to a plurality of factors, and the most critical factor is the scanning algorithm. The graphic code comprises a bar code and a two-dimensional code. At present, in the field of pattern recognition, two more common two-dimensional code recognition algorithms are mainly used, wherein the two more common two-dimensional code recognition algorithms comprise: the global histogram binarization scanning GlobalhistogrammBinarizer algorithm is suitable for low-end equipment and has low requirements on a CPU and a memory of a mobile phone. But it selects all black dots to compute and therefore cannot handle both shadow and fade cases. The hybrid binary scan hybrid binary divider algorithm is slower in execution efficiency than the globalprost binary divider algorithm, but relatively more efficient in identification, and therefore suitable for high-end devices. The method is specially designed for analyzing the continuous black block two-dimensional code image with white as the background, and is also more suitable for analyzing the two-dimensional code image with serious shadow and gradual change. In the zxing calling, the system version and the system configuration of the mobile phone are firstly obtained; the high-low end is set with a critical value as the basis for selecting the algorithm.
Another embodiment of the present invention provides a mobile terminal, as shown in fig. 2, the mobile terminal 10 includes:
one or more processors 110 and a memory 120, where one processor 110 is illustrated in fig. 2, the processor 110 and the memory 120 may be connected by a bus or other means, and the connection by the bus is illustrated in fig. 2.
The processor 110 is configured to implement various control logic for the mobile terminal 10, which may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single chip microcomputer, an ARM (Acorn RISCMache) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. Processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The memory 120, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the zxing-based continuous scanning method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the mobile terminal 10, i.e., implementing the zxing-based continuous scanning method in the above-described method embodiments, by executing the non-volatile software programs, instructions and units stored in the memory 120.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the mobile terminal 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 120 may optionally include memory located remotely from the processor 110, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, which when executed by the one or more processors 110, perform the zxing-based continuous scanning method in any of the above-described method embodiments, e.g. performing the above-described method steps S100 to S300 in fig. 1.
The mobile terminal 10 can execute the zxing-based continuous scanning method provided by the embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in the embodiment of the mobile terminal 10, reference may be made to the zxing-based continuous scanning method provided in the embodiment of the present invention.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, for example, to perform method steps S100-S300 of fig. 1 described above.
Another embodiment of the invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the zxing based continuous scanning method of the above-described method embodiment. For example, the method steps S100 to S300 in fig. 1 described above are performed.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a general hardware platform, and may also be implemented by hardware. With this in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A zxing-based continuous scanning method is applied to a mobile terminal provided with a camera, and is characterized by comprising the following steps:
calling a zxing scanning program, expanding zxing scanning frequency and obtaining a scanning mode of the mobile terminal;
when the mobile terminal is detected to be in a continuous scanning mode, controlling the camera to be in a scanning state all the time, and displaying a scanning interface on a display screen of the mobile terminal;
and acquiring scanned data, and displaying the scanned data and the scanning interface on a display screen of the mobile terminal together.
2. The zxing-based continuous scanning method according to claim 1, wherein the invoking the zxing scanning procedure to expand the zxing scanning frequency before acquiring the scanning mode of the mobile terminal comprises:
and performing logic analysis on parameters of the mobile terminal in advance, generating zxing maximum scanning number according to a logic analysis result, exposing the maximum scanning number to a user, and receiving a user instruction to set the maximum scanning number.
3. The zxing-based continuous scan method of claim 1, wherein expanding the zxing scan frequency comprises:
acquiring parameters of the mobile terminal, and acquiring a default frequency value and a high frequency value of zxing scanning frequency according to the parameters of the mobile terminal; wherein the high frequency value is the scanning frequency of zxing in continuous scanning, and the default frequency value is the scanning frequency of zxing in single scanning.
4. The zxing-based continuous scanning method according to claim 3, wherein the obtaining parameters of the mobile terminal and the obtaining the default frequency value and the high frequency value of the zxing scanning frequency according to the parameters of the mobile terminal comprises:
and acquiring the equipment model of the mobile terminal, and acquiring a default frequency value and a high frequency value of the zxing scanning frequency according to the equipment model of the mobile terminal.
5. The zxing-based continuous scanning method according to claim 3 or 4, wherein the default frequency value and the high frequency value of the zxing scanning frequency are automatically generated according to parameters of the mobile terminal or generated after receiving user instruction setting.
6. The zxing-based continuous scanning method as claimed in claim 1, wherein when the mobile terminal is detected to be in the continuous scanning mode, the camera is controlled to be in a scanning state all the time, and a scanning interface is displayed on a display screen of the mobile terminal, comprising:
when the mobile terminal is detected to be in a continuous scanning mode, controlling to start a camera control thread;
controlling the camera to be set to a permanent loop call in the camera control routine;
and displaying the scanning interface on a display screen of the mobile terminal.
7. The zxing-based continuous scanning method according to claim 1, wherein the acquiring scanned data and displaying the scanned data and the scanning interface together on a display screen of the mobile terminal comprise:
acquiring a scanning result, analyzing the scanning result and adding the scanning result to a data list;
and updating the scanned data according to the data list, and displaying the updated scanned data and the scanning interface on a display screen of the mobile terminal together.
8. The zxing-based continuous scanning method according to claim 1, wherein the zxing scanning algorithm comprises a global histogram binarization scanning algorithm and a hybrid binarization scanning algorithm, and the method further comprises, before the invoking of the zxing scanning procedure:
and acquiring operating system parameters of the mobile terminal, and selecting a global histogram binarization scanning algorithm and a mixed binarization scanning algorithm according to the system parameters of the mobile terminal.
9. A mobile terminal, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the zxing based continuous scan method of any of claims 1-8.
10. A non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the zxing-based continuous scan method of any of claims 1-8.
CN201710998452.7A 2017-10-24 2017-10-24 A kind of continuous scan method and mobile terminal based on zxing Pending CN107832648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710998452.7A CN107832648A (en) 2017-10-24 2017-10-24 A kind of continuous scan method and mobile terminal based on zxing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710998452.7A CN107832648A (en) 2017-10-24 2017-10-24 A kind of continuous scan method and mobile terminal based on zxing

Publications (1)

Publication Number Publication Date
CN107832648A true CN107832648A (en) 2018-03-23

Family

ID=61648967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710998452.7A Pending CN107832648A (en) 2017-10-24 2017-10-24 A kind of continuous scan method and mobile terminal based on zxing

Country Status (1)

Country Link
CN (1) CN107832648A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020042790A1 (en) * 2018-08-31 2020-03-05 阿里巴巴集团控股有限公司 Two-dimensional code analysis method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001167226A (en) * 1999-10-26 2001-06-22 Datalogic Spa Method for restoring bar code with continuous scan
CN102324015A (en) * 2011-08-05 2012-01-18 泰州市锋硕电子科技有限公司 Bar code scan reader wireless data sending system and method thereof
CN104866495A (en) * 2014-02-24 2015-08-26 腾讯科技(深圳)有限公司 Violation information querying method and mobile equipment
CN106022433A (en) * 2016-06-23 2016-10-12 天津众阳科技有限公司 Novel QR code and generation and code scanning method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001167226A (en) * 1999-10-26 2001-06-22 Datalogic Spa Method for restoring bar code with continuous scan
CN102324015A (en) * 2011-08-05 2012-01-18 泰州市锋硕电子科技有限公司 Bar code scan reader wireless data sending system and method thereof
CN104866495A (en) * 2014-02-24 2015-08-26 腾讯科技(深圳)有限公司 Violation information querying method and mobile equipment
CN106022433A (en) * 2016-06-23 2016-10-12 天津众阳科技有限公司 Novel QR code and generation and code scanning method thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
百度知道: "Zxing怎么实现连续扫描", 《HTTPS://ZHIDAO.BAIDU.COM/QUESTION/553577700492951532.HTML》 *
简书: "Android zxing 连续扫描 再次扫描", 《HTTPS://WWW.JIANSHU.COM/P/D2729726D9F2HTTPS://WWW.JIANSHU.COM/P/D2729726D9F2》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020042790A1 (en) * 2018-08-31 2020-03-05 阿里巴巴集团控股有限公司 Two-dimensional code analysis method and device

Similar Documents

Publication Publication Date Title
JP5887419B2 (en) Method and apparatus for taking a screen shot of an application screen in a mobile terminal
EP3309676B1 (en) Method and apparatus for providing screenshot service on terminal device and storage medium and device
CN108496198B (en) Image processing method and device
AU2021229220B2 (en) Image processing method and device
CN108228321B (en) Android system application closing method and device
CN110928543A (en) Page processing method and device and storage medium
CN110569250B (en) Management method and device for analysis library of Internet of things network element
CN106547547B (en) data acquisition method and device
US10691390B2 (en) Method and device for video rendering
CN109949391A (en) Graphic rendering method, apparatus, electronic equipment and storage medium
CN107832648A (en) A kind of continuous scan method and mobile terminal based on zxing
CN111104108A (en) Display interface WPF generation method and device
CN116720533B (en) Code scanning method, electronic equipment and readable storage medium
CN110825373A (en) Dynamic method and device for mobile terminal
CN113805954A (en) Screen saver display method, electronic device, and computer storage medium
CN112671816B (en) File downloading method, device, equipment and medium
CN112367205A (en) Processing method and scheduling system for HTTP scheduling request
US20230367616A1 (en) Data processing method, computer device, and storage medium
US11888685B1 (en) System, method, and computer program for a model driven non-real time radio intelligent controller (RIC) for O-RAN management and orchestration
CN117850918A (en) Method, device and equipment for realizing applet image recognition based on Taro framework
CN110221873B (en) Method for improving full-screen animation loading performance based on programming language and electronic equipment
CN111353320B (en) Code scanning identification method and device
EP3531261A1 (en) Method and apparatus for image display, and computer storage medium
CN114237839A (en) Method and device for accelerating game running and computer readable storage medium
CN114895948A (en) Application program processing method and device, electronic equipment and readable storage medium

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

Application publication date: 20180323

RJ01 Rejection of invention patent application after publication