CN112949326B - Information query method, device, equipment and computer readable medium - Google Patents

Information query method, device, equipment and computer readable medium Download PDF

Info

Publication number
CN112949326B
CN112949326B CN201911171674.7A CN201911171674A CN112949326B CN 112949326 B CN112949326 B CN 112949326B CN 201911171674 A CN201911171674 A CN 201911171674A CN 112949326 B CN112949326 B CN 112949326B
Authority
CN
China
Prior art keywords
information
article
self
client
management server
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.)
Active
Application number
CN201911171674.7A
Other languages
Chinese (zh)
Other versions
CN112949326A (en
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.)
Multipoint Shenzhen Digital Technology Co ltd
Original Assignee
Multipoint Shenzhen Digital 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 Multipoint Shenzhen Digital Technology Co ltd filed Critical Multipoint Shenzhen Digital Technology Co ltd
Priority to CN201911171674.7A priority Critical patent/CN112949326B/en
Publication of CN112949326A publication Critical patent/CN112949326A/en
Application granted granted Critical
Publication of CN112949326B publication Critical patent/CN112949326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06K7/10861Methods 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 sensing of data fields affixed to objects or articles, e.g. coded labels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/123Replacement control using replacement algorithms with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9554Retrieval from the web using information identifiers, e.g. uniform resource locators [URL] by using bar codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Embodiments of the present disclosure disclose information query methods, apparatuses, devices, and computer-readable media for clients. One embodiment of the method comprises the following steps: scanning the bar code of the article; inquiring article information based on the article bar code; inquiring the local cache of the client to determine whether the article information is stored in the local cache; in response to the determination being yes, updating the item information in the local cache and displaying the item information; and in response to the determination of no, inquiring the information of the article in a database server connected in a communication mode according to the article bar code. The embodiment realizes the shortening of the inquiry time of the article information.

Description

Information query method, device, equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, an apparatus, a device, and a computer readable medium for querying information.
Background
With the wide popularization of self-service cashing equipment in retail scenes, business efficiency and user experience are greatly improved. However, in the practical use process, new problems such as the influence of the network on the equipment are also caused. When a user scans the bar code of an article, the user needs to request the information of the article in real time through networking. When the network is unstable, the article information is difficult to obtain in time, which can seriously affect the user experience and limit the payment efficiency.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a client-based information query method, apparatus, device, and computer-readable medium to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an information query method for a client, the method including: scanning the article bar code to obtain article bar code information; inquiring the article information in the local cache of the client based on the article bar code information, and determining whether the article information is stored in the local cache; in response to the determination being yes, displaying item information; and in response to the determination, inquiring the article information in a database server connected in a communication mode according to the article bar code information.
In some embodiments, the above method further comprises, in some embodiments: receiving initial item change information from a communicatively connected management server, wherein the initial item change information is generated by the management server in response to a change operation to the item information; receiving a self-increasing identifier from the management server, wherein the self-increasing identifier is an identifier which is distributed by the management server for the initial article change information and corresponds to the change operation; and updating the article information according to the initial article change information, and storing the self-increasing identification.
In some embodiments, the above method further comprises: managing article change information in the server according to the self-increasing identification request; receiving a latest self-increasing identification of the article change information from the management server; if the latest self-increasing identification is determined to be larger than the self-increasing identification, performing incremental updating operation of the article change information on the local cache; updating the self-increasing identification and generating the latest value of the self-increasing identification.
In some embodiments, the article change information in the management server is requested according to the self-increasing identifier, where the management server sets the absolute value of the latest self-increasing identifier minus the self-increasing identifier to be full-scale update if the absolute value of the latest self-increasing identifier is greater than a preset value;
downloading the latest database backup file from the management server in response to determining to be the full update;
and updating all the article change information through the database backup file.
In some embodiments, the clients belong to a client cluster, one client in the client cluster is a master client, and the other clients are slave clients, where the master client is configured to receive the item change information and the latest self-increment identifier sent by the management server, perform the corresponding incremental update operation on the item change information of the master client according to the latest self-increment identifier, and send the item change information and the latest self-increment identifier to the slave client; and the slave client performs the incremental update operation on the article change information according to the latest self-increment identifier.
In some embodiments, the client supports near field communication NFC technology.
In some embodiments, the local memory in the above method is provided with a secondary cache, and the secondary cache uses the least recently used LRU algorithm to cache the item information data.
In a second aspect, some embodiments of the present disclosure further provide an information query apparatus for a client, the information query apparatus including: a scanning unit configured to scan the item barcode to generate item barcode information; a first query unit configured to query the local cache of the client for the item information according to the item barcode information, and determine whether the item information is stored in the local cache; a display unit configured to display the article information in response to the determination of the first inquiry unit; and the second inquiry unit is configured to respond to the determination of the first inquiry unit, and inquire the article information in a database server connected in a communication mode according to the article bar code information.
In a third aspect, some embodiments of the present disclosure further provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement the method as in any of the first aspects.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as in any of the first aspects.
One of the above embodiments of the present disclosure has the following advantageous effects: the client acquires the article bar code information through scanning the code article bar code. And the client directly inquires the local cache according to the bar code information of the article. And displaying the article information on the client under the condition of finding, and inquiring through the networked server under the condition of not finding. Therefore, the article information inquiry time is shortened, the inquiry flow is optimized, the user experience is improved, and convenience is provided for the life of the user.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of an application scenario of an information query method according to some embodiments of the present disclosure.
Fig. 2 is a flow chart of a method of querying information in accordance with some embodiments of the present disclosure.
Fig. 3 is a flow chart of information query synchronization in accordance with some embodiments of the present disclosure.
Fig. 4 is a flow diagram of further embodiments of information query synchronization according to the present disclosure.
Fig. 5 is a schematic diagram of multiple client cluster synchronization in accordance with some embodiments of the present disclosure.
Fig. 6 is a schematic structural diagram of an information query according to some embodiments of the present disclosure.
Fig. 7 is a schematic diagram of a computer system suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of an information query method according to some embodiments of the present disclosure.
As shown in fig. 1, a user may scan an item barcode on a client 101 through an item scanning area 104 to obtain item barcode information. As an example, where the client 101 may be a self-service cash register. The client 101 first looks up item information (e.g., item quantity, price, etc.) in the local cache based on the item barcode information, and determines whether it is stored in the local cache. If it is determined that the item information is stored in the local cache, the item information is displayed on the display screen 102 of the client 101. If it is determined that the item is not stored in the local cache, the item information is looked up on the database server 103 via the network. After the database server 103 finds the item information, the item information is returned to the client 101 so as to be displayed on the display screen 102 correspondingly. For example, a user scans bar codes of fish packages and clothes through the item scanning area 104, and corresponding information of the quantity and price of fish and clothes is displayed through the display screen 102.
Although the execution subject of the information query method is embodied as a client, the execution subject may be embodied as other hardware or software. When the executing body is hardware, it may be various electronic devices having a display screen and supporting network communication, including but not limited to smartphones, tablets, electronic book readers, laptop and desktop computers, and the like. When the execution subject is software, the execution subject can be installed in the electronic device enumerated above. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of clients, servers in fig. 1 is merely illustrative. There may be any number of clients, servers, as desired for the implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of information query methods according to the present disclosure is shown. The information query method comprises the following steps:
step 201, scan an item barcode.
In some embodiments, as an example, an executing subject of the information query method (e.g., the self-service cash register shown in fig. 1) may perform scanning of the item bar code via an embedded scanner or scanning gun to obtain item bar code information. Wherein, the article bar code can be a two-dimensional code or a bar code.
Step 202, inquiring the local cache of the client based on the article bar code information to determine whether the article information is stored in the local cache.
Wherein, the article bar code information can be an article identification code; by way of example, the query may be in a locally cached data structure table storing item barcode information. And when the article bar code information is consistent with or matched with the article bar code information on the surface and the inner side of the data structure, extracting the article information corresponding to the article bar code information. In alternative implementations of some embodiments, the item information may include, but is not limited to, at least one of: item name, quantity, and price.
In alternative implementations of some embodiments, to reduce the query time for item information, item information may be stored in a local cache of the executing body. That is, the item information may be stored offline. As an example, the local cache may be stored using a lightweight relational database (e.g., SQLite database) that can be embedded in memory.
In alternative implementations of some embodiments, the secondary cache may be further provided in local memory. The secondary cache employs an LRU (Least recently used ) algorithm to cache item information data. In order to prevent memory overflow, the item information cache queue has a fixed size. When the queue is larger than a certain length, if new article information exists, deleting data at the tail of the queue, and storing the new article at the head of the queue. When the inquired article information exists in the queue, if the article information is not at the head of the queue, the article information is moved to the head of the queue, so that quick inquiry is convenient again.
In the query process, based on the item barcode information obtained in step 201, at least one item information of the following may be queried in the local cache. The look-up table is shown below:
article bar code information Article name Quantity of Price of
Article identification code 1 Fish 2 200
Article identification code 2 Clothes with a pair of elastic members 1 300
In response to the determination being yes, item information is presented, step 204.
After the execution body has queried the article information in the local cache, the execution body displays the latest article information on the display screen 102, and the quantity, price and the like of the fish and the clothes are displayed as shown in the table above.
And step 205, in response to determining no, querying the database server in communication connection for the item information according to the item bar code information.
The item identification code is sent to a database server. The item table in the database server is "tb_wres", the identification code of the fish is "0012xxx", and the query SQL script may be: "SELECT wire_code, wire_name, wire_price FROM wire_wire_code= '0012xxx'", i.e. the name of the item is fish, quantity is 2, price is 200, can be obtained FROM the item table "tb_wire" of the database server by means of the identification code "0012 xxx".
With continued reference to fig. 3, a flow 300 of some embodiments of the information query method according to the present disclosure is shown. The information inquiry method further comprises the following steps:
step 301, receiving initial article change information from a management server connected in communication, wherein the initial article change information is generated by the management server according to a change operation of the article information.
Wherein the initial item change is initiated by the management server, a first edit made to the item, such as deleting item data: "DELETE FROM tb_wres write_code= 'xxx'". Newly added article data: "INSERT INTO tb_wres (ware_code, ware_name, ware_price) value ('XXX', 'XXX', 1000)". Modifying the item data: "UPDATE tb_wres SET ware_name= 'XXX', ware_price= 200WHERE ware_code = 'XXX'". For the information of the initial item change, the management server notifies the execution subject through the push system to perform data synchronization change: delete, add, modify.
Step 302, receiving a self-increasing identifier from the management server, wherein the self-increasing identifier is an identifier allocated by the management server to the initial item change information and corresponds to the change operation.
The self-increment identifier can be a self-increment id ranging from 0 to the maximum value, or a time stamp of operation, and each editing record carries the self-increment identifier.
And step 303, updating the article information according to the initial article change information and storing the self-increasing identification.
The execution body receives the initial change information of the article and the self-increasing identification allocated for the first time, and updates the data in the local database according to the article change information so as to keep consistent with the data in the database server, and simultaneously saves the self-increasing identification locally for later use.
With continued reference to fig. 4, a flow 400 of some embodiments of information query methods according to the present disclosure is shown. The information query method further comprises the following steps:
step 401 manages item change information in the server based on the self-increment identification request.
When the client is started, a TCP long connection is established with the management server, then article change information is requested to the management server through the local self-increasing identification, and if no article change exists, the management server does not return change information data.
Step 402, receiving article change information and a latest self-increasing identifier from the management server.
The latest self-increasing identification is that the executive body edits the article by the manager at the management server during the shutdown or standby period, and the self-increasing identification at the management server changes, namely, the executive body changes to the latest self-increasing identification. Meanwhile, the management server can timely inform an execution main body through the pushing system, and the execution main body receives the latest article change information and the latest self-increasing identification aiming at the article change information from the management server.
Step 403, determining that the latest self-increasing identifier is greater than the self-increasing identifier, and performing incremental update operation of the article change information on the local cache.
The execution body firstly judges whether the latest self-increasing identification obtained from the management server side is larger than the self-increasing identification in the local cache, if so, the execution body updates the article information, and if not, the execution body does not update. The incremental update is an update method of updating only changed data. As an example, the number of fish in the database server is changed to 1, the price is changed to 80 yuan, and the number and price of clothes are not changed at all, at this time, the executing body only updates the number of fish to 1, and the price to 80 yuan, so that only data with local variation is processed, and the system processing time is reduced.
Step 404, updating the self-increasing identifier to generate the latest value of the self-increasing identifier.
The self-increment identity of the executing body will change accordingly for this update. The executing body as an example stores the self-increment identifier originally stored in the local cache as 2, updates the self-increment identifier to 3, and stores the latest value 3 into the self-increment identifier of the local cache, namely generates the latest value of the self-increment identifier.
An alternative implementation of some embodiments of the information query method according to the present disclosure further comprises the steps of:
1. and requesting the article change information in the management server according to the self-increasing identification, wherein the management server sets the absolute value of the latest self-increasing identification minus the self-increasing identification to be full-quantity updated if the absolute value is larger than a preset value.
The management server has a maintenance mechanism for the self-increasing identifier, and controls the failure range of the self-increasing identifier, and as an example, the absolute value of the self-increasing identifier of the client subtracted from the latest self-increasing identifier of the management server can be set to be larger than 1000; when the execution body is not started for a long time, the self-increasing identifier carried when the server is requested after the execution body is started is 2, and the self-increasing identifier of the server is 1222, the absolute value of 1222 minus 2 is 1220, which is larger than 1000, and the server judges that the article information of the execution body is too old, and the execution body needs to be updated in full quantity.
2. In response to determining to be a full update, the latest database backup file is downloaded from the management server.
The special instruction can be received from the management server, for example, the latest backup file is automatically downloaded from a specific address of the database, so that the execution main body can perform full-scale update, and the latest data backup file is downloaded from the database server to the designated address after receiving the special instruction.
3. And updating all the article change information through the latest database backup file.
The execution main body clears the local cache, and the latest database backup file is stored locally to execute full-quantity update, so that the full-quantity update is more efficient because of large modification records under the condition, and finally the local cache of the execution main body stores the latest self-increment identification.
With continued reference to fig. 5, fig. 5 is a schematic illustration of multiple client cluster synchronization in accordance with some embodiments of the present disclosure. The method comprises the steps that a master client side is configured to receive article change information and a latest self-increasing identifier sent by a management server, perform corresponding incremental update operation on the article information of the master client side according to the latest self-increasing identifier, and send the article change information and the latest self-increasing identifier to a slave client side; and the slave client performs updating operation on the article change information according to the latest self-increasing identification.
In an actual scene, according to an activity policy of a merchant, information of an article is required to be frequently adjusted, such as price adjustment, a plurality of self-service cashing devices are arranged in a certain store, when the article information in a management server is modified, the management server can inform a pushing system, the pushing system can inform each device of the store, in order to ensure arrival synchronism of the notification, the condition that article information between devices is inconsistent in a data synchronization process is prevented, and the store devices are designed by adopting a clustered architecture. Referring to fig. 5, one self-service cash register is designated as a master device 501, the other devices are slave devices 502-504, when a server side notifies the devices to update data, only the master device 501 in a store is notified, after the master device is updated, the master device performs unified data synchronization on the slave devices 502-504 through a store intranet (local area network, which is high in data transmission reliability relative to a wide area network), and because the data transmission is performed through the store intranet, the data transmission efficiency is high and more timely. The device clusters in the above schematic diagrams are not limited to four devices, and are simplified for convenience of description, so that the number of devices in the actual scene is more.
According to alternative implementations of some embodiments of the present disclosure, the client supports near field communication NFC technology.
The information of the client can be updated offline. Because the article information is synchronously communicated with cloud service by depending on a wide area network, in order to cope with the abnormal condition of wide area network data synchronization, an NFC module is arranged in the self-service cash register, the data in the self-service cash register is manually updated offline in a mode of NFC communication between a mobile phone or other handheld devices and the self-service cash register, when certain article or certain article is required to be modified, editing operation is carried out in the mobile phone or handheld devices, then the NFC module of the mobile phone or handheld terminal close to the self-service cash register is subjected to data synchronization, the updating mode is the same as online updating, the incremental updating mode is also adopted, only the offline modified article information is communicated through NFC, a communication link is established between the mobile phone or other handheld devices through the NFC module, and when the mobile phone or the handheld devices are updated with articles, the updated data is synchronously given to the self-service cash register through the NFC module.
With further reference to fig. 6, fig. 6 is a schematic structural diagram of an information query according to some embodiments of the present disclosure. As an implementation of the method shown in the above figures, the present disclosure provides some embodiments of an information presentation apparatus, which correspond to those method embodiments shown in fig. 2, and which are particularly applicable to various electronic devices.
As shown in fig. 6, the information query apparatus 600 of some embodiments includes: a scanning unit 601 configured to scan an item barcode to generate item barcode information; a first query unit 602 configured to query the local cache of the client based on the item barcode information, and determine whether the item information is stored in the local cache; a display unit 604 configured to display the item information in response to the determination of yes by the determination unit; and a second querying element 605 configured to query the communicatively coupled database server for item information based on the item barcode in response to determining no.
Referring now to FIG. 7, a schematic diagram of an electronic device (e.g., self-service cash register of FIG. 1) 700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is only one example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage means 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: scanning device 706 including cameras, dedicated scanning guns, scanners, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, a memory card; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 700 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 7 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in flowchart 2. In such embodiments, the computer program may be downloaded and installed from a network via communications device 709, or from storage 708, or from ROM 702. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing means 701.
It should be noted that, in some embodiments of the present disclosure, the computer readable medium may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: scanning the bar code of the article to acquire the bar code information of the article; inquiring the article information in the local cache of the client based on the article bar code information, and determining whether the article information is stored in the local cache; in response to the determination being yes, displaying item information;
and in response to the determination, inquiring the article information in a database server connected in a communication mode according to the article bar code information.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (7)

1. An information query method for a client, comprising:
scanning the bar code of the article to acquire the bar code information of the article;
inquiring article information in a local cache of the client based on the article bar code information, and determining whether the article information is stored in the local cache;
in response to determining yes, displaying the item information;
in response to determining no, inquiring the article information in a database server in communication connection according to the article bar code information;
receiving initial item change information from a communicatively connected management server, wherein the initial item change information is generated by the management server in response to a change operation to the item information;
receiving a self-increasing identification from the management server, wherein the self-increasing identification is an identification which is distributed by the management server for the initial article change information and corresponds to the change operation;
updating the article information according to the initial article change information, and storing the self-increasing identification;
requesting article change information in the management server according to the self-increasing identification, wherein the management server determines the update as full update in response to determining that the absolute value of the latest self-increasing identification minus the self-increasing identification is larger than a preset value;
downloading, from the management server, a most up-to-date database backup file in response to determining to be the full update;
updating all article change information according to the database backup file;
the clients belong to a client cluster, one client in the client cluster is a master client, and the other clients are slave clients, wherein the master client is configured to receive the article change information and the latest self-increment identifier sent by the management server, perform corresponding incremental update operation on the article change information of the master client according to the latest self-increment identifier, and send the article change information and the latest self-increment identifier to the slave client; the slave client performs the incremental updating operation on the article change information according to the latest self-increasing identification so as to ensure the arrival synchronism of the article information and prevent the condition of inconsistent article information among devices in the data synchronization process.
2. The method of claim 1, wherein the method further comprises:
requesting the article change information in the management server according to the self-increasing identification;
receiving the item change information and a latest self-increasing identification from the management server;
in response to determining that the latest self-increasing identifier is greater than the self-increasing identifier, performing incremental updating operation on the article change information on the local cache;
updating the self-increasing identification and generating the latest value of the self-increasing identification.
3. The method of claim 1, the client supporting near field communication, NFC, technology.
4. The method of claim 1, wherein the local memory is further provided with a secondary cache that caches the item information data using a least recently used LRU algorithm.
5. An information query apparatus for a client, comprising:
a scanning unit configured to scan the item barcode to generate item barcode information;
the first query unit is configured to query the article information in the local cache of the client according to the article bar code information and determine whether the article information is stored in the local cache;
a display unit configured to display the item information in response to a determination by the first query unit;
the second query unit is configured to respond to the determination of the first query unit, and query the article information in a database server in communication connection according to the article bar code information;
an initial article change information receiving unit configured to receive initial article change information from a management server connected in communication, wherein the initial article change information is generated by the management server according to a change operation to the article information;
a self-increasing identification receiving unit configured to receive a self-increasing identification from the management server, wherein the self-increasing identification is an identification corresponding to the changing operation, which is assigned by the management server for the initial article change information;
a saving unit configured to update the item information according to the initial item change information, and save the self-increasing identification;
a request unit configured to request item change information in the management server according to the self-increasing identification, wherein the management server determines an update as a full-scale update in response to determining that an absolute value of a latest self-increasing identification minus the self-increasing identification is greater than a preset value;
a download unit configured to download the latest database backup file from the management server in response to determining that the full amount of updates;
an updating unit configured to update all item change information according to the database backup file;
the clients belong to a client cluster, one client in the client cluster is a master client, and the other clients are slave clients, wherein the master client is configured to receive the article change information and the latest self-increment identifier sent by the management server, perform corresponding incremental update operation on the article change information of the master client according to the latest self-increment identifier, and send the article change information and the latest self-increment identifier to the slave client; the slave client performs the incremental updating operation on the article change information according to the latest self-increasing identification so as to ensure the arrival synchronism of the article information and prevent the condition of inconsistent article information among devices in the data synchronization process.
6. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
7. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method according to any of claims 1-4.
CN201911171674.7A 2019-11-26 2019-11-26 Information query method, device, equipment and computer readable medium Active CN112949326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911171674.7A CN112949326B (en) 2019-11-26 2019-11-26 Information query method, device, equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911171674.7A CN112949326B (en) 2019-11-26 2019-11-26 Information query method, device, equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN112949326A CN112949326A (en) 2021-06-11
CN112949326B true CN112949326B (en) 2023-05-05

Family

ID=76224814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911171674.7A Active CN112949326B (en) 2019-11-26 2019-11-26 Information query method, device, equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112949326B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113674769A (en) * 2021-08-20 2021-11-19 湖北亿咖通科技有限公司 Voice system test method, device, equipment, medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103379159A (en) * 2012-04-24 2013-10-30 阿里巴巴集团控股有限公司 Distributed web site data synchronization method
CN103389993A (en) * 2012-05-10 2013-11-13 苏州工业园区苏睿软件技术有限公司 Network information obtaining method and system for mobile equipment
CN107819795A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of major-minor server data synchronous method of DNS, apparatus and system
CN108280215A (en) * 2018-02-06 2018-07-13 福建工程学院 A kind of hybrid update method of the electric business index file based on Solr
CN108744504A (en) * 2018-05-17 2018-11-06 网易(杭州)网络有限公司 The processing method and processing device of game data, game server, games system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103167017B (en) * 2013-01-09 2016-06-29 北京奇虎科技有限公司 Web polling method, Apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103379159A (en) * 2012-04-24 2013-10-30 阿里巴巴集团控股有限公司 Distributed web site data synchronization method
CN103389993A (en) * 2012-05-10 2013-11-13 苏州工业园区苏睿软件技术有限公司 Network information obtaining method and system for mobile equipment
CN107819795A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of major-minor server data synchronous method of DNS, apparatus and system
CN108280215A (en) * 2018-02-06 2018-07-13 福建工程学院 A kind of hybrid update method of the electric business index file based on Solr
CN108744504A (en) * 2018-05-17 2018-11-06 网易(杭州)网络有限公司 The processing method and processing device of game data, game server, games system

Also Published As

Publication number Publication date
CN112949326A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN110096660B (en) Method and device for loading page pictures and electronic equipment
CN107438084B (en) Multi-client data synchronization method and device
CN112860451A (en) Multi-tenant data processing method and device based on SaaS
CN111221469B (en) Method, device and system for synchronizing cache data
CN103024052A (en) System and method for achieving browser data synchronization
CN102984278A (en) System and method for realizing browser data synchronization
CN110648216A (en) Wind control method and device
CN114971786A (en) Order information management method, device and system, electronic equipment and storage medium
CN112949326B (en) Information query method, device, equipment and computer readable medium
CN112948498A (en) Method and device for generating global identification of distributed system
CN110798495A (en) Method and server for end-to-end message push in cluster architecture mode
CN113364887A (en) File downloading method based on FTP, proxy server and system
CN113127923A (en) Method and device for managing authority
CN112395337A (en) Data export method and device
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN102739562A (en) Method and device for sending collection information
CN111767495A (en) Method and system for synthesizing webpage
CN115496544A (en) Data processing method and device
CN113760929A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN113138943B (en) Method and device for processing request
CN112688982B (en) User request processing method and device
CN113868687A (en) Task processing progress management method and device
US9749426B2 (en) Method, system, and apparatus for agent-based architecture for integrated mobile applications
CN111090530A (en) Distributed cross-interprocess communication bus system
CN113450170A (en) Information display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant