Ticket order verification method, device, server and storage medium
By generating dynamic codes on the application server and verifying them by the site server, the problem of low security in the existing ticket order verification method is solved, achieving higher security and lower server pressure.
Patent Information
- Application Number
- CN202210540689.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-05-17
AI Technical Summary
The existing ticket order verification method is low in security, and users can successfully enter the market through screenshots of static codes of illegal resellers.
By generating static codes on the site server and sending them to the application server, the application server generates dynamic codes based on the timestamp and mark stamps. The dynamic codes are displayed by the application client, and the site server verifies ticket orders based on the dynamic code.
It improves the security of ticket order verification, and the timeliness of dynamic codes make it difficult for users to successfully enter the market through code screenshots provided by illegal resellers, reducing the pressure on the venue server and ensuring the update performance of dynamic codes.
Smart Images

Figure CN115037475B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a ticket order verification method, device, server and storage medium. Background Art
[0002] Currently, people can purchase tickets for attractions, concerts, amusement parks, etc. in the app client. After purchasing tickets in the app client, people can pick up tickets at offline ticket collection points, and staff will check tickets at the entrance to control people's entry.
[0003] At present, in order to reduce user operations, after the user purchases the attraction ticket in the application client, the application client can display the static code of the ticket. When the user needs to enter, he / she presents the static code displayed by the application client, and the venue server verifies the user's ticket order based on the static code. After the verification is successful, the user can enter.
[0004] However, the above scheme often encounters the situation where illegal ticket resellers resell tickets. After the user purchases the ticket from the illegal ticket reseller, he can successfully enter the venue by taking a screenshot of the static code provided by the illegal ticket reseller. Therefore, the security of the above ticket order verification is relatively low. Summary of the invention
[0005] The embodiment of the present application provides a ticket order verification method, device, server and storage medium, which improves the security of ticket order verification. The technical solution is as follows:
[0006] In one aspect, a ticket order verification method is provided, which is performed by a venue server, and the method includes:
[0007] After generating a ticket order for the application client, generating a static code for the ticket order;
[0008] Sending the static code to the application server, the static code is used to generate a dynamic code in the application server based on a timestamp and a marker, the timestamp is used to indicate the timeliness of the dynamic code, the marker is used to mark the code type of the dynamic code, the static code is used to indicate the validity of the dynamic code, and the dynamic code is used to be displayed on the application client;
[0009] Identify the dynamic code displayed by the application client, and verify the ticket order based on the dynamic code.
[0010] In one aspect, a ticket order verification method is provided, which is executed by an application server, and the method includes:
[0011] Receive a static code generated by the venue server for the ticket order;
[0012] Determining a timestamp for the static code based on a current time;
[0013] Generate a dynamic code based on the timestamp, the static code and the marking stamp, wherein the marking stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code;
[0014] The dynamic code is sent to the application client, where the dynamic code is used to be displayed on the application client and is also used to verify the ticket order.
[0015] In one aspect, a ticket order verification device is provided, the device comprising:
[0016] A generating module, configured to generate a static code for a ticket order after generating a ticket order for an application client;
[0017] A sending module, used for sending the static code to an application server, wherein the static code is used to generate a dynamic code in the application server based on a timestamp and a mark stamp, wherein the timestamp is used to indicate the timeliness of the dynamic code, the mark stamp is used to mark the code type of the dynamic code, the static code is used to indicate the validity of the dynamic code, and the dynamic code is used to be displayed on the application client;
[0018] The verification module is used to identify the dynamic code displayed by the application client and verify the ticket order based on the dynamic code.
[0019] In a possible implementation, the verification module includes:
[0020] A parsing unit, used for parsing the dynamic code to obtain the timestamp, the static code and the marking stamp;
[0021] A verification unit is used to verify the ticket order based on the timestamp and the static code when the code type marked by the marking stamp is a dynamic code.
[0022] In a possible implementation, the parsing unit is used to parse the dynamic code to obtain a marking stamp, an encrypted timestamp and an encrypted static code; and decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
[0023] In one possible implementation, the parsing unit is used to encrypt the agreed password between the application server and obtain a key; use the key to decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
[0024] In one possible implementation, the verification unit is used to obtain time tolerance information between two servers, the time tolerance information includes a first duration, the first duration is used to indicate the allowable time error range between the venue server and the application server; the current time is advanced by the first duration and delayed by the first duration respectively to obtain the time range corresponding to the application server, the time range is used to indicate multiple time points that satisfy the time error range; the starting time point of the time range is advanced by the effective duration of the dynamic code, and the ending time point of the time range is delayed by the effective duration to obtain a valid timestamp range, the valid timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; the ticket order is verified based on whether the timestamp is within the valid timestamp range and whether the static code is a valid static code.
[0025] In one possible implementation, the verification unit is used to determine the validity period of the dynamic code based on the timestamp and the validity period of the dynamic code, and the dynamic code is periodically updated according to the validity period; obtain time tolerance information between two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the validity period by the first duration to obtain the fault-tolerant validity period of the dynamic code; based on whether the current time exceeds the fault-tolerant validity period and whether the static code is a valid static code, verify the ticket order.
[0026] In a possible implementation, the device further includes:
[0027] A receiving module, configured to receive a downgrade indication sent by the application server, wherein the downgrade indication is sent after a time error between the venue server and the application server exceeds the time error range;
[0028] The verification module is further configured to, in response to the downgrade indication, verify the static code included in the dynamic code to be processed, and stop verifying the timestamp included in the dynamic code.
[0029] In a possible implementation, the device further includes:
[0030] An acquisition module, used to acquire the current time of the application server;
[0031] A synchronization module, configured to perform time synchronization with the application server based on the current time, so that the time error between the place server and the application server is within the time error range;
[0032] The verification module is further used to verify the static code and timestamp included in the dynamic code to be processed after successfully synchronizing the time of the application server.
[0033] In one aspect, a ticket order verification device is provided, the device comprising:
[0034] A receiving module for receiving a static code generated by a venue server for a ticket order;
[0035] A determination module, configured to determine a timestamp for the static code based on a current time;
[0036] A generating module, configured to generate a dynamic code based on the timestamp, the static code and a marking stamp, wherein the marking stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code;
[0037] The sending module is used to send the dynamic code to the application client, and the dynamic code is used to be displayed on the application client. The dynamic code is also used to verify the ticket order.
[0038] In a possible implementation, the generating module includes:
[0039] An encryption unit, used for encrypting the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code;
[0040] A generating unit is used to generate a dynamic code including the marking stamp, the encrypted timestamp and the encrypted static code based on the marking stamp, the encrypted timestamp and the encrypted static code.
[0041] In one possible implementation, the encryption unit is used to encrypt the agreed password with the place server to obtain a key; and use the key to encrypt the timestamp and the static code to obtain the encrypted timestamp and the encrypted static code.
[0042] In a possible implementation, the dynamic code is updated periodically according to the validity period;
[0043] Every time the validity period is
[0044] The determining module is further configured to determine a timestamp for the static code based on a current time;
[0045] The generating module is further used to update the dynamic code based on the timestamp, the static code and the marking stamp;
[0046] The sending module is further used to send the updated dynamic code to the application client.
[0047] In a possible implementation, the sending module is further used to send a time acquisition request to the place server every target time, and the time acquisition request is used to obtain the current time of the place server;
[0048] The determination module is further configured to determine a time error between the place server and the application server based on the time returned by the place server and the current time of the application server;
[0049] The sending module is also used to send a downgrade indication to the place server when the time error exceeds the time error range, and the downgrade indication is used to instruct the place server to stop verifying the timestamp in the dynamic code. The time error range is used to represent the allowable time error range between the place server and the application server.
[0050] On the one hand, a server is provided, which includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the ticket order verification method in any possible implementation manner as described above.
[0051] On the one hand, a computer-readable storage medium is provided, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the operations performed by the ticket order verification method in any possible implementation manner as described above.
[0052] On the one hand, a computer program or a computer program product is provided, wherein the computer program or the computer program product comprises: a computer program code, wherein when the computer program code is executed by a computer, the computer implements the operations performed by the ticket order verification method in any possible implementation manner as described above.
[0053] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0054] The ticket order verification method, device, server, and storage medium provided in the embodiments of the present application use a dynamic code verification method when verifying a ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through a screenshot of the code provided by an illegal ticket reseller, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 is a schematic diagram of a ticket order verification system provided in an embodiment of the present application;
[0057] Figure 2 is a flow chart of a ticket order verification method provided by an embodiment of the present application;
[0058] Figure 3 is a flow chart of another ticket order verification method provided by an embodiment of the present application;
[0059] Figure 4 is a flow chart of another ticket order verification method provided by an embodiment of the present application;
[0060] Figure 5 is a flow chart of another ticket order verification method provided by an embodiment of the present application;
[0061] Figure 6 is a flow chart of another ticket order verification method provided by an embodiment of the present application;
[0062] Figure 7 It is a schematic diagram of the structure of a ticket order verification device provided in an embodiment of the present application;
[0063] Figure 8 It is a schematic diagram of the structure of another ticket order verification device provided in an embodiment of the present application;
[0064] Fig. 9 It is a schematic diagram of the structure of a ticket order verification device provided in an embodiment of the present application;
[0065] Fig.10 It is a schematic diagram of the structure of another ticket order verification device provided in an embodiment of the present application;
[0066] Fig.11 It is a schematic diagram of the structure of the server provided in the embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0068] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, a first ticket order may be referred to as a second ticket order, and similarly, a second ticket order may be referred to as a first ticket order without departing from the scope of this application.
[0069] The terms "at least one", "multiple", "each" and "any" used in this application, at least one includes one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple ticket orders include 3 ticket orders, and each refers to each of the 3 ticket orders, and any refers to any one of the 3 ticket orders, which can be the first, the second or the third.
[0070] The ticket order verification method provided in the embodiment of the present application can be applied to the entrance scenario of any venue.
[0071] For example, it is used in the entrance scene of a scenic spot.
[0072] A user purchases a ticket for scenic spot A through an e-commerce application client. If the ticket order verification method provided by the embodiment of the present application is adopted, when the user displays the dynamic code corresponding to the ticket through the e-commerce application client and waits for verification for entry, if the display time of the dynamic code reaches the effective time, then the e-commerce application client will request the application server of the e-commerce application to update the dynamic code. There is no need for the scenic spot server of scenic spot A to generate a dynamic code, which reduces the pressure on the scenic spot server. There is no need for the application server and the scenic spot server to exchange dynamic codes, thereby reducing the pressure on the application server and ensuring the update performance of the dynamic code.
[0073] It should be noted that the embodiment of the present application only exemplifies the entrance scene of any place by using the entrance scene of a scenic spot, and does not limit the entrance scene. Optionally, the entrance scene can also be the entrance scene of a concert, the entrance scene of an amusement park, etc.
[0074] In a possible implementation, the ticket order verification method provided in the embodiment of the present application is executed by a server. For example, the server may be a single server, or a server cluster consisting of several servers, or a cloud computing service center.
[0075] In another possible implementation, the ticket order verification method provided in the embodiment of the present application is executed by a ticket order verification system, which includes an application server, a venue server and an application client.
[0076] Figure 1 is a schematic diagram of a ticket order verification system provided in an embodiment of the present application, such as Figure 1 As shown, the ticket order verification system includes an application client 101, an application server 102 and a venue server 103. The application client 101 is connected to the application server 102 via a wireless or wired network. The application server 102 is connected to the venue server 103 via a wireless or wired network.
[0077] The location server 103 is a server used by the target location, which is a location that requires a ticket to enter, such as a tourist attraction, amusement park, etc. The location server 103 is used to provide services for the target location, such as verifying the ticket order of the target location.
[0078] The application client 101 is a client having the function of purchasing tickets for a target venue. Of course, the application client 101 may also have other functions, such as a review function, a sharing function, etc. In some embodiments, the application client 101 may be a client in a terminal operating system, or a client provided by a third party. In some embodiments, the application client 101 may be installed on any terminal, which may be any type of terminal such as a desktop computer, a tablet computer, or a mobile phone.
[0079] The application server 102 is a server that provides services for the application client 101. The application server 102 is a server, or a server cluster composed of several servers, or a cloud computing service center.
[0080] In some embodiments, a user purchases a ticket for a target venue on application client 101, application server 102 sends the ticket order of application client 101 to venue server 103, venue server 103 generates a graphic code for the ticket order, and sends the graphic code to application client 101 via application server 102. When the user enters the venue, the graphic code is displayed via application client 101, and venue server 103 scans and recognizes the graphic code, and verifies the ticket order based on the graphic code.
[0081] Figure 2 This is a flow chart of a ticket order verification method provided by an embodiment of the present application. This embodiment of the present application is illustrated by taking the execution subject as a venue server as an example. The embodiment includes:
[0082] 201. After generating a ticket order for an application client, the venue server generates a static code for the ticket order.
[0083] After the user successfully purchases the ticket of the target venue, a ticket order will be generated in the server. Subsequently, the user can obtain the physical ticket based on the ticket order and enter the venue based on the ticket. In order to prevent illegal ticket resellers from reselling the tickets of the target venue, an embodiment of the present application provides a method of controlling user admission using dynamic code verification. For example, after the user purchases the ticket of the target venue, when the user needs to enter the target venue, the dynamic code of the ticket is displayed through the application client, and the dynamic code is verified by the venue server. After the verification is successful, the user can enter. Among them, the dynamic code is periodically updated according to the effective duration, that is, the dynamic code will be updated once every effective duration, wherein the effective duration can be any duration such as 1 minute, 50 seconds, 30 seconds, etc., and the embodiment of the present application does not limit the effective duration. In some embodiments, the effective duration is controllable and can be set based on the needs of actual applications.
[0084] It should be noted that the work of verifying ticket orders based on dynamic codes is completed by the venue server. Therefore, the dynamic code should also be generated by the venue server, so that it is convenient for the venue server to verify ticket orders based on the dynamic code. However, the venue server is the server used by the target venue, and the performance of the venue server is very limited. Take the venue server as a server for a certain scenic spot as an example. The scenic spot receives more than tens of thousands of tourists every day. In this way, the venue server needs to generate dynamic codes for tens of thousands of ticket orders every day, and also needs to update dynamic codes and verify dynamic codes for tens of thousands of ticket orders. In addition, the venue server needs to interact with the application client through the application server. In this way, in order to transmit the dynamic code, the venue server also needs to interact with the application server tens of thousands of times a day. Therefore, this dynamic code verification method has extremely high performance requirements for the venue server, and the current venue server performance cannot meet this function at all.
[0085] In view of the above problems, the embodiment of the present application proposes a solution in which a static code is generated by a venue server, a dynamic code is generated by an application server based on the static code generated by the venue server, and a dynamic code update service is provided by the application server. In this way, the venue server can verify the dynamic code displayed by the application client based on the static code, thereby ensuring the accuracy of the dynamic code verification. In addition, the venue server only needs to generate and transmit a static code based on a ticket order, thereby reducing the number of codes generated and transmitted, thereby reducing the pressure on the venue server. For the application server, the performance of the application server is generally high, and it can undertake the task of updating the dynamic code, and it can also realize the high-frequency code change of the dynamic code. Since the validity period of each dynamic code is short when the dynamic code changes frequently, it is difficult for users to enter the venue through the screenshots provided by illegal ticket resellers, which effectively prevents illegal ticket resellers from reselling tickets.
[0086] It should be noted that the static code does not change over time, and after the venue server generates the static code, the static code remains unchanged. The ticket order in step 301 is a ticket order for which resource transfer has been completed.
[0087] 202. The place server sends the static code to the application server. The static code is used to generate a dynamic code in the application server based on a timestamp and a mark stamp. The timestamp is used to indicate the timeliness of the dynamic code. The mark stamp is used to mark the code type of the dynamic code. The static code is used to indicate the validity of the dynamic code. The dynamic code is used to be displayed on the application client.
[0088] In the embodiment of the present application, the dynamic code is generated based on the static code, the timestamp and the mark stamp. The timestamp is used to indicate the timeliness of the dynamic code. Since the dynamic code is updated periodically, after the dynamic code is updated, the previous dynamic code becomes invalid. Based on the timestamp in the dynamic code, it can be determined whether the dynamic code is invalid. In the embodiment of the present application, whether it is a static code or a dynamic code, the difference cannot be seen when it is displayed in the application client. In order to facilitate the place server to know whether the identified graphic code is a static code or a dynamic code, a mark stamp is added when the dynamic code is generated. The mark stamp is used to mark the code type of the dynamic code. In this way, when the subsequent place server parses the mark stamp from the identified graphic code, it can determine that the graphic code is a dynamic code and process the graphic code according to the processing method of the dynamic code.
[0089] It should be noted that the static code may include a marking stamp or may not include a marking stamp. In some embodiments, if the identified graphic code includes a marking stamp, and the marking stamp indicates that the code type is a static code, the server processes the graphic code according to the processing flow of the static code. In some embodiments, if the identified graphic code does not include a marking stamp, the server processes the graphic code according to the processing flow of the static code.
[0090] 203. The venue server identifies the dynamic code displayed by the application client, and verifies the ticket order based on the dynamic code.
[0091] When the user enters the venue, the dynamic code of the ticket order can be obtained from the application server through the application client and displayed. The venue server verifies the ticket order based on the dynamic code. If the verification passes, the user can enter; if the verification fails, the user cannot enter.
[0092] The ticket order verification method provided by the implementation of this application adopts a dynamic code verification method when verifying the ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through the code screenshot provided by illegal ticket resellers, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code.
[0093] Figure 3 This is a flow chart of a ticket order verification method provided by an embodiment of the present application. This embodiment of the present application is illustrated by taking the execution subject as an application server as an example. The embodiment includes:
[0094] 301. The application server receives a static code generated by the venue server for the ticket order.
[0095] The application server is a server that provides services for the application client. The application client is a client with shopping functions. The application client provides the function of purchasing tickets for the target venue. Optionally, the application client also provides the function of purchasing tickets for other venues; optionally, the application client also provides the function of purchasing other items. For example, the application client is an e-commerce client that provides functions such as purchasing tickets for attractions, concert tickets, and takeout. It also provides functions such as evaluation and sharing. The embodiments of the present application do not limit the functions of the application client. In one possible implementation, the application client is a client commonly used by users for shopping. The target venue cooperates with the application to sell tickets on the application client.
[0096] After the user purchases the ticket on the application client, a ticket order can be generated. The venue server can generate a static code for the ticket order and send the static code to the application server. Subsequently, the application server generates a dynamic code based on the static code and provides the dynamic code of the ticket order to the application client.
[0097] 302. The application server determines a timestamp for the static code based on the current time.
[0098] The dynamic code is time-sensitive. Therefore, when generating a dynamic code, it is necessary to determine a timestamp for the static code based on the current time to indicate the time when the dynamic code was generated, so that the subsequent venue server can determine whether the dynamic code is invalid based on the timestamp in the dynamic code.
[0099] 303. The application server generates a dynamic code based on the timestamp, the static code and the mark stamp, wherein the mark stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code.
[0100] It should be noted that the user can enter the venue at any time after purchasing the ticket or within a specified time period. For example, if the ticket purchased by the user does not have a specified date of use, the user can use the dynamic code of the ticket to enter the venue at any time within the validity period of the ticket. For another example, if the user purchases a ticket for a certain year, month, and day, the user needs to use the dynamic code of the ticket to enter the venue on that year, month, and day. It can be seen that the user may not need to enter the venue immediately after purchasing the ticket, so the above step 302 does not need to be executed immediately after step 301 is completed.
[0101] The application server may execute steps 302 to 303 upon receiving a dynamic code acquisition request for a ticket order from the application client.
[0102] 304. The application server sends the dynamic code to the application client. The dynamic code is used to be displayed on the application client. The dynamic code is also used to verify the ticket order.
[0103] The ticket order verification method provided in the embodiment of the present application adopts a dynamic code verification method when verifying the ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through a screenshot of the code provided by illegal ticket resellers, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code.
[0104] Figure 4 This is a flow chart of a ticket order verification method provided by the embodiment of the present application. Figure 1 The ticket order verification system shown in the figure is used as an example for exemplary description. The ticket order verification system includes an application client, an application server and a venue server. The embodiment includes:
[0105] 401. After completing the resource transfer for the ticket order of the target venue, the application server sends a ticket issuance request to the venue server, where the ticket issuance request carries the order information of the ticket order. The venue server is the server used by the target venue.
[0106] The target place is a place that requires a ticket to enter, for example, a scenic spot, a concert, an amusement park, etc., and the embodiment of the present application does not limit the target place. The ticket order for the target place can be any type of ticket order for adult tickets, children's tickets, group tickets, etc., and the embodiment of the present application does not limit the ticket order.
[0107] In the embodiment of the present application, a user can purchase tickets for a target venue on an application client, which can be a client of any third-party application, which can be a commonly used e-commerce application, etc. The embodiment of the present application does not limit the third-party application. The application server is a server that provides services for the third-party application.
[0108] The following embodiment of the present application exemplifies the process of a user purchasing a ticket for a target venue in an application client, but does not limit the process of purchasing tickets. For example, a user purchases a ticket for a target venue in an application client, and the application client sends an order generation request to an application server, and the order generation request carries a ticket identifier of the ticket; the application server receives the order generation request and forwards the order generation request to a venue server; the venue server receives the order generation request, generates a ticket order to be transferred based on the ticket identifier, and returns an order generation notification to the application server; the application server receives the order generation notification, generates a resource transfer interface for the ticket order, and sends the resource transfer interface to the application client; the application client receives and displays the resource transfer interface, and the application client responds to the user's resource transfer operation and sends a resource transfer request to the application server. The application server performs a resource transfer operation for the ticket order based on the resource transfer request, and after the resource transfer is successful, sends a ticket issuance request to the venue server, and the venue server receives the ticket issuance request and generates a ticket order with resource transfer completed based on the ticket order to be transferred.
[0109] It should be noted that the embodiment of the present application is only illustrative of the example of directly generating the corresponding ticket order to be transferred based on the ticket identifier. In another embodiment, the number of people entering the venue server every day is limited, so the number of tickets is also limited. The venue server will first determine whether the corresponding tickets are still available based on the ticket identifier. If there are any remaining tickets, the ticket order to be transferred is generated. If there are no remaining tickets, an order failure notification is returned to the application server, and the order failure notification carries the reason for the order failure. The application server forwards the order failure notification to the application client, and the application client displays the reason for the order failure to let the user know the reason for the failure to purchase the ticket.
[0110] The order information may be order details, order ID, order number, and other information that can identify a unique ticket order. The present embodiment does not limit the order information. By carrying the order information in the ticket request, the venue server can determine a unique ticket order based on the order information, so that the venue server generates a static code for the ticket order.
[0111] 402. The venue server receives the ticket issuance request and generates a static code for the ticket order based on the ticket issuance request.
[0112] The ticket request carries order information, so that the venue server can determine the corresponding ticket order based on the ticket request, then generate a static code for the ticket order, and store the static code and the order identifier of the ticket order locally.
[0113] In one possible implementation, the venue server provides multiple types of tickets, some of which use dynamic code verification for admission, and other types of tickets use other verification methods for admission. For example, static code verification is used for admission; or, physical paper tickets are used for admission, etc. The venue server can determine which method is used to verify the tickets purchased by the ticket order based on the order information. Optionally, the venue server generates a static code and indication information for the ticket order based on the order information, and the indication information is used to indicate the verification method of the ticket order. In some embodiments, the indication information is used to indicate whether the ticket order is a dynamic code order or a static code order, wherein a dynamic code order refers to a ticket order that uses a dynamic code verification method, and a static code order refers to a ticket order that uses a static code verification method. In some embodiments, the indication information is used to indicate a processing method for a static code, and the processing method includes directly forwarding the static code and generating a dynamic code based on the static code.
[0114] The order information may be any information such as order details, order identification, etc. that can determine which verification method is used for the ticket purchased in the ticket order; or the order information may be any information such as order details, order identification, order number, etc. that can determine a unique ticket order. The venue server may determine the ticket order based on the order information and determine the indication information based on the ticket order. The embodiments of the present application do not limit the order information.
[0115] It should be noted that the embodiment of the present application is only an example of an example in which a ticket request carries order information and whether to generate a dynamic code for a ticket order is determined based on the order information. In another possible implementation, all tickets in the target venue must be entered by means of dynamic code verification. Therefore, the venue server does not need to determine the indication information based on the order information. After the application server receives the static code, it does not need the indication information and directly generates a dynamic code based on the static code.
[0116] 403. The venue server sends a ticket issuance notification to the application server, where the ticket issuance notification includes a static code generated for the ticket order.
[0117] In the embodiment of the present application, the venue server will also return a ticket issuance notification to the application server based on the ticket issuance request, and the ticket issuance notification includes a static code generated for the ticket order. Optionally, the ticket issuance notification also includes other content. For example, the ticket issuance notification also includes an order identifier of the ticket order, so that the venue server knows which ticket order the ticket issuance notification is for.
[0118] In a possible implementation, the ticket issuance notice further includes instruction information, where the instruction information is used to indicate a processing method for the static code, where the processing method includes directly forwarding the static code and generating a dynamic code based on the static code.
[0119] Optionally, the external interfaces of the application server and the venue server are modified, and new fields related to dynamic codes are added to the external interfaces, so that the venue server can inform the application server which ticket orders are dynamic code orders based on the external interfaces, so that the application server can dynamically splice and encrypt the dynamic code orders to generate dynamic codes. For example, the indication information is the value returned by the external interface connected to the venue server and the application server. The value 1 indicates that the dynamic code is generated based on the static code. When the venue server sends the static code to the application server through the interface, if the value fed back by the interface is 1, it means that the ticket order is a dynamic code order and a dynamic code needs to be generated based on the static code, such as Figure 5 As shown. Among them, dynamic code orders refer to orders that are verified through dynamic code verification.
[0120] The embodiment of the present application only takes the example that the ticket issuance notification includes a static code, instruction information and an order identifier to exemplify the ticket issuance notification, and does not limit the ticket issuance notification.
[0121] 404. The application server receives the ticket issuance notification and stores the static code.
[0122] In the embodiment of the present application, after the user purchases the ticket for the target venue, he or she does not have to enter the target venue immediately. Therefore, the application server needs to store the static code and generate a dynamic code for the user based on the static code when the user needs to enter the target venue.
[0123] When storing the static code, the application server may store the static code in correspondence with the order identifier of the ticket order, so as to accurately find the static code of the ticket order based on the order identifier later.
[0124] 405. The application client sends a dynamic code acquisition request to the application server in response to the dynamic code display operation. The dynamic code acquisition request carries the order identifier of the ticket order.
[0125] The dynamic code display operation is used to trigger the application client to display the dynamic code of the ticket order. The embodiment of the present application does not limit the dynamic code display operation.
[0126] After purchasing a ticket for a target venue, the user can immediately trigger the application client to display the dynamic code of the ticket, or trigger the application client to display the dynamic code of the ticket when entering the venue, or trigger the application client to display the dynamic code of the ticket at any time after purchasing the ticket for the target venue. The embodiment of the present application does not limit the timing of triggering the application client to display the dynamic code.
[0127] 406. The application server receives the dynamic code acquisition request, and in response to the dynamic code acquisition request, determines the static code corresponding to the order identifier from the static codes acquired from the venue server.
[0128] In the embodiment of the present application, each time the venue server receives a ticket issuance request from the application server, it returns a static code to the application server. Therefore, the application server stores multiple static codes obtained from the venue server. After receiving the dynamic code acquisition request, the application server determines the static code corresponding to the order identifier in the static code obtained from the venue server based on the order identifier carried in the dynamic code acquisition request, so that the application server generates a dynamic code based on the static code.
[0129] 407. The application server determines a timestamp for the static code based on the current time, and generates a dynamic code based on the timestamp, the static code and the marking stamp.
[0130] In an embodiment of the present application, the application server may determine a timestamp for the static code based on the dynamic code acquisition request and directly based on the current time, and generate a dynamic code based on the timestamp, the static code, and the mark stamp; or after receiving the dynamic code acquisition request, the application server may determine the indication information in the ticket issuance notification corresponding to the ticket order based on the order identifier carried in the dynamic code acquisition request, and process the static code according to the indication information. In a possible implementation, the application server determines a timestamp for the static code based on the current time, and generates a dynamic code based on the timestamp, the static code, and the mark stamp, including: when the indication information in the ticket issuance notification corresponding to the ticket order is used to indicate the generation of a dynamic code based on a static code, the timestamp for the static code is determined based on the current time, and the dynamic code is generated based on the timestamp, the static code, and the mark stamp.
[0131] In a possible implementation, the application server directly generates the dynamic code based on the timestamp, the static code and the marking stamp. The application server generates the dynamic code based on the timestamp, the static code and the marking stamp, including: based on the timestamp and the static code, generating a dynamic code including the timestamp, the static code and the marking stamp.
[0132] For example, the static code is 001, the current time is 18:22:31 on October 18, 2021, the timestamp determined based on the current time is 20211018182231, the marker stamp is MTD, and a dynamic code containing MTD2021101818223100 is generated based on the timestamp and the static code.
[0133] In another possible implementation, in order to prevent illegal ticket resellers from learning the generation rules of the dynamic code and forging the dynamic code, the embodiment of the present application encrypts the timestamp and the static code. Figure 6 As shown, the application server generates a dynamic code based on the timestamp, static code and mark stamp, including: encrypting the timestamp and static code to obtain an encrypted timestamp and an encrypted static code; based on the mark stamp, the encrypted timestamp and the encrypted static code, generating a dynamic code containing the mark stamp, the encrypted timestamp and the encrypted static code.
[0134] It should be noted that the embodiments of the present application can use any encryption method to encrypt the timestamp and static code, as long as the venue server can correctly decrypt it. Optionally, the timestamp and static code are encrypted using the agreed password between the application server and the venue server to obtain an encrypted timestamp and an encrypted static code.
[0135] Optionally, the application server uses an AES (Advanced Encryption Standard) algorithm to encrypt the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code. For example, ECB encryption is used, the padding mode is PKCS5, the key length is 128 bits, and the block length is 128 bits.
[0136] Optionally, the application server encrypts the timestamp and static code to obtain an encrypted timestamp and an encrypted static code, including: encrypting the agreed password with the venue server to obtain a key; using the key to encrypt the timestamp and static code to obtain the encrypted timestamp and encrypted static code.
[0137] In the embodiment of the present application, the logic of changing the dynamic code is based on cross-platform interaction. Therefore, in the embodiment of the present application, the application server encrypts the dynamic code using a fixed algorithm. After the venue server parses the dynamic code, it decrypts it based on the fixed algorithm and makes a judgment on the decrypted information. That is, after obtaining the dynamic code displayed by the application client, the venue server needs to use the key configured one-to-one by the application server to decrypt it in order to identify it.
[0138] It should be noted that the embodiment of the present application only takes the display of the dynamic code based on the dynamic code acquisition request as an example to exemplify the generation and display process of the dynamic code. In another embodiment, after the application client completes the resource transfer of the ticket order, the application client displays the completion interface of the ticket order, and the completion interface includes the dynamic code of the ticket order. In one possible implementation, the venue server receives the ticket issuance request for the ticket order sent by the application server, generates a static code for the ticket order based on the ticket issuance request, and sends the static code to the application server; the application server receives the static code generated by the venue server for the ticket order, determines a timestamp for the static code based on the current time, and generates a dynamic code based on the timestamp, the static code and the mark stamp.
[0139] 408. The application server sends the dynamic code to the application client.
[0140] After generating the dynamic code, the application server sends the dynamic code to the application client so that the application client receives and displays the dynamic code. In the embodiment of the present application, during the display of the dynamic code, the dynamic code is updated every effective time. Therefore, during the display of the dynamic code by the application client, after the display time of the currently displayed dynamic code reaches the effective time, the application client needs to resend a dynamic code acquisition request to the application server to obtain a new dynamic code.
[0141] In a possible implementation, the application server further sends the code type of the dynamic code to the application client, so that the application client promptly requests the application server to update the dynamic code. The application server sends the dynamic code to the application client, including: the application server sends the dynamic code and the code type of the dynamic code to the application client; when the code type indicates a dynamic code, the application client continues to send a dynamic code acquisition request after the display duration of the dynamic code reaches the effective duration.
[0142] It should be noted that the dynamic code in the embodiment of the present application is updated according to the target format and effective duration. The embodiment of the present application only exemplifies the update process of the dynamic code by taking the application client sending a dynamic code acquisition request to update the dynamic code as an example. In another embodiment, after the dynamic code is issued for an effective duration, the application server continues to generate dynamic codes for the ticket order and updates the dynamic code displayed by the application client to the newly generated dynamic code. In some embodiments, the application server performs the following steps at every effective duration: based on the current time, determine a timestamp for the static code, based on the timestamp, the static code and the mark stamp, update the dynamic code, and send the updated dynamic code to the application client.
[0143] In some embodiments, the application server updates the dynamic code according to the target format. For example, each time the application server updates the dynamic code, it re-determines the timestamp based on the current time, that is, the application server updates the dynamic code by updating the timestamp in the dynamic code.
[0144] 409. The application client receives the dynamic code and displays the received dynamic code.
[0145] It should be noted that in the embodiment of the present application, the dynamic code can be in text form or image form, and the embodiment of the present application does not limit the form of the dynamic code. Optionally, the form of the dynamic code generated by the application server is the same as the form of the dynamic code displayed by the application client; optionally, the form of the dynamic code generated by the application server is different from the form of the dynamic code displayed by the application client. For example, the dynamic code generated by the application server is in text form, and the dynamic code displayed by the application client is in image form. For example, the application server sends the dynamic code in text form to the application client, and the application client converts the dynamic code into a graphic code for display.
[0146] 410. In response to the display duration of the currently displayed dynamic code reaching the effective duration, the application client sends a dynamic code acquisition request to the application server, where the dynamic code acquisition request carries an order identifier of the ticket order.
[0147] It should be noted that step 410 is similar to step 405 and will not be described in detail here.
[0148] 411. The application server receives the dynamic code acquisition request, and in response to the dynamic code acquisition request, determines the static code corresponding to the order identifier from the static codes acquired from the venue server.
[0149] It should be noted that step 411 is similar to step 406 and will not be described in detail here.
[0150] 412. The application server determines a timestamp for the static code based on the current time, and generates a dynamic code based on the timestamp, the static code and the mark stamp.
[0151] It should be noted that step 412 is similar to step 407 and will not be described in detail here.
[0152] 413. The application server sends the generated dynamic code to the application client.
[0153] It should be noted that step 413 is the same as step 408 and will not be described in detail here.
[0154] 414. The application client receives the dynamic code and displays the received dynamic code.
[0155] It should be noted that step 414 is the same as step 409 and will not be described in detail here.
[0156] It should be noted that steps 410 to 414 are optional execution steps, which will be triggered only after the duration of displaying the current dynamic code on the application client reaches the effective duration.
[0157] 415. The venue server identifies the dynamic code displayed by the application client and verifies the ticket order based on the dynamic code.
[0158] Optionally, the place server includes a scanning device, which is arranged at the target place, and the place server scans the dynamic code displayed by the application client through the scanning device to identify the dynamic code displayed by the application client. Optionally, the target place is provided with a scanning device, and the scanning device is connected to the place server through a wired or wireless network. After the scanning device scans the dynamic code, it sends the scanned dynamic code to the place server, and the place server identifies the dynamic code.
[0159] In order to enable the venue server to accurately verify the dynamic code, the dynamic code may include the order ID of the ticket order, so that the venue server can obtain the static code corresponding to the order ID of the ticket order from the local, and verify the dynamic code based on the static code. It should be noted that after the venue server generates the static code for the ticket order based on the ticket issuance request, it also stores the static code locally.
[0160] Among them, the order identifier can be added by the application server when generating the dynamic code, or it can be added by the application client when displaying the dynamic code. The embodiment of the present application does not limit this.
[0161] In some embodiments, the venue server verifies the ticket order based on the dynamic code, including: the venue server parses the dynamic code to obtain a timestamp, a static code and a mark stamp; when the code type marked by the mark stamp is a dynamic code, the ticket order is verified based on the timestamp and the static code.
[0162] In the embodiment of the present application, the dynamic code includes a timestamp and a static code, wherein the timestamp is used to indicate the generation time of the dynamic code. Since the dynamic code is continuously updated according to the effective period, the dynamic code has timeliness, and the timeliness of the dynamic code can be verified based on the timestamp in the dynamic code, that is, whether the dynamic code is within the effective period. The static code is used to indicate the validity of the dynamic code. Only when the static code included in the dynamic code is the same as the static code generated by the venue server, can it be said that the dynamic code is valid and not a forged dynamic code.
[0163] Considering that the timestamp in the dynamic code is used to indicate the time when the application server generates the dynamic code, the timestamp is determined based on the current time of the application server, and the place server will verify based on the current time of the place server when verifying. Since the place server and the application server are not the same server, there may be a time difference between the two. Therefore, in an embodiment of the present application, based on the effective duration of the dynamic code, a certain amount of tolerance space is supported for the effective duration of each dynamic code. For example, the tolerance space is 10 seconds, 15 seconds, etc. In some embodiments, the tolerance space is an empirical value. For example, the timestamp in the dynamic code is 192959, which means 19:29:59. When the place server verifies the dynamic code, the dynamic code is valid between 19:29:49 and 19:31:09.
[0164] In some embodiments, the venue server determines the valid timestamp range at the current time based on the current time, that is, determines which timestamps are valid at the current time, and compares the obtained timestamp with the valid timestamp range to determine whether the timestamp is valid. The venue server verifies the ticket order based on the timestamp and the static code, including: obtaining the time tolerance information between the two servers, the time tolerance information includes a first duration, and the first duration is used to indicate the time error range allowed between the venue server and the application server; advancing the current time by the first duration and delaying the first duration respectively to obtain the time range corresponding to the application server, and the time range is used to indicate multiple time points that meet the time error range; advancing the starting time point of the time range by the effective duration of the dynamic code to obtain the effective timestamp range, and the effective timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; based on whether the timestamp is within the effective timestamp range and whether the static code is a valid static code, the ticket order is verified. Optionally, when the timestamp is not within the valid timestamp range or the static code is not a valid static code, it is determined that the ticket order verification is invalid; when the timestamp is within the valid timestamp range and the static code is a valid static code, it is determined that the ticket order verification is successful.
[0165] It should be noted that the valid timestamp range changes with the current time. Therefore, after the valid timestamp range is determined for the first time, it can be changed based on the current time change. For example, the current time is 11:35:15, and the valid timestamp range is 113405 to 113525, which means 11:34:05 to 11:35:25. When the current time is increased by 1 second, the valid timestamp range is also increased by 1 second, becoming 113406 to 113525.
[0166] In some embodiments, the venue server can determine the validity period of each dynamic code and whether the dynamic code is still within the validity period, so as to determine whether the dynamic code is still timely. The venue server verifies the ticket order based on the timestamp and the static code, including: determining the validity period of the dynamic code based on the timestamp and the validity period of the dynamic code, and the dynamic code is periodically updated according to the validity period; obtaining the time tolerance information between the two servers, the time tolerance information includes a first period, and the first period is used to represent the time error range allowed between the venue server and the application server; based on the time tolerance information, the starting time point of the validity period is advanced by the first period, and the end time point of the validity period is postponed by the first period to obtain the fault-tolerant validity period of the dynamic code; based on whether the current time exceeds the fault-tolerant validity period and whether the static code is a valid static code, the ticket order is verified.
[0167] Optionally, when the current time exceeds the fault tolerance validity period or the static code is not a valid static code, it is determined that the ticket order verification has failed; when the current time does not exceed the fault tolerance validity period and the static code is a valid static code, it is determined that the ticket order verification has succeeded.
[0168] In some embodiments, in order to prevent illegal ticket resellers from cracking the combination rules of the dynamic code, the application server encrypts the timestamp and the static code. In this way, when the venue server verifies the ticket order based on the dynamic code, it needs to decrypt it. In one possible implementation, the timestamp included in the dynamic code is an encrypted timestamp, and the static code included in the dynamic code is an encrypted static code. The venue server parses the dynamic code to obtain the timestamp, the static code and the marking stamp, including: parsing the dynamic code to obtain the marking stamp, the encrypted timestamp and the encrypted static code; decrypting the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
[0169] Among them, the encryption process and decryption process of the dynamic code are an inverse process, and any encryption algorithm and decryption algorithm can be used, as long as the place server can successfully decrypt. In order to enable the place server to successfully decrypt, in some embodiments, the dynamic code is encrypted and decrypted using an agreed password. For example, the place server decrypts the encrypted timestamp and the encrypted static code in the dynamic code to obtain the decrypted timestamp and the decrypted static code, including: encrypting the agreed password between the application server and obtaining a key; using the key to decrypt the encrypted timestamp and the encrypted static code to obtain a decrypted timestamp and a decrypted static code.
[0170] For example, the agreed password between the venue server and the application server is key, and the content of key is clientId+clientSecret (client ID+client password), and then MD5 16-digit lowercase is used as the key. The client ID and client password can be determined through offline communication.
[0171] It should be noted that the change of dynamic codes is based on the basic synchronization of the time of the application server and the venue server. In order to avoid the problem of ticket order verification failure and user inability to enter caused by temporary inconsistency between the two server times, the embodiment of the present application also provides a monitoring and downgrade solution. In the embodiment of the present application, the venue server is configured with a one-click downgrade function. When an emergency problem occurs, the venue server turns on the downgrade function. At this time, all dynamic code orders will no longer verify the timestamp, and the default dynamic code is time-effective. At the same time, an automated time synchronization interface is established between the venue server and the application server, and time synchronization is performed every certain period of time. Once the time error between the two servers is too large, an alarm message is directly pushed to remind the corresponding business personnel to intervene.
[0172] In a possible implementation, the one-key downgrade function of the venue server is controlled by the application server. The method further includes: the venue server receives a downgrade indication sent by the application server, the downgrade indication is used to be sent after the time error between the venue server and the application server exceeds the time error range; in response to the downgrade indication, the static code included in the dynamic code to be processed is checked, and the timestamp included in the dynamic code is stopped to be checked.
[0173] Optionally, the place server responds to the downgrade indication, verifies the static code contained in the dynamic code to be processed, and stops verifying the timestamp contained in the dynamic code. The method further includes: obtaining the current time of the application server; based on the current time, performing time synchronization with the application server so that the time error between the place server and the application server is within the time error range; after successfully synchronizing the time of the application server, verifying the static code and timestamp contained in the dynamic code to be processed.
[0174] In one possible implementation, the venue server obtains the current time of the application server, and determines the time error between the two servers based on the current time of the venue server and the current time of the application server; if the time error exceeds the time error range, the static code contained in the dynamic code to be processed is verified, and the verification of the timestamp contained in the dynamic code is stopped.
[0175] It should be noted that the one-click downgrade function of the venue server is only to avoid misjudgment of the dynamic code. However, in order to verify the dynamic code more accurately, the venue server must continue to verify the timestamp in the dynamic code after the time error between the venue server and the application server returns to normal.
[0176] Optionally, after the place server verifies the static code contained in the dynamic code to be processed and stops verifying the timestamp contained in the dynamic code, the method further includes: obtaining the current time of the application server, and based on the current time, performing time synchronization with the application server so that the time error between the place server and the application server is within the time error range; after successfully synchronizing the time of the application server, verifying the static code and timestamp contained in the dynamic code to be processed.
[0177] In some embodiments, if it is determined that the time error between the two servers exceeds the time error range, an alarm message may be issued, which at least indicates that the time error exceeds the time error range. The alarm message may be issued by an application server or a location server, which is not limited in the embodiments of the present application.
[0178] In addition, the server can use any alarm method to send out alarm information, for example, sending out an alarm message in the management group, sending out an alarm voice, etc., to remind relevant business personnel to intervene.
[0179] In one possible implementation, in order to reduce the occurrence of a situation where the time error between two servers exceeds a time error range, the method further includes: the application server sends a time acquisition request to the place server at target time intervals, the time acquisition request is used to obtain the current time of the place server; based on the time returned by the place server and the current time of the application server, the time error between the place server and the application server is determined; if the time error exceeds the time error range, a downgrade indication is sent to the place server, the downgrade indication is used to instruct the place server to stop verifying the timestamp in the dynamic code, and the time error range is used to represent the allowable time error range between the place server and the application server.
[0180] Optionally, after the application server receives the time returned by the place server, the application server may perform time synchronization with the place server.
[0181] The target duration may be any duration, for example, 10 minutes, half an hour, or any other duration. The embodiment of the present application does not limit the target duration.
[0182] The ticket order verification method provided in the embodiment of the present application adopts a dynamic code verification method when verifying the ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through a screenshot of the code provided by illegal ticket resellers, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code.
[0183] Moreover, in the process of generating the dynamic code, the timestamp and static code are also encrypted, which prevents illegal ticket resellers from parsing the dynamic code to discover the combination pattern of the dynamic code and then cracking the dynamic code, thereby ensuring the security and reliability of the dynamic code and preventing illegal ticket resellers from reselling or counterfeiting tickets.
[0184] In addition, the embodiment of the present application also provides a bottom-up and downgrade strategy, which not only ensures the accuracy of the verification, but also ensures the stability of the verification process. That is, the embodiment of the present application can ensure that the dynamic code changes at a high frequency to prevent illegal ticket resellers from reselling tickets while also ensuring stable operation of the server.
[0185] Figure 7 This is a schematic diagram of the structure of a ticket order verification device provided in an embodiment of the present application, see Figure 7 , the device comprises:
[0186] A generating module 701, for generating a static code for a ticket order after generating a ticket order for an application client;
[0187] A sending module 702 is used to send the static code to the application server. The static code is used to generate a dynamic code in the application server based on a timestamp and a mark stamp. The timestamp is used to indicate the timeliness of the dynamic code. The mark stamp is used to mark the code type of the dynamic code. The static code is used to indicate the validity of the dynamic code. The dynamic code is used to be displayed on the application client.
[0188] The verification module 703 is used to identify the dynamic code displayed by the application client and verify the ticket order based on the dynamic code.
[0189] like Figure 8 As shown, in a possible implementation, the verification module 703 includes:
[0190] The parsing unit 7031 is used to parse the dynamic code to obtain the timestamp, the static code and the marking stamp;
[0191] The verification unit 7032 is used to verify the ticket order based on the timestamp and the static code when the code type marked by the mark stamp is a dynamic code.
[0192] In a possible implementation, the parsing unit 7031 is used to parse the dynamic code to obtain a marking stamp, an encrypted timestamp and an encrypted static code; and decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
[0193] In one possible implementation, the parsing unit 7031 is used to encrypt the agreed password with the application server to obtain a key; use the key to decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
[0194] In one possible implementation, the verification unit 7032 is used to obtain time tolerance information between two servers, where the time tolerance information includes a first duration, where the first duration is used to indicate the allowable time error range between the venue server and the application server; the current time is advanced by the first duration and delayed by the first duration respectively to obtain a time range corresponding to the application server, where the time range is used to indicate multiple time points that satisfy the time error range; the starting time point of the time range is advanced by the effective duration of the dynamic code, and the ending time point of the time range is delayed by the effective duration to obtain a valid timestamp range, where the valid timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; and the ticket order is verified based on whether the timestamp is within the valid timestamp range and whether the static code is a valid static code.
[0195] In one possible implementation, the verification unit 7032 is used to determine the validity period of the dynamic code based on the timestamp and the validity period of the dynamic code, and the dynamic code is periodically updated according to the validity period; obtain time tolerance information between the two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the validity period by the first duration to obtain the fault-tolerant validity period of the dynamic code; based on whether the current time exceeds the fault-tolerant validity period and whether the static code is a valid static code, verify the ticket order.
[0196] In a possible implementation, the device further includes:
[0197] A receiving module 704, configured to receive a downgrade indication sent by the application server, wherein the downgrade indication is sent after a time error between the venue server and the application server exceeds the time error range;
[0198] The verification module 703 is further configured to, in response to the downgrade indication, verify the static code included in the dynamic code to be processed, and stop verifying the timestamp included in the dynamic code.
[0199] In a possible implementation, the device further includes:
[0200] The acquisition module 705 is used to acquire the current time of the application server;
[0201] A synchronization module 706, configured to synchronize time with the application server based on the current time, so that a time error between the venue server and the application server is within the time error range;
[0202] The verification module 703 is further used to verify the static code and timestamp included in the dynamic code to be processed after the time of the application server is successfully synchronized.
[0203] The ticket order verification device provided in the embodiment of the present application adopts a dynamic code verification method when verifying the ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through the code screenshot provided by illegal ticket resellers, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code.
[0204] Fig. 9 This is a schematic diagram of the structure of a ticket order verification device provided in an embodiment of the present application, see Fig. 9 , the device comprises:
[0205] Receiving module 901, for receiving a static code generated by a venue server for a ticket order;
[0206] A determination module 902, configured to determine a timestamp for the static code based on a current time;
[0207] A generating module 903, configured to generate a dynamic code based on the timestamp, the static code and a marking stamp, wherein the marking stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code;
[0208] The sending module 904 is used to send the dynamic code to the application client. The dynamic code is used to be displayed on the application client. The dynamic code is also used to verify the ticket order.
[0209] like Fig.10As shown, in a possible implementation, the generating module 903 includes:
[0210] The encryption unit 9031 is used to encrypt the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code;
[0211] The generating unit 9032 is configured to generate a dynamic code including the marking stamp, the encrypted timestamp and the encrypted static code based on the marking stamp, the encrypted timestamp and the encrypted static code.
[0212] In one possible implementation, the encryption unit 9031 is used to encrypt the agreed password with the place server to obtain a key; use the key to encrypt the timestamp and the static code to obtain the encrypted timestamp and the encrypted static code.
[0213] In one possible implementation, the dynamic code is updated periodically according to the validity period;
[0214] At each effective time, the determination module 902 is further used to determine a timestamp for the static code based on the current time; the generation module 903 is further used to update the dynamic code based on the timestamp, the static code and the marking stamp; the sending module 904 is further used to send the updated dynamic code to the application client.
[0215] In a possible implementation, the sending module 904 is further configured to send a time acquisition request to the place server every target time period, where the time acquisition request is used to acquire the current time of the place server;
[0216] The determination module 902 is further configured to determine a time error between the place server and the application server based on the time returned by the place server and the current time of the application server;
[0217] The sending module 904 is also used to send a downgrade indication to the place server when the time error exceeds the time error range. The downgrade indication is used to instruct the place server to stop verifying the timestamp in the dynamic code. The time error range is used to indicate the allowable time error range between the place server and the application server.
[0218] The ticket order verification device provided in the embodiment of the present application adopts a dynamic code verification method when verifying the ticket order. Since the dynamic code is time-sensitive, it is difficult for users to successfully enter the venue through the code screenshot provided by illegal ticket resellers, thereby improving the security of ticket order verification. In addition, the venue server only needs to provide a static code without generating a dynamic code, and the dynamic code is generated by a high-performance application server. Since the static code of a ticket order is fixed, the venue server only needs to transmit the static code once for a ticket order, and there is no need to transmit the dynamic code to the application server multiple times, which reduces the pressure on the venue server and ensures the update performance of the dynamic code.
[0219] It should be noted that: the ticket order verification device provided in the above embodiment only uses the division of the above functional modules as an example when verifying the ticket order. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the ticket order verification device provided in the above embodiment and the ticket order verification method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0220] Fig.11 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the memory 1102 stores at least one program code, and the at least one program code is loaded and executed by the processor 1101 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0221] The server 1100 is used to execute the steps executed by the server in the above method embodiment.
[0222] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a program code, and the program code can be executed by a processor in a computer device to complete the ticket order verification method in the above embodiment. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0223] In an exemplary embodiment, a computer program or a computer program product is also provided. The computer program or the computer program product includes a computer program code. When the computer program code is executed by a computer, the computer implements the ticket order verification method in the above embodiment.
[0224] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0225] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A ticket order verification method, characterized in that: The method is executed by a venue server, the venue server is a server used by a target venue, and the target venue is a venue that requires a ticket to enter; the method includes: After generating a ticket order for an application client, generating a static code for the ticket order, the application client being a client having a function of purchasing tickets for a target venue; Sending the static code to an application server, the static code is used to generate a dynamic code in the application server based on a timestamp and a marker, the timestamp is used to indicate the timeliness of the dynamic code, the marker is used to mark the code type of the dynamic code, the static code is used to indicate the validity of the dynamic code, the dynamic code is used to be displayed on the application client, and the application server is a server that provides services for the application client; Identify the dynamic code displayed by the application client, and verify the ticket order based on the dynamic code, including: parsing the dynamic code to obtain the timestamp, the static code and the marking stamp, and verify the ticket order based on the timestamp and the static code when the code type marked by the marking stamp is a dynamic code; The verifying the ticket order based on the timestamp and the static code includes: Obtain time fault tolerance information between two servers, the time fault tolerance information includes a first duration, the first duration is used to indicate the time error range allowed between the venue server and the application server; advance the current time by the first duration and delay the current time by the first duration respectively, to obtain a time range corresponding to the application server, the time range is used to indicate multiple time points that satisfy the time error range; advance the starting time point of the time range by the effective duration of the dynamic code to obtain a valid timestamp range, the valid timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; verify the ticket order based on whether the timestamp is within the effective timestamp range and whether the static code is a valid static code; or, Based on the timestamp and the effective duration of the dynamic code, determine the effective period of the dynamic code, and the dynamic code is periodically updated according to the effective duration; obtain time tolerance information between the two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the effective period by the first duration, and postpone the ending time point of the effective period by the first duration to obtain the fault-tolerant effective period of the dynamic code; based on whether the current time exceeds the fault-tolerant effective period and whether the static code is a valid static code, verify the ticket order.
2. The method according to claim 1, characterized in that: The step of parsing the dynamic code to obtain the timestamp, the static code and the marking stamp includes: Parsing the dynamic code to obtain a marking stamp, an encrypted timestamp and an encrypted static code; The encrypted timestamp and the encrypted static code are decrypted to obtain the timestamp and the static code.
3. The method according to claim 2, characterized in that The decrypting the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code includes: Encrypting the agreed password between the application server and the application server to obtain a key; The encrypted timestamp and the encrypted static code are decrypted using the key to obtain the timestamp and the static code.
4. The method according to claim 1, characterized in that: The method further comprises: receiving a downgrade indication sent by the application server, wherein the downgrade indication is sent after a time error between the venue server and the application server exceeds the time error range; In response to the downgrade indication, the static code included in the dynamic code to be processed is verified, and the verification of the timestamp included in the dynamic code is stopped.
5. The method according to claim 4, characterized in that After the step of responding to the downgrade indication, checking the static code included in the dynamic code to be processed, and stopping checking the timestamp included in the dynamic code, the method further includes: Obtaining the current time of the application server; Based on the current time, synchronize time with the application server so that the time error between the place server and the application server is within the time error range; After the time of the application server is successfully synchronized, the static code and the timestamp included in the dynamic code to be processed are verified.
6. A ticket order verification method, characterized in that: The method is executed by an application server, the application server is a server that provides services for an application client, and the application client is a client that has the function of purchasing tickets for a target venue; the method includes: Receiving a static code generated by a venue server for a ticket order, the venue server being a server used by a target venue, the target venue being a venue that requires a ticket to enter; Determining a timestamp for the static code based on a current time; Generate a dynamic code based on the timestamp, the static code and the marking stamp, wherein the marking stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code; Sending the dynamic code to the application client, the dynamic code is used to be displayed on the application client, so that the venue server recognizes the dynamic code displayed by the application client, and verifies the ticket order based on the dynamic code; The verifying the ticket order based on the dynamic code includes: parsing the dynamic code to obtain the timestamp, the static code and the marking stamp, and verifying the ticket order based on the timestamp and the static code when the code type marked by the marking stamp is a dynamic code; The verifying the ticket order based on the timestamp and the static code includes: Obtain time fault tolerance information between two servers, the time fault tolerance information includes a first duration, the first duration is used to indicate the time error range allowed between the venue server and the application server; advance the current time by the first duration and delay the current time by the first duration respectively, to obtain a time range corresponding to the application server, the time range is used to indicate multiple time points that satisfy the time error range; advance the starting time point of the time range by the effective duration of the dynamic code to obtain a valid timestamp range, the valid timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; verify the ticket order based on whether the timestamp is within the effective timestamp range and whether the static code is a valid static code; or, Based on the timestamp and the effective duration of the dynamic code, determine the effective period of the dynamic code, and the dynamic code is periodically updated according to the effective duration; obtain time tolerance information between the two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the effective period by the first duration, and postpone the ending time point of the effective period by the first duration to obtain the fault-tolerant effective period of the dynamic code; based on whether the current time exceeds the fault-tolerant effective period and whether the static code is a valid static code, verify the ticket order.
7. The method according to claim 6, characterized in that The generating a dynamic code based on the timestamp, the static code and the marking stamp comprises: Encrypting the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code; Based on the marking stamp, the encrypted timestamp and the encrypted static code, a dynamic code including the marking stamp, the encrypted timestamp and the encrypted static code is generated.
8. The method according to claim 7, characterized in that The step of encrypting the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code includes: Encrypting the agreed password between the venue server and obtaining a key; The key is used to encrypt the timestamp and the static code to obtain the encrypted timestamp and the encrypted static code.
9. The method according to claim 6, characterized in that The dynamic code is updated periodically according to the effective duration; the method further comprises: At each effective time, perform the following steps: Determining a timestamp for the static code based on a current time; Based on the timestamp, the static code and the marking stamp, updating the dynamic code; The updated dynamic code is sent to the application client.
10. The method according to claim 6, characterized in that The method further comprises: Sending a time acquisition request to the place server at target time intervals, wherein the time acquisition request is used to acquire the current time of the place server; Determining a time error between the venue server and the application server based on the time returned by the venue server and the current time of the application server; When the time error exceeds the time error range, a downgrade indication is sent to the place server, wherein the downgrade indication is used to instruct the place server to stop verifying the timestamp in the dynamic code, and the time error range is used to indicate the allowable time error range between the place server and the application server.
11. A ticket order verification device, characterized in that: The device is applied in a place server, which is a server used by a target place, and the target place is a place that requires a ticket to enter; the device includes: A generating module, configured to generate a static code for a ticket order after generating a ticket order for an application client, wherein the application client is a client having a function of purchasing a ticket for a target venue; a sending module, configured to send the static code to an application server, wherein the static code is used to generate a dynamic code in the application server based on a timestamp and a mark stamp, wherein the timestamp is used to indicate the timeliness of the dynamic code, the mark stamp is used to mark the code type of the dynamic code, the static code is used to indicate the validity of the dynamic code, and the dynamic code is used to be displayed on the application client, wherein the application server is a server providing services for the application client; A verification module, used to identify the dynamic code displayed by the application client, and verify the ticket order based on the dynamic code; The verification module comprises: A parsing unit, used for parsing the dynamic code to obtain the timestamp, the static code and the marking stamp; A verification unit, configured to verify the ticket order based on the timestamp and the static code when the code type marked by the marking stamp is a dynamic code; The verification unit is used to obtain time fault tolerance information between two servers, the time fault tolerance information includes a first duration, the first duration is used to indicate the time error range allowed between the venue server and the application server; advance the current time by the first duration and delay the current time by the first duration respectively to obtain the time range corresponding to the application server, the time range is used to indicate multiple time points that meet the time error range; advance the starting time point of the time range by the effective duration of the dynamic code, and delay the ending time point of the time range by the effective duration to obtain a valid timestamp range, the valid timestamp range indicates the range of the timestamp with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; verify the ticket order based on whether the timestamp is within the valid timestamp range and whether the static code is a valid static code; or, The verification unit is used to determine the validity period of the dynamic code based on the timestamp and the validity period of the dynamic code, and the dynamic code is periodically updated according to the validity period; obtain time tolerance information between two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the validity period by the first duration to obtain the fault-tolerant validity period of the dynamic code; based on whether the current time exceeds the fault-tolerant validity period and whether the static code is a valid static code, verify the ticket order.
12. The device according to claim 11, characterized in that The parsing unit is used to parse the dynamic code to obtain a mark stamp, an encrypted timestamp and an encrypted static code; and decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
13. The device according to claim 12, characterized in that The parsing unit is used to encrypt the agreed password between the application server and obtain a key; use the key to decrypt the encrypted timestamp and the encrypted static code to obtain the timestamp and the static code.
14. The device according to claim 11, characterized in that The device also includes: A receiving module, configured to receive a downgrade indication sent by the application server, wherein the downgrade indication is sent after a time error between the venue server and the application server exceeds the time error range; The verification module is further configured to, in response to the downgrade indication, verify the static code included in the dynamic code to be processed, and stop verifying the timestamp included in the dynamic code.
15. The device according to claim 14, characterized in that The device also includes: An acquisition module, used to acquire the current time of the application server; A synchronization module, configured to perform time synchronization with the application server based on the current time, so that a time error between the place server and the application server is within the time error range; The verification module is further used to verify the static code and timestamp included in the dynamic code to be processed after successfully synchronizing the time of the application server.
16. A ticket order verification device, characterized in that: The device is applied in an application server, which is a server that provides services for an application client, and the application client is a client that has the function of purchasing tickets for a target venue; the device includes: A receiving module, used to receive a static code generated by a venue server for a ticket order, wherein the venue server is a server used by a target venue, and the target venue is a venue that requires a ticket to enter; A determination module, configured to determine a timestamp for the static code based on a current time; A generating module, configured to generate a dynamic code based on the timestamp, the static code and a marking stamp, wherein the marking stamp is used to mark the code type of the dynamic code, the timestamp is used to indicate the timeliness of the dynamic code, and the static code is used to indicate the validity of the dynamic code; A sending module, used for sending the dynamic code to the application client, the dynamic code is used for displaying on the application client, so that the venue server recognizes the dynamic code displayed by the application client, and verifies the ticket order based on the dynamic code; The verifying the ticket order based on the dynamic code includes: parsing the dynamic code to obtain the timestamp, the static code and the marking stamp, and verifying the ticket order based on the timestamp and the static code when the code type marked by the marking stamp is a dynamic code; The verifying the ticket order based on the timestamp and the static code includes: Obtain time fault tolerance information between two servers, the time fault tolerance information includes a first duration, the first duration is used to indicate the time error range allowed between the venue server and the application server; advance the current time by the first duration and delay the current time by the first duration respectively, to obtain a time range corresponding to the application server, the time range is used to indicate multiple time points that satisfy the time error range; advance the starting time point of the time range by the effective duration of the dynamic code to obtain a valid timestamp range, the valid timestamp range indicates the range of timestamps with timeliness of the dynamic code, and the dynamic code is periodically updated according to the effective duration; verify the ticket order based on whether the timestamp is within the effective timestamp range and whether the static code is a valid static code; or, Based on the timestamp and the effective duration of the dynamic code, determine the effective period of the dynamic code, and the dynamic code is periodically updated according to the effective duration; obtain time tolerance information between the two servers, the time tolerance information includes a first duration, and the first duration is used to represent the allowable time error range between the venue server and the application server; based on the time tolerance information, advance the starting time point of the effective period by the first duration, and postpone the ending time point of the effective period by the first duration to obtain the fault-tolerant effective period of the dynamic code; based on whether the current time exceeds the fault-tolerant effective period and whether the static code is a valid static code, verify the ticket order.
17. The device according to claim 16, characterized in that The generating module comprises: An encryption unit, used for encrypting the timestamp and the static code to obtain an encrypted timestamp and an encrypted static code; A generating unit is used to generate a dynamic code including the marking stamp, the encrypted timestamp and the encrypted static code based on the marking stamp, the encrypted timestamp and the encrypted static code.
18. The device according to claim 17, characterized in that The encryption unit is used to encrypt the agreed password between the venue server and obtain a key; use the key to encrypt the timestamp and the static code to obtain the encrypted timestamp and the encrypted static code.
19. The device according to claim 16, characterized in that The dynamic code is updated periodically according to its validity period; Every time the validity period is The determining module is further used to determine a timestamp for the static code based on the current time; The generating module is further used to update the dynamic code based on the timestamp, the static code and the marking stamp; The sending module is further used to send the updated dynamic code to the application client.
20. The device according to claim 16, characterized in that The sending module is further used to send a time acquisition request to the place server every target time, and the time acquisition request is used to obtain the current time of the place server; The determination module is further configured to determine a time error between the place server and the application server based on the time returned by the place server and the current time of the application server; The sending module is also used to send a downgrade indication to the place server when the time error exceeds the time error range, and the downgrade indication is used to instruct the place server to stop verifying the timestamp in the dynamic code. The time error range is used to represent the allowable time error range between the place server and the application server.
21. A server, characterized in that: The server includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the ticket order verification method as described in any one of claims 1 to 5; or, to implement the operations performed by the ticket order verification method as described in any one of claims 6 to 10.
22. A computer-readable storage medium, characterized in that: The storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed by the ticket order verification method as described in any one of claims 1 to 5; or to implement the operations performed by the ticket order verification method as described in any one of claims 6 to 10.
Citation Information
Patent Citations
Two-dimensional code processing method, device and system
CN106899570A