A dynamic electronic one-way ticket generation and verification method based on H5 page
By adopting dynamic electronic one-way ticket generation and verification methods based on H5 pages in the electronic ticketing system, using asymmetric key encryption and dynamic timestamps, the problem of static encoding being easily copied and tampered is solved, and efficient verification and user experience improvement during network instability or peak periods is achieved.
Patent Information
- Application Number
- CN202411738611.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing electronic ticketing system uses static encoding when designing H5 pages, which is easily copied and tampered with, and cannot be verified in time during network instability or peak periods, affecting the user experience.
The dynamic electronic one-way ticket generation and verification method based on the H5 page is adopted to generate unique electronic tickets through asymmetric key encryption and dynamic timestamps, and QR codes are stored locally on the H5 page, supporting offline verification and online key exchange verification.
Ensure that the ticket information has not been tampered with, avoid offline tampering, improve verification efficiency during network instability or peak periods, prevent QR codes from being copied and used, and improve user experience.
Smart Images

Figure CN119232492B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dynamic electronic one-way ticket generation and verification, and in particular to a dynamic electronic one-way ticket generation and verification method based on an H5 page. Background Art
[0002] Electronic ticketing systems have become an integral part of modern transportation and are widely used in a variety of travel scenarios, including buses, subways, and trains. These systems provide great convenience to users, making the ticket purchase and verification process faster and more efficient. As an important form of electronic ticketing systems, electronic single-trip tickets can be purchased by users through mobile terminals such as smartphones, and quickly verified by scanning codes or NFC technology when riding.
[0003] However, most electronic ticketing systems on the market currently tend to use static coding when designing H5 pages. Statically coded electronic ticketing systems usually generate electronic tickets through fixed codes and vouchers. Although this method simplifies the system architecture, it also brings the risk of easy copying and tampering. Since the ticket information is relatively fixed, technicians can copy it relatively easily, which may lead to the ticket being forged or reused. At the same time, static tickets are also relatively slow in information update and dynamic verification, and it is difficult to quickly respond to real-time change requirements or emergencies, affecting the user's convenient experience.
[0004] Although some electronic ticketing systems have adopted dynamic coding to improve security and reliability, and prevent counterfeiting and abuse by generating and verifying ticket information in real time, in ticketing systems that adopt dynamic coding, during the verification process, the system usually needs to exchange data with the server in real time to verify the validity of the electronic ticket. However, this process has high requirements on the network, and network instability or delay may directly affect the smooth progress of verification. For example, the user's mobile network (such as cellular data) may be unstable or even offline in areas with weak signals or high traffic density. In these cases, the dynamically coded tickets cannot be verified in time, resulting in the user's inability to enter the station smoothly. Especially during peak traffic periods, the station has a huge flow of people, which will aggravate the problem of network congestion.
[0005] The purpose of this invention is to design a dynamic electronic one-way ticket generation and verification method based on H5 page in view of the above-mentioned problems in the prior art. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a dynamic electronic one-way ticket generation and verification method based on H5 page, which can solve the above-mentioned problems.
[0007] The present invention provides a method for generating and verifying a dynamic electronic one-way ticket based on an H5 page, comprising:
[0008] When purchasing a ticket, the user obtains the ticket information, user ID, and timestamp of the electronic ticket, and uses an asymmetric key to encrypt the ticket information and user ID data of the electronic ticket to obtain an encrypted electronic ticket;
[0009] The encrypted electronic ticket is combined with the dynamically updated timestamp to generate a dynamic electronic one-way ticket, a QR code of the dynamic electronic one-way ticket is generated, and the QR code of the dynamic electronic one-way ticket is locally stored through the H5 page;
[0010] During verification, the verification terminal scans the QR codes of three electronic one-way tickets at the same time, randomly selects the QR codes of two dynamic electronic one-way tickets for comparison, and obtains the comparison result;
[0011] If the comparison results are the same, the verification request is rejected. Otherwise, the QR code of the electronic one-way ticket is verified based on the current verification busyness and the user-side network status.
[0012] Further, the method of using an asymmetric key to encrypt the ticket information and user identification data of the electronic ticket to obtain the encrypted electronic ticket includes:
[0013] The verification end generates an asymmetric key pair. When a user purchases a ticket, the verification end sends the verification end public key to the user end, and the verification end private key is stored on the verification end;
[0014] The user generates an asymmetric key pair. When purchasing a ticket, the user sends the user's public key to the verification end, and the user's private key is stored on the user's end;
[0015] The ticket information and user identification data of the electronic ticket are encrypted using the user's private key to generate a digital string, and the digital string is encrypted using the verification end public key to obtain an encrypted electronic ticket.
[0016] Further, the verification busyness is obtained through the following steps:
[0017] Collect historical verification data and its corresponding verification terminals, time periods, holidays, and number of people participating in surrounding activities to build busyness prediction training samples;
[0018] A busyness prediction model is constructed through a neural network model. The verification end, time period, holidays, and number of people in surrounding activities are used as inputs of the busyness prediction model, and the historical verification number data is used as outputs of the busyness prediction model to train the busyness prediction model.
[0019] Input the data of the current verification terminal, time period, holidays, and number of people in surrounding activities into the busyness prediction model to predict the number of possible verifications in the current time period;
[0020] If the number of possible verification times in the current time period is less than the first busyness threshold, the current verification busyness is marked as a medium or low peak period, otherwise it is marked as a peak period.
[0021] Further, the verification of the QR code of the electronic one-way ticket according to the current verification busyness and the user terminal network status includes:
[0022] If the current user end network status is offline, the QR code of the electronic one-way ticket is verified offline according to the current verification busyness;
[0023] If the current user-side network status is online, if the current verification busyness is at peak, the QR code of the electronic one-way ticket is verified offline; if the current verification busyness is at medium or low peak, the QR code of the electronic one-way ticket is verified online through key exchange.
[0024] Further, the online key exchange verification steps are as follows:
[0025] Perform verification of the verification end private key on the QR code of any dynamic electronic one-way ticket to obtain a first electronic ticket string;
[0026] The verification end obtains the user end public key in real time, performs user end public key verification on the first electronic ticket string, and obtains the second electronic ticket string;
[0027] Determine whether the ticket information and user identification in the second electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
[0028] Further, the offline verification steps are as follows:
[0029] Perform verification of the QR code of the electronic one-way ticket with the verification end private key to obtain a third electronic ticket string;
[0030] Performing user end public key verification on the third electronic ticket character string to obtain a fourth electronic ticket character string;
[0031] Determine whether the ticket information and user identification in the fourth electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
[0032] Further, the offline verification of the QR code of the electronic one-way ticket according to the current verification busyness includes:
[0033] If the current verification busyness is at peak, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR code of any one of the dynamic electronic one-way tickets is successfully verified offline, the verification is successful.
[0034] If the current verification busyness is in the medium or low peak period, the QR codes of the two dynamic electronic one-way tickets will be verified offline. If the offline verification of the QR codes of the two dynamic electronic one-way tickets is successful and the timestamp interval is less than the interval threshold, the verification is passed.
[0035] Furthermore, if the current verification busyness is at a peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the offline verification of the QR code of any one of the dynamic electronic one-way tickets succeeds, the verification is passed and further execution is performed:
[0036] If the offline verification of the QR codes of two dynamic electronic one-way tickets fails, the QR code of the third dynamic electronic one-way ticket is selected for offline verification. If the offline verification of the QR code of the third dynamic electronic one-way ticket succeeds, the verification is successful, otherwise the verification fails.
[0037] Furthermore, if the current verification busyness is in the middle or low peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR codes of the two dynamic electronic one-way tickets are successfully verified offline and the timestamp interval is less than the interval threshold, the verification is passed and further execution is performed:
[0038] If the offline verification of the QR codes of both dynamic electronic one-way tickets fails, the verification fails;
[0039] If the offline verification of the QR codes of two dynamic electronic one-way tickets is successful, but the time stamp interval is greater than the interval threshold, the verification fails.
[0040] Furthermore, if the current verification busyness is in the middle or low peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR codes of the two dynamic electronic one-way tickets are successfully verified offline and the timestamp interval is less than the interval threshold, the verification is passed and further execution is performed:
[0041] If the offline verification of the QR code of any dynamic electronic one-way ticket fails, the QR code of the third dynamic electronic one-way ticket will be selected for offline verification;
[0042] If the QR code of the third dynamic electronic one-way ticket is successfully verified offline and the timestamp interval between it and the timestamp of the QR code of the dynamic electronic one-way ticket that has been verified offline before is less than the interval threshold, the verification is successful, otherwise the verification fails.
[0043] Beneficial effects of the present invention:
[0044] First, the digital string encrypted by the public and private keys of the user end through asymmetric encryption ensures that the ticket information has not been tampered with, and the public key encryption of the verification end through asymmetric encryption ensures that only the verification end can read and verify the ticket. The user end public key obtained by the verification end when the user purchases the ticket can be verified using the local user end public key when the network is unstable or offline. This encryption mode is applied to offline or online application scenarios, which can effectively prevent offline tampering of electronic tickets.
[0045] The second is to generate a dynamic electronic one-way ticket by combining the encrypted electronic ticket with a dynamically updated timestamp. This ensures that each ticket is unique, and the timestamp can be used to verify whether it has been screenshot or copied. The generated encrypted string is stored through the local storage function of the H5 page. When the mobile phone signal is poor, the user can use the dynamic electronic one-way ticket for verification in an offline state.
[0046] The third is to randomly select two QR codes for comparison, with one QR code as a redundant backup. If the reading results of the two QR codes are the same, it is considered that the QR code may be copied, and the system will reject the verification request without the need for subsequent verification steps. This pre-verification step can save time and prevent the QR code from being reused.
[0047] Fourth, if the user is offline or verifying during peak hours, the quick offline verification is used directly. Only when the verification is not busy and the user's network is normal, the online key exchange verification is used. However, the offline verification method has certain risks, so it is also necessary to verify the QR codes of multiple dynamic electronic tickets according to the current busy situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a method flow chart of an embodiment. DETAILED DESCRIPTION
[0050] To facilitate understanding by those skilled in the art, the structure of the present invention is now further described in detail with reference to the embodiments and the accompanying drawings. It should be understood that the steps mentioned in the present embodiment, unless otherwise specified in their order, can be adjusted in order according to actual needs, and can even be executed simultaneously or partially simultaneously.
[0051] Example
[0052] like Figure 1 As shown, the embodiment of the present invention provides a method for generating and verifying a dynamic electronic one-way ticket based on an H5 page, including:
[0053] When S1 purchases a ticket, the user obtains the ticket information, user ID, and timestamp of the electronic ticket, and uses an asymmetric key to encrypt the ticket information and user ID data of the electronic ticket to obtain an encrypted electronic ticket;
[0054] S101 The verification end generates an asymmetric key pair. When a user purchases a ticket, the verification end sends the verification end public key to the user end, and the verification end private key is stored in the verification end;
[0055] S102 The user terminal generates an asymmetric key pair. When the user purchases a ticket, the user terminal public key is sent to the verification terminal, and the user terminal private key is stored in the user terminal;
[0056] S103 uses the user's private key to encrypt the ticket information and user identification data of the electronic ticket to generate a digital string, and then uses the verification end public key to encrypt the digital string to obtain an encrypted electronic ticket.
[0057] In this step, asymmetric encryption allows different keys (public key and private key) to be used for encryption and decryption. The public key is used to encrypt the ticket information, ensuring that the data is kept confidential during transmission and storage. Even if it is intercepted, it cannot be easily decrypted. Only the corresponding private key can decrypt the data, ensuring the confidentiality of the information.
[0058] When purchasing a ticket, the user can automatically apply for a verification end public key from the verification end (server) on the user's mobile phone, provide the user with the verification end public key for encrypting data, and ensure that only the verification end private key can decrypt this data. The public key and private key of the user end allow the verification end to verify the user's identity and the authenticity of the ticket when checking the ticket. The digital string encrypted by the public key and private key of the user end ensures that the ticket information has not been tampered with, and the verification end public key encryption ensures that only the verification end can read and verify the ticket. The user end public key obtained by the verification end when the user purchases the ticket can be verified using the local user end public key when the network is unstable or offline. This encryption mode is applied to offline or online application scenarios, which can effectively prevent offline tampering of electronic tickets. The public key and private key encryption and decryption calculation process is a prior art and will not be repeated in the present invention.
[0059] The S2 encrypted electronic ticket is combined with the dynamically updated timestamp to generate a dynamic electronic one-way ticket, generate a QR code for the dynamic electronic one-way ticket, and store the QR code of the dynamic electronic one-way ticket locally on the H5 page;
[0060] In this step, the encrypted electronic ticket is combined with the dynamically updated timestamp to generate a dynamic electronic one-way ticket. This ensures that each ticket is unique, and the timestamp can be used to verify whether it has been screenshot or copied. The generated encrypted string is stored through the local storage function of the H5 page. When the mobile phone signal is poor, the user can use the dynamic electronic one-way ticket for verification in an offline state.
[0061] During S3 verification, the verification end scans the QR codes of three electronic one-way tickets at the same time, randomly selects the QR codes of two dynamic electronic one-way tickets for comparison, and obtains the comparison result;
[0062] In this step, in order to prevent the QR code from being copied and used, the verification end (gate) reads three QR codes continuously within 800 milliseconds, randomly selects two of them for comparison, and keeps one of them as a redundant backup. If the reading results of the two QR codes are the same, it is considered that the QR code may have been copied, and the system will reject the verification request without the need for subsequent verification steps. This pre-verification step can save time and achieve the purpose of preventing the QR code from being reused.
[0063] If the comparison results are the same, S4 rejects the verification request, otherwise the QR code of the electronic one-way ticket is verified according to the current verification busyness and the user-side network status.
[0064] Specifically, the verification busyness is obtained through the following steps:
[0065] Collect historical verification data and its corresponding verification terminals, time periods, holidays, and number of people participating in surrounding activities to build busyness prediction training samples;
[0066] A busyness prediction model is constructed through a neural network model. The verification end, time period, holidays, and number of people in surrounding activities are used as inputs of the busyness prediction model, and the historical verification number data is used as outputs of the busyness prediction model to train the busyness prediction model.
[0067] Input the data of the current verification terminal, time period, holidays, and number of people in surrounding activities into the busyness prediction model to predict the number of possible verifications in the current time period;
[0068] If the number of possible verification times in the current time period is less than the first busyness threshold, the current verification busyness is marked as a medium or low peak period, otherwise it is marked as a peak period.
[0069] In this step, different verification terminals may be located in different geographical locations or serve different user groups. Some verification terminals may be busier than others, especially at transportation hubs or large event venues. Different time periods of the day (such as morning rush hour, noon rush hour, and evening rush hour) will have different passenger flows, which will directly affect the number of verifications. Holidays usually lead to significant changes in passenger flow. For example, holidays may increase passenger flow in tourist attractions, shopping malls, etc. Surrounding activities (such as concerts, sports events, etc.) will significantly increase passenger flow at nearby verification terminals. By combining these parameters with historical verification number data to predict the busyness of the site, the busyness of the site can be predicted in advance, and the verification strategy can be adjusted in advance to deal with the verification overload problem of the site.
[0070] The first busyness threshold can be statistically analyzed through historical verification number data. For example, the first busyness threshold can be set to the 70th percentile of the historical verification number data. 70% of the values in the historical verification number data are less than this threshold. Verification times below this value are considered to be less busy, and verification times above this value indicate a higher level of busyness.
[0071] S401: if the current user terminal network status is offline, perform offline verification on the QR code of the electronic one-way ticket according to the current verification busyness;
[0072] S402: If the current user terminal network status is online, if the current verification busyness is at peak, then the QR code of the electronic one-way ticket is verified offline; if the current verification busyness is at medium or low peak, then the QR code of the electronic one-way ticket is verified online through key exchange.
[0073] In this step, the user's mobile network (such as cellular data) may be unstable or even offline in areas with weak signals or when there is a high density of people. In these cases, the dynamically encoded ticket cannot be verified in time, resulting in the user being unable to enter the station smoothly. Therefore, if the user is offline or verifying during peak hours, use quick offline verification directly, and only use online key exchange verification when verification is not busy and the user's network is normal.
[0074] Specifically, the online key exchange verification steps are as follows:
[0075] Perform verification of the verification end private key on the QR code of any dynamic electronic one-way ticket to obtain a first electronic ticket string;
[0076] The verification end obtains the user end public key in real time, performs user end public key verification on the first electronic ticket string, and obtains the second electronic ticket string;
[0077] Determine whether the ticket information and user identification in the second electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
[0078] In this step, online key exchange emphasizes obtaining the user's public key in real time during verification, so the public key verification at this time is the most accurate, which ensures that the public key is the latest and accurate, avoiding the risk caused by expired or tampered public keys, so only one dynamic electronic one-way ticket needs to be verified by online key exchange. After successful user-side public key verification, check the ticket information and user identification in the string to confirm whether it is correct, confirm whether the ticket information is consistent with the details of the purchased ticket, and whether the user identity is consistent with the ticket purchaser.
[0079] Specifically, the offline verification steps are as follows:
[0080] Perform verification of the QR code of the electronic one-way ticket with the verification end private key to obtain a third electronic ticket string;
[0081] Performing user end public key verification on the third electronic ticket character string to obtain a fourth electronic ticket character string;
[0082] Determine whether the ticket information and user identification in the fourth electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
[0083] In this step, when the user purchases the ticket, the verification end has obtained the user's public key, so the user's public key verification is used after the verification end private key is verified for the first time. It can also be used when the user is offline, without the need to exchange public key data in real time. The verification end private key verification can confirm that the data is encrypted by the verification end public key authority to ensure the authenticity of the data. The user's public key verification ensures that the data has not been tampered with and proves that it was indeed created or owned by the user, because only the user has the private key to generate this specific signature.
[0084] Furthermore, since offline verification has the risk of offline tampering, for example, an attacker may try to copy the QR code and distribute multiple copies. If there is no online synchronization verification mechanism, fake tickets may be reused and pass verification. Therefore, it is necessary to use the QR codes of multiple dynamic electronic tickets for verification. The specific steps are as follows:
[0085] If the current verification busyness is at peak, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR code of any one of the dynamic electronic one-way tickets is successfully verified offline, the verification is successful.
[0086] Furthermore, if the offline verification of the QR codes of the two dynamic electronic one-way tickets fails, the QR code of the third dynamic electronic one-way ticket is selected for offline verification. If the offline verification of the QR code of the third dynamic electronic one-way ticket succeeds, the verification is successful, otherwise the verification fails.
[0087] In this step, as long as the private key verification of any QR code is successful, the verification is passed. If both QR codes fail, a third QR code is added for verification. This can avoid verification failures due to scanning problems to a certain extent. If resources permit, the accuracy and security of verification can be improved to prevent forgery or reuse of bills. During peak hours, the verification process can be appropriately relaxed to improve the overall passing efficiency.
[0088] If the current verification busyness is in the medium or low peak period, the QR codes of the two dynamic electronic one-way tickets will be verified offline. If the offline verification of the QR codes of the two dynamic electronic one-way tickets is successful and the timestamp interval is less than the interval threshold, the verification is passed.
[0089] Furthermore, if the offline verification of the QR codes of both dynamic electronic one-way tickets fails, the verification fails;
[0090] If the offline verification of the QR codes of two dynamic electronic one-way tickets is successful, but the time stamp interval is greater than the interval threshold, the verification fails.
[0091] Furthermore, if the offline verification of the QR code of any one of the dynamic electronic one-way tickets fails, the QR code of the third dynamic electronic one-way ticket is selected for offline verification;
[0092] If the QR code of the third dynamic electronic one-way ticket is successfully verified offline and the timestamp interval between it and the timestamp of the QR code of the dynamic electronic one-way ticket that has been verified offline before is less than the interval threshold, the verification is successful, otherwise the verification fails.
[0093] In this step, only two QR codes are successfully verified. If there is a failed QR code, a third ticket is added for verification to avoid verification failures caused by scanning problems on the verification end, so as to ensure the rigor of the verification. Since the three QR codes are scanned and read continuously, there is a continuity in the timestamps and the time interval is less than the interval threshold. This interval threshold is generally the time for the three QR codes to be scanned and read continuously. If the timestamp interval of the ticket is unreasonable and the timestamp interval is greater than the interval threshold, it may indicate that the ticket has been forged or tampered with, and the verification cannot pass. Use the conventional verification process during the mid- and low-peak periods to ensure the accuracy of the verification.
[0094] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0098] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0099] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0100] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0101] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0102] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
Claims
1. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page, characterized in that: include: When purchasing a ticket, the user obtains the ticket information, user ID, and timestamp of the electronic ticket, and uses an asymmetric key to encrypt the ticket information and user ID data of the electronic ticket to obtain an encrypted electronic ticket; The encrypted electronic ticket is combined with the dynamically updated timestamp to generate a dynamic electronic one-way ticket, a QR code of the dynamic electronic one-way ticket is generated, and the QR code of the dynamic electronic one-way ticket is locally stored through the H5 page; During verification, the verification terminal scans the QR codes of three electronic one-way tickets at the same time, randomly selects the QR codes of two dynamic electronic one-way tickets for comparison, and obtains the comparison result; If the comparison results are the same, the verification request is rejected, otherwise the QR code of the electronic one-way ticket is verified according to the current verification busyness and the user's end network status; Further, the verification busyness is obtained through the following steps: Collect historical verification data and its corresponding verification terminals, time periods, holidays, and number of people participating in surrounding activities to build busyness prediction training samples; A busyness prediction model is constructed through a neural network model. The verification end, time period, holidays, and number of people in surrounding activities are used as inputs of the busyness prediction model, and the historical verification number data is used as outputs of the busyness prediction model to train the busyness prediction model. Input the data of the current verification terminal, time period, holidays, and number of people in surrounding activities into the busyness prediction model to predict the number of possible verifications in the current time period; If the number of possible verifications in the current time period is less than the first busyness threshold, the current verification busyness is marked as a medium-low peak period, otherwise it is marked as a peak period; Specific: If the current user end network status is offline, the QR code of the electronic one-way ticket is verified offline according to the current verification busyness. Specifically: If the current verification busyness is at peak, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR code of any one of the dynamic electronic one-way tickets is successfully verified offline, the verification is successful. If the current verification busyness is in the middle or low peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the offline verification of the QR codes of the two dynamic electronic one-way tickets is successful and the timestamp interval is less than the interval threshold, the verification is passed; If the current user-side network status is online, if the current verification busyness is at peak, the QR code of the electronic one-way ticket is verified offline; if the current verification busyness is at medium or low peak, the QR code of the electronic one-way ticket is verified online through key exchange.
2. According to claim 1, a method for generating and verifying a dynamic electronic one-way ticket based on an H5 page is characterized in that: The method of using an asymmetric key to encrypt the ticket information and user identification data of the electronic ticket to obtain the encrypted electronic ticket includes: The verification end generates an asymmetric key pair. When a user purchases a ticket, the verification end sends the verification end public key to the user end, and the verification end private key is stored on the verification end; The user generates an asymmetric key pair. When purchasing a ticket, the user sends the user's public key to the verification end, and the user's private key is stored on the user's end; The ticket information and user identification data of the electronic ticket are encrypted using the user's private key to generate a digital string, and the digital string is encrypted using the verification end public key to obtain an encrypted electronic ticket.
3. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page according to claim 1, characterized in that: The online key exchange verification steps are as follows: Perform verification of the verification end private key on the QR code of any dynamic electronic one-way ticket to obtain a first electronic ticket string; The verification end obtains the user end public key in real time, performs user end public key verification on the first electronic ticket string, and obtains the second electronic ticket string; Determine whether the ticket information and user identification in the second electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
4. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page according to claim 1, characterized in that: The offline verification steps are as follows: Perform verification of the QR code of the electronic one-way ticket with the verification end private key to obtain a third electronic ticket string; Performing user end public key verification on the third electronic ticket character string to obtain a fourth electronic ticket character string; Determine whether the ticket information and user identification in the fourth electronic ticket character string are correct. If they are correct, the verification passes; otherwise, the verification fails.
5. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page according to claim 1, characterized in that: If the current verification busyness is at peak, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the offline verification of the QR code of any one of the dynamic electronic one-way tickets succeeds, the verification is passed and further executed: If the offline verification of the QR codes of two dynamic electronic one-way tickets fails, the QR code of the third dynamic electronic one-way ticket is selected for offline verification. If the offline verification of the QR code of the third dynamic electronic one-way ticket succeeds, the verification is successful, otherwise the verification fails.
6. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page according to claim 1, characterized in that: If the current verification busyness is in the middle or low peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR codes of the two dynamic electronic one-way tickets are successfully verified offline and the timestamp interval is less than the interval threshold, the verification is passed and further execution is performed: If the offline verification of the QR codes of both dynamic electronic one-way tickets fails, the verification fails; If the offline verification of the QR codes of two dynamic electronic one-way tickets is successful, but the time stamp interval is greater than the interval threshold, the verification fails.
7. A method for generating and verifying a dynamic electronic one-way ticket based on an H5 page according to claim 1, characterized in that: If the current verification busyness is in the middle or low peak period, the QR codes of the two dynamic electronic one-way tickets are verified offline. If the QR codes of the two dynamic electronic one-way tickets are successfully verified offline and the timestamp interval is less than the interval threshold, the verification is passed and further execution is performed: If the offline verification of the QR code of any dynamic electronic one-way ticket fails, the QR code of the third dynamic electronic one-way ticket will be selected for offline verification; If the QR code of the third dynamic electronic one-way ticket is successfully verified offline and the timestamp interval between it and the timestamp of the QR code of the dynamic electronic one-way ticket that has been verified offline before is less than the interval threshold, the verification is successful, otherwise the verification fails.
Citation Information
Patent Citations
Two dimension code electronic ticket business management method and system
CN106780775A
An encryption and decryption method for generating a dynamic two-dimensional code
CN109325575A
Identity verification method, system and device, terminal equipment and storage medium
CN117972658A