CN115034782A - Code scanning implementation method and device, storage medium and electronic equipment - Google Patents

Code scanning implementation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115034782A
CN115034782A CN202210817332.3A CN202210817332A CN115034782A CN 115034782 A CN115034782 A CN 115034782A CN 202210817332 A CN202210817332 A CN 202210817332A CN 115034782 A CN115034782 A CN 115034782A
Authority
CN
China
Prior art keywords
code scanning
image acquisition
module
decoding
monitoring
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
CN202210817332.3A
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.)
Shandong Paimeng Network Technology Co ltd
Original Assignee
Shandong Paimeng Network 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 Shandong Paimeng Network Technology Co ltd filed Critical Shandong Paimeng Network Technology Co ltd
Priority to CN202210817332.3A priority Critical patent/CN115034782A/en
Publication of CN115034782A publication Critical patent/CN115034782A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3276Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being read by the M-device
    • 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/14Methods 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/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a code scanning implementation method, a code scanning implementation device, a storage medium and electronic equipment, which comprise a code scanning process, wherein the code scanning process comprises an image acquisition step and a decoding step, the image acquisition step is used for acquiring images in a target area, the decoding step is used for identifying the acquired images, the code scanning process operates in a first type of working mode, and the first type of working mode comprises the following steps: the image acquisition step and/or the decoding step are/is in a working state; the image acquisition step and the decoding step are in a working state to obtain a code scanning result, and the code scanning result is monitored; and the image acquisition step and/or the decoding step are/is in a working state so as to monitor the code scanning result again. The time consumption of starting and stopping the image acquisition step and the decoding step is reduced, the code scanning efficiency can be improved, and the requirement of intensive code scanning is met. The condition that the camera is not completely closed or opened can not be easily caused by frequently opening and closing the camera, and the possibility of code scanning failure and even abnormal program occurrence is reduced.

Description

Code scanning implementation method and device, storage medium and electronic equipment
Technical Field
The application relates to the field of code scanning, in particular to a code scanning implementation method, device, storage medium and electronic equipment.
Background
With the rapid development of internet technology, the life of people is greatly changed. Taking the electronic payment technology with the current high popularity as an example, the development of the electronic payment technology greatly increases the convenience and security of payment, and is increasingly accepted and popularized by the public.
Code scanning payment is a very popular electronic payment mode, and the frequency of occurrence in daily life is very high. The code scanning payment is relatively dependent on the operating efficiency of a code scanning assembly, and the code scanning assembly comprises a camera module and a decoding module. How to guarantee the operating efficiency of the code scanning assembly, thereby improving the efficiency of code scanning payment, and becoming a problem which is continuously concerned by technicians in the field.
Disclosure of Invention
The present application aims to provide a code scanning implementation method, apparatus, storage medium and electronic device to at least partially improve the above problems.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, an embodiment of the present application provides a code scanning implementation method, including a code scanning process, where the code scanning process includes an image acquisition step and a decoding step, the image acquisition step is used to acquire an image in a target region, and the decoding step is used to identify the acquired image to obtain a code scanning result;
the method comprises the following steps that the code scanning process runs in a first type working mode, and the first type working mode comprises the following steps:
the image acquisition step and/or the decoding step are/is in a working state;
the image acquisition step and the decoding step are in a working state to obtain a code scanning result, and the code scanning result is monitored;
and the image acquisition step and/or the decoding step are/is in a working state so as to monitor the code scanning result again.
In a second aspect, an embodiment of the present application provides a code scanning system, including: the device comprises an image acquisition module, a decoding module and a monitoring module, wherein the image acquisition module is used for acquiring images in a target area, the decoding module is used for identifying the acquired images to obtain a code scanning result, and the monitoring module is used for acquiring a code scanning result generation module;
the code scanning system operates in a first type of working mode, and the first type of working mode comprises the following steps:
the image acquisition module and/or the decoding module are/is in a working state;
the image acquisition module and the decoding module are in a working state, and a code scanning result is fed back to the monitoring module;
and the image acquisition module and/or the decoding module are/is in a working state so as to feed back a code scanning result to the newly generated monitoring module.
In a third aspect, an embodiment of the present application provides a code scanning implementation apparatus, including an image acquisition unit, a decoding unit, and a monitoring unit, where the image acquisition unit is configured to acquire an image in a target area, the decoding unit is configured to identify the acquired image to obtain a code scanning result, and the monitoring unit is a unit configured to obtain a primary code scanning result;
the code scanning implementation device operates in a first type of working mode, and the first type of working mode comprises the following steps:
the image acquisition unit and/or the decoding unit are/is in a working state;
the image acquisition unit and the decoding unit are in working states, and code scanning results are fed back to the monitoring unit;
and the image acquisition unit and/or the decoding unit are/is in a working state so as to feed back a code scanning result to the newly generated monitoring unit.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method described above.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor and memory for storing one or more programs; the one or more programs, when executed by the processor, implement the methods described above.
Compared with the prior art, the code scanning implementation method, the device, the storage medium and the electronic equipment comprise a code scanning process, wherein the code scanning process comprises an image acquisition step and a decoding step, the image acquisition step is used for acquiring an image in a target area, and the decoding step is used for identifying the acquired image to obtain a code scanning result; the method comprises that the code scanning process is operated in a first type working mode, and the first type working mode comprises the following steps: the image acquisition step and/or the decoding step are/is in a working state; the image acquisition step and the decoding step are in a working state to obtain a code scanning result, and the code scanning result is monitored; and the image acquisition step and/or the decoding step are/is in a working state for monitoring the code scanning result again. When the image acquisition device is in the first type of working mode, the time consumption of starting and stopping the image acquisition step and the decoding step is reduced, the code scanning efficiency can be improved, and the requirement of intensive code scanning is met. Under the continuous working state, start and stop can not appear, the condition that frequent camera opening and closing in a short period easily produces the camera and does not close completely or open can not appear, and the possibility that code scanning fails and even the program is abnormal is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and it will be apparent to those skilled in the art that other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a code scanning implementation method according to an embodiment of the present application;
fig. 3 is a schematic view of substeps S201 provided in an embodiment of the present application;
fig. 4 is a schematic diagram illustrating the substeps of S202 according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a code scanning implementation method according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a code scanning implementation method according to an embodiment of the present application;
fig. 7 is a flowchart illustrating a code scanning implementation method according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a code scanning system according to an embodiment of the present disclosure;
fig. 9 is a schematic unit diagram of a code scanning implementation apparatus according to an embodiment of the present application.
In the figure: 10-a processor; 11-a memory; 12-a bus; 13-a communication interface; 1001-image acquisition module; 1002-a decoding module; 1003-a monitoring module; 1004-a monitoring module; 1005-a control module; 2001-an image acquisition unit; 2002-a decoding unit; 2003-listening unit.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, the terms "first," "second," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
With the high popularity of networking, the frequency of appearance of scanning scenes is also very high. Such as code scanning payment, product information inquiry, logistics information statistics, express delivery and receipt, and express delivery, etc. Taking a code scanning payment process as an example, the code scanning payment is a process of acquiring continuous frame pictures through a camera, decoding and identifying picture contents by using a two-dimensional code decoder, analyzing whether two-dimensional codes exist or not, continuously processing the next frame picture if the two-dimensional codes do not exist, analyzing effective two-dimensional code contents in the pictures if the two-dimensional codes exist, and finally calling a payment interface to pay.
In the current code scanning payment process, one-time payment is initiated, the camera is started once, and the camera is closed after the code scanning is finished. Because the camera is started once when payment is initiated, the two-dimensional code decoder is also initialized once again correspondingly, and starting the camera, starting the two-dimensional code decoder and the like are all time-consuming operations, a consumer can scan codes only after waiting for a period of time when payment is initiated, and certain closing time is also needed when the payment is closed. The payment process basically meets the common payment scene, but cannot meet the scene that the payment needs to be initiated frequently. For example, in a dining room, a consumer orders an egg to cook meal, a merchant inputs 6 yuan, and a camera and a two-dimensional code decoder are started; however, the consumer adds another steamed bun, and the merchant needs to cancel the current payment and input 6.5 yuan again. In the consumer consumption process, the camera and the two-dimensional code decoder need to be closed first, then the camera is opened again, the two-dimensional code decoder is initialized again, and when the payment is completed, the camera is closed again and then the camera is opened before the next consumer arrives. More time consumption is generated in the period, and the condition that the camera is not completely closed or opened is easily generated by frequently switching the camera in a short period, so that code scanning failure or even program abnormity is caused.
The embodiment of the application provides an electronic device, which can be a cash register or a server, and can also be any component in a code scanning system, for example, any one of a monitoring module, a decoding module and a control module of the code scanning system.
Please refer to fig. 1, a schematic structural diagram of an electronic device. The electronic device comprises a processor 10, a memory 11, a bus 12. The processor 10 and the memory 11 are connected by a bus 12, and the processor 10 is configured to execute an executable module, such as a computer program, stored in the memory 11.
The processor 10 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the code scanning implementation method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 10. The Processor 10 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The Memory 11 may comprise a high-speed Random Access Memory (RAM) and may further comprise a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.
The bus 12 may be an ISA (Industry Standard architecture) bus, a PCI (peripheral Component interconnect) bus, an EISA (extended Industry Standard architecture) bus, or the like. Only one bi-directional arrow is shown in fig. 1, but this does not indicate only one bus 12 or one type of bus 12.
The memory 11 is used for storing programs, such as programs corresponding to the code scanning implementation device. The scan code implementation device includes at least one software functional module which can be stored in the memory 11 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the electronic device. The processor 10 executes the program to realize the code scanning implementation method after receiving the execution instruction.
Possibly, the electronic device provided by the embodiment of the present application further includes a communication interface 13. The communication interface 13 is connected to the processor 10 via a bus.
It should be understood that the structure shown in fig. 1 is merely a structural schematic diagram of a portion of an electronic device, which may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
The code scanning implementation method provided by the embodiment of the application can be applied to the electronic device shown in fig. 1, but is not limited thereto, and includes a code scanning process, the code scanning process includes an image acquisition step and a decoding step, the image acquisition step is used for acquiring an image in a target area, and the decoding step is used for identifying the acquired image to obtain a code scanning result. The acquired image can be a human face image, a two-dimensional code image, a bar code image and the like. The code scanning result may be a two-dimensional code, a bar code, and a face recognition result, which is not limited herein. The code scanning result can be used for payment, but is not limited to be used for payment, for example, when a one-dimensional barcode of a commodity is scanned, the code scanning result can be used for inquiring commodity information (production date, activation, production place and the like), and can also be used for carrying out warehouse-out or warehouse-in registration of the commodity.
Referring to fig. 2, a specific process of code scanning implementation includes: s201 and S202 are specifically set forth below.
S201, the code scanning process operates in a first type working mode.
Optionally, regarding specific content of the first type of operation mode in S201 in fig. 2, an embodiment of the present application further provides a possible implementation manner, please refer to fig. 3, where the first type of operation mode includes: s201-1, S201-2 and S201-3 are specifically described as follows.
S201-1, the image acquisition step and/or the decoding step are/is in a working state.
Alternatively, the image acquisition step may be performed by an image acquisition module, for example a camera, and the decoding step may be performed by a decoder, for example a two-dimensional decoder.
S201-2, the image acquisition step and the decoding step are in a working state to obtain a code scanning result.
It should be understood that, when the image capturing step and the decoding step are in an operating state, the image capturing step is used for capturing an image in the target area, and the decoding step is used for identifying the captured image to obtain a code scanning result.
S201-3, the image acquisition step and/or the decoding step are/is in a working state for monitoring the code scanning result again.
Optionally, after obtaining the code scanning result, at least one of the image capturing step and the decoding step is kept in a continuous working state, and the executing step is not closed or stopped.
In the first operating mode, the image acquisition step is continuously in an operating state, or the decoding step is continuously in an operating state, or the image acquisition step and the decoding step are continuously in an operating state. With the above code scanning payment process as a comparative example, in the first working mode, even if the merchant inputs the amount of money again or the last consumer successfully pays, the image capturing step and/or the decoding step are still in a working state, and the situation that the image capturing step and the decoding step are stopped to be executed, that is, the camera and the decoder are not restarted at the same time, does not occur.
When the image acquisition device is in the first type of working mode, the time consumption of starting and stopping the image acquisition step and the decoding step is reduced, the code scanning efficiency can be improved, and the requirement of intensive code scanning is met. Under the continuous working state, start and stop can not appear, the condition that frequent camera opening and closing in a short period easily produces the camera and does not close completely or open can not appear, and the possibility that code scanning fails and even the program is abnormal is reduced.
S202, monitoring the code scanning result.
Optionally, the monitoring of the code scanning result refers to sending the scanning result to a corresponding module or thread, and taking code scanning payment as an example, the code scanning result may be sent to a payment thread to complete payment.
In summary, the code scanning implementation method provided in the embodiment of the present application includes a code scanning process, where the code scanning process includes an image acquisition step and a decoding step, the image acquisition step is used to acquire an image in a target region, and the decoding step is used to identify the acquired image to obtain a code scanning result; the method comprises the following steps that the code scanning process is operated in a first type working mode, and the first type working mode comprises the following steps: the image acquisition step and/or the decoding step are/is in a working state; the image acquisition step and the decoding step are in a working state to obtain a code scanning result, and the code scanning result is monitored; and the image acquisition step and/or the decoding step are/is in a working state so as to monitor the code scanning result again. When the image acquisition device is in the first type of working mode, the time consumption of starting and stopping the image acquisition step and the decoding step is reduced, the code scanning efficiency can be improved, and the requirement of intensive code scanning is met. Under the continuous working state, start and stop can not appear, the condition that frequent camera opening and closing in a short period easily produces the camera and does not close completely or open can not appear, and the possibility that code scanning fails and even the program is abnormal is reduced.
On the basis of fig. 2, as for the content in S202, the embodiment of the present application further provides a possible implementation manner, please refer to fig. 4, where the process of monitoring the code scanning result includes: s202-1, as detailed below.
S202-1, at least one code searching step for registering and monitoring for obtaining the single code scanning result is carried out, and the code searching step is used for obtaining the code scanning result and carrying out a further processing process on the code scanning result.
Optionally, the code searching step is configured to obtain a code scanning result, and clear the registration monitoring table after the code scanning result is fed back to the corresponding monitoring module. The first type of working mode is that when the registration monitoring table does not comprise a monitoring module, the image acquisition step and/or the decoding step are still in a continuous working state. Taking code scanning payment as an example, when payment of an amount (e.g. 6.5 yuan) input by a merchant is completed, the registry listening table is emptied, in the existing process, the camera and the decoder need to be turned off, and in the scheme of the present application, the image acquisition step and/or the decoding step are still in a continuous working state.
Optionally, the process of further processing the code scanning result may include: and completing payment based on the code scanning result, or inquiring commodity information based on the code scanning result, or carrying out commodity warehouse-out or warehouse-in registration based on the code scanning result.
On the basis of fig. 2, as to how to switch the code scanning process to the first type of operation mode, please refer to fig. 5 and fig. 6, which also provides a possible implementation manner. As shown in fig. 5, the code scanning implementation method further includes: s101 and S105 are specifically described as follows.
S101, when entering a preset high-frequency code scanning time period, generating a first-class trigger instruction.
Optionally, the high-frequency code scanning time period is preset based on human or automatically set based on historical data. The first type of trigger instruction indicates that the currently required code scanning frequency is greater than a preset frequency threshold.
In one possible implementation, the high-frequency code scanning time period can be customized in cooperation with a network clock. Taking school dining rooms as an example, students often concentrate on dining in several interval time periods, the requirement of high-frequency code scanning may occur in the time periods, the code scanning process needs to be switched to a first type of working mode, and the code scanning time periods can be customized to be high-frequency code scanning time periods. In other time periods, the required code scanning frequency may be low, and the high-frequency code scanning period is not defined when the high-frequency code scanning is not needed. Alternatively, the high-frequency code scanning period may also avoid weekends and holidays, i.e., the corresponding period is not set as the high-frequency code scanning period on holidays.
And S105, under the condition that the first-class trigger instruction is obtained, switching the code scanning process to a first-class working mode.
In one possible implementation, the work mode switching is too complicated for the employee to operate in consideration of the user experience, and the employee may ignore the setting for the work mode. Therefore, big data analysis can be carried out, the time period of high-frequency code scanning is counted in the using period, for example, the time period required by high-frequency code scanning can be determined when the number of code scanning in each minute reaches a threshold value, and in the subsequent using process, big data analysis can be carried out regularly to adjust the starting time strategy of the first type of working mode in time. Specifically, as shown in fig. 6, the code scanning implementation method further includes: s102, S103, S104, S105, S106, and S107 are specifically described below.
S102, acquiring the code scanning frequency in the current time period.
Alternatively, the current time period may be a time period of a preset length before the current time, for example, 10 minutes or 5 minutes before the current time. And determining the code scanning frequency in the current time period by the code scanning result acquisition times in the current time period.
S103, determining whether the code scanning frequency is greater than a preset frequency threshold value. If yes, executing S104; if not, go to step S106.
It should be understood that in the case of the second type of operation mode, the second type of operation mode is the triggered operation state of the image capturing step and the decoding step. When the code scanning frequency is greater than the preset frequency threshold, it indicates that the code scanning frequency in the current time period is very high, and it is presumed that the next time period may still have a high code scanning requirement according to the continuity of time, so at least S104, when the code scanning frequency is greater than the preset frequency threshold, a first type of trigger instruction is generated. Under the condition of being in the first type working mode, if the code scanning frequency is greater than the preset frequency threshold, the first type working mode can be kept, and switching is not carried out.
Under the condition that the current working mode is in the second working mode, if the code scanning frequency is less than or equal to the preset frequency threshold, the second working mode can be continuously kept without switching. If the code scanning frequency is less than or equal to the preset frequency threshold value under the condition of being in the first type of working mode, it needs to further determine whether to switch to the second type of working mode, that is, execute S106.
And S104, generating a first type of trigger instruction when the code scanning frequency is greater than a preset frequency threshold value.
And S105, under the condition that the first-class trigger instruction is obtained, switching the code scanning process to a first-class working mode.
S106, i is i +1, i represents the number of time periods in which the code scanning frequency is less than or equal to the preset frequency threshold.
Optionally, i represents the number of consecutive time periods in which the code sweeping frequency is less than or equal to a preset frequency threshold.
Optionally, in the case of already being in the first type of operating mode, counting a number i of time periods in which the code scanning frequency is less than or equal to a preset frequency threshold, and assuming that i is equal to 2 and is still less than the preset number threshold, maintaining the first type of operating mode. And if the code scanning frequency is greater than a preset frequency threshold value in the next time period, clearing i.
S107, if the number of the time periods of which the code scanning frequency is less than or equal to the preset frequency threshold is greater than the preset number threshold, generating a second type of trigger instruction, and switching the code scanning process to a second type of working mode.
It will be appreciated that in the first type of operation mode, more energy is consumed relative to the second operation mode, since the image acquisition step and/or the decoding step are in a continuous operation state. Therefore, when the mobile terminal is not in a scene with high-frequency code scanning requirements, the code scanning process can be switched to the second type of working mode to play a role in energy conservation.
Optionally, for some application scenarios, such as a school dining payment environment, the dining intensive time of each day is relatively consistent, and the intensive payment time periods determined based on the code scanning process in a certain period of time in the previous period, such as 11 hours-13 hours and 16 hours-18 hours determined in the day of generating a valid order, during the subsequent usage, the determination process of S102-S107 is not continued, and the determined intensive payment time periods are continued for usage, i.e., the first operation mode is started at 11 hours-13 hours and 16 hours-18 hours each day. Or reducing the frequency use, such as starting at regular intervals, and correcting the determined high-frequency code scanning time period to reduce the data calculation amount of the control system of the payment equipment. In a possible implementation manner, in order to ensure that code scanning is correctly performed when the code scanning process operates in the first type of operating mode, an embodiment of the present application further provides a possible implementation manner, please refer to fig. 7, where the code scanning implementation method further includes: s301, S302, S303, S304, and S305 are specifically described below.
S301, a monitoring step.
Optionally, the monitoring step is used for monitoring the operation state of the image acquisition step and the decoding step.
In particular, the monitoring step may be accomplished by a pre-configured monitoring module.
S302, when the running state of the image acquisition step and/or the decoding step is monitored to be in an abnormal state, controlling the abnormal process or restarting the whole process in the image acquisition step and the decoding step.
The abnormal process is a process in an abnormal state in the image acquisition step and the decoding step.
Optionally, the monitoring module enables a thread polling mechanism, for example, queries whether the current code scanning state is normal every 10 seconds, that is, queries whether the implementation processes of the image acquisition step and the decoding step are normal. If an abnormal condition is triggered, for example, when the running state of the image acquisition step and/or the decoding step is monitored to be in an abnormal state, a reconnection mechanism is entered, and the abnormal process in the image acquisition step and the decoding step is controlled or all the abnormal process is restarted.
And S303, storing the restart information.
Wherein the restart information includes an abnormal cause causing the restart.
In a possible implementation manner, the images acquired by the image acquisition step are stored in a queue, and the decoding step calls the images in the queue for decoding. Alternatively, the cause of the exception may be, but is not limited to, an overflow of queue storage, or a high temperature exception. The abnormal reason record is that, for example, some abnormality occurs at a certain time point in the image acquisition module, so that the abnormality can be conveniently optimized by a worker. The restart information may also include a point in time at which a restart occurred, based on which the number of restarts and the restart frequency over a period of time may be counted to trigger an optimization reminder.
S304, determining whether the code scanning process meets a first preset condition or a second preset condition. If yes, go to S305; if not, skipping.
The first preset condition represents that the restart frequency in the first time period is greater than a preset frequency threshold, the second preset condition represents that the restart frequency in the second time period is greater than a preset frequency threshold, and the restart information further comprises a restart occurring time point.
The first time period and the second time period may be the same, or the second time period may be smaller than the first time period, which is not limited herein.
It should be understood that when the code scanning process satisfies the first preset condition or the second preset condition, which indicates that the restart is too frequent, optimization is required to reduce the restart frequency and ensure the smoothness of the code scanning process, i.e., S305 is executed, otherwise, the restart may be skipped.
S305, when the code scanning process meets a first preset condition or a second preset condition, an optimization prompt is generated.
It should be appreciated that by generating optimization reminders, staff are reminded to optimize, reducing the likelihood of abnormal conditions occurring.
Referring to fig. 8, fig. 8 is a code scanning system according to an embodiment of the present disclosure, and optionally, the code scanning system may execute the method flow shown in the above method flow embodiment to achieve the corresponding technical effect. For the sake of brevity, the corresponding contents in the above embodiments may be referred to where not mentioned in this embodiment.
As shown in fig. 8, the code scanning system includes: the image acquisition module 1001 is used for acquiring images in a target area, the decoding module 1002 is used for identifying the acquired images to obtain a code scanning result, and the monitoring module 1003 is used for acquiring a code scanning result.
The code scanning system operates in a first type of working mode, and the first type of working mode comprises the following steps:
the image acquisition module 1001 and/or the decoding module 1002 are/is in a working state;
the image acquisition module 1001 and the decoding module 1002 are in a working state, and feed back a code scanning result to the monitoring module 1003;
the image capturing module 1001 and/or the decoding module 1002 are/is in a working state, so as to feed back a code scanning result to the newly generated monitoring module 1003.
With continued reference to fig. 8, the code scanning system further includes: a monitoring module 1004 and a control module 1005.
The monitoring module 1004 is used for monitoring the operation states of the image acquisition module 1001 and the decoding module 1002. The control module 1005 is used for state control of the image acquisition module 1001 and the decoding module 1002.
When the code scanning system operates in the first type of working mode, the monitoring module 1004 is further configured to send an abnormal state to the control module 1005 when monitoring that the operating state of the image acquisition module 1001 and/or the decoding module 1002 is in the abnormal state;
the control module 1005 is configured to control an abnormal component or all of the image capturing module 1001 and the decoding module 1002 to restart, where the abnormal component is a component in an abnormal state in the image capturing module 1001 and the decoding module 1002.
The control module 1005 is further configured to store restart information, where the restart information includes an abnormal reason causing the restart.
Optionally, the control module 1005 is further configured to register the generate snooping module 1003 when there is a thread that requests a code scanning result for the next time, and log out the snooping module 1003 after sending the code scanning result.
Alternatively, the control module 1005 may also perform the above-described S101 to S107, S304, and S305.
Referring to fig. 9, fig. 9 is a view of a code scanning implementation apparatus provided in the present application, and optionally, the code scanning implementation apparatus is applied to the electronic device described above.
The code scanning implementation device comprises an image acquisition unit 2001, a decoding unit 2002 and a monitoring unit 2003, wherein the image acquisition unit 2001 is used for acquiring images in a target area, the decoding unit 2002 is used for identifying the acquired images to obtain a code scanning result, and the monitoring unit 2003 is used for acquiring a code scanning result generation unit.
The code scanning implementation device operates in a first type of working mode, and the first type of working mode comprises the following steps:
the image acquisition unit 2001 and/or the decoding unit 2002 are/is in a working state;
the image acquisition unit 2001 and the decoding unit 2002 are in working states, and the code scanning result is fed back to the monitoring unit 2003;
the image acquisition unit 2001 and/or the decoding unit 2002 are/is in a working state to feed back a code scanning result to the newly generated monitoring unit 2003.
Optionally, the code scanning implementation apparatus further includes: a monitoring unit and a control unit.
The monitoring unit is used for monitoring the operation states of the image acquisition unit 2001 and the decoding unit 2002. The control unit is used for state control of the image capturing unit 2001 and the decoding unit 2002.
When the code scanning system operates in the first type of working mode, the monitoring unit is further configured to send the abnormal state to the control unit when monitoring that the operating state of the image acquisition unit 2001 and/or the decoding unit 2002 is in the abnormal state;
the control unit is used for controlling the image acquisition unit 2001 and the abnormal component or all of the decoding unit 2002 to restart, wherein the abnormal component is a component in an abnormal state in the image acquisition unit 2001 and the decoding unit 2002.
The control unit is also used for storing restart information, wherein the restart information comprises an abnormal reason causing the restart.
Optionally, the control unit is further configured to register the generation snooping unit 2003 when there is a thread that requests a code scanning result of one time, and to cancel the snooping unit 2003 after sending the code scanning result.
Alternatively, the control unit may also execute the above-described S101 to S107, S304, and S305.
It should be noted that the code scanning implementation apparatus provided in this embodiment may execute the method flows shown in the above method flow embodiments to implement the corresponding technical effects. For the sake of brevity, the corresponding contents in the above embodiments may be referred to where not mentioned in this embodiment.
The embodiment of the application also provides a storage medium, wherein the storage medium stores computer instructions and programs, and the computer instructions and the programs execute the code scanning implementation method of the embodiment when being read and run. The storage medium may include memory, flash memory, registers, or a combination thereof, etc.
The following provides an electronic device, which may be a code scanning implementation device, where the code scanning implementation device includes the electronic device shown in fig. 1, and may implement the code scanning implementation method described above; specifically, the electronic device includes: processor 10, memory 11, bus 12. The processor 10 may be a CPU. The memory 11 is used for storing one or more programs, and when the one or more programs are executed by the processor 10, the code scanning implementation method of the above embodiment is executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, a network storage space, and other various media capable of storing program codes.

Claims (13)

1. A code scanning implementation method is characterized by comprising a code scanning process, wherein the code scanning process comprises an image acquisition step and a decoding step, the image acquisition step is used for acquiring images in a target area, and the decoding step is used for identifying the acquired images to obtain a code scanning result;
the method comprises the following steps that the code scanning process runs in a first type working mode, and the first type working mode comprises the following steps:
the image acquisition step and/or the decoding step are/is in a working state;
the image acquisition step and the decoding step are in a working state to obtain a code scanning result, and the code scanning result is monitored;
and the image acquisition step and/or the decoding step are/is in a working state so as to monitor the code scanning result again.
2. The code scanning implementation method of claim 1, wherein: the monitoring process of the code scanning result comprises the following steps: and at least one code searching step for registering and monitoring to obtain a single code scanning result, wherein the code searching step is used for obtaining the code scanning result and further processing the code scanning result.
3. The code scanning implementation method of claim 1, wherein: the method further comprises the following steps:
and under the condition of acquiring the first-class trigger instruction, switching the code scanning process to a first-class working mode.
4. The code scanning implementation method of claim 1, wherein: the method further comprises the following steps:
a monitoring step; the monitoring step is used for monitoring the running states of the image acquisition step and the decoding step, and when the code scanning process runs in the first type of working mode, the method further comprises the following steps:
when the running state of the image acquisition step and/or the decoding step is monitored to be in an abnormal state, controlling the abnormal process in the image acquisition step and the decoding step or restarting the abnormal process completely, wherein the abnormal process is the process in the abnormal state in the image acquisition step and the decoding step;
and storing restart information, wherein the restart information comprises an abnormal reason causing restart.
5. The code scanning implementation method of claim 4, wherein: the restart information further includes a time point at which a restart occurs, and after the restart information is updated, the method further includes:
determining whether the code scanning process meets a first preset condition or a second preset condition, wherein the first preset condition represents that the restart frequency in a first time period is greater than a preset frequency threshold, and the second preset condition represents that the restart frequency in a second time period is greater than a preset frequency threshold;
and when the code scanning process meets a first preset condition or a second preset condition, generating an optimization prompt.
6. The code scanning implementation method of claim 3, wherein: the method further comprises the following steps:
generating the first type of trigger instruction when entering a preset high-frequency code scanning time period;
the high-frequency code scanning time period is preset manually or automatically set based on historical data.
7. The code scanning implementation method of claim 3, wherein: the method further comprises the following steps:
acquiring code scanning frequency in the current time period;
when the code scanning frequency is greater than a preset frequency threshold, generating the first type of trigger instruction;
and if the number of the time periods of which the code scanning frequency is less than or equal to the preset frequency threshold is greater than the preset number threshold, generating a second type of trigger instruction, and switching the code scanning process to a second type of working mode, wherein the second type of working mode is that the image acquisition step and the decoding step are in a trigger type working state.
8. A code scanning system, comprising: the device comprises an image acquisition module, a decoding module and a monitoring module, wherein the image acquisition module is used for acquiring images in a target area, the decoding module is used for identifying the acquired images to obtain a code scanning result, and the monitoring module is used for acquiring a code scanning result and generating a code scanning result;
the code scanning system operates in a first type of working mode, and the first type of working mode comprises the following steps:
the image acquisition module and/or the decoding module are/is in a working state;
the image acquisition module and the decoding module are in working states, and code scanning results are fed back to the monitoring module;
and the image acquisition module and/or the decoding module are/is in a working state so as to feed back a code scanning result to the newly generated monitoring module.
9. The code scanning system of claim 8, wherein: the code scanning system further comprises: the monitoring module is used for monitoring the running states of the image acquisition module and the decoding module;
when the code scanning system operates in the first type of working mode, the monitoring module is further used for sending an abnormal state to the control module when the operation state of the image acquisition module and/or the decoding module is monitored to be in the abnormal state;
the control module is used for controlling the image acquisition module and the decoding module to restart abnormal components or all the abnormal components, wherein the abnormal components are the components in abnormal states in the image acquisition module and the decoding module;
the control module is further used for storing restart information, wherein the restart information comprises an abnormal reason causing restart.
10. The code scanning system of claim 8, wherein: the code scanning system also comprises a control module, wherein the control module is used for controlling the states of the image acquisition module and the decoding module;
and the monitoring module is also used for registering and generating the monitoring module when a thread requesting a code scanning result exists, and canceling the monitoring module after the code scanning result is sent.
11. A code scanning implementation device is characterized by comprising an image acquisition unit, a decoding unit and a monitoring unit, wherein the image acquisition unit is used for acquiring images in a target area, the decoding unit is used for identifying the acquired images to obtain a code scanning result, and the monitoring unit is used for acquiring a primary code scanning result and generating the primary code scanning result;
the code scanning implementation device operates in a first type of working mode, and the first type of working mode comprises:
the image acquisition unit and/or the decoding unit are/is in a working state;
the image acquisition unit and the decoding unit are in a working state, and a code scanning result is fed back to the monitoring unit;
and the image acquisition unit and/or the decoding unit are/is in a working state so as to feed back a code scanning result to the newly generated monitoring unit.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
13. An electronic device, comprising: a processor and memory for storing one or more programs; the one or more programs, when executed by the processor, implement the method of any of claims 1-7.
CN202210817332.3A 2022-07-12 2022-07-12 Code scanning implementation method and device, storage medium and electronic equipment Pending CN115034782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210817332.3A CN115034782A (en) 2022-07-12 2022-07-12 Code scanning implementation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210817332.3A CN115034782A (en) 2022-07-12 2022-07-12 Code scanning implementation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115034782A true CN115034782A (en) 2022-09-09

Family

ID=83129613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210817332.3A Pending CN115034782A (en) 2022-07-12 2022-07-12 Code scanning implementation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115034782A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117313761A (en) * 2023-11-27 2023-12-29 北京紫光青藤微系统有限公司 Bar code reading method and device, electronic equipment and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117313761A (en) * 2023-11-27 2023-12-29 北京紫光青藤微系统有限公司 Bar code reading method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
EP2109844B1 (en) Dual-task decoder for improved symbol reading
WO2017084293A1 (en) Application closing method, device and electronic equipment
US10776129B2 (en) Method and apparatus for controlling a startup bootstrap program of an intelligent TV set
US20180176658A1 (en) Video advertisement filtering method, apparatus and device
CN115034782A (en) Code scanning implementation method and device, storage medium and electronic equipment
CN114973436B (en) Attendance checking method and device, intelligent attendance checking terminal and storage medium
CN114584712A (en) Method and equipment for rapidly acquiring tunable spectral image and storage medium
CN112987891A (en) Method for protecting special network card from overheating, electronic equipment and machine-readable storage medium
WO2024103583A1 (en) Method and apparatus for changed bios options to take effect, nonvolatile readable storage medium, and electronic apparatus
CN109491771B (en) Task processing method based on system performance optimization and related equipment
JPWO2018146923A1 (en) Distributed collaboration system, device behavior monitoring device and home appliance
CN110798693B (en) User management method, server and computer readable storage medium
CN108920214B (en) Application program running method, application program running device and mobile terminal
JP2008058097A (en) Timer regulation apparatus and electronic device using it
CN114898755B (en) Voice processing method and related device, electronic equipment and storage medium
CN110996314A (en) Information processing method and device, electronic equipment and computer readable medium
CN112732733B (en) Data checking processing method and device
CN107038552B (en) Service processing method, device and equipment and readable medium
CN112463348B (en) Timed task processing method and device
CN111061701B (en) Information processing method, device, server and computer readable medium
CN111694628A (en) Page display method based on application program thread and related equipment
CN112133066A (en) Reminding method, reminding system and storage medium for medicine taking event before meal
US10699327B2 (en) Information processing apparatus, control method, and program
CN113296597B (en) Power consumption control method and terminal equipment
AU2012227156C1 (en) A method of selecting a device for delivering a recommendation

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