Detailed Description
The technical scheme provided by the application will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a scanning system suitable for use with the present application. The scanning system includes cloud 110, POS 120, and code scanner 130.
The cloud 110 is, for example, a server, on which a software platform employing a virtualization technology is installed, and integrates multiple functions of searching, downloading, using, managing, backing up, and the like. Through the platform, various common software can be packaged in an independent virtualized environment, so that the application software and an operating system are decoupled, and the purpose of using the software in a green way is achieved.
The POS machine 120 can accelerate the cashing speed and accuracy, and the basic principle is that commodity data (unit price, department, discount.) is created in the computer file of the POS machine, and after the bar code on the commodity is read in by the optical reading device (for example, the code scanner 130), the commodity data can be directly displayed in the POS machine.
The code scanning gun 130 can convert the two-dimensional code or the bar code on the commodity into information which can be identified by a computer according to a preset decoding mode, so that management, use, storage and output of the information are realized, and for example, the information can be transmitted to the POS machine 120 so as to be convenient for the POS machine 120 to process.
POS 120 may communicate with cloud 110 or with code scanner 130, as indicated by the double-headed arrow in FIG. 1. The communication method may be wireless communication or wired communication. For example, POS 120 and cloud 110 may communicate via optical fiber or cellular network, POS 120 and gun 130 may communicate via Bluetooth or universal serial bus (universal serial bus, USB). In addition, the code scanner 130 may also communicate directly with the cloud 110 (not shown in FIG. 1). The application does not limit the communication mode among the devices in the scanning system.
The scanning system shown in fig. 1 is only one example of a scanning system suitable for the present application, and the scanning system suitable for the present application is not limited thereto. For example, POS 120 may be a cell phone or tablet computer, and code scanner 130 may be a scanner with more functions.
Typically, the user uses a gun 130 that matches the function set by the manufacturer of POS 120. In some cases, however, the two devices may be mismatched.
For example, when a user changes the code scanner, the code scanner is usually faster in the code scanner speed and the transmission speed, and the data receiving and processing speed of the POS machine 120 cannot keep up with the transmission speed of the new code scanner, so that the code scanner may have a problem of error in code scanning if the POS machine 120 or the new code scanner is not set.
For another example, if POS machine 120 is not upgraded when POS machine 120 has new upgradeable firmware, POS machine 120 and code scanner 130 may not be used better.
Two examples of the mismatch between the gun 130 and the POS 120 are described above. For the user, whether the POS machine 120 or a new code scanner or an upgrade firmware is set, a certain expertise is required, and in addition, some two-dimensional codes containing setting information or upgrade information may need to be scanned, so that difficulty of better code scanning effect of user experience is increased.
The application provides a method for adapting scanning equipment, which can enhance the operability of the scanning equipment and reduce the difficulty of better code scanning effect of user experience.
As shown in fig. 2, the method 200 includes:
s210, detecting scanning equipment and acquiring equipment information of the scanning equipment.
The scanning device is, for example, a scanning gun 130. The implementation device of the method 200 may be the POS machine 120, and after the scan gun 130 is connected to the POS machine 120, for example, after the USB plug of the scan gun 130 is plugged into the USB interface of the POS machine 120, the POS machine 120 detects the scan gun 130 and reads the device information of the scan gun 130.
The device information may be hardware information such as medium access control (MEDIA ACCESS control, MAC) layer information of the scan gun 130, or software information such as firmware version information of the scan gun 130. The application does not limit the specific content of the equipment information.
S220, judging whether the equipment information is matched with preset information.
The preset information is information pre-stored in the execution device of the method 200, and may be information of the same type as the device information or information of a different type from the device information.
For example, the device information and the preset information are both MAC layer information, and when the device information is the same as the preset information, the executing device may determine that the device information matches the preset information, and when the device information is different from the preset information, the executing device may determine that the device information does not match the preset information.
For example, the device information is firmware version information, the preset information is a hash value, after the execution device obtains the firmware version information of the scanning device, hash operation is performed on the firmware version information to obtain a hash value, if the hash value is the same as the preset information, the execution device can determine that the device information is matched with the preset information, and if the hash value is different from the preset information, the execution device can determine that the device information is not matched with the preset information.
If the device information is not matched with the preset information, the execution device may not send an adaptation request, and the POS machine 120 may perform the scanning operation through the code scanner 130, and if the device information is not matched with the preset information, the execution device may perform the following steps.
And S230, when the equipment information is not matched with preset information, sending an adaptation request, wherein the adaptation request is used for requesting to configure the scanning equipment.
The execution device may send an adaptation request to the cloud 110, and request the cloud 110 to configure the scanning device, where the execution device may directly send the adaptation request to the cloud 110, or may forward the adaptation request through the code scanning device.
The cloud 110 may send a query request to the scanning device or the execution device to query the state of the scanning device, e.g., obtain MAC layer information and/or firmware version information of the scanning device. Subsequently, the cloud 110 may send configuration information to the executing device, which may include at least one of scan and transmission parameters of the scanning device, receive and processing parameters of the associated device of the scanning device.
As an alternative embodiment, the adaptation request includes device information of the scanning device and/or device information of an associated device of the scanning device, so that the cloud 110 does not need to send the query request again, thereby reducing signaling overhead of the execution device and the cloud 110, and improving a rate of adapting the scanning device.
The association device of the scanning device may be a POS machine 120, where the POS machine 120 sets based on the receiving parameter and the processing parameter in the configuration information, so as to improve the matching degree between the POS machine 120 and the scanning device. The association device of the scanning device may also be another device capable of communicating with the scanning device, which is not limited by the present application.
S240, receiving configuration information.
S250, configuring the scanning equipment according to the configuration information.
Taking the execution device as the POS machine 120 as an example, after the POS machine 120 obtains the configuration information, if the configuration information includes the receiving parameter and the processing parameter of the POS machine 120, the POS machine 120 may configure the local parameter according to the receiving parameter and the processing parameter, and if the configuration information includes the scanning parameter and the transmission parameter of the code scanner 130, the POS machine 120 may send the scanning parameter and the transmission parameter to the code scanner 130, so that the code scanner 130 configures the local parameter. The scheme does not need to communicate with the cloud 110 by the scanning device, and reduces the cost of the scanning device.
In the scanning system to which the method 200 is applied, since the execution device can detect the device information of the scanning device after the scanning device is powered on, and execute the step of matching the scanning device when the device information is not matched with the preset information, no user intervention is required, the method 200 can enhance the operability of the scanning device, and reduce the difficulty of better code scanning effect experienced by the user.
The method for adapting a scanning device provided by the present application is described in detail above from the point of view of a terminal device, and processing steps of a server (i.e., cloud) in the method for adapting a scanning device provided by the present application will be described below.
As shown in fig. 3, the method 300 includes:
S310, receiving an adaptation request, wherein the adaptation request is used for requesting to configure the scanning device.
The execution device of the method 300 may be the cloud 110, or may be a chip in the cloud 110. Cloud 110 may receive an adaptation request from POS machine 120 or code scanner 130, which has the same meaning as the adaptation request in method 200, and is not described in detail herein for brevity.
After the cloud 110 obtains the adaptation request, the following steps may be performed.
S320, determining configuration information corresponding to the equipment information of the scanning equipment from at least one piece of configuration information according to the equipment information of the scanning equipment.
For example, the cloud 110 may search a locally stored database for configuration information corresponding to the device information of the code scanner 130, where the database is a configuration information set including at least one model and at least one configuration information, the at least one model corresponds to the at least one configuration information one by one, the device information is a model of the code scanner 130, the cloud 110 determines target configuration information from the at least one configuration information in the database according to the model of the code scanner 130, and the target configuration information is configuration information with a model associated with the at least one configuration information being the same as the model of the code scanner 130.
Cloud 110 may also determine the configuration information of POS machine 120 from a database containing the configuration information of the associated device in a similar manner.
The database may be generated by a tester through test verification, for example, the tester determines the configuration parameters of the code scanner 130 and the configuration parameters of the POS machine 120 based on the code scanner 130 code scanner rate, the data transmission rate between the code scanner 130 and the POS machine 120, and the processing rate of the POS machine 120, and stores the two configuration parameters and the device information (e.g., the device model) of the code scanner 130 and the POS machine 120 in the database, where the four information corresponds one to form a set of information, and after the cloud 110 receives a request message containing the device information of the code scanner 130 and/or the POS machine 120, the configuration parameters of the code scanner 130 and/or the POS machine 120, that is, the configuration information, may be determined uniquely.
After the cloud 110 determines the configuration information, the following steps may be performed.
S330, sending configuration information, wherein the configuration information is used for configuring the scanning equipment.
The specific process of configuring the scanning device may refer to the related description in the method 200, and will not be described herein.
In the scanning system applying the method 300, the execution device of the method 300 can select appropriate configuration information from the database after acquiring the adaptation request without user intervention, so that the method 300 can enhance the operability of the scanning device and reduce the difficulty of better code scanning effect experienced by the user.
Examples of the method for adapting a scanning device provided by the present application are described in detail above. It will be appreciated that the means adapted to the scanning device comprise, in order to achieve the above-described functions, corresponding hardware structures and/or software modules performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The present application may divide the functional units of the apparatus adapted to the scanning device according to the above-described method example, for example, each function may be divided into each functional unit, or two or more functions may be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that the division of the units in the present application is illustrative, and is merely a logic function division, and other division manners may be implemented in practice.
Fig. 4 is a schematic structural diagram of an apparatus for adapting to a scanning device according to the present application. The apparatus 400 comprises a receiving unit 410, a processing unit 420 and a transmitting unit 430, the processing unit 420 being capable of controlling the transmitting unit 430 to perform the transmitting step, the processing unit 420 being capable of controlling the receiving unit 410 to perform the receiving step.
The processing unit 420 is configured to detect a scanning device and obtain device information of the scanning device;
The processing unit 420 is further configured to determine whether the device information matches with preset information;
the sending unit 430 is configured to send an adaptation request when the device information does not match the preset information, where the adaptation request is used to request configuration of the scanning device;
the receiving unit 410 is configured to receive configuration information;
the processing unit 420 is further configured to configure the scanning device according to the configuration information.
Optionally, the processing unit 420 is further configured to determine not to send the adaptation request when the device information matches preset information.
Optionally, the adaptation request includes device information of the scanning device.
Optionally, the adaptation request further comprises device information of an associated device of the scanning device.
Optionally, the processing unit 420 is specifically configured to send the configuration information to the scanning device through the sending unit.
Optionally, the configuration information comprises at least one of a scanning parameter and a transmission parameter of the scanning device, a receiving parameter and a processing parameter of an associated device of the scanning device.
The specific process of the method for adapting the scanning device by the apparatus 400 and the resulting advantageous effects can be referred to the relevant description in the method embodiment, and will not be described herein.
Fig. 5 is a schematic structural diagram of another apparatus for adapting a scanning device according to the present application. The apparatus 500 comprises a receiving unit 510, a processing unit 520 and a transmitting unit 530, the processing unit 520 being capable of controlling the transmitting unit 530 to perform the transmitting step, the processing unit 520 being capable of controlling the receiving unit 510 to perform the receiving step.
The receiving unit 510 is configured to receive an adaptation request, where the adaptation request is used to request configuration of a scanning device;
the processing unit 520 is configured to determine configuration information corresponding to the device information of the scanning device from at least one configuration information according to the device information of the scanning device;
the transmitting unit 530 is configured to transmit configuration information for configuring the scanning device.
Optionally, the adaptation request further includes device information of an associated device of the scanning device, and the processing unit 520 is further configured to determine, from at least one configuration information, configuration information corresponding to the device information of the associated device according to the device information of the associated device.
Optionally, the configuration information comprises at least one of a scanning parameter and a transmission parameter of the scanning device, a receiving parameter and a processing parameter of an associated device of the scanning device.
The specific process of the method for adapting the scanning device by the apparatus 500 and the resulting advantageous effects can be referred to the relevant description in the method embodiment, and will not be described herein.
Fig. 6 shows a schematic structural diagram of an apparatus for adapting a scanning apparatus according to the present application. The dashed line in fig. 6 indicates that the unit or the module is optional. The apparatus 600 may be used to implement the methods described in the method embodiments above. The device 600 may be a terminal device or a server or a chip.
The device 600 includes one or more processors 601, which one or more processors 601 may support the device 600 to implement the method in the corresponding method embodiments of fig. 2 or 3. The processor 601 may be a general purpose processor or a special purpose processor. For example, the processor 601 may be a CPU. The CPU may be used to control the device 600, execute software programs, and process data for the software programs. The device 600 may also include a communication unit 605 to enable input (reception) and output (transmission) of signals.
For example, the device 600 may be a chip, the communication unit 605 may be input and/or output circuitry of the chip, or the communication unit 605 may be a communication interface of the chip, which may be an integral part of a terminal device or a server or other electronic device.
For another example, the device 600 may be a terminal device or a server, the communication unit 605 may be a transceiver of the terminal device or the server, or the communication unit 605 may be a transceiver circuit of the terminal device or the server.
The device 600 may include one or more memories 602 having a program 604 stored thereon, the program 604 being executable by the processor 601 to generate instructions 603 such that the processor 601 performs the methods described in the method embodiments above according to the instructions 603. Optionally, the memory 602 may also have data stored therein. Alternatively, the processor 601 may also read data stored in the memory 602, which may be stored at the same memory address as the program 604, or which may be stored at a different memory address than the program 604.
The processor 601 and the memory 602 may be provided separately or may be integrated together, for example, on a single board of a server or a System On Chip (SOC) of a terminal device.
The device 600 may also include an antenna 606. The communication unit 605 is used to implement the transceiving function of the device 600 through the antenna 606.
The specific way in which the processor 601 performs the method of processing an adapted scanning device may be found in the relevant description of the method embodiments.
It should be understood that the steps of the above-described method embodiments may be accomplished by logic circuitry in the form of hardware or instructions in the form of software in the processor 601. The processor 601 may be a CPU, digital signal processor (DIGITAL SIGNAL processor), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (field programmable GATE ARRAY, FPGA), or other programmable logic device such as discrete gates, transistor logic, or discrete hardware components.
The application also provides a computer program product which, when executed by the processor 601, implements the method according to any of the method embodiments of the application.
The computer program product may be stored in the memory 602, for example, the program 604, and the program 604 is finally converted into an executable object file capable of being executed by the processor 601 through preprocessing, compiling, assembling, and linking.
The application also provides a computer readable storage medium having stored thereon a computer program which when executed by a computer implements the method according to any of the method embodiments of the application. The computer program may be a high-level language program or an executable object program.
The computer-readable storage medium is, for example, memory 602. The memory 602 may be volatile memory or nonvolatile memory, or the memory 602 may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an erasable programmable ROM (erasable PROM), an electrically erasable programmable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (double DATA RATE SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCHLINK DRAM, SLDRAM), and direct memory bus random access memory (direct rambus RAM, DR RAM).
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working processes and technical effects of the apparatus and device described above may refer to corresponding processes and technical effects in the foregoing method embodiments, which are not described in detail herein.
In the several embodiments provided by the present application, the disclosed systems, devices, and methods may be implemented in other manners. For example, some features of the method embodiments described above may be omitted, or not performed. The above-described apparatus embodiments are merely illustrative, the division of units is merely a logical function division, and there may be additional divisions in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the elements or the coupling between the elements may be direct or indirect, including electrical, mechanical, or other forms of connection.
It should be understood that, in various embodiments of the present application, the size of the sequence number of each process does not mean that the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
In addition, the term "and/or" herein is merely an association relation describing the association object, and means that three kinds of relations may exist, for example, a and/or B, and that three kinds of cases where a exists alone, while a and B exist alone, exist alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
In summary, the foregoing description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.