One-way ticket checking method and device and one-way ticket generating method
By performing legality checks and ticket card status updates on the QR code of the one-way ticket in the subway automatic ticket sales system, the problem of easy loss and high cost of one-way tickets is solved, and an unmanned ticket inspection process is realized, improving operational efficiency and passenger safety.
Patent Information
- Application Number
- CN202411809329.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
AI Technical Summary
In the existing subway automatic ticket sales and inspection system, one-way tickets are easily lost and costly. In addition, multiple processes are involved in the use of physical one-way tickets, which increases operating costs and leads to a decrease in the number of use year by year.
By obtaining the QR code verification request sent by the gate device, the legality verification of the target QR code printed and generated after the ticket purchase device receives the ticket purchase request. If it is legal, it is determined whether the gate is allowed to pass through the gate based on the one-way ticket status, entry site, exit site and gate device attributes of the QR code, and the ticket card status is updated when the pass is allowed.
It realizes one-way ticket checking without manual intervention, improves ride safety and operational efficiency, reduces the cost of one-way tickets, and updates the legality checksum ticket card status through the QR code, preventing ticket fraud and reuse.
Smart Images

Figure CN119694010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit technology, and in particular to a one-way ticket checking method and device, and a one-way ticket generating method. Background Art
[0002] The subway automatic ticket vending system can issue physical one-way tickets through station equipment, and the tickets need to be collected at the gate when leaving the station.
[0003] In the related art, one-way tickets mainly use contactless IC (Integrated Circuit) cards, but there are problems such as easy loss and high cost. In addition, the use of physical one-way tickets involves unavoidable processes such as ticket making, warehouse management, transportation, and recycling, which increases operating costs. With the update of Internet services, the use of physical one-way tickets has decreased year by year. At the same time, with the high maintenance cost of TVM (Ticket Vending Machine), the number of physical one-way ticket sales equipment at each station has gradually decreased, which has also led to a decrease in the number of uses.
[0004] In view of this, a one-way ticket checking method which reduces costs and does not require manual intervention is needed. Summary of the invention
[0005] In view of this, the present invention provides a one-way ticket checking method, which can reduce costs and does not require manual intervention.
[0006] In the first aspect, the present invention provides a one-way ticket checking method, the method comprising: obtaining a QR code verification request sent by a gate device; the QR code verification request is generated by the gate device scanning a target QR code; the target QR code is printed and generated after the ticket purchasing device receives the ticket purchase request; the ticket purchase request includes an entry station and an exit station; according to the QR code verification request, the target structure data of the target QR code is verified for legitimacy; if the target QR code is legal, judging whether to allow passage through the gate device based on the ticket card status of the one-way ticket of the target QR code, the entry station and the exit station and the attributes of the gate device; if passage is allowed, the gate device is controlled to open, and the ticket card status of the one-way ticket of the target QR code is updated.
[0007] In this embodiment, by obtaining the QR code verification request sent by the gate device, the target QR code printed and generated after the ticket purchasing device receives the user's ticket purchase request is verified for legitimacy. If the target QR code is legal, it is determined whether to allow passage through the gate device based on the ticket card status of the one-way ticket of the target QR code, the entry and exit stations, and the properties of the gate device. If passage is allowed, the gate device is opened and the ticket card status of the one-way ticket of the target QR code is updated. The above scheme can improve the safety and operational efficiency of riding and reduce the cost of one-way tickets by performing a legitimacy check on the printed target QR code, and if the legitimacy check passes, it is further determined whether to allow passage through the gate based on the ticket card status of the one-way ticket of the target QR code, the entry and exit stations, and the properties of the gate device.
[0008] In an optional implementation, performing a legitimacy check on the target structure data of the target QR code includes: extracting the target structure data of the target QR code; determining whether the card issuing institution code and the verification signature in the target structure data are accurate; if the determination results of the card issuing institution code and the verification signature are both accurate, the legitimacy check is passed.
[0009] In this embodiment, by extracting the target structure data of the target QR code and determining whether the card issuer code and verification signature in the target result data are accurate, the target QR code can be prevented from being forged, thereby protecting the travel safety of passengers.
[0010] In an optional embodiment, when the gate device is an entry gate, judging whether to allow passage through the gate device is based on the ticket status of the one-way ticket with the target QR code, the entry station and the exit station, and the attributes of the gate device, including: obtaining the ticket status of the one-way ticket with the target QR code, where the ticket status is one of entered, not entered, and exited; when the ticket status of the one-way ticket with the target QR code is not entered, obtaining the device code in the target structure data of the target QR code; judging whether the site to which the device code belongs is consistent with the entry station, and if they are consistent, allowing passage through the gate device.
[0011] In this embodiment, when the gate device is an entry gate, the ticket status of the one-way ticket of the target QR code is obtained, and when the ticket status of the one-way ticket is not entered, it is determined whether the station to which the device code in the target QR code belongs is consistent with the entry station, and if they are consistent, the passenger is allowed to pass through the gate device. It can be verified whether the one-way ticket of the target QR code is used at its issuing station, thereby maintaining the management order of one-way ticket inspection.
[0012] In an optional implementation, when the gate device is an entry gate, controlling the gate device to open and updating the ticket status of the one-way ticket with the target QR code includes: marking the ticket status of the one-way ticket with the target QR code as having entered the station.
[0013] In this embodiment, when the gate device is an entry gate, after the gate device is opened, the ticket status of the one-way ticket with the target QR code is updated to entered, which can prevent the reuse of the one-way ticket with the target QR code and maintain the order of one-way ticket inspection.
[0014] In an optional embodiment, when the gate device is an exit gate, judging whether to allow passage through the gate device is based on the ticket status of the one-way ticket with the target QR code, the entry station and the exit station, and the attributes of the gate device, including: obtaining the ticket status of the one-way ticket with the target QR code, where the ticket status is one of entered, not entered, and exited; when the ticket status of the one-way ticket with the target QR code is entered, obtaining the device code in the target structure data of the target QR code; judging whether the site to which the device code belongs is consistent with the exit site, and if they are consistent, allowing passage through the gate device.
[0015] In this embodiment, when the gate device is an exit gate, the ticket status of the one-way ticket of the target QR code is obtained, and when the ticket status of the one-way ticket is entered, it is determined whether the station to which the device code in the target QR code belongs is consistent with the exit station, and if they are consistent, the passenger is allowed to pass through the gate device. It can be verified whether the one-way ticket of the target QR code is used at its destination station, thereby maintaining the management order of one-way ticket inspection.
[0016] In an optional implementation, when the gate device is an exit gate, controlling the gate device to open and updating the ticket status of the one-way ticket with the target QR code includes: marking the ticket status of the one-way ticket with the target QR code as exited.
[0017] In this embodiment, when the gate device is an exit gate, after the gate device is opened, the ticket status of the one-way ticket with the target QR code is updated to exit, which can prevent the reuse of the one-way ticket with the target QR code and maintain the order of one-way ticket inspection.
[0018] In the second aspect, the present invention provides a one-way ticket checking device, which includes: a sending module, which is used to obtain a QR code verification request sent by a gate device; the QR code verification request is generated by the gate device scanning a target QR code; the target QR code is printed and generated after the ticket purchasing device receives the ticket purchase request; the ticket purchase request includes an entry station and an exit station; a verification module, which is used to verify the legitimacy of the target structure data of the target QR code according to the QR code verification request; a judgment module, which is used to judge whether to allow passage through the gate device based on the ticket card status of the one-way ticket of the target QR code, the entry station and the exit station and the attributes of the gate device if the target QR code is legal; an update module, which is used to control the gate device to open if passage is allowed, and update the ticket card status of the one-way ticket of the target QR code.
[0019] In a third aspect, the present invention provides a method for generating a one-way ticket, the method comprising: obtaining a ticket purchase request sent by a ticket purchasing device; the ticket purchase request includes an entry site and an exit site; if the payment operation corresponding to the ticket purchase request is completed, generating a target QR code of a target data structure according to the ticket purchase request; the target QR code is used to instruct the gate device to send a QR code verification request to the server when the gate device scans, so that the server performs a legitimacy verification on the target structure data of the target QR code according to the QR code verification request; if the target QR code is legal, judging whether to allow passage through the gate device based on the ticket card status of the target QR code, the entry site and the exit site, and the attributes of the gate device; sending the target QR code to the ticket purchasing device, so that the ticket purchasing device prints a one-way ticket including the target QR code; when the ticket purchasing device successfully prints the one-way ticket with the target QR code, saving the ticket card status of the one-way ticket with the target QR code; the ticket card status is used to indicate whether the one-way ticket with the target QR code is used.
[0020] In some optional implementations, the target structure data of the target two-dimensional code includes a card issuer code and a verification signature.
[0021] In some optional embodiments, sending the target QR code to a ticket purchasing device so that the ticket purchasing device prints a one-way ticket including the target QR code includes: obtaining printing parameters, wherein the printing parameters include at least one of a printing font and a printing cover; the printing cover includes at least one of an entry site, an exit site, and a holiday pattern; and printing a one-way ticket including the target QR code according to the printing parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 This is a system structure diagram of a one-way ticket sales and ticket checking system according to an embodiment of the present invention;
[0024] Figure 2 It is a flowchart of a one-way ticket checking method according to an embodiment of the present invention;
[0025] Figure 3 is a flow chart of another one-way ticket checking method according to an embodiment of the present invention;
[0026] Figure 4 is a flow chart of another one-way ticket checking method according to an embodiment of the present invention;
[0027] Figure 5 This is a schematic diagram of a gate entry process according to an embodiment of the present invention;
[0028] Figure 6 This is a schematic diagram of a gate exit process according to an embodiment of the present invention;
[0029] Figure 7 is a flow chart of a method for generating a one-way ticket according to an embodiment of the present invention;
[0030] Figure 8 It is a schematic diagram of the flow of a method for customizing the face of a one-way ticket with a two-dimensional code according to an embodiment of the present invention;
[0031] Fig. 9 is a schematic diagram of a process of purchasing a one-way ticket according to an embodiment of the present invention;
[0032] Fig.10 is a structural block diagram of a one-way ticket checking device according to an embodiment of the present invention;
[0033] Fig.11 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0035] The embodiment of the present invention provides a one-way ticket inspection method, which performs a legitimacy check on the one-way ticket with the target QR code generated by printing, and if the legitimacy check passes, further determines whether to allow the ticket to pass through the gate according to the ticket card status, the entry station and the exit station of the one-way ticket with the target QR code and the properties of the gate equipment, thereby improving the safety of passengers and the operating efficiency of urban rail transit enterprises. At the same time, when using the one-way ticket with the target QR code generated by printing, there is no need for the gate to recycle it when the passenger exits the station, and the key contents such as the ticket price, the sale time, the starting station and the terminal station can be intuitively viewed on the ticket face, which can reduce costs while making the information of the one-way ticket more transparent and intuitive.
[0036] According to an embodiment of the present invention, a one-way ticket selling and checking system is provided, such as Figure 1 As shown, the passenger purchases tickets on the TVM or mobile phone and selects the destination station for this trip. After the selection, the device sends a code generation request to the Internet ticketing system. The code generation management unit in the Internet ticketing system generates QR code structure data according to the code generation request, and sends the sales result and QR code structure data to the TVM or mobile phone. After the passenger receives and confirms the sales result and QR code structure data, a paper QR code one-way ticket is printed.
[0037] After obtaining a paper QR code one-way ticket, the passenger can scan the code in the AGM (Automatic Gate Machine) to enter the station. The AGM at the entrance, i.e. the entrance gate, recognizes the paper QR code one-way ticket and sends an entry gate monitoring request to the Internet ticketing system. The Internet ticketing system performs anti-duplication checks and entry and exit number checks, and then returns the results to the entrance gate. After receiving the results, the gate opens the gate and the passenger enters the station. The entrance gate uploads the entry transaction to the transaction management unit of the Internet ticketing system, and the transaction management unit processes the entry transaction.
[0038] Passengers hold a paper QR code one-way ticket to exit the station, scan the code in the AGM to exit the station, and the AGM at the exit, i.e. the exit gate, recognizes the paper QR code one-way ticket and sends an exit gate monitoring request to the Internet ticketing system. The Internet ticketing system performs anti-duplicate checks and in and out number checks, etc., and returns the results to the exit gate. After receiving the results, the gate opens the gate and the passenger exits the station. The exit gate uploads the exit transaction to the transaction management unit of the Internet ticketing system, which processes the exit transaction. From then on, the passenger completes the use of the paper QR code one-way ticket, and the paper single QR code one-way ticket becomes invalid after the passenger passes through the exit gate.
[0039] In an actual application, the station equipment is connected to the device gateway of the Internet ticketing system. The station equipment program sends a message to the Internet ticketing system device gateway through the SOCKET channel to request the gate-passing monitoring of the QR code single-trip ticket and upload the ticket transaction data. The QR code single-trip ticket is scanned on the gate machine, and the gate machine sends a gate-passing monitoring request to the Internet ticketing system. The Internet ticketing system quickly determines whether the ticket is repeatedly entered and exited, whether it is legal, etc., and then returns the judgment result to the device side, realizing the background of business logic and reducing the transformation and maintenance costs of the device side. After the ticket passes the gate, the device side uploads the entry and exit ticket transaction data of the QR code single-trip ticket through the SOCKET channel to achieve real-time processing and real-time monitoring.
[0040] According to an embodiment of the present invention, an embodiment of a one-way ticket checking method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] In this embodiment, a one-way ticket checking method is provided. Figure 2 is a flow chart of a one-way ticket checking method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0042] Step S101, obtain the QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning the target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes the entry site and the exit site.
[0043] Among them, passengers can purchase tickets through ticket vending machines, mobile phones and other ticket purchasing devices. Passengers select ticket purchase information such as entry and exit stations on the ticket vending machine, and the ticket vending machine generates a ticket purchase request based on the ticket purchase information and sends the ticket purchase request to the ticketing system, which generates a target QR code; after the ticketing system generates the target QR code, it sends the target QR code to the corresponding ticket vending machine for printing.
[0044] Passengers can send a ticket purchase request to the ticketing system through the ticketing applet on their mobile phones. The ticket purchase request can include information such as the entry station, exit station, and usage time. After receiving the ticket purchase request sent by the ticketing applet, the ticketing system generates a corresponding target QR code, sends the target QR code back to the ticketing applet, and then displays the QR code one-way ticket electronically on the mobile phone, where the display method of the QR code one-way ticket can be the same as the paper QR code one-way ticket printed out from the ticket vending machine.
[0045] After obtaining a QR code one-way ticket, passengers can scan the paper QR code one-way ticket or the mobile QR code one-way ticket interface at the gate to enter the station. After detecting the QR code, the gate generates a QR code verification request and sends the QR code verification request to the ticketing system, which verifies the QR code.
[0046] Step S102: According to the two-dimensional code verification request, the target structure data of the target two-dimensional code is verified for legality.
[0047] After receiving the QR code verification request, the target QR code can be decoded first to extract the target structure data of the target QR code, and then the target structure data can be verified for legitimacy, and based on the result of the legitimacy verification, it can be determined whether the target QR code is legal.
[0048] Among them, the target structure data of the target QR code may include information such as the ticket number, the riding range, the riding time, and the corresponding entry and exit stations.
[0049] The legitimacy check may include checking the ticket number, ticketing equipment code, etc. of the target QR code. If the ticket number does not meet the setting specifications of the ticketing system, or there are number anomalies such as incorrect number digits or traces of alteration, it is judged as illegal. If the ticketing equipment corresponding to the ticketing equipment code is not the ticketing system, it is judged as illegal. The content and rules of the legitimacy check can be set by the staff according to the target structure data of the target QR code.
[0050] If the target QR code is found to be invalid, the passenger cannot pass through the gate with the target QR code. You can ask the staff for help to reduce travel delays caused by QR code problems.
[0051] Step S103, if the target QR code is legal, determine whether to allow passing through the gate device based on the ticket status of the one-way ticket of the target QR code, the entry and exit stations, and the properties of the gate device.
[0052] The ticket status of the one-way ticket with the target QR code may include whether it has been used, whether it is within the validity period, etc. If the one-way ticket with the target QR code has completed the process of entering and exiting the station once, that is, it has been used, it will not be allowed to pass through the gate device. The validity period can be uniformly set by the staff according to the actual situation. The validity period of the one-way ticket with the target QR code can be the same day. If it exceeds the validity period at the current time, it will not be allowed to pass through the gate device.
[0053] When the gate device is an entry gate, check whether the entry station in the one-way ticket with the target QR code is consistent with the entry station that the passenger is currently at. In an actual application, if the entry station of the one-way ticket with the target QR code held by the passenger is the first station, the current station is the second station, and the gate device is the entry gate of the second station, the entry gate will not open.
[0054] If the gate device is an exit gate, check whether the exit station in the one-way ticket with the target QR code is consistent with the exit station the passenger is currently at. In an actual application, if the exit station of the one-way ticket with the target QR code held by the passenger is the third station, the current station is the second station, and the gate device is the exit gate of the second station, the exit gate will not open.
[0055] Step S104: If passage is allowed, the gate device is controlled to open and the ticket status of the one-way ticket with the target QR code is updated.
[0056] Wherein, in the case where the gate device is allowed to pass, a command can be sent to the gate device to open the gate device. In the case where the gate device is an entry gate, the passenger enters the entry gate, and the ticket card status of the one-way ticket with the target QR code can be updated to have entered the station. In the case where the gate device is an exit gate, the passenger exits the station from the exit gate, and the ticket card status of the one-way ticket with the target QR code can be updated to have exited the station, marking that the one-way ticket with the target QR code has been used up, or has been invalidated, indicating that the one-way ticket with the target QR code can no longer be used.
[0057] The one-way ticket inspection method provided in this embodiment obtains the two-dimensional code verification request sent by the gate device, and performs a legality check on the target two-dimensional code printed and generated after the ticket purchasing device receives the user's ticket purchase request. If the target two-dimensional code is legal, it is determined whether to allow the gate device to pass according to the ticket card status of the one-way ticket of the target two-dimensional code, the entry and exit stations, and the attributes of the gate device. If passage is allowed, the gate device is opened and the ticket card status of the one-way ticket of the target two-dimensional code is updated. The above scheme performs a legality check on the target two-dimensional code generated by printing, and if the legality check passes, it further determines whether to allow the gate device to pass according to the ticket card status of the one-way ticket of the target two-dimensional code, the entry and exit stations, and the attributes of the gate device, which can improve the safety and operational efficiency of riding and reduce the cost of one-way tickets. Without manual intervention, passengers do not need to register an account to complete the entry and exit of one-way tickets, which is convenient for passengers to travel, improve the operational efficiency of urban rail transit companies, and reduce costs.
[0058] In this embodiment, a one-way ticket checking method is provided. Figure 3 is a flow chart of a one-way ticket checking method according to an embodiment of the present invention. Figure 3As shown, the process includes the following steps:
[0059] Step S201, obtain the QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning the target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes the entry site and the exit site.
[0060] For details, please see Figure 2 Step S101 of the illustrated embodiment will not be described in detail here.
[0061] Step S202: According to the two-dimensional code verification request, the target structure data of the target two-dimensional code is verified for legality.
[0062] Specifically, the above step S202 includes:
[0063] Step S2021, extracting target structure data of the target two-dimensional code.
[0064] After obtaining the target two-dimensional code, the target two-dimensional code can be parsed by a related decoding algorithm, and the target structure data can be obtained according to the parsed data.
[0065] In a practical application, decoding software is used to parse the coded information in the QR code, and then the coding format of the coded information is determined; according to the identified coding format, the corresponding parsing tool is used to extract the target structure data from the coded information.
[0066] Step S2022, determining whether the card issuer code and verification signature in the target structure data are accurate.
[0067] Obtain the card issuer code portion of the target structure data, compare the card issuer code in the target structure data with the code of the ticketing system bit by bit, and ensure that each bit of data or character is exactly the same, so that the card issuer code can be determined to be accurate.
[0068] When the ticketing system generates a QR code, it encrypts the structural data of the QR code. After determining the encryption algorithm, the ticketing system generates a public-private key pair that matches the encryption algorithm. In some optional implementations, the ticketing system saves the private key, calculates the structural data of the QR code based on the private key, and encrypts the calculation result to generate a verification signature, where the QR code is generated based on the ticket purchase request; the verification signature can be attached to the end of the structural data of the QR code; the public key can be saved in the gate device, and the gate device uses the public key to decrypt the verification signature in the structural data of the QR code to obtain the first data, and perform the same calculation on the structural data of the QR code to obtain the second data; compare the first data and the second data to see if they are completely consistent. If they are completely consistent, the verification signature is accurate.
[0069] In an actual application, the encryption algorithm is the national secret algorithm SM2 (Elliptic Curve Public Key Cryptography Algorithm). The ticketing system pre-generates the SM2 public and private key pair, where the private key is encrypted and saved in the ticketing system, and is used to add a verification signature to the target structure data of the QR code. The signature is attached to the end of the target structure data, and the public key is sent to the gate device for storage, and is used to verify whether the signature is consistent when scanning the code.
[0070] Step S2023: If the judgment results of the card issuing institution code and the verification signature are both accurate, the legitimacy check is passed.
[0071] When the judgment results of the card issuer code and the verification signature are both accurate, it means that the target QR code is legal, that is, it passes the legality check.
[0072] In the event that the judgment results of the card issuer code and the verification signature are inaccurate, it means that the target QR code is illegal, that is, it has failed the legitimacy check.
[0073] Step S203, if the target QR code is legal, determine whether to allow passing through the gate device based on the ticket status of the one-way ticket of the target QR code, the entry and exit stations, and the properties of the gate device.
[0074] For details, please see Figure 2 Step S103 of the illustrated embodiment will not be described in detail here.
[0075] Step S204: If passage is allowed, the gate device is controlled to open and the ticket status of the one-way ticket with the target QR code is updated.
[0076] For details, please see Figure 2 Step S104 of the illustrated embodiment will not be described in detail here.
[0077] The one-way ticket checking method provided in this embodiment extracts the target structure data of the target QR code and determines whether the card issuing agency code and verification signature in the target result data are accurate; it can prevent the target QR code from being forged and protect the travel safety of passengers.
[0078] In this embodiment, a one-way ticket checking method is provided. Figure 4 is a flow chart of a one-way ticket checking method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0079] Step S301, obtain the QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning the target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes the entry site and the exit site.
[0080] For details, please see Figure 2 Step S101 of the illustrated embodiment will not be described in detail here.
[0081] Step S302: According to the two-dimensional code verification request, the target structure data of the target two-dimensional code is verified for legality.
[0082] For details, please see Figure 2 Step S102 of the illustrated embodiment will not be described in detail here.
[0083] Step S303: If the target QR code is legal, determine whether to allow the vehicle to pass through the gate device based on the ticket status of the one-way ticket of the target QR code, the entry and exit stations, and the properties of the gate device.
[0084] Specifically, when the gate device is a station entry gate, the above step S303 includes:
[0085] Step a1, obtaining the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited.
[0086] The ticket status of the one-way ticket with the target QR code indicates the usage of the one-way ticket with the target QR code. When the ticket status is "entered", it means that the one-way ticket with the target QR code has completed one entry; when the ticket status is "not entered", it means that the one-way ticket with the target QR code has not completed the entry and exit operations; when the ticket status is "exited", it means that the one-way ticket with the target QR code has completed one entry and exit operations and cannot be used any further.
[0087] Step a2, when the ticket status of the one-way ticket of the target QR code is not entered, obtain the device code in the target structure data of the target QR code.
[0088] When the ticket status of the one-way ticket with the target QR code is "Not entered the station", it means that the one-way ticket with the target QR code has not been used yet, and the passenger can board the train with this one-way ticket with the target QR code.
[0089] Based on the format of the target structure data of the target two-dimensional code, the position of the device code in the target structure data is determined; and the device code in the target structure data is extracted according to the position.
[0090] Step a3, determine whether the site to which the device code belongs is consistent with the entry site. If they are consistent, allow the vehicle to pass through the gate device.
[0091] After determining the equipment code of the entry station corresponding to the one-way ticket of the target QR code, compare the equipment codes of the other entry stations one by one to see if they are consistent. If they are consistent, you are allowed to pass through the gate equipment. If they are inconsistent, you are prohibited from passing through the gate equipment.
[0092] Specifically, when the gate device is an exit gate, the above step S303 includes:
[0093] Step b1, obtaining the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited.
[0094] Please refer to step a1 for details and will not be repeated here.
[0095] Step b2, when the ticket status of the one-way ticket of the target QR code is entered, obtain the device code in the target structure data of the target QR code.
[0096] When the ticket status of the one-way ticket with the target QR code is Entered, it means that the one-way ticket with the target QR code has completed one entry, and the passenger can complete the exit with this one-way ticket with the target QR code.
[0097] Step b3, determine whether the site to which the device code belongs is consistent with the exit site. If they are consistent, allow the device to pass through the gate.
[0098] After determining the equipment code of the entry station corresponding to the one-way ticket of the target QR code, compare the equipment codes of the other entry stations one by one to see if they are consistent. If they are consistent, you are allowed to pass through the gate equipment. If they are inconsistent, you are prohibited from passing through the gate equipment.
[0099] Step S304: If passage is allowed, the gate device is controlled to open and the ticket status of the one-way ticket with the target QR code is updated.
[0100] For details, please see Figure 2 Step S104 of the illustrated embodiment will not be described in detail here.
[0101] In some optional implementations, when the gate device is a station entry gate, the above step S304 includes:
[0102] Step a4, marking the ticket status of the one-way ticket with the target QR code as entered.
[0103] When the gate device is an entry gate, after the gate device is opened, the ticket status of the one-way ticket with the target QR code is updated to entered, which can prevent the reuse of the one-way ticket with the target QR code and maintain the order of one-way ticket checking.
[0104] In some optional implementations, when the gate device is an exit gate, the above step S304 includes:
[0105] Step b4, marking the ticket status of the one-way ticket with the target QR code as exited.
[0106] When the gate device is an exit gate, after the gate device is opened, the ticket status of the one-way ticket with the target QR code is updated to exit, which can prevent the reuse of the one-way ticket with the target QR code and maintain the order of one-way ticket checking.
[0107] The one-way ticket inspection method provided in this embodiment, when the gate device is an entry gate, obtains the ticket card status of the one-way ticket of the target QR code, and when the ticket card status of the one-way ticket is not entered, it is judged whether the station to which the device code in the target QR code belongs is consistent with the station to enter, and when they are consistent, the passenger is allowed to pass through the gate device. It can be verified whether the one-way ticket of the target QR code is used at its issuance site. When the gate device is an exit gate, obtains the ticket card status of the one-way ticket of the target QR code, and when the ticket card status of the one-way ticket is entered, it is judged whether the station to which the device code in the target QR code belongs is consistent with the station to exit, and when they are consistent, the passenger is allowed to pass through the gate device. It can be verified whether the one-way ticket of the target QR code is used at its destination station. Thereby maintaining the management order of one-way ticket inspection.
[0108] In a practical application, Figure 5 As shown, the passenger enters the gate holding a one-way ticket with a QR code. The gate machine scans and identifies the one-way ticket and initiates a QR code gate verification request to the Internet ticketing system. The Internet ticketing system verifies the legitimacy of the QR code to determine whether the ticket status is normal and whether the ticket is issued by this station. The legitimacy verification includes verifying whether the issuing institution code is consistent, determining whether the current time exceeds the QR code expiration time, whether the device code is in the whitelist, and verifying the QR code signature data. Through legitimacy verification, the forgery and tampering of paper QR code one-way tickets can be prevented. After the QR code passes the code legitimacy verification, determine whether the ticket status of the QR code one-way ticket is unused, and then determine whether the entry device code in the QR code is consistent with the current entry station.
[0109] After the verification is completed, the one-way ticket with the QR code is marked as having entered the station, and the return result is sent to the station gate. If the return result is successful, the station gate executes the door opening command and uploads the QR code entry and gate transaction to the Internet ticketing system. If the return result is failed, the station gate displays the reason for the rejection of passage. If the station gate repeatedly initiates the gate verification request, the ticketing system returns the verification result to the gate end.
[0110] In a practical application, Figure 6As shown, the passenger takes the one-way ticket with QR code to the exit gate, the exit gate scans and identifies it, and initiates a gate monitoring request to the Internet ticketing system. The Internet ticketing system verifies the legitimacy of the target structure data of the QR code, where the legitimacy verification includes verifying whether the issuing institution code is consistent, judging whether the current time exceeds the expiration time of the QR code, whether the device code is in the whitelist, and verifying the signature data of the QR code. Through the legitimacy verification, the forgery and tampering of the paper QR code one-way ticket can be prevented. After the legitimacy verification is passed, it is determined whether the ticket card status of the one-way ticket with QR code is entered, and then it is determined whether the station to which the exit device code in the target structure data belongs is consistent with the current exit station. After the verification is passed, the ticket card status of the one-way ticket with QR code is marked as exited, and the verification result is returned to the exit gate. If the exit gate repeatedly requests gate monitoring, the Internet ticketing system will return the verification result to the exit gate. After the exit gate receives the returned result, if the returned result is successful, the exit gate will execute the door opening command and upload the QR code exit gate transaction to the Internet ticketing system. If the returned result is failure, the exit gate will display the reason for rejection of passage.
[0111] In this embodiment, a one-way ticket generation method is also provided. Figure 7 is a flow chart of a method for generating a one-way ticket according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:
[0112] Step S401, obtaining a ticket purchase request sent by a ticket purchase device; the ticket purchase request includes an entry station and an exit station.
[0113] Passengers can use the ticket purchasing device to select ticket purchasing information such as the entry and exit stations, and send a ticket purchase request to the ticketing system. The ticket purchase information may also include information such as the travel date, the number of tickets purchased, and the payment method. After obtaining the ticket purchase request sent by the ticket purchasing device, the ticketing system will determine whether the ticket purchase request has completed the payment operation. If the payment operation is not completed, a prompt may be displayed on the ticket purchasing device.
[0114] Step S402: If the payment operation corresponding to the ticket purchase request is completed, a target QR code of the target structure data is generated according to the ticket purchase request; the target QR code is used to instruct the gate device to send a QR code verification request to the server when the gate device scans it, so that the server can perform a legitimacy verification on the target structure data of the target QR code according to the QR code verification request; if the target QR code is legal, it is determined whether to allow the target to pass through the gate device based on the ticket status of the target QR code, the entry and exit stations, and the properties of the gate device.
[0115] When the payment operation corresponding to the ticket purchase request is completed, the ticket purchase information corresponding to the ticket purchase request is determined, wherein the ticket purchase information includes the entry station, the exit station, etc., and may also include the ticket purchase time, the payment channel, etc. After the ticket purchase information is determined, the pre-set generation format of the target QR code is obtained, and the ticket purchase information is combined according to the generation format to generate the target QR code. After obtaining the ticket purchase information, the ticket purchase information may also be encrypted, and then combined to obtain the encrypted target QR code.
[0116] In some optional implementations, the target structure data of the target two-dimensional code includes a card issuer code and a verification signature.
[0117] The target structure data includes the card issuer code and verification signature, which can facilitate the subsequent legitimacy verification of the one-way ticket with the target QR code.
[0118] In a practical application, the target structure data is shown in Table 1:
[0119]
[0120] Table 1
[0121] In the table, the length of the ticket order number "N-32" means that the length of the ticket order number is N to 32; "B" means byte; "Ans" means any data type; "M" means a required item; "C" means a conditional required item, that is, under certain conditions, this field must be filled in; "MC" means that under certain conditions, this field can be filled in optionally; the specific conditions can be determined by the staff.
[0122] Step S403: Send the target QR code to the ticket purchasing device so that the ticket purchasing device prints a one-way ticket including the target QR code.
[0123] After obtaining the target QR code, the ticket purchasing device can directly print the target QR code.
[0124] In some optional implementations, the above step S403 includes:
[0125] Step S4031, obtaining printing parameters, wherein the printing parameters include at least one of a printing font and a printing cover; the printing cover includes at least one of an entry site, an exit site, and a holiday pattern.
[0126] The ticketing system stores different print covers, print fonts, etc., where the print parameters may include font size, print cover, etc.; the print cover may include the purchase date, the bus route, etc. In some optional implementations, the ticketing system provides a visual interface to set the face of the one-way ticket of the target QR code, including the print cover, print font, and the time dimension and space dimension corresponding to different ticket styles. The time dimension may include holidays, major event days, anniversaries, working days, etc., and the space dimension may include different routes, hotspot stations, and different station terminal equipment, etc. The staff can set the printing parameters according to the current date, the route, station, etc. in the target structure data of the target QR code.
[0127] Printing parameters can be changed in real time according to time. When the date changes, the holiday pattern in the printing parameters will change with the holiday closest to the current date.
[0128] In some optional implementations, the ticket purchasing device may also display printing parameters through a visual interface, and passengers may select and set the printing parameters through the visual interface.
[0129] Step S4032: Print a one-way ticket containing the target QR code according to the printing parameters.
[0130] After obtaining the printing parameters, the ticket purchasing device prints a one-way ticket with the target QR code according to the printing parameters.
[0131] By obtaining the printing parameters and printing a one-way ticket containing the target QR code according to the printing parameters, it can meet personalized needs and improve the travel experience of passengers.
[0132] Step S404, when the ticket purchasing device successfully prints the one-way ticket of the target QR code, the ticket card status of the one-way ticket of the target QR code is saved; the ticket card status is used to indicate whether the one-way ticket of the target QR code is used.
[0133] After printing the one-way ticket of the target QR code, the ticket status of the one-way ticket of the target QR code is set to unused, so that the passenger can complete the trip with the one-way ticket of the target QR code.
[0134] The one-way ticket generation method provided in this embodiment allows passengers to send ticket purchase applications to the ticketing platform through a ticket purchasing device; after completing the payment, the ticketing platform generates a QR code and sends the QR code to the ticket purchasing device, which prints the one-way ticket with the QR code to meet the travel needs of the passengers.
[0135] In some optional implementations, the face of the one-way ticket can be customized through the ticketing system. The face cover of the one-way ticket can be freely configured through the ticketing system. The ticketing system can configure the face of the one-way ticket according to the use time, route, ticket number and equipment in the passing station of the one-way ticket.
[0136] In some optional implementations, the face of the one-way ticket with a QR code also includes a ticket number, and the ticket number of each one-way ticket is different. The ticket number can be generated in the ticketing system, and the composition rules of the ticket number can be preset by the staff.
[0137] By customizing the face of a one-way ticket, you can differentiate between passengers, routes, station facilities, boarding stations, etc.
[0138] In a practical application, the steps for customizing the face of a QR code one-way ticket are as follows: Figure 8 As shown, the Internet ticketing system pre-sets the ticket customization parameters, and then selects the corresponding ticket customization parameters according to the actual situation and sends them to the ticket purchasing device; the ticket purchasing device can be a mobile phone APP or a ticket purchasing terminal in the station. After obtaining the ticket customization parameters, the ticket purchasing device updates its own ticket customization parameters to make them effective, and reports the effectiveness results to the Internet ticketing system so that the Internet ticketing system can view the effectiveness and manage the ticket purchasing device. After the passenger sends an application to purchase a QR code one-way ticket to the ticket purchasing device, the ticket purchasing device generates the corresponding QR code one-way ticket according to the ticket customization parameters. When the ticket purchasing device is a ticket purchasing terminal in the station, the ticket purchasing terminal prints a paper QR code one-way ticket according to the ticket customization parameters. When the ticket purchasing device is a mobile phone APP, the ticket of the QR code one-way ticket can be displayed electronically on the mobile phone, and its appearance and usage attributes are the same as the paper QR code. It can prevent passengers from damage, loss and other problems and improve operational efficiency.
[0139] In some optional implementations, when the ticket purchasing device is a mobile phone APP, the mobile phone can take a screenshot of the QR code of the one-way ticket, save it, and use it to avoid being unable to open the purchased ticket due to mobile phone network problems in the station, thereby improving the convenience of use for passengers.
[0140] In a practical application, Fig. 9 As shown, the passenger purchases a QR code one-way ticket in the non-paid area of the ticket purchasing device, selects the destination station and the number of tickets to be issued, and the ticket purchasing device displays the fare payable, which the passenger pays. The ticket purchasing device includes a mobile phone APP and a ticket purchasing terminal in the station. When the ticket purchasing device is a mobile phone APP, the passenger can use a non-cash payment method. When the ticket purchasing device is a ticket purchasing terminal in the station, the passenger can choose to pay in cash or non-cash. The passenger confirms the payment method, payment amount and other information before making the payment. After the payment is successful, a successful payment mark can be displayed on the ticket purchasing device.
[0141] After the passenger completes the payment, the ticket purchasing device and the Internet ticketing system generate the code. The code generation includes: the ticket purchasing device sends a QR code single-trip ticket pre-sale request to the Internet ticketing system, and the Internet ticketing system prepares the code data according to the pre-sale request, and then sequentially performs data assembly, code structure encryption, and data saving operations, and then the saved data is returned to the ticket purchasing device. The ticket purchasing device generates a QR code based on the received data. In the case of failure to generate the QR code, a cancellation of the sale result notification is sent to the Internet ticketing system, and the ticket purchasing device automatically refunds the original account of the passenger. In some optional implementations, after the Internet ticketing system receives the cancellation of the sale result notification, a return result is generated to the ticket purchasing device. In the case of successful QR code generation, a successful sale result notification and a single-trip ticket sale transaction are sent to the Internet ticketing system, and the Internet ticketing system saves the data after receiving the single-trip ticket sale transaction. In some optional implementations, after the Internet ticketing system receives the successful sale result notification and the single-trip ticket sale transaction, a return result is generated to the ticket purchasing device.
[0142] In this embodiment, a one-way ticket inspection device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions have been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0143] This embodiment provides a one-way ticket inspection device, such as Fig.10 As shown, including:
[0144] The sending module 501 is used to obtain a QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning the target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes the entry station and the exit station;
[0145] Verification module 502, used to perform legality verification on target structure data of the target two-dimensional code according to the two-dimensional code verification request;
[0146] The judging module 503 is used to judge whether to allow the target QR code to pass through the gate device according to the ticket card status of the one-way ticket of the target QR code, the entry station and the exit station, and the attributes of the gate device if the target QR code is legal;
[0147] The updating module 504 is used to control the gate device to open if passage is allowed, and to update the ticket status of the one-way ticket of the target QR code.
[0148] In some optional implementations, the verification module 502 includes:
[0149] The extraction unit is used to extract the target structure data of the target two-dimensional code.
[0150] The data judgment unit is used to judge whether the card issuing institution code and verification signature in the target structure data are accurate.
[0151] The first verification result unit is used to pass the legality verification if the judgment results of the card issuing institution code and the verification signature are both accurate.
[0152] In some optional implementations, the gate device is a station entry gate, and the determination module 503 includes:
[0153] A first ticket status acquisition unit is used to acquire the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited;
[0154] A first device code acquisition unit is used to acquire the device code in the target structure data of the target QR code when the ticket card status of the one-way ticket of the target QR code is not entered into the station;
[0155] The first passing judgment unit is used to judge whether the station to which the equipment code belongs is consistent with the station entry station. If they are consistent, the equipment is allowed to pass through the gate.
[0156] In some optional implementations, the gate device is an exit gate, and the determination module 503 further includes:
[0157] A second ticket status acquisition unit is used to acquire the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited;
[0158] A second device code acquisition unit is used to acquire the device code in the target structure data of the target QR code when the ticket card status of the one-way ticket of the target QR code is entered;
[0159] The second passing judgment unit is used to judge whether the station to which the equipment code belongs is consistent with the exit station. If they are consistent, the gate equipment is allowed to pass.
[0160] In some optional implementations, the gate device is a station entry gate, and the update module 504 includes:
[0161] The first marking unit is used to mark the ticket status of the one-way ticket with the target QR code as having entered the station.
[0162] In some optional implementations, the gate device is an exit gate, and the update module 504 includes:
[0163] The second marking unit is used to mark the ticket status of the one-way ticket with the target QR code as exited.
[0164] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0165] The single-trip ticket inspection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0166] This embodiment also provides a one-way ticket generating device, including:
[0167] The ticket purchase application acquisition module 601 is used to acquire the ticket purchase request sent by the ticket purchase device; the ticket purchase request includes the entry station and the exit station.
[0168] The target QR code generation module 602 is used to generate a target QR code of the target data structure according to the ticket purchase request if the payment operation corresponding to the ticket purchase request is completed; the target QR code is used to instruct the gate device to send a QR code verification request to the server when the gate device scans it, so that the server can perform a legitimacy check on the target structure data of the target QR code according to the QR code verification request; if the target QR code is legal, it is determined whether to allow the target to pass through the gate device based on the ticket status of the target QR code, the entry and exit stations, and the properties of the gate device.
[0169] The printing module 603 is used to send the target QR code to the ticket purchasing device so that the ticket purchasing device prints a one-way ticket including the target QR code.
[0170] The saving module 604 is used to save the ticket card status of the one-way ticket with the target QR code when the ticket purchasing device successfully prints the one-way ticket with the target QR code; the ticket card status is used to indicate whether the one-way ticket with the target QR code is used.
[0171] In some optional implementations, the target structure data of the target two-dimensional code includes a card issuer code and a verification signature.
[0172] In some optional implementations, the module 603 includes:
[0173] The printing parameter acquisition unit is used to acquire printing parameters, wherein the printing parameters include at least one of a printing font and a printing cover; the printing cover includes at least one of an entry site, an exit site, and a holiday pattern.
[0174] The printing unit is used for printing a one-way ticket containing a target QR code according to printing parameters.
[0175] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0176] The one-way ticket generating device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0177] The embodiment of the present invention also provides a computer device having the above Fig.10 The single-trip ticket checking device shown.
[0178] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.11 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 10 is taken as an example.
[0179] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0180] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0181] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0183] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.
[0184] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0185] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0186] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0187] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A one-way ticket checking method, characterized in that: The method comprises: Obtain a QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning a target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes an entry station and an exit station; According to the two-dimensional code verification request, the target structure data of the target two-dimensional code is verified for legality; If the target QR code is legal, determine whether to allow the ticket to pass through the gate device according to the ticket status of the one-way ticket of the target QR code, the entry and exit stations, and the attributes of the gate device; If passage is allowed, the gate device is controlled to open and the ticket status of the one-way ticket with the target QR code is updated.
2. The method according to claim 1, characterized in that The legitimacy verification of the target structure data of the target two-dimensional code includes: Extracting target structure data of the target two-dimensional code; Determining whether the card issuer code and verification signature in the target structure data are accurate; If the judgment results of the card issuing institution code and the verification signature are both accurate, the legitimacy check is passed.
3. The method according to claim 1, characterized in that In the case where the gate device is an entry gate, judging whether to allow passage through the gate device according to the ticket status of the one-way ticket of the target QR code, the entry station and the exit station, and the attributes of the gate device includes: Obtaining the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited; When the ticket status of the one-way ticket of the target QR code is "not entered", the device code in the target structure data of the target QR code is obtained; Determine whether the site to which the device code belongs is consistent with the entry site. If they are consistent, allow the vehicle to pass through the gate device.
4. The method according to claim 1, characterized in that: In the case where the gate device is an entry gate, the controlling the gate device to open and updating the ticket card status of the one-way ticket of the target QR code includes: The ticket status of the one-way ticket of the target QR code is marked as entered.
5. The method according to claim 1, characterized in that In the case where the gate device is an exit gate device, judging whether to allow passage through the gate device according to the ticket status of the one-way ticket of the target QR code, the entry station and the exit station and the attribute of the gate device includes: Obtaining the ticket status of the one-way ticket of the target QR code, wherein the ticket status is one of entered, not entered, and exited; When the ticket status of the one-way ticket of the target QR code is "entered", obtaining the device code in the target structure data of the target QR code; Determine whether the site to which the device code belongs is consistent with the exit site, and if consistent, allow the vehicle to pass through the gate device.
6. The method according to claim 1, characterized in that In the case where the gate device is an exit gate device, the controlling the gate device to open and updating the ticket card status of the one-way ticket of the target QR code includes: The ticket status of the one-way ticket of the target QR code is marked as exited.
7. A method for generating a one-way ticket, characterized in that: The method comprises: Obtaining a ticket purchase request sent by a ticket purchase device; the ticket purchase request includes an entry station and an exit station; If the payment operation corresponding to the ticket purchase request is completed, a target two-dimensional code of the target data structure is generated according to the ticket purchase request; the target two-dimensional code is used to instruct the gate device to send a two-dimensional code verification request to the server when the gate device scans it, so that the server performs a legality verification on the target structure data of the target two-dimensional code according to the two-dimensional code verification request; if the target two-dimensional code is legal, it is determined whether to allow the gate device to pass according to the ticket card status of the target two-dimensional code, the entry station and the exit station and the attributes of the gate device; Sending the target QR code to the ticket purchasing device so that the ticket purchasing device prints a one-way ticket including the target QR code; When the ticket purchasing device successfully prints the one-way ticket of the target QR code, the ticket card status of the one-way ticket of the target QR code is saved; the ticket card status is used to indicate whether the one-way ticket of the target QR code is used.
8. The method according to claim 7, characterized in that The target structure data of the target two-dimensional code includes a card issuing institution code and a verification signature.
9. The method according to claim 7, characterized in that: The step of sending the target two-dimensional code to the ticket purchasing device so that the ticket purchasing device prints a one-way ticket including the target two-dimensional code comprises: Acquire printing parameters, wherein the printing parameters include at least one of a printing font and a printing cover; the printing cover includes at least one of an entry station, an exit station, and a holiday pattern; According to the printing parameters, a one-way ticket including the target two-dimensional code is printed.
10. A one-way ticket checking device, characterized in that: The device comprises: The sending module is used to obtain a QR code verification request sent by the gate device; the QR code verification request is generated by the gate device scanning a target QR code; the target QR code is printed and generated by the ticket purchasing device after receiving the ticket purchase request; the ticket purchase request includes an entry station and an exit station; A verification module, used to perform a legality verification on the target structure data of the target two-dimensional code according to the two-dimensional code verification request; A judgment module, for judging whether to allow the user to pass through the gate device according to the ticket status of the one-way ticket of the target QR code, the entry station and the exit station, and the attributes of the gate device if the target QR code is legal; The updating module is used to control the gate device to open if passage is allowed, and to update the ticket status of the one-way ticket of the target QR code.
Citation Information
Cited By
Subway riding code verification method and device, electronic equipment and storage medium
CN120725046A
Subway ride code checking method and device, electronic equipment and storage medium
CN120725046B