CN111553990A - Method for storing ticket checking record, ticket checking terminal and system - Google Patents

Method for storing ticket checking record, ticket checking terminal and system Download PDF

Info

Publication number
CN111553990A
CN111553990A CN201910110133.7A CN201910110133A CN111553990A CN 111553990 A CN111553990 A CN 111553990A CN 201910110133 A CN201910110133 A CN 201910110133A CN 111553990 A CN111553990 A CN 111553990A
Authority
CN
China
Prior art keywords
ticket checking
terminal
ticket
record
terminals
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
CN201910110133.7A
Other languages
Chinese (zh)
Inventor
朱晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910110133.7A priority Critical patent/CN111553990A/en
Publication of CN111553990A publication Critical patent/CN111553990A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07BTICKET-ISSUING APPARATUS; FARE-REGISTERING APPARATUS; FRANKING APPARATUS
    • G07B11/00Apparatus for validating or cancelling issued tickets
    • G07B11/11Apparatus for validating or cancelling issued tickets for cancelling tickets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method for storing ticket checking records, a ticket checking terminal and a system, wherein the method comprises the following steps: establishing communication connection with other ticket checking terminals to form a ticket checking group; obtaining ticket checking records generated by ticket checking of the ticket checking group on the admission tickets; and carrying out distributed accounting on the ticket checking record together with the other ticket checking terminals so as to update a local database.

Description

Method for storing ticket checking record, ticket checking terminal and system
Technical Field
The invention relates to the technical field of data processing, in particular to a method for storing a ticket checking record, a ticket checking terminal and a ticket checking system.
Background
When developing the event, for example concert, sports event, etc., in order to guarantee that the spectators can both enter the field by virtue of the ticket, a plurality of ticket checking terminals need to be arranged on the field to check the ticket on the spot at the same time, so as to guarantee that thousands of people can enter the field orderly and quickly. At present, the modes of on-site ticket checking through a plurality of ticket checking terminals comprise public network ticket checking, local area network ticket checking and single machine ticket checking.
The public network ticket checking is that each ticket checking terminal on site is in wireless connection with the cloud server through a public external network, and each ticket checking terminal stores ticket checking records generated by checking admission tickets into the cloud server for centralized storage of the ticket checking records.
The local area network ticket checking is that a local server is configured for a venue, each ticket checking terminal is connected with the local server through the local area network, and each ticket checking terminal stores a ticket checking record generated by checking an admission ticket into the local server, and also performs centralized storage of the ticket checking record.
The single ticket checking is that each ticket checking terminal independently completes the ticket checking operation, and each ticket checking terminal cannot obtain the ticket checking record generated and stored by the ticket checking of other ticket checking terminals, so that the single ticket checking has the problem of multiple admission.
Compared with single ticket checking, although in public network ticket checking and local area network ticket checking, each ticket checking terminal can obtain all ticket checking records through the connection server, the existing public network ticket checking and local area network ticket checking both adopt a centralized single-node storage structure, so that once a cloud server or a local server has a single-point fault, such as being attacked, the situations of ticket checking record loss, unavailable server and the like occur, and the normal operation of on-site ticket checking is seriously influenced, therefore, a new scheme for storing the ticket checking records is very necessary to be provided, so that the response capability of a ticket checking system consisting of a plurality of ticket checking terminals to the single-point fault is improved, and the orderly operation of on-site ticket checking is ensured.
Disclosure of Invention
The invention aims to provide a new technical scheme for storing ticket checking records.
According to a first aspect of the present invention there is provided a method of storing a ticket record comprising:
establishing communication connection with other ticket checking terminals to form a ticket checking group;
obtaining ticket checking records generated by ticket checking of the ticket checking group on the admission tickets;
and carrying out distributed accounting on the ticket checking record together with the other ticket checking terminals so as to update a local database.
Optionally, the step of performing distributed accounting on the ticket checking record together with the other ticket checking terminals includes:
electing a ticket checking terminal in the ticket checking group as an execution terminal, wherein the execution terminal is the ticket checking terminal which has the right to create a corresponding storage block aiming at the ticket checking record;
and carrying out distributed accounting on the storage blocks created by the execution terminal aiming at the ticket checking records together with the other ticket checking terminals.
Optionally, the method further comprises:
under the condition that the ticket checking terminal is the execution terminal, establishing a corresponding storage block aiming at the ticket checking record, and synchronizing the storage block to other ticket checking terminals;
and under the condition that the ticket checking terminal is not the execution terminal, acquiring a storage block corresponding to the ticket checking record and synchronized by the execution terminal.
Optionally, the step of creating a corresponding storage block for the ticket checking record includes:
acquiring the characteristic information of the storage block of the last ticket checking record;
acquiring right information as the execution terminal;
and creating a storage block corresponding to the ticket checking record according to the characteristic information, the right information and the ticket checking record.
Optionally, the step of electing a ticket checking terminal as an execution terminal in the ticket checking group includes:
calculating respective election codes together with the other ticket checking terminals;
and the election terminal which firstly obtains the election code meeting the set condition is used as the execution terminal.
Optionally, the step of calculating the election codes of the respective votes together with the other ticket checking terminals includes:
obtaining respective seed pools, wherein the seed pools of each ticket checking terminal in the ticket checking group are different from each other;
and selecting seeds in the respective seed pools to calculate respective election codes.
Optionally, the step of using the election terminal that first obtains the election code satisfying the set condition as the execution terminal includes:
under the condition that the ticket checking terminal firstly obtains the election code meeting the set condition, determining the ticket checking terminal as an execution terminal, and informing other ticket checking terminals of the election result;
and under the condition that the other ticket checking terminals firstly obtain the election codes meeting the set conditions, stopping continuously calculating the election codes according to the notification of the other ticket checking terminals, and taking the other ticket checking terminals sending the notification as the execution terminals.
Optionally, the step of performing distributed accounting on the ticket checking record together with the other ticket checking terminals to update the local database includes:
and linking the ticket checking record to the last ticket checking record in a local database according to a chain data structure so as to update the local database.
Optionally, the method further comprises:
and responding to the trigger of ticket checking initialization, and executing the operation of initializing the local database.
Optionally, each ticket checking record is stored in a corresponding storage block, and the step of linking the ticket checking record to a previous ticket checking record includes: linking the storage block storing the ticket checking record to a previous storage block storing a previous ticket checking record, wherein the first storage block is linked to the created world block; the step of performing an operation to initialize the local database includes:
detecting whether the founding block has the authority to create the founding block;
under the condition of having the authority, creating and storing the created blocks, and synchronizing the created blocks to other ticket checking terminals;
and under the condition that the authority is not provided, acquiring and storing other ticket checking terminals with the authority to provide the created block.
Optionally, the step of establishing a communication connection with other ticket checking terminals includes:
and establishing short-distance communication connection with other ticket checking terminals.
Optionally, the method further comprises:
responding to a request for inquiring the ticket checking record, and acquiring the ticket checking record from the local database;
and providing the acquired ticket checking record.
Optionally, the method further comprises:
monitoring a set calibration event;
in case of the occurrence of the calibration event, comparing whether the local database is consistent with local databases of other ticket checking terminals;
and calibrating the local database according to the comparison result.
Optionally, the method further comprises:
acquiring the information of the admission ticket;
detecting whether the local database has a ticket checking record corresponding to the information or not according to the information of the admission ticket;
under the condition that the ticket checking record corresponding to the information is available, prompting that the ticket checking is performed;
and in the case of not having a ticket checking record corresponding to the information, checking the admission ticket to generate the ticket checking record.
Optionally, the method further comprises:
providing a setup portal to set up the calibration event;
acquiring a calibration event input through the setting entrance;
updating the set calibration event to the input calibration event.
According to a second aspect of the present invention, there is also provided a ticket checking terminal, comprising: a memory for storing instructions for controlling the processor to operate to perform a method of storing a ticket record according to any one of the first aspects of the invention and a processor.
According to a third aspect of the present invention, there is further provided a ticket checking system, comprising a plurality of ticket checking terminals according to the second aspect of the present invention, wherein a communication connection is established between a plurality of the ticket checking terminals to form a ticket checking group.
According to the method, the ticket checking terminal and the ticket checking system, on one hand, communication connection can be established among the ticket checking terminals to form a ticket checking group, so that the reliability of the communication connection among the ticket checking terminals is improved, and the safety risk of a ticket checking field is reduced. On the other hand, when any ticket checking terminal in the ticket checking group checks the admission ticket to generate a ticket checking record, each ticket checking terminal in the ticket checking group performs distributed accounting on the ticket checking record together to update the respective local database, so that all ticket checking records in the field are stored in the local database of each ticket checking terminal, all ticket checking terminals in the ticket checking group are equal and do not have a central node, and the dependence on a certain specific node is greatly reduced, therefore, the safety of ticket checking record storage can be improved, the capability of a ticket checking system for coping with single-node faults is improved, the reliable on-site ticket checking is ensured, once the ticket checking records are subjected to distributed accounting and the local database is updated, the ticket checking records are permanently stored, and the modification of the local database by a single node is invalid, thereby improving the stability and reliability of keeping the ticket checking record.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic diagram of a configuration of a venue according to an embodiment of the present invention;
FIG. 2a is a schematic block diagram showing a hardware configuration of a ticket checking system that may be used to implement an embodiment of the present invention;
FIG. 2b is a schematic block diagram showing a hardware configuration of a ticket checking system that may be used to implement another embodiment of the present invention;
fig. 3 is a schematic hardware structure diagram of a ticket checking terminal according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram of a method of storing ticket checking records according to an embodiment of the invention;
FIG. 5 is a schematic flow chart diagram of a method of storing ticket checking records according to another embodiment of the present invention;
FIG. 6 is a schematic flow chart diagram of a method of storing ticket checking records according to a third embodiment of the present invention;
FIG. 7 is a flow chart of a method of storing ticket checking records according to one example of the invention;
FIGS. 8 a-8 f are schematic interaction diagrams of a ticket checking terminal according to an embodiment of the invention;
FIG. 9 is a flow chart of a method of storing ticket checking records according to another example of the present invention;
FIGS. 10 and 11 are schematic diagrams of chained data structures in an example in accordance with the invention;
fig. 12 is a schematic diagram of a hardware structure of a ticket checking terminal according to another embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< System embodiment >
Fig. 1, fig. 2a and fig. 2b are schematic configuration diagrams of a ticket checking system 100 according to an embodiment of the present invention.
Referring to fig. 1, when an event is performed, for example, a concert or a sporting event, in order to ensure that the spectators can enter the event by checking tickets, a plurality of ticket checking terminals are installed in a venue to check tickets on the spot at the same time, so as to ensure that thousands of people can enter the event in order and quickly. Here, the ticket checking terminal may be a fixed ticket checking terminal, such as a gate, or a portable mobile ticket checking terminal, such as a PDA, etc., and the plurality of ticket checking terminals configured in the venue shown in fig. 1 may be the same type of ticket checking terminal, such as a fixed ticket checking terminal or a mobile ticket checking terminal, or may include different types of ticket checking terminals, such as a fixed ticket checking terminal and a mobile ticket checking terminal.
Referring to the schematic view of the venue shown in fig. 1, the venue has three entrances, namely a first entrance, a second entrance and a third entrance, through which the spectators can enter before the performance starts, so that the operator needs to configure at least one ticket checking terminal at each entrance, so as to check the tickets provided by the spectators entering the venue through the ticket checking terminal at each entrance, and if the tickets pass, the spectators are allowed to enter the venue for sitting, and if the tickets do not pass, the spectators are prohibited from entering the venue.
Referring to fig. 1, 2a and 2B, for an event, an operator configures four ticket checking terminals 1000 for the venue, which are a ticket checking terminal 1000A, a ticket checking terminal 1000B, a ticket checking terminal 1000C and a ticket checking terminal 1000D, the four ticket checking terminals 1000 establish communication connection with each other to form a ticket checking group, and any ticket checking terminal 1000 in the ticket checking group can obtain a ticket checking record generated by the ticket checking of other ticket checking terminals 1000 through the communication connection with each other, so that each ticket checking terminal 1000 in the ticket checking group can perform distributed accounting on each ticket checking record generated by the ticket checking group through the ticket checking, thereby implementing distributed storage of multiple nodes of all ticket checking records, improving the capability of coping with single node faults, ensuring that the ticket checking on site is performed smoothly and reliably, for example, a part or all of the ticket checking records stored by a certain ticket checking terminal are lost, other ticket checking terminals still store complete ticket checking records, and therefore the dependency on a certain specific node is reduced.
Distributed accounting is realized in various ways in the industry, including but not limited to performing distributed accounting on the ticket checking records according to a chain data structure, so that the ticket checking records are conveniently searched by establishing index association among the ticket checking records, and deletion and tampering of the ticket checking records are effectively prevented. For example, each ticket checking record generated by the ticket checking group through the ticket checking may be combined into a chain data file (chain table) in a sequential connection manner according to a chain data structure, as shown in fig. 11, this may be that each ticket checking record is stored in a block body of a corresponding storage block, and feature information of a previous block is stored in a block header of the corresponding storage block, where the feature information is, for example, a hash value of the previous block, so that the storage blocks storing each ticket checking record may be linked together in a sequential connection manner to form the chain data file, and according to a feature of distributed accounting, each ticket checking terminal 1000 stores one chain data file. In this scenario, since four ticket checking terminals 1000 are located in the same venue, communication connections between the respective ticket checking terminals 1000 can be established based on the local area network 2000 to improve stability of network connection.
Referring to fig. 1, the four ticket checking terminals 1000 are distributed such that a first entrance is provided with a ticket checking terminal 1000A, a second entrance is provided with a ticket checking terminal 1000B, and a third entrance is provided with a ticket checking terminal 1000C and a ticket checking terminal 1000D, for example. In this example, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D may form a ticket checking group in the same local area network, when the ticket checking terminal 1000A checks the admission ticket to generate a ticket checking record, the ticket checking record may be broadcasted in the ticket checking group by the ticket checking terminal 1000A generating the ticket checking record, so that the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D all obtain the ticket checking record, or the ticket checking record may be mutually propagated among the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D, for example, the ticket checking terminal 1000A sends the ticket checking record to the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D until the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D in the ticket checking group all receive the ticket checking record, and the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D collectively perform distributed accounting on the ticket checking record, so that each ticket checking terminal 1000 stores the ticket checking record into a respective local database.
In this embodiment, the number of the ticket checking terminals 1000 of the ticket checking system 100 may be determined according to an actual scene, and is not limited herein.
In another embodiment, referring to fig. 2B, in order to extend the capability of the ticket checking terminal 1000 to store data, the ticket checking system 100 may further include a corresponding data storage center 3000 configured for each ticket checking terminal 1000, which may be, for example, a storage server, such as, for example, a data storage center 3000A configured for the ticket checking terminal 1000A, a data storage center 3000B configured for the ticket checking terminal 1000B, a data storage center 3000C configured for the ticket checking terminal 1000C, and a data storage center 3000D configured for the ticket checking terminal 1000D, so that each ticket checking terminal 1000 may store a local database in its own memory as shown in fig. 2a, or store a local database in a corresponding data storage center as shown in fig. 2B.
The ticket checking terminal 1000 may be any electronic device having a ticket checking function, such as a gate, a scanning gun, a PDA (Personal Digital Assistant), a mobile phone, a tablet computer, a palm computer, a wearable device, and the like, which is not limited herein.
In one embodiment, the ticketing terminal 1000 can be as shown in fig. 3, including a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so forth.
Processor 1100 can be a central processing unit, a portable version of a processor, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 is capable of wired or wireless communication, for example, the communication device 1400 may include a short-range communication device, such as any device that performs short-range wireless communication based on short-range wireless communication protocols, such as the Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, and the like, and the communication device 1400 may also include a long-range communication device, such as any device that performs WLAN, GPRS, 2G/3G/4G/5G long-range communication. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. A user can input/output voice information through the speaker 1700 and the microphone 1800.
Although a plurality of devices of the ticketing terminal 1000 are shown in fig. 3, the present invention can relate to only some of the devices, for example, the ticketing terminal 1000 relates to only the communication device 1400, the memory 1200, and the processor 1100.
In this embodiment, the memory 1200 of the ticketing terminal 1000 is configured to store instructions for controlling the processor 1100 to operate at least to perform a method of storing a ticket record in accordance with any embodiment of the present invention. The skilled person can design the instructions according to the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< method examples >
Fig. 4 is a schematic flowchart of a method for storing a ticket checking record according to an embodiment of the present invention, where the method is implemented by any ticket checking terminal 1000 in the ticket checking system 100, and the method for storing a ticket checking record according to the embodiment may include the following steps:
in step S2100, any ticket checking terminal 1000 establishes a communication connection with other ticket checking terminals 1000 to form a ticket checking group.
According to the step S2100, each ticket checking terminal in the ticket checking system establishes a communication connection with other ticket checking terminals 1000, thereby forming a ticket checking group. For example, referring to fig. 1, the ticket checking terminal 2000A is a main body for executing the method for storing the ticket checking record according to the embodiment, and here, the communication connection among the ticket checking terminal 1000A, the ticket checking terminal 1000B and the ticket checking terminal 1000C may be established through a local area network to form a ticket checking group.
In an example, the local area network may be a wired local area network, that is, a wired communication manner is adopted among the plurality of ticket checking terminals 1000, and the wired communication manner may further improve stability of communication connection of the plurality of ticket checking terminals 1000, thereby improving reliability of the ticket checking system 100.
In an example, the local area network may also be a wireless local area network, and the ticket checking personnel uses the wireless ticket checking terminal 1000, so that the ticket checking operation is more flexible, and when more ticket checking channels need to be opened, the ticket checking personnel can more easily carry the ticket checking terminal 1000 to move. This approach compromises the reliability and flexibility of the ticketing system 100.
In this embodiment, the step S2100 of establishing a communication connection between any ticket checking terminal 1000 and another ticket checking terminal 1000 may further include: any ticket checking terminal 1000 establishes short-distance communication connection with other ticket checking terminals 1000.
For example, the short-distance communication connection between the ticket-checking terminal 1000 and other ticket-checking terminals 1000 can be established based on short-distance wireless communication protocols such as a Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, and the like.
In this example, by establishing short-distance communication connection between any ticket checking terminal 1000 and other ticket checking terminals 1000, the ticket checking operation can be more flexible, and meanwhile, the reliability and stability of communication connection are improved.
In step S2200, any ticket checking terminal 1000 obtains a ticket checking record generated by checking tickets for the admission tickets by the ticket checking group.
The admission ticket at least comprises information such as ticket number, name, field time, opening time, seat number and the like, and the ticket number is used for distinguishing different admission tickets.
In the present embodiment, any ticket checking terminal 1000 in the ticket checking group generates a ticket checking record after checking the admission ticket, that is, the ticket checking record is a record generated by checking the admission ticket.
In one example, the ticket record may include information about the ticket, such as ticket number, name, time of day, time of departure, seat number, etc.
In one example, the ticket checking record may further include a ticket checking time and a unique identifier of the ticket checking terminal 1000, the unique identifier is used to indicate the ticket checking terminal 1000 performing the ticket checking operation on the admission ticket, and the unique identifier may be a serial number of the ticket checking terminal 1000. The ticket checking record may also include other records generated by checking the admission ticket, which is not limited herein.
In one example, the ticket checking record may be broadcast by the ticket checking terminal 1000 that generated the ticket checking record within the ticket checking group, so that other ticket checking terminals 1000 within the ticket checking group receive the ticket checking record.
Referring to fig. 1, still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record in the embodiment, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D form a ticket checking group, when the ticket checking terminal 1000A checks the admission ticket to generate the ticket checking record, the ticket checking terminal 1000A generating the ticket checking record broadcasts the ticket checking record in the ticket checking group, so that the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D receive the ticket checking record.
In an example, the ticket checking terminal 1000 that generates the ticket checking record may send the ticket checking record to any other ticket checking terminal 1000 in the ticket checking group, and the other ticket checking terminals 1000 that receive the ticket checking record send the ticket checking record to any other ticket checking terminal 1000 in the ticket checking group that does not receive the ticket checking record, that is, the ticket checking records may be mutually propagated among the ticket checking terminals 1000 in the ticket checking group, so that each ticket checking terminal 1000 in the ticket checking group obtains the ticket checking record.
Referring to fig. 1, still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record in the embodiment, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D form a ticket checking group, when the ticket checking terminal 1000A checks the admission ticket to generate a ticket checking record, the ticket checking record generated by itself is sent to the ticket checking terminal 1000B in the ticket checking group, the ticket checking terminal 1000B sends the ticket checking record to the ticket checking terminal 1000C, and the ticket checking terminal 1000C sends the ticket checking record to the ticket checking terminal 1000D, so that each ticket checking terminal 1000 in the ticket checking group obtains the ticket checking record.
In step S2300, any ticket checking terminal 1000 and other ticket checking terminals 1000 perform distributed accounting on the ticket checking record together to update the local database.
The distributed accounting technology is a database distributed on a plurality of nodes, each node copies and stores an account book, and each node can independently update, and is characterized in that the account book is not maintained by any central node, the update of the account book is independently constructed and recorded by each node, and each ticket checking terminal 1000 in a ticket checking group can be used as a node in the ticket checking group.
In one embodiment, the distributed accounting of the ticket checking records by the ticket checking terminal 1000 and the other ticket checking terminals 1000 in the step S2300 may further include the following steps S2310 to S2320:
in step S2310, a ticket checking terminal 1000 is elected as an execution terminal in the ticket checking group.
The execution terminal is a ticket checking terminal which has a right to create a corresponding storage block for the ticket checking record, and here, the execution terminal creates the corresponding storage block for the ticket checking record, which can be understood as that the execution terminal stores the ticket checking record in the form of the storage block into a local database of the execution terminal so as to update the local database of the execution terminal.
The execution terminal for creating the corresponding storage block for the ticket checking record may be any one ticket checking terminal 1000 in the ticket checking group, or may be any two ticket checking terminals 1000 in the ticket checking group, or even more, and is not limited herein. When the execution terminal is more than two ticket checking terminals 1000 in the ticket checking group, that is, when more than two ticket checking terminals 1000 exist in the same timestamp and create corresponding storage blocks for the ticket checking records, processing may be performed according to a hard forking technique and a soft forking technique in the prior art, which is not described in detail herein.
Step S2320, performing distributed accounting on the storage blocks created by the execution terminal for the ticket checking record together with other ticket checking terminals 1000.
In this embodiment, any ticket checking terminal 1000 and other ticket checking terminals 1000 perform distributed accounting on the storage block created by the execution terminal for the ticket checking record together, that is, each ticket checking terminal 1000 can store the storage block created for the ticket checking record, thereby implementing distributed management of the ticket checking record.
In an example, when the ticket checking terminal 1000 is an executing terminal, the ticket checking terminal 1000 creates a corresponding storage block for the ticket checking record, and synchronizes the storage block to other ticket checking terminals 1000, so that the other ticket checking terminals 1000 store the storage block to local databases of the other ticket checking terminals 1000 to update the local databases of the other ticket checking terminals 1000, that is, the local database of each ticket checking terminal 1000 stores the ticket checking record, thereby realizing that the ticket checking terminal 1000 and the other ticket checking terminals 1000 jointly make a distributed accounting for the storage block created by the ticket checking terminal 1000 for the ticket checking record.
In one example, in the case that the ticket checking terminal 1000 is not an executing terminal, a storage block corresponding to a ticket checking record of the executing terminal synchronization is acquired to update the local database.
Referring to fig. 1, still taking the ticket checking terminal 1000A as a main body for executing the method for storing the ticket checking record in the embodiment, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D form a ticket checking group as an example, when the ticket checking terminal 1000A is not an executing terminal and the ticket checking terminal 1000B is an executing terminal, the ticket checking terminal 1000B creates a corresponding storage block for the ticket checking record, and the ticket checking terminal 1000A, the ticket checking terminal 1000C and the ticket checking terminal 1000D acquire the storage block for the ticket checking record synchronized by the ticket checking terminal 1000B, so that the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D update the local database.
According to the method of the embodiment, on one hand, the communication connection can be established among the plurality of ticket checking terminals to form the ticket checking group, so that the reliability of the communication connection among the plurality of ticket checking terminals is improved, and the safety risk of a ticket checking field is reduced. On the other hand, when any ticket checking terminal in the ticket checking group checks the admission ticket to generate a ticket checking record, each ticket checking terminal in the ticket checking group performs distributed accounting on the ticket checking record together to update the respective local database, so that all the ticket checking records on the spot are stored in the local database of each ticket checking terminal, the dependence on a certain specific node is greatly reduced, the safety of storing the ticket checking record can be improved, the response capability of the ticket checking system to a single-point fault is improved, and the reliable on-site ticket checking is guaranteed.
For the distributed accounting, various modes are realized in the industry, and through investigation, the inventor selects a mode for performing distributed accounting on the ticket checking record according to a chain data structure. The method has the advantages of conveniently searching the ticket checking record and effectively preventing the ticket checking record from being deleted and tampered. Therefore, in one embodiment, the step S2300 of distributively accounting the ticket checking records by one ticket checking terminal 1000 and the other ticket checking terminals 1000 together to update the local database may further include: any ticket checking terminal 1000 links the ticket checking record to the previous ticket checking record in the local database according to the chain data structure, so as to update the local database.
In this embodiment, for each ticket checking terminal 1000, since all the ticket checking records stored in the local database are stored according to a chain data structure, that is, the latter ticket checking record is linked to the former ticket checking record to obtain a chain data file, after a new ticket checking record is obtained, each ticket checking terminal 1000 in the ticket checking group can link the new ticket checking record to the former ticket checking record in the respective local database to update the respective local database.
According to the embodiment of the invention, after each ticket checking terminal 1000 in the ticket checking group obtains a new ticket checking record, the new ticket checking record can be linked to the previous ticket checking record in the respective local database according to the chain-shaped data structure to update the respective local database, and here, since the new ticket checking record is linked to the previous ticket checking record, the efficiency of inquiring the ticket checking record can be improved, and the possibility that a cattle enters the field with people by destroying the ticket checking record stored in the ticket checking terminal is reduced.
In the implementation that each ticket checking record generated by the ticket checking group through the ticket checking is linked in a sequential connection mode according to a chain data structure to form a chain data file, it is possible to save each ticket proof record in the corresponding memory block and link the corresponding memory block to the previous memory block, see figure 11, this may save ticket checking record 1 in the block of the corresponding memory block1, and ticket checking record 2 in the block of the corresponding memory block2, and saves the characteristic information of memory block1 in the block header of memory block2, the characteristic information includes, but is not limited to, hash values of block1, so that block2 can be linked to block1, and so on, so that the blocks storing each ticket checking record can be linked together in a sequential connection manner to form a chain data file.
As described in step S2310, in an embodiment, each storage block may be created by an execution terminal listed in a ticket group, in this embodiment, each time a new ticket record is generated by the ticket group via the ticket group, all the ticket checking terminals in the ticket group together list the execution terminal, so as to create a storage block corresponding to the new ticket record by the listed execution terminal, wherein all the ticket checking terminals in the ticket group may participate in the election based on a preset same algorithm. Therefore, in one embodiment, the election of a ticket terminal 1000 as an executing terminal in the ticket group in the above step S2310 may further include the following steps S2311 to S2312:
in step S2311, any ticket checking terminal 1000 and other ticket checking terminals 1000 calculate their own election codes together.
According to the step S2311, all the ticket checking terminals 1000 in the ticket checking group calculate their own election codes based on the same algorithm, and the ticket checking terminal 1000 that first obtains the election code satisfying the set condition for election is used as the executing terminal.
In this embodiment, the step of calculating the election codes of the ticket checking terminal 1000 and the other ticket checking terminals 1000 in step S2311 may further include the following steps S2311-1 to S2311-2:
step S2311-1, the ticket checking terminal 1000 obtains respective seed pools.
The seed pools of each ticket checking terminal 1000 in the ticket checking group are different from each other, and the seeds included in the seed pool of the same ticket checking terminal 1000 are also different from each other.
In one example, an initial value and a step size can be set for the ticket proof groups, so that the seed pool of each ticket proof terminal 1000 can be determined according to the initial value and the step size.
For example, the step size may be a preset fixed value, and all the ticket checking terminals 1000 in the ticket checking group determine their own seed pool based on the fixed value. For example, the initial value is 1, the step size is 9999, and the seeds included in the seed pool of the ticketing terminal 1000A may be: 1-10000, the seeds included in the seed pool of the ticket terminal 1000B are: 10001-: for each natural number in 20001-30000, the seeds included in the seed pool of the ticket verification terminal 1000D are: 30001-.
For another example, a corresponding step size may be set for each ticket checking terminal 1000 in the ticket checking group, and the step sizes corresponding to different ticket checking terminals 1000 may be the same or different.
In an example, a random function generator may be used to randomly generate a corresponding seed pool for each ticket checking terminal 1000 in the ticket checking group, and any one seed in the seed pool of each ticket checking terminal 1000 may be any combination of letters and numbers, as long as it is ensured that the randomly generated seed pools of each ticket checking terminal 1000 are different from each other and the seeds included in the seed pools of the same ticket checking terminal 1000 are different from each other.
Step S2311-2, the ticket checking terminal 1000 selects seeds from the respective seed pools and calculates respective election codes.
In one example, the ticketing terminals 1000 in the ticketing group can simultaneously pick seeds from respective seed pools and calculate respective election codes.
In one example, the ticket checking terminal 1000 in the ticket checking group may also select a seed from its seed pool to calculate its own election code immediately after obtaining the ticket checking record.
The seeds included in the seed pool of the ticket checking terminal 1000A determined in the step S2311-1 are: 1-10000, for example, when a notification sent by the ticket checking terminal 1000B, the ticket checking terminal 1000C, or the ticket checking terminal 1000D is not received, or the election code satisfying the set condition is not calculated by the ticket checking terminal 1000A, each natural number in 1-10000 is sequentially selected by the ticket checking terminal 1000A to calculate the election code corresponding to each natural number until the election code satisfying the set condition is calculated by the ticket checking terminal 1000A, or the notification sent by the ticket checking terminal 1000B, the ticket checking terminal 1000C, or the ticket checking terminal 1000D is received, and the calculation is stopped.
According to the above examples of steps S2311-1 to S2311-2, a seed pool corresponding to each ticket checking terminal 1000 in the ticket checking group is set, the seed pools of each ticket checking terminal 1000 in the ticket checking group are different from each other, and each ticket checking terminal 1000 selects a seed from the respective seed pool to calculate a respective election code, so that different ticket checking terminals 1000 can be prevented from calculating their own election codes by using the same seed, and the speed of the election execution terminal can be increased.
In step S2312, the ticket checking terminal 1000 elects the ticket checking terminal 1000 that first obtains the election code satisfying the set condition, as an execution terminal.
In this embodiment, since the executing terminal is the ticket checking terminal 1000 which has the right to create the corresponding storage block for the ticket checking record, after the executing terminal is elected, the executing terminal can create the corresponding storage block for the ticket checking record, so that all the ticket checking terminals 1000 in the ticket checking group perform distributed accounting on the storage block together.
The election code satisfying the set condition may be an election code whose set digit satisfies a set rule. For example, the first n bits may be the same number, for example, the first 2 bits of the election code may be all 1, the first 3 bits of the election code may be all 0, the first 5 bits of the election code may be all 0, and the like, which is not limited herein.
In this embodiment, the step of electing the ticket checking terminal 1000 that first obtains the election code satisfying the setting condition in step S2312 may further include the following steps S2312-1 to S2312-2 as an execution terminal:
in step S2312-1, when any ticket checking terminal 1000 first obtains the election code satisfying the set condition, it determines itself as the executing terminal, and notifies other ticket checking terminals 1000 of the election result.
Still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record of the present invention, and taking the other ticket checking terminals 1000 in the ticket checking group as the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D respectively as examples, when the ticket checking terminal 1000A first obtains the election code satisfying the set condition, the ticket checking terminal 1000A determines itself as the executing terminal and notifies the election result to the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D.
In step S2312-2, when other ticket checking terminals 1000 obtain the election code satisfying the set condition first, any ticket checking terminal 1000 stops calculating the election code according to the notification of other ticket checking terminals 1000, and uses other ticket checking terminals 1000 as executing terminals.
Still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record of the present invention, and taking the other ticket checking terminals 1000 in the ticket checking group as the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D as examples, when the ticket checking terminal 1000B first obtains the election code satisfying the set condition, a notification of stopping calculating the election code is sent to the ticket checking terminal 1000A, the ticket checking terminal 1000C and the ticket checking terminal 1000D, here, the ticket checking terminal 1000A stops continuously calculating the election code according to the notification sent by the ticket checking terminal 1000B, and the ticket checking terminal 1000B is determined as the executing terminal.
According to the embodiment of the invention, a competition scheme is defined, all the ticket checking terminals 1000 in the ticket checking group can be used for participating in competition calculation in order to become execution terminals for creating corresponding storage blocks aiming at the ticket checking records, namely, all the ticket checking terminals 1000 in the ticket checking group jointly calculate respective election codes, and the ticket checking terminal 1000 which firstly obtains the election codes meeting set conditions is elected to serve as the execution terminal, so that the efficiency and the accuracy of the election execution terminal can be improved, and the efficiency for creating the corresponding storage blocks aiming at the ticket checking records is further improved.
In one embodiment, besides the above participation of the seed, the algorithm for participating in the election may be configured to participate in the right information (i.e. proof of operation) of the executing terminal that needs to create the previous block, so as to enhance the verification of the identity of the ticket checking terminal, and to more effectively avoid the illegal terminal participating in the election. In this embodiment, in addition to saving the feature information of the previous block in the block header of each memory block to realize linking, the right information for creating the memory block can be saved in the block header of each memory block for all the ticket checking terminals in the ticket checking group to use for the execution terminal that created the next memory block based on the algorithm election. In this way, in order that all ticket checking terminals of the ticket checking group can elect an execution terminal for creating the storage block1 based on the algorithm after generating the ticket checking record 1, still referring to fig. 11, a created block0 may be created in an initialization stage of performing ticket checking, wherein the created block0 does not have a ticket checking record, but stores initially set right information for creating the created block0, wherein the initially set right information may be a preset fixed value or a random number.
In addition, still referring to fig. 11, when memory block1 is created by an elected executing terminal, the executing terminal will save in the block header of memory block1 the characteristic information of created block0 to link memory block1 to created block0 so that created block0 becomes the starting block of the chain data file.
Creating the foundational block0 may be performed during the initialization of the local database, and therefore, in an embodiment, the method of storing a ticket checking record of the present invention may further include: any ticket checking terminal 1000 executes an operation of initializing the local database in response to a trigger for performing ticket checking initialization.
In this embodiment, the step of initializing the local database may further include the following steps S3100 to S3300:
in step S3100, any of the ticketing terminals 1000 detects whether or not it has the authority to create a foundational block forming a chain data structure.
In this embodiment, the step of detecting whether the created block has the authority to create is set, which is beneficial to flexibly configuring which ticket checking terminal creates the created block in all ticket checking terminals of the ticket checking group through assigning the authority. For example, if the authority of any ticket verifying terminal 1000 is assigned to "1", it indicates that the ticket verifying terminal 1000 has the authority to create the created block, and if the authority is assigned to "0", it indicates that the ticket verifying terminal 1000 does not have the authority to initialize the created block.
For example, the authority may be assigned through an input device such as a button of the ticket checking terminal.
In other embodiments, creation of a created block by a specific ticketing terminal 1000 in a ticketing group can be directly specified, and is not limited herein.
In step S3200, when any ticket checking terminal 1000 has the authority, the created block is created and saved, and the created block is synchronized to other ticket checking terminals 1000.
A created block is the block that was created earliest in forming the chained data structure.
Still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record of the present invention, and taking the other ticket checking terminals 1000 in the ticket checking group as the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D as examples, when it is detected according to the above step S3100 that the ticket checking terminal 1000A in the ticket checking group has the authority to create the created block, the ticket checking terminal 1000A may create and store the created block of the block chain according to the step S3200, and at the same time, the created block is synchronized to the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D.
In step S3300, when any ticket checking terminal 1000 does not have the right, the created blocks provided by other ticket checking terminals 1000 with the right are acquired and saved.
Still taking the ticket checking terminal 1000A as the main body for executing the method for storing the ticket checking record of the present invention, and taking the other ticket checking terminals 1000 in the ticket checking group as the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D as examples, when it is detected according to the above step S3100 that the ticket checking terminal 1000A in the ticket checking group does not have the authority to create the created block, and the ticket checking terminal 1000B in the ticket checking group has the authority to create the created block, the ticket checking terminal 1000A can obtain and store the created block provided by the ticket checking terminal 1000B according to the step S3300.
According to the embodiment of the invention, any ticket checking terminal 1000 can detect whether the ticket checking terminal has the authority to create the created block, create and store the created block of the block chain under the condition that the ticket checking terminal has the authority, and can store the created blocks provided by other ticket checking terminals 1000 with the authority under the condition that the ticket checking terminal does not have the authority, without creating the created block by the ticket checking terminal, so that the ticket checking terminals 1000 keep consistency during initialization operation, and whether the corresponding ticket checking terminal has the authority or not can be determined through assignment of the authority, and the flexibility of the ticket checking group for the initialization operation is improved.
In an embodiment, the step of creating a corresponding storage block for the ticket checking record may further include the following steps S2321 to S2323:
in step S2321, any ticket checking terminal 1000 obtains the feature information of the storage block of the previous ticket checking record.
Referring to fig. 10 and 11, the block format of the storage block may include a block header and a block body, where the block header includes header information of the block, and the header information includes at least a hash value of a previous storage block, a hash value of the current storage block, and a time stamp for creating the current storage block. The block body bears the stored ticket checking record. Here, the storage block has at least a block header, and may or may not have a block body according to the function of the storage block, for example, the created block does not have a block body.
The characteristic information of the storage block of the last ticket checking record can be at least the hash value of the storage block of the last ticket checking record, and the characteristic information of the storage block of the last ticket checking record can be stored in the block header.
In step S2322, any ticket checking terminal 1000 acquires right information as an execution terminal.
The right information of the execution terminal is used to indicate that the ticket checking terminal 1000 as the execution terminal is authorized to create the corresponding storage block for the ticket checking record, and the right information of the execution terminal may be, for example, an election code that satisfies the setting condition and is obtained by the execution terminal, or may be a seed of the election code obtained by calculation, where the right information may also be referred to as a working certificate.
In step S2323, any ticket checking terminal 1000 creates a corresponding storage block according to the feature information, the right information, and the ticket checking record.
In step S2323, referring to fig. 10, the ticket checking terminal 1000 may store the characteristic information and the right information in the block header, and store the ticket checking record in the block body to create a storage block corresponding to the ticket checking record.
In this embodiment, after obtaining the ticket checking record according to the step S2200, obtaining the feature information of the storage block of the previous ticket checking record according to the step S2321, and obtaining the right information of the execution terminal according to the step S2322, the hash processing may be performed on the ticket checking record, the feature information of the storage block of the previous ticket checking record, and the right information of the execution terminal, so as to obtain the hash value corresponding to the ticket checking terminal 1000, so as to create the corresponding storage block.
In this embodiment, the encrypted hash function may be used to perform hash processing on the ticket checking record, the feature information of the storage block of the previous ticket checking record, and the right information of the execution terminal, so as to obtain a hash value corresponding to the ticket checking terminal 1000.
The cryptographic hash function may be any function capable of performing a hash process, such as, but not limited to, the SHA256 algorithm, the MD5 message digest algorithm, the PBKDF2 algorithm, and the like.
According to the embodiment of the invention, the unique storage block aiming at the ticket checking record can be created through the characteristic information of the last ticket checking record, the right information of the execution terminal and the ticket checking record, so that on one hand, the accuracy and the efficiency of creating the storage block can be improved, and on the other hand, as the characteristic information of the last storage block is stored in the created storage block, the newly created storage block can be stored in the local database of the ticket checking terminal 1000 according to the characteristic information, so that the local database can be updated and searched quickly, and the possibility that the local database is attacked is reduced.
In one embodiment, as shown in fig. 5, the method for storing a ticket checking record of the present invention may further include the following steps S4100 to S4300:
in step S4100, any ticket checking terminal 1000 monitors a set calibration event.
In this embodiment, a ticket terminal 1000 may set at least one calibration event, and the at least one calibration event may include: the current calibration time is up; starting a restarting operation; and after the communication connection with other ticket checking terminals 1000 is disconnected, the ticket checking terminal 1000 restores any one or more of the communication connections.
In one example, for a calibration event when the current calibration time is up, the length of the calibration time window may be set to determine the current calibration time in conjunction with the previous calibration time.
For example, the length of the calibration time window may be a preset fixed value, which in this example may be set for all ticketing terminals 1000 in a ticketing group.
This fixed numerical value can be set for according to the number of the terminal 1000 of checking the ticket in the group of checking the ticket, and the more the number of the terminal 1000 of checking the ticket, the length of the calibration time window can be bigger, and the less the number of the terminal 1000 of checking the ticket, the smaller the length of the calibration time window can be.
For example, the length of the calibration time window may be set for each ticket checking terminal 1000 in the ticket checking group, and the lengths of the calibration time windows may be the same or different for different ticket checking terminals 1000.
In step S4200, the ticketing terminal 1000 compares whether the local database is consistent with the local databases of other ticketing terminals 1000 when a calibration event occurs.
In this embodiment, upon the occurrence of any calibration event, a ticket terminal 1000 can compare the local database with the local databases of other ticket terminals 1000 for consistency in response to the calibration event.
Still take the ticket checking terminal 1000A as the main body for executing the method for storing data in this embodiment, and the other ticket checking terminals 1000 in the ticket checking group are the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D, respectively, as an example.
For example, if the calibration time window is Y and the previous calibration time is X, the next calibration time is calculated to be X + Y, and when the calibration time X + Y arrives, the ticket checking terminal 1000A compares whether the local database is consistent with the local databases of the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D.
For another example, after the ticket checking terminal 1000A reboots after performing the restart operation, it is compared whether the local databases are consistent with the local databases of the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D.
For example, the ticket checking terminal 1000A compares whether the local database is consistent with the local databases of the ticket checking terminals 1000B, 1000C and 1000D after resuming the communication connection with other ticket checking terminals 1000.
Step S4300, the ticket checking terminal 1000 calibrates the local database according to the comparison result.
In this embodiment, a ticket checking terminal 1000 can calibrate the local database according to the comparison result so as to keep consistent with the local databases of other ticket checking terminals 1000.
According to the embodiment of the invention, when the set calibration event is triggered, whether the local database stored in the ticket checking terminal 1000 is consistent with the local databases of other ticket checking terminals 1000 is compared, and the local database of the ticket checking terminal 1000 is calibrated under the condition of inconsistency, so that the consistency between the local database of the ticket checking terminal 1000 and the local databases of other ticket checking terminals 1000 is ensured, the security of ticket checking record storage is improved, the ticket checking can be continuously performed through the embodiment after partial data loss or all data loss caused by an attack of any ticket checking terminal, and the capability of each ticket checking terminal for resisting the attack is effectively improved.
In one embodiment, the method for storing a ticket checking record of the present invention may further include the following steps S5100 to S5300:
in step S5100, any ticket checking terminal 1000 provides a setting entry for setting a calibration event.
The setup entry may be an input box, a drop down list, a voice input, etc., for example, the operator may enter "calibrate time window 5 minutes" through the input box; as another example, the operator may select "calibrate time window 5 minutes" via a drop down list; as another example, the operator may enter "calibrate time window 5 minutes" by voice.
In step S5200, the ticket checking terminal 1000 acquires a calibration event input through a setting entry.
For example, the input calibration event may be "the length of the calibration time window is 5 minutes".
In step S5300, the ticketing terminal 1000 updates the set calibration event to the input calibration event.
In this embodiment, if the currently set calibration event is "the length of the calibration time window is 3 minutes", the ticket checking terminal 1000 may update "the length of the calibration time window is 3 minutes" to "the length of the calibration time window is 5 minutes".
According to the embodiment of the invention, a man-machine interaction interface can be provided to support an operator to set a required calibration event according to the current actual requirement, so as to realize customized design.
In one embodiment, the method for storing a ticket checking record of the present invention may further include the following steps S6100 to S6200:
in step S6100, any ticket checking terminal 1000 obtains a ticket checking record from the local database in response to the request for querying the ticket checking record.
In this embodiment, for example, the ticket checking person may perform an inquiry operation on the ticket checking record in any ticket checking terminal 1000, and the ticket checking terminal 1000 obtains the ticket checking record from the local database in response to an inquiry request on the ticket checking record performed by the ticket checking person. The operation of inquiring the ticket checking record performed by the ticket checking person may be, for example, that the ticket checking person performs an input operation on an operation interface of the ticket checking terminal 1000 to input the ticket checking record to be inquired.
In step S6200, the ticket checking terminal 1000 provides the acquired ticket checking record.
In one example, the acquired ticket checking record may be displayed in a display interface of a ticket checking terminal 1000.
For example, after receiving the query request implemented by the ticket checking personnel, all information of the ticket checking record can be directly displayed in the whole display interface of the ticket checking terminal 1000.
For another example, after receiving an inquiry request implemented by a ticket checker, the acquired ticket checking record may be displayed in a message notification box of the ticket checking terminal 1000 in a message notification manner, and the message notification box may display only the first line of information of the inquired ticket checking record, so that after clicking the first line of information, all information of the ticket checking record is displayed in a skipping manner; or all information of the ticket checking record can be directly displayed.
In an example, the obtained ticket checking record may be played through voice broadcasting, and a specific providing manner of the ticket checking record is not limited herein.
According to the embodiment of the invention, when a request of a ticket checker for inquiring the ticket checking record is received, the ticket checking record can be directly acquired from the local database, so that the efficiency of inquiring the ticket checking record can be improved.
In one embodiment, as shown in fig. 6, the method for storing a ticket checking record of the present invention may further include the following steps S7100 to S7400:
in step S7100, any ticket checking terminal 1000 acquires information of the admission ticket.
The information of the admission ticket at least comprises information of a ticket number, a name, a field time, a starting time, a seat number and the like, and the ticket number is used for distinguishing different admission tickets.
In this embodiment, the ticket checking terminal 1000 is a ticket checking terminal 1000 for checking tickets of an entrance and generating a ticket checking record.
Step S7200, the ticket checking terminal 1000 detects whether the local database has a ticket checking record corresponding to the information according to the information of the admission ticket.
In this embodiment, if the ticket checking terminal 1000 checks the admission ticket, a ticket checking record is generated, and since the ticket number corresponding to the admission ticket is also stored in the ticket checking record, it can be detected whether the local database has the ticket checking record of the ticket number at least according to the ticket number of the admission ticket.
In step S7300, the ticket checking terminal 1000 prompts that the ticket checking has been performed when the ticket checking record of the corresponding information is present.
In this embodiment, if a ticket checking terminal 1000 has a ticket checking record corresponding to the ticket number, a prompt that a ticket check has been performed may be made.
In this embodiment, any prompt manner may be adopted to prompt that a ticket is checked, for example, a voice broadcast manner may be adopted, or "checked ticket" may be directly displayed in a display interface of the ticket checking terminal 1000, as long as the checked ticket and the unchecked ticket can be distinguished according to an appointment, which is not limited herein.
In step S7400, the ticket checking terminal 1000 checks the admission ticket without the ticket checking record of the corresponding information to generate a ticket checking record.
In this embodiment, if one ticket checking terminal 1000 does not have a ticket checking record corresponding to the ticket number of the admission ticket, the admission ticket may be checked to generate a ticket checking record, and distributed accounting may be performed on the ticket checking record together with other ticket checking terminals 1000 in step S2300 to update the operation of the local database.
According to the embodiment of the invention, whether the local database has the ticket checking record corresponding to the information can be detected according to the information of the admission ticket, and the prompt of checking the ticket is given under the condition of having the ticket checking record corresponding to the information, so that the problem that a single ticket checking can be admitted for multiple times is solved.
< example 1>
Fig. 7 is a schematic flow chart of an interaction process between a ticket validating terminal 1000A, a ticket validating terminal 1000B, a ticket validating terminal 1000C, and a ticket validating terminal 1000D according to an example of the present invention. In this example, each ticket checking terminal performs distributed accounting on the ticket checking record based on the network architecture of the block chain.
According to fig. 1, fig. 7, fig. 8a to fig. 8f and fig. 10, in this example, the interaction process between the ticket checking terminals may include the following steps:
step S8110, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D establish communication connection based on the local area network to form a ticket checking group.
Referring to fig. 8a, the ticket checking group at least includes a ticket checking terminal 1000A, a ticket checking terminal 1000B, a ticket checking terminal 1000C and a ticket checking terminal 1000D, and the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D can access each other.
In this step S8110, the communication connection may be, for example, a bluetooth connection.
Any ticket checking terminal 1000 can join the ticket checking group by installing an application implementing the method of the present example and joining the local area network, so that each ticket checking terminal 1000 joining the ticket checking group can perform distributed accounting on the ticket checking records generated by ticket checking together with other ticket checking terminals 1000 according to the method of the present example when performing on-site ticket checking. In addition, any ticket checking terminal 1000 can also exit from the ticket checking group by exiting the local area network or hiding in the local area network.
In one example, each ticket checking terminal 1000 in the ticket checking group can be configured to perform distributed accounting on join messages of any ticket checking terminal 1000. Similarly, each ticket checking terminal 1000 in the ticket checking group can also be configured to perform distributed accounting on the quit message of any ticket checking terminal 1000.
Step S8120, in response to the trigger for initializing ticket checking, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D detect whether or not they have the authority to initialize the block chain, that is, the authority to create the created block, wherein the ticket checking terminal 1000A detects that it has the authority, and therefore, the ticket checking terminal 1000A creates and stores the created block of the block chain.
In step S8120, referring to fig. 10, the created block0 includes a block header, where the block header at least includes a hash value of the created block, a timestamp of creating the created block, and the like. Here, since no ticketing record is generated within the group of tickets created block0 when created, and created block0 is the oldest created block in the block chain, there is no hash value of the previous storage block in the block header of created block0, and created block0 has no block.
In step S8120, referring to fig. 8b, when the ticket checking terminal 1000A detects that it has the authority to initialize the block chain, it creates and stores the created block0 of the block chain.
In step S8130, the ticket checking terminal 1000A synchronizes the created blocks to the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D.
Referring to FIG. 8C, ticketing terminal 1000A synchronizes created blocks 0 to ticketing terminal 1000B, ticketing terminal 1000C, and ticketing terminal 1000D, which are all maintained by created blocks block 0.
Step S8140, the ticket checking terminal 1000A checks the admission ticket to generate a ticket checking record.
In step S8150, the ticket checking terminal 1000A broadcasts the ticket checking record, so that the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D obtain the ticket checking record.
According to the step S8150, the ticket checking records may also be mutually propagated among the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D, so as to ensure that all of the four ticket checking terminals successfully obtain the ticket checking records.
Step S8160, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D obtain respective seed pools, and select seeds from the respective seed pools to calculate respective election codes.
In step S8160, the seed pool corresponding to each ticket terminal 1000 is also the respective mine digging range.
Step S8170, the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D elect the ticket checking terminal 1000B that firstly obtains the election code satisfying the set condition as the execution terminal.
For example, a competition function may be defined for calculating the election code, and the argument of the competition function includes the proof of operation for creating the previous memory block and the seed selected by calculating the election code, and the dependent variable is the election code, wherein the proof of operation for creating the previous memory block may be the seed selected by the ticket checking terminal for creating the previous memory block to obtain the election code satisfying the set condition. Thus, when the ticket checking record is generated, the selected seeds are respectively substituted into the competition function by the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D to obtain respective election codes, and a storage block is created by the ticket checking terminal which firstly calculates the election codes meeting the set conditions, referring to fig. 8D, when the ticket checking record is generated, the ticket checking terminal 1000A in the ticket checking group can be in the corresponding seed pool: 1-10000, and the ticket checking terminal 1000B is in the corresponding seed pool: selecting seeds from 10001-20000, and checking the ticket terminal 1000C in the corresponding seed pool: selecting seeds in 20001-30000 and checking the ticket of the terminal 1000D in the corresponding seed pool: 30001 and 40000 together with other information, selecting seeds, substituting the selected current seeds and the working certificate of creating the previous memory block into the competition function, calculating the election code corresponding to the current seeds, wherein the election process is completed until a ticket-checking terminal selects proper seeds to obtain the election code meeting the set conditions, for example, the first 2 bits of the hash value of the election code are "1", and the proper seeds can be used as the working certificate of creating the current memory block by the elected ticket-checking terminal and store the working certificate in the created current memory block.
For example, each ticket checking terminal 1000 in the ticket checking group may specify a mine digging algorithm based on the consensus mechanism, that is, if the first 2 bits of the hash value of the sum of the working certificate y of the new storage block and the working certificate x of the previous storage block are both "1", the mine digging is successful, that is, the election is successful:
guess=(str(x)+str(y)).encode()
guess_hash=hashlib.sha256(guess).hexdigest()
if guess_hash[:4]=="11":return y
else y=y+1
in the mining algorithm, when each ticket checking terminal 1000 competes for an execution terminal serving as a new storage block, each ticket checking terminal 1000 selects a seed y expected to serve as a working certificate of the new storage block from a respective seed pool, both a stress function and a stress _ hash function are competitive functions participating in competition, the stress function is used for calculating the sum of the seed y and a working certificate x of a previous storage block, the stress _ hash function is used for calculating a hash value of a function value of the stress function, the function value of the stress _ hash function is an election code, when the function value of the stress _ hash function satisfies a set condition that the first 2 bits are all "1", mining succeeds, the working certificate of the new storage block is returned to be y, and at this time, the ticket checking terminal 1000 which is mined successfully first becomes an execution terminal for creating the new storage block; if the seed y does not enable the election code to meet the condition, the seed y is set to be y +1, and ore excavation is continued until one ticket checking terminal 1000 first obtains the election code meeting the set condition.
When the ticket verifying terminal 1000B calculates the election code satisfying the set condition by using the competition function in the calculation process of fig. 8d, the ticket verifying terminal 1000B obtains the right to create the corresponding storage block for the ticket verifying record, and then referring to fig. 8e, the ticket verifying terminal 1000B creates a storage block1 corresponding to the ticket verifying record, and searches the previous storage block in the local block chain according to the hash value of the previous storage block stored in the storage block1, since the hash value of the previous storage block stored in the storage block1 is the hash value of the created block0, the storage block1 is linked to the local created block0 according to the hash value of the created block0, that is, the created block0 and the storage block1 are sequentially connected, so as to update the local block chain.
Step S8180, the ticket checking terminal 1000B creates a storage block corresponding to the ticket checking record, and links the storage block to the previous storage block in the local database, so as to update the block chain stored locally.
Referring to fig. 10, each storage block includes a block header and a block body, where the block header includes at least a hash value of a previous storage block, a hash value of the current storage block, a timestamp for creating the current storage block, and the block body carries a stored ticket checking record. For example, the memory block in this example is memory block1 in fig. 10, then the corresponding previous memory block is created block0, the block header of the previous memory block at least includes the hash value of created block0, and the ticket checking record 1 stored in the block is the ticket checking record generated by the ticket checking terminal 1000A in step S8140, so that memory block1 is linked to created block0 to form the linked list as shown in fig. 10.
In step S8190, the ticket checking terminal 1000B synchronizes the storage blocks corresponding to the ticket checking records to the ticket checking terminal 1000A, the ticket checking terminal 1000C, and the ticket checking terminal 1000D.
Referring to fig. 8f, ticket checking terminal 1000A, ticket checking terminal 1000C and ticket checking terminal 1000D receive storage block1 synchronized with ticket checking terminal 1000B, link storage block1 to created block0 locally according to the hash value of created block0, that is, created block0 and storage block1 are sequentially connected to update their respective local block chains, so far, the local database of each ticket checking terminal in the ticket checking group stores the same linked list as shown in fig. 10.
Further, referring to fig. 11, when a ticket checking group generates a ticket checking record 2 through ticket checking, an execution terminal of a storage block2 for creating a corresponding ticket checking record 2 is selected according to the above steps S8160 and S8160, and after the execution terminal creates a storage block2, a block header of the storage block2 includes a hash value of the storage block1 and a working certificate of the execution terminal, each ticket checking terminal links the storage block2 to the storage block1 in a respective local database, so that the local database of each ticket checking terminal in the ticket checking group stores the same linked list as shown in fig. 11. And by analogy, each ticket checking terminal in the ticket checking group completes distributed accounting of each ticket checking record.
In this example 1, a ticket checking record generated by the ticket checking terminal 1000A for checking an admission ticket is taken as an example, and an optional implementation scheme for performing distributed accounting on the ticket checking record by all ticket checking terminals in a ticket checking group is described, where for other subsequently generated ticket checking records, a storage block for the other ticket checking records may be created by referring to the above steps S8150 to S8190, so that the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C, and the ticket checking terminal 1000D perform distributed accounting on the other ticket checking records together, which is not described herein again.
In this example, since the blockchain itself is distributed, data of a certain storage block is lost, and data integrity of the whole blockchain is not affected, which can reduce dependency on a certain specific node, thereby solving the problem that local servers are excessively depended on in local area network ticket checking, and ensuring that on-site ticket checking can be performed orderly without being affected when a single-node fault occurs. In addition, based on the safety of the block chain architecture, the possibility that the cattle enters the field with people by attacking the server can be greatly reduced, and the validity of ticket checking is further ensured. In addition, under the network architecture, each ticket checking terminal stores complete ticket checking records, so that each ticket checking terminal can obtain all the ticket checking records by inquiring the local database, and technical support is provided for solving the problem of multiple entries of single ticket checking. Finally, under the network architecture, each storage block stores the characteristic information (hash value of the previous storage block) of the previous storage block, so that the created storage blocks are orderly connected, the ticket checking record can be quickly searched, the requirement of field operation on the ticket checking speed can be met in an application scene of inquiring whether each admission ticket is checked on the basis of a local database so as to solve the problem of multiple admission, and the rapid admission of the ticket can be guaranteed for audiences.
< example 2>
Based on example 1, example 2 takes ticket checking terminal 1000A as an example, and illustrates an implementation procedure for solving the multiple entry problem in single ticket checking, and as shown in fig. 9, the implementation procedure may include:
in step S9110, the ticket checking terminal 1000A acquires information of the admission ticket.
In step S9120, the ticket checking terminal 1000A detects whether the local block chain has a ticket checking record corresponding to the information according to the information of the admission ticket.
In step S9130, the ticket checking terminal 1000A prompts ticket checking and prohibits the entrance of the audience carrying the entrance ticket when the ticket checking terminal has the ticket checking record of the corresponding information.
In step S9140, the ticket checking terminal 1000A checks the admission ticket without a ticket checking record of the corresponding information to generate a ticket checking record, while allowing the entrance of the audience carrying the admission ticket.
After step S9140 is executed, the ticket checking terminal 1000A may continue to execute the steps of S8150 to S8190 in example 1, and perform distributed accounting on the ticket checking record together with the ticket checking terminal 1000B, the ticket checking terminal 1000C and the ticket checking terminal 1000D to update the local block chain.
< terminal embodiment for ticket check >
In this embodiment, a ticket checking terminal 1000 is further provided, which may also be any one of the ticket checking terminal 1000A, the ticket checking terminal 1000B, the ticket checking terminal 1000C, or the ticket checking terminal 1000D shown in fig. 1 or fig. 2a and fig. 2B.
Referring to fig. 12, the ticketing terminal 1000 can include one or more memories 1100, and one or more processors 1200, the memories 1100 for storing executable instructions; the processor 1200 is configured to execute a method of storing a ticket record according to any embodiment of the invention under the control of instructions.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). 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. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (17)

1. A method of storing a ticket validation record, implemented by a ticket validation terminal, the method comprising:
establishing communication connection with other ticket checking terminals to form a ticket checking group;
obtaining ticket checking records generated by ticket checking of the ticket checking group on the admission tickets;
and carrying out distributed accounting on the ticket checking record together with the other ticket checking terminals so as to update a local database.
2. The method of claim 1, wherein the step of performing distributed accounting on the ticket checking record together with the other ticket checking terminals comprises:
electing a ticket checking terminal in the ticket checking group as an execution terminal, wherein the execution terminal is the ticket checking terminal which has the right to create a corresponding storage block aiming at the ticket checking record;
and carrying out distributed accounting on the storage blocks created by the execution terminal together with the other ticket checking terminals.
3. The method of claim 2, wherein the method further comprises:
under the condition that the ticket checking terminal is the execution terminal, establishing a corresponding storage block aiming at the ticket checking record, and synchronizing the storage block to other ticket checking terminals;
and under the condition that the ticket checking terminal is not the execution terminal, acquiring a storage block corresponding to the ticket checking record and synchronized by the execution terminal.
4. The method of claim 3, wherein the step of creating a corresponding memory block for the ticket checking record comprises:
acquiring the characteristic information of the storage block of the last ticket checking record;
acquiring right information as the execution terminal;
and creating a storage block corresponding to the ticket checking record according to the characteristic information, the right information and the ticket checking record.
5. The method of claim 2, wherein the step of electing a ticket gate terminal as an executive terminal in the ticket gate group comprises:
calculating respective election codes together with the other ticket checking terminals;
and the election terminal which firstly obtains the election code meeting the set condition is used as the execution terminal.
6. The method of claim 5, wherein the step of calculating the respective election codes in conjunction with the other ticketing terminals comprises:
obtaining respective seed pools, wherein the seed pools of each ticket checking terminal in the ticket checking group are different from each other;
and selecting seeds in the respective seed pools to calculate respective election codes.
7. The method of claim 5, wherein the step of electing the ticket checking terminal that first obtains the election code satisfying the set condition as the executing terminal comprises:
under the condition that the ticket checking terminal firstly obtains the election code meeting the set condition, determining the ticket checking terminal as an execution terminal, and informing other ticket checking terminals of the election result;
and under the condition that the other ticket checking terminals firstly obtain the election codes meeting the set conditions, stopping continuously calculating the election codes according to the notification of the other ticket checking terminals, and taking the ticket checking terminal sending the notification as the execution terminal.
8. The method according to any one of claims 1 to 7, wherein the step of performing distributed accounting on the ticket checking records together with the other ticket checking terminals to update a local database comprises:
and linking the ticket checking record to the last ticket checking record in a local database according to a chain data structure so as to update the local database.
9. The method of claim 8, wherein the method further comprises:
and responding to the trigger of ticket checking initialization, and executing the operation of initializing the local database.
10. The method of claim 9, wherein each ticket validation record is stored in a corresponding memory block, the linking the ticket validation record to a previous ticket validation record comprising: linking the storage block storing the ticket checking record to a previous storage block storing a previous ticket checking record, wherein the first storage block is linked to the created world block; the step of performing an operation to initialize the local database includes:
detecting whether the founding block has the authority to create the founding block;
under the condition of having the authority, creating and storing the created blocks, and synchronizing the created blocks to other ticket checking terminals;
and under the condition that the authority is not provided, acquiring and storing other ticket checking terminals with the authority to provide the created block.
11. The method according to any one of claims 1 to 7, wherein the step of establishing a communication connection with other ticket checking terminals comprises:
and establishing short-distance communication connection with other ticket checking terminals.
12. The method of any of claims 1 to 7, wherein the method further comprises:
responding to a request for inquiring the ticket checking record, and acquiring the ticket checking record from the local database;
and providing the acquired ticket checking record.
13. The method of any of claims 1 to 7, wherein the method further comprises:
monitoring a set calibration event;
in case of the occurrence of the calibration event, comparing whether the local database is consistent with local databases of other ticket checking terminals;
and calibrating the local database according to the comparison result.
14. The method of any of claims 1-7, further comprising:
acquiring the information of the admission ticket;
detecting whether the local database has a ticket checking record corresponding to the information or not according to the information of the admission ticket;
under the condition that the ticket checking record corresponding to the information is available, prompting that the ticket checking is performed;
and in the case of not having a ticket checking record corresponding to the information, checking the admission ticket to generate the ticket checking record.
15. The method of claim 13, wherein the method further comprises:
providing a setup portal to set up the calibration event;
acquiring a calibration event input through the setting entrance;
updating the set calibration event to the input calibration event.
16. A ticket terminal, comprising: a memory for storing instructions for controlling the processor to operate to perform a method of storing a ticket record according to any one of claims 1-15 and a processor.
17. A ticket validating system comprising a plurality of ticket validating terminals as claimed in claim 16, a plurality of said ticket validating terminals being communicatively connected to form said ticket validating group.
CN201910110133.7A 2019-02-11 2019-02-11 Method for storing ticket checking record, ticket checking terminal and system Pending CN111553990A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910110133.7A CN111553990A (en) 2019-02-11 2019-02-11 Method for storing ticket checking record, ticket checking terminal and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910110133.7A CN111553990A (en) 2019-02-11 2019-02-11 Method for storing ticket checking record, ticket checking terminal and system

Publications (1)

Publication Number Publication Date
CN111553990A true CN111553990A (en) 2020-08-18

Family

ID=72007175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910110133.7A Pending CN111553990A (en) 2019-02-11 2019-02-11 Method for storing ticket checking record, ticket checking terminal and system

Country Status (1)

Country Link
CN (1) CN111553990A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112669471A (en) * 2020-12-24 2021-04-16 杭州趣链科技有限公司 Gate and ticket checking transaction method, device and storage medium thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279982A (en) * 2010-06-09 2011-12-14 北京红马传媒文化发展有限公司 Ticket checking system and method
CN105404701A (en) * 2015-12-31 2016-03-16 浙江图讯科技股份有限公司 Peer-to-peer network-based heterogeneous database synchronization method
EP3257191A1 (en) * 2016-02-23 2017-12-20 Nchain Holdings Limited Registry and automated management method for blockchain-enforced smart contracts
CN108027867A (en) * 2015-07-14 2018-05-11 Fmr有限责任公司 Calculate efficient transfer accounts processing, audit and searcher, method and system
CN109118597A (en) * 2018-08-29 2019-01-01 上海哔哩哔哩科技有限公司 Intelligent terminal, ticketing service verifying system, method and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279982A (en) * 2010-06-09 2011-12-14 北京红马传媒文化发展有限公司 Ticket checking system and method
CN108027867A (en) * 2015-07-14 2018-05-11 Fmr有限责任公司 Calculate efficient transfer accounts processing, audit and searcher, method and system
CN105404701A (en) * 2015-12-31 2016-03-16 浙江图讯科技股份有限公司 Peer-to-peer network-based heterogeneous database synchronization method
EP3257191A1 (en) * 2016-02-23 2017-12-20 Nchain Holdings Limited Registry and automated management method for blockchain-enforced smart contracts
CN109118597A (en) * 2018-08-29 2019-01-01 上海哔哩哔哩科技有限公司 Intelligent terminal, ticketing service verifying system, method and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张世强: "《中国智能金融产业蓝皮书》", 31 March 2018 *
杜宁等: "《监管科技 人工智能与区块链应用之大道》", 31 July 2018 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112669471A (en) * 2020-12-24 2021-04-16 杭州趣链科技有限公司 Gate and ticket checking transaction method, device and storage medium thereof

Similar Documents

Publication Publication Date Title
EP3542514B1 (en) Facilitating practical byzantine fault tolerance blockchain consensus and node synchronization
CN110505065B (en) Trusted timestamp adding method and device and storage medium
CN110059089B (en) Data synchronization method and device, storage medium and electronic equipment
CN111324672A (en) Block chain safety processing system and method
CN109479053B (en) Method and system for node discovery and self-healing of block chain networks
CN110597918B (en) Account management method, account management device and computer readable storage medium
CN110430087A (en) The architecture design and realization of block chain heat upgrading
CN110989994A (en) Block chain-based code version management method and device, terminal and storage medium
CN110599346A (en) Block chain information acquisition method and related equipment
CN111338608B (en) Distributed application development method and device, node equipment and readable storage medium
US20230037932A1 (en) Data processing method and apparatus based on blockchain network, and computer device
CN110557452B (en) Node management method and device of block chain, storage medium and computer equipment
CN110808839B (en) Processing method, device, equipment and medium for block chain abnormal data
CN110086856B (en) Control method and device of block chain node, storage medium and electronic equipment
EP3779756A1 (en) Information processing device, information processing method, and program
CN111726376B (en) On-site ticket checking system
CN108260015B (en) Voting data processing method and device and electronic equipment
US9083515B1 (en) Forward secure pseudorandom number generation resilient to forward clock attacks
CN110602108B (en) Data communication method, device, equipment and storage medium based on block chain network
CN110929229A (en) Block chain-based office document credibility verification method and system
CN112364049B (en) Data synchronization script generation method, system, terminal and storage medium
CN110069260A (en) Distribution management method, device, equipment and the storage medium of cross-version
CN110647583B (en) Block chain construction method, device, terminal and medium
CN111556115A (en) Data processing method, device and equipment based on block chain and storage medium
CN111553990A (en) Method for storing ticket checking record, ticket checking terminal and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200818

RJ01 Rejection of invention patent application after publication