Reservation request verification method and device, electronic equipment and program product
By hashing the registration time and user information, the target hash value is generated and the request interface is encrypted, and the appointment request is verified, the appointment request is solved, and the appointment request cannot be effectively identified by the automated script is improved, and the accuracy of appointment request verification is improved.
Patent Information
- Application Number
- CN202510053474.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art cannot effectively identify and prevent appointment requests initiated by automated scripts, resulting in low accuracy of appointment request verification.
By receiving the registration request from the target terminal, the registration time and user information are hashed, the target hash value is generated, and based on the hash value encrypts the request interface, an encrypted reservation request interface is generated, which is used to verify the reservation request.
Effectively identify and intercept appointment requests initiated by automated scripts, improve the accuracy of appointment request verification, and prevent malicious behaviors in the illegal appointment industry chain.
Smart Images

Figure CN119892464A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a method for verifying an appointment request, a device thereof, an electronic device, and a program product. Background Art
[0002] In recent years, online reservation services have been developing at a very high speed. While making people's lives more convenient, reservation services have also brought many problems, especially the emergence of the illegal reservation industry chain (i.e., using Internet technology to carry out network attacks, steal information and other illegal activities, as well as providing tools, resources and platforms for these activities as illegal monetization channels), which has brought challenges to reservation services.
[0003] In the commemorative coin reservation scenario, the illegal reservation industry chain mainly refers to the use of scripts, special machines, and a large amount of invalid ID card information to squeeze the normal reservation quota through abnormal reservation behavior. Due to the automation characteristics of automatic scripts, the reservation operation has an extremely high success rate and an extremely short trial and error time. Within a very short time window, the limited reservation resources in the system can be grabbed.
[0004] There are two modes for booking commemorative coins: offline booking and online booking. When popular coins are issued, the secondary market price of commemorative coins will be significantly higher than their face value or initial issue price. The high popularity will lead to an active illegal booking industry chain during the online booking period. At present, most online booking systems for commemorative coins are B / S (BroWSer / Server) architectures, which receive customer inquiries and booking requests through HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure). The illegal booking industry chain will initiate a large number of booking requests in a very short time through scripts and specific programs, occupying the normal customer booking quota, causing normal customer booking failures and affecting customer booking experience. At the same time, there is a problem of successful bookings using a large amount of invalid identity information, but not redeemed, which affects the normal sales of commemorative coins.
[0005] In the related technologies, the control of the illegal reservation industry chain is mainly at the level of illegal reservation industry chain identification. For example, through technical means such as device fingerprints and device portraits, risky devices are identified in advance before reservations and the number of reservations for a single device is controlled. This has achieved certain results in the prevention and control of the illegal reservation industry chain. However, this method of prevention and control still has loopholes. The illegal reservation industry chain can bypass risk identification by simulating customer behavior and using virtual user IP (Internet Protocol) to achieve the purpose of illegally occupying the quota. Therefore, how to effectively control and block the illegal reservation industry chain has become an urgent problem to be solved during the reservation period.
[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a method and device for verifying an appointment request, an electronic device, and a program product thereof, so as to at least solve the technical problem in the related art that an appointment request initiated by an automated script cannot be effectively identified, resulting in low accuracy in verifying the appointment request.
[0008] According to one aspect of an embodiment of the present application, a method for verifying a reservation request is provided, comprising: receiving registration requests sent by multiple target terminals on a front-end page, wherein each of the registration requests carries registration request information, and the registration request information includes at least: a request interface, a registration time, and a user information; for each of the registration requests, performing a hash calculation on the registration time and the user information to obtain a target hash value; based on the target hash value, encrypting the request interface to generate an encrypted reservation request interface, and returning the encrypted reservation request interface to the front-end page; receiving a reservation request initiated by the target terminal on the front-end page based on the reservation interface, and verifying the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
[0009] Furthermore, the step of performing hash calculation on the registration time and the user information to obtain a target hash value includes: using a preset hash function to perform hash calculation on the registration time to obtain a first hash value of the registration time; using the preset hash function to perform hash calculation on the user information to obtain a second hash value of the user information; and determining the target hash value based on the first hash value and the second hash value.
[0010] Furthermore, the step of determining the target hash value based on the first hash value and the second hash value includes: concatenating the first hash value and the second hash value to obtain an initial hash value; and performing hash calculation on the initial hash value to obtain the target hash value.
[0011] Furthermore, based on the target hash value, the request interface is encrypted to generate an encrypted reservation request interface, comprising: determining a block length of a preset hash function; in a case where the length of the target hash value is less than the block length, padding the target hash value until the length of the target hash value is equal to the block length, and representing the target hash value with a length equal to the block length as an initial key; or, in a case where the length of the target hash value is greater than the block length, performing a hash calculation on the target hash value to obtain the initial key with a length equal to the block length; performing an XOR operation on the initial key and a first character string with a length equal to the block length to generate a first key; performing an XOR operation on the initial key and a second character string with a length equal to the block length to generate a second key, wherein the first character string is different from the second character string; and generating the encrypted reservation request interface based on the first key and the second key.
[0012] Furthermore, based on the first key and the second key, the step of generating the encrypted reservation request interface includes: splicing the first key with the request interface to obtain first spliced data, and performing hash calculation on the first spliced data to obtain a first hash value; splicing the first hash value with the second key to obtain second spliced data, and performing hash calculation on the second spliced data to obtain the encrypted reservation request interface.
[0013] Furthermore, after returning the encrypted reservation request interface to the front-end page, it also includes: characterizing each of the encrypted reservation request interfaces as a target request interface, and adding each of the target request interfaces to a preset request interface list; splicing each of the encrypted reservation request interfaces to the request interface to obtain the reservation interface, wherein the target terminal makes a reservation based on the reservation interface to generate the reservation request.
[0014] Furthermore, based on the encrypted reservation request interface, the step of verifying the reservation request includes: determining whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request; if there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, determining that the reservation request is successfully verified; if there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, generating response failure data, and returning the response failure data to the front-end page, determining that the reservation request verification has failed.
[0015] According to another aspect of an embodiment of the present application, a reservation request verification device is also provided, including: a receiving unit, used to receive registration requests sent by multiple target terminals on a front-end page, wherein each of the registration requests carries registration request information, and the registration request information includes at least: a request interface, a registration time, and a user information; a calculation unit, used to perform a hash calculation on the registration time and the user information for each registration request to obtain a target hash value; a generation unit, used to encrypt the request interface based on the target hash value, generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page; a verification unit, used to receive a reservation request initiated by the target terminal on the front-end page based on the reservation interface, and verify the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
[0016] Furthermore, the calculation unit includes: a first calculation module, used to perform hash calculation on the registration time using a preset hash function to obtain a first hash value of the registration time; a second calculation module, used to perform hash calculation on the user information using the preset hash function to obtain a second hash value of the user information; and a first determination module, used to determine the target hash value based on the first hash value and the second hash value.
[0017] Furthermore, the first determination module includes: a first concatenation submodule, used for concatenating the first hash value and the second hash value to obtain an initial hash value; and a first calculation submodule, used for performing hash calculation on the initial hash value to obtain the target hash value.
[0018] Furthermore, the generation unit includes: a second determination module, used to determine the block length of a preset hash function; a first filling module, used to fill the target hash value when the length of the target hash value is less than the block length, until the length of the target hash value is equal to the block length, and characterize the target hash value with the length equal to the block length as an initial key; a third calculation module, used to perform hash calculation on the target hash value when the length of the target hash value is greater than the block length, to obtain the initial key with the length equal to the block length; a fourth calculation module, used to perform an XOR operation on the initial key and a first character string with a length equal to the block length to generate a first key; a fifth calculation module, used to perform an XOR operation on the initial key and a second character string with a length equal to the block length to generate a second key, wherein the first character string is different from the second character string; and a first generation module, used to generate the encryption reservation request interface based on the first key and the second key.
[0019] Furthermore, the first generation module includes: a second calculation submodule, used to splice the first key and the request interface to obtain first spliced data, and perform hash calculation on the first spliced data to obtain a first hash value; a third calculation submodule, used to splice the first hash value and the second key to obtain second spliced data, and perform hash calculation on the second spliced data to obtain the encrypted reservation request interface.
[0020] Furthermore, the verification device for the reservation request includes: a first adding module, used to characterize each of the encrypted reservation request interfaces as a target request interface after returning the encrypted reservation request interface to the front-end page, and add each of the target request interfaces to a preset request interface list; a first splicing module, used to splice each of the encrypted reservation request interfaces to the request interface to obtain the reservation interface, wherein the target terminal makes a reservation based on the reservation interface to generate the reservation request.
[0021] Further, the verification unit includes: a first judgment module, used to judge whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, and determine that the reservation request is successfully verified when there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request; a second judgment module, used to generate response failure data and return the response failure data to the front-end page when there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, and determine that the verification of the reservation request has failed.
[0022] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned reservation request verification methods.
[0023] According to another aspect of an embodiment of the present application, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned methods for verifying a reservation request.
[0024] In the present invention, by receiving registration requests sent by multiple target terminals on the front-end page, for each registration request, the registration time and user information are hashed to obtain a target hash value, based on the target hash value, the request interface is encrypted, an encrypted reservation request interface is generated, and the encrypted reservation request interface is returned to the front-end page, and a reservation request initiated by the target terminal on the front-end page based on the reservation interface is received, and the reservation request is verified based on the encrypted reservation request interface, thereby solving the technical problem in the related art that the reservation request initiated by the automated script cannot be effectively identified, resulting in low accuracy in verifying the reservation request.
[0025] In the present invention, by encrypting the reservation request interface, it is ensured that the reservation request submission interface is inconsistent for different users in different time periods when making a reservation. Only users who have conducted an encrypted interaction with the server can successfully make a reservation. It is able to distinguish the behavior of submitting reservation requests in batches through batch scripts, virtual addresses, etc., and can reject and block such behavior, thereby achieving the technical effect of improving the accuracy of reservation request verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a verification method for a reservation request is shown;
[0028] Figure 2 is a flowchart of a method for verifying a reservation request according to Embodiment 1 of the present application;
[0029] Figure 3 is a flow chart of an optional commemorative coin reservation according to an embodiment of the present application;
[0030] Figure 4 is a schematic diagram of an optional reservation request verification device according to an embodiment of the present application;
[0031] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) collected and involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set between the system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0035] In the present invention, by performing hash calculation on user information and registration time, a target hash value can be obtained, and according to the target hash value, the request interface is encrypted to obtain an encrypted reservation request interface, the target terminal can generate a reservation interface according to the encrypted reservation request interface, and initiate a reservation request to the server, the server can verify the reservation interface according to the encrypted reservation request interface, and by using the encrypted reservation request interface dynamically generated based on the current timestamp and user information in each reservation request, batch requests of illegal reservation industry chains can be effectively prevented, and at the same time, the problem of illegal reservation industry chains using a large amount of invalid identity information for reservations but not exchanging commemorative coins on time is reduced, and the impact on commemorative coin sales is reduced. The present invention can also perform secondary encryption prevention and control based on device fingerprint technology, improve the illegal reservation industry chain prevention and control capabilities of the commemorative coin reservation system, and solve the problem of customer reservation failures due to batch reservation requests.
[0036] The present invention is described in detail below in conjunction with various embodiments.
[0037] Example 1
[0038] According to an embodiment of the present application, an embodiment of a method for verifying an appointment request is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a verification method for a reservation request. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more ( Figure 1 102a, 102b, ..., 102n are used to illustrate) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera, wherein the network interface may be connected to a wired and / or wireless network. A person of ordinary skill in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0040] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the reservation request verification method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned reservation request verification method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0042] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0044] Under the above operating environment, this application provides Figure 2 The verification method for the reservation request is shown. Figure 2 is a flowchart of a method for verifying a reservation request according to Example 1 of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0045] Step S201, receiving registration requests sent by multiple target terminals on the front-end page, wherein each registration request carries registration request information, and the registration request information at least includes: request interface, registration time, and user information.
[0046] Optionally, the user can access the front-end page through a target terminal (such as a mobile phone, computer, etc.), fill in personal attribute information (i.e., user information) on the front-end page, including but not limited to name, ID number, contact information, etc., to register or log in before making an appointment.
[0047] In an embodiment of the present invention, after the user fills in the information, the front end can send a registration request (such as a silent request) to the server, and the registration request carries registration request information, including at least: a request interface, a registration time (i.e., the precise timestamp when the user submits the registration request), and user information.
[0048] Step S202: For each registration request, perform hash calculation on the registration time and user information to obtain a target hash value.
[0049] Optionally, when the server receives the registration request sent by the front end, it can extract the registration time and user information therein, and use a hash function (such as SHA-256 (Secure Hash Algorithm 256bit, a hash function), SHA-512 (Secure Hash Algorithm 512bit, a hash function), etc.) to perform hash calculations on the registration time and user information respectively. After obtaining the hash values of the registration time and user information respectively, the server can concatenate the two hash values to form an initial hash value, and can perform hash calculations on this initial hash value again to generate a target hash value (such as a specific hash value K).
[0050] In the embodiment of the present invention, the target hash value is unique for each user's request at a specific time point. Even if the request time is exactly the same, as long as the identity card information of the two users is different, the generated target hash value will be different.
[0051] Step S203: encrypt the request interface based on the target hash value, generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page.
[0052] Optionally, the server may encrypt the request interface according to the target hash value, generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page.
[0053] In the embodiment of the present invention, the target hash value can be used as a key, the request interface can be used as a message, and a HMAC (Hash-based Message Authentication Code) algorithm can be used to calculate a fixed-length message digest (ie, an encrypted reservation request interface).
[0054] Step S204, receiving a reservation request initiated by the target terminal on the front-end page based on the reservation interface, and verifying the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
[0055] Optionally, after the front end receives the encrypted reservation request interface returned by the server, the target terminal may initiate a reservation request to the server according to the encrypted reservation request interface.
[0056] In the embodiment of the present invention, the reservation interface can be generated according to the request interface. The reservation request carries the reservation interface. The server receives the reservation request initiated by the target terminal on the front-end page and can verify the reservation request according to the encrypted reservation request interface.
[0057] In summary, registration requests sent by multiple target terminals on the front-end page are received. For each registration request, the registration time and user information can be hashed to obtain a target hash value. Then, according to the target hash value, the request interface can be encrypted, an encrypted reservation request interface can be generated, and the encrypted reservation request interface can be returned to the front-end page. After that, the reservation request initiated by the target terminal on the front-end page based on the reservation interface can be received. According to the generated encrypted reservation request interface, the reservation request can be verified. Only users who have conducted an encrypted interaction with the server can make a successful reservation. The batch reservation requests initiated by the automated script can be effectively identified, thereby improving the accuracy of the reservation request verification, thereby solving the technical problem that the relevant technology cannot effectively identify the reservation requests initiated by the automated script, resulting in low accuracy in verifying the reservation requests.
[0058] In order to accurately determine the target hash value, in the reservation request verification method provided in Example 1 of the present application, a preset hash function is used to hash the registration time to obtain a first hash value of the registration time; a preset hash function is used to hash the user information to obtain a second hash value of the user information; and based on the first hash value and the second hash value, the target hash value is determined.
[0059] Optionally, a hash function is an encryption algorithm that can convert input data of any length into an output of a fixed length. The output result is a hash value. A preset hash function (such as SHA-256, SHA-512, MD5 (Message-Digest Algorithm 5, a hash function), etc.) can be used to perform hash calculations on registration time and user information respectively.
[0060] In an embodiment of the present invention, the first hash value obtained by hashing the registration time can ensure that different registration times result in different first hash values. The second hash value obtained by hashing the user information can ensure that even if the registration time is the same, different users will generate different second hash values due to information differences. Based on the first hash value and the second hash value, a target hash value can be obtained, which is unique for any user's request at a specific time.
[0061] In order to improve the accuracy of determining the target hash value, in the reservation request verification method provided in Example 1 of the present application, the first hash value and the second hash value are concatenated to obtain an initial hash value; and the initial hash value is hashed to obtain the target hash value.
[0062] Optionally, the server concatenates the first hash value and the second hash value to obtain an initial hash value, which may include dual features of registration time and user information, thereby enhancing the complexity and security of the hash value.
[0063] In the embodiment of the present invention, a preset hash function may be used to perform hash calculation on the initial hash value to obtain a final target hash value.
[0064] In order to accurately generate an encrypted reservation request interface, in the reservation request verification method provided in Example 1 of the present application, the block length of a preset hash function is determined; when the length of a target hash value is less than the block length, the target hash value is padded until the length of the target hash value is equal to the block length, and the target hash value whose length is equal to the block length is represented as an initial key; or, when the length of the target hash value is greater than the block length, the target hash value is hashed to obtain an initial key whose length is equal to the block length; the initial key is XORed with a first character string whose length is equal to the block length to generate a first key; the initial key is XORed with a second character string whose length is equal to the block length to generate a second key, wherein the first character string is different from the second character string; based on the first key and the second key, an encrypted reservation request interface is generated.
[0065] Optionally, the block length is an important parameter of the hash function when processing input data, which determines how the data is processed in blocks. For example, the block length of SHA-256 is 512 bits, the block length of SHA-512 is 1024 bits, and the block length of MD5 is 512 bits. The block length can be determined based on the preset hash function used.
[0066] In an embodiment of the present invention, if the length of the target hash value is less than the block length of the preset hash function, 0s may be padded after the target hash value to make its length equal to the block length, and the target hash value with a length equal to the block length may be represented as the initial key.
[0067] In the embodiment of the present invention, if the length of the target hash value is greater than the block length of the preset hash function, the preset hash function may be used to perform hash processing on the target hash value to obtain an initial key having a length equal to the block length.
[0068] In the embodiment of the present invention, XOR is a bit operation. If the two compared bits are different, the result is 1, and if the two compared bits are the same, the result is 0. The initial key can be XORed with a first string whose length is equal to the block length (such as 0x36...) to generate a first key, and the initial key can be XORed with a second string whose length is equal to the block length (such as 0x5c...) to generate a second key, and an encryption reservation request interface can be generated based on the first key and the second key.
[0069] Exemplarily, the block length of the preset hash function is 512 bits, that is, 64 bytes, the first character string may be 0x36 padded 64 times, and the second character string may be 0x5c padded 64 times.
[0070] In order to improve the accuracy of generating an encrypted reservation request interface, in the reservation request verification method provided in Example 1 of the present application, the first key is spliced with the request interface to obtain first spliced data, and the first spliced data is hashed to obtain a first hash value; the first hash value is spliced with the second key to obtain second spliced data, and the second spliced data is hashed to obtain an encrypted reservation request interface.
[0071] Optionally, the server may concatenate the first key with the request interface to form first concatenated data, and may perform hash calculation on the first concatenated data to generate a first hash value.
[0072] In the embodiment of the present invention, the first hash value and the second key may be concatenated to form second concatenated data, and the second concatenated data may be subjected to hash calculation, and the result obtained is the encrypted reservation request interface.
[0073] In order to accurately generate a reservation request, in the reservation request verification method provided in Example 1 of the present application, each encrypted reservation request interface is characterized as a target request interface, and each target request interface is added to a preset request interface list; each encrypted reservation request interface is spliced to the request interface to obtain a reservation interface, wherein the target terminal makes a reservation based on the reservation interface to generate a reservation request.
[0074] Optionally, an encrypted reservation request interface may be generated for each registration request, each encrypted reservation request interface may be characterized as a target request interface, and each target request interface may be added to a preset request interface list.
[0075] In the embodiment of the present invention, the preset request interface list stores verification information of the reservation request (such as the target request interface). When processing the reservation request, the server can search the preset request interface list for the target request interface that matches the reservation interface carried by the reservation request.
[0076] In the embodiment of the present invention, each encrypted reservation request interface can be spliced onto the request interface to generate a reservation interface, and the target terminal can make a reservation based on the reservation interface to generate a reservation request (ie, the reservation request carries the encrypted reservation request interface).
[0077] In order to accurately verify the reservation request, in the reservation request verification method provided in Example 1 of the present application, it is determined whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request. If there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, it is determined that the reservation request verification is successful. If there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, response failure data is generated and the response failure data is returned to the front-end page, determining that the reservation request verification has failed.
[0078] Optionally, after the user submits the reservation request, the server may search from the preset request interface list whether there is a target request interface that is the same as the encrypted reservation request interface carried in the currently received reservation request.
[0079] In an embodiment of the present invention, if there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, it can be determined that the verification of the reservation request is successful, and the server can further process the reservation request, for example, record the user's reservation information, allocate the reservation quota of commemorative coins, etc.
[0080] In an embodiment of the present invention, if there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, it can be determined that the verification of the reservation request has failed, and response failure data (such as an error code or error message) can be generated to inform the user of the reservation failure, and this response failure data can be returned to the front-end page.
[0081] Figure 3 is a flow chart of an optional commemorative coin reservation according to an embodiment of the present application, such as Figure 3 As shown, the user can enter the reservation page (i.e., the front-end page) through the target terminal, and after filling in the information, request the server (i.e., the registration request) and record the request time and customer information (i.e., the registration request carries the request time, customer information, and the request interface). The server can encrypt the request time and customer information, generate a unique hash value corresponding to the time and identity information, and encrypt the request interface according to the hash value, and generate an encrypted reservation request interface. The server can record the encrypted reservation request interface and return it to the client (i.e., the target terminal). The user can submit a reservation request through the target terminal, and the reservation request carries the encrypted reservation request interface. The server can verify whether the request is correct by judging whether the encrypted reservation request interface carried by the reservation request is the same as the recorded encrypted reservation request interface (i.e., the target request interface). After completing the verification of the reservation request, the reservation ends, and the reservation result can be returned to the reservation page. The user can view the reservation result on the target terminal (such as returning an error code or error message to inform the user that the reservation failed).
[0082] The reservation request verification method provided in the embodiment of the present application can obtain a specific and unique hash value of the user within the reservation time period by performing multiple hash operations on the user request time and identity information, and use this value as a key to encrypt and calculate the reservation interface, so as to obtain an encrypted reservation request interface, and use the encrypted interface to verify the reservation request, so that the server can reject and block illegal reservation industry chain requests, such as batch submission of reservation requests using scripts or virtual IP machines. Only users who have performed an encrypted interaction with the server can successfully make a reservation, thereby improving the accuracy of reservation request verification.
[0083] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0084] Example 2
[0085] The embodiment of the present application also provides a reservation request verification device. It should be noted that the reservation request verification device of the embodiment of the present application can be used to execute the reservation request verification method provided by the embodiment of the present application. The reservation request verification device provided by the embodiment of the present application is introduced below.
[0086] According to an embodiment of the present application, a device for implementing the above-mentioned reservation request verification method is also provided. Figure 4 is a schematic diagram of an optional reservation request verification device according to an embodiment of the present application, such as Figure 4 As shown, the verification device for the reservation request may include: a receiving unit 40, a calculating unit 41, a generating unit 42, and a verification unit 43.
[0087] The receiving unit 40 is used to receive registration requests sent by multiple target terminals on the front-end page, wherein each registration request carries registration request information, and the registration request information at least includes: request interface, registration time, and user information;
[0088] The calculation unit 41 is used to perform hash calculation on the registration time and user information for each registration request to obtain a target hash value;
[0089] The generating unit 42 is used to encrypt the request interface based on the target hash value, generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page;
[0090] The verification unit 43 is used to receive a reservation request initiated by the target terminal on the front-end page based on the reservation interface, and verify the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
[0091] The reservation request verification device provided in the embodiment of the present application can receive registration requests sent by multiple target terminals on the front-end page through the receiving unit 40, and can perform hash calculation on the registration time and user information for each registration request through the calculation unit 41 to obtain a target hash value, and can encrypt the request interface based on the target hash value through the generation unit 42 to generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page, and can receive the reservation request initiated by the target terminal on the front-end page based on the reservation interface through the verification unit 43, and verify the reservation request based on the encrypted reservation request interface.
[0092] Optionally, the calculation unit includes: a first calculation module, used to use a preset hash function to perform hash calculation on the registration time to obtain a first hash value of the registration time; a second calculation module, used to use a preset hash function to perform hash calculation on the user information to obtain a second hash value of the user information; a first determination module, used to determine the target hash value based on the first hash value and the second hash value.
[0093] Optionally, the first determination module includes: a first concatenation submodule, used for concatenating the first hash value and the second hash value to obtain an initial hash value; and a first calculation submodule, used for performing hash calculation on the initial hash value to obtain a target hash value.
[0094] Optionally, the generation unit includes: a second determination module, used to determine the block length of a preset hash function; a first filling module, used to fill the target hash value when the length of the target hash value is less than the block length, until the length of the target hash value is equal to the block length, and represent the target hash value with a length equal to the block length as an initial key; a third calculation module, used to perform hash calculation on the target hash value when the length of the target hash value is greater than the block length, to obtain an initial key with a length equal to the block length; a fourth calculation module, used to perform an XOR operation on the initial key and a first character string with a length equal to the block length to generate a first key; a fifth calculation module, used to perform an XOR operation on the initial key and a second character string with a length equal to the block length to generate a second key, wherein the first character string is different from the second character string; and a first generation module, used to generate an encryption reservation request interface based on the first key and the second key.
[0095] Optionally, the first generation module includes: a second calculation submodule, used to splice the first key and the request interface to obtain first spliced data, and perform hash calculation on the first spliced data to obtain a first hash value; a third calculation submodule, used to splice the first hash value and the second key to obtain second spliced data, and perform hash calculation on the second spliced data to obtain an encrypted reservation request interface.
[0096] Optionally, the verification device for the reservation request includes: a first joining module, used to characterize each encrypted reservation request interface as a target request interface after returning the encrypted reservation request interface to the front-end page, and add each target request interface to a preset request interface list; a first splicing module, used to splice each encrypted reservation request interface to the request interface to obtain a reservation interface, wherein the target terminal makes a reservation based on the reservation interface and generates a reservation request.
[0097] Optionally, the verification unit includes: a first judgment module, used to judge whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, and if there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, determining that the reservation request verification is successful; a second judgment module, used to generate response failure data and return the response failure data to the front-end page to determine that the reservation request verification has failed if there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request.
[0098] The above-mentioned reservation request verification device may also include a processor and a memory. The above-mentioned receiving unit 40, calculation unit 41, generation unit 42, verification unit 43, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0099] The processor includes a kernel, which retrieves the corresponding program unit from the memory. The kernel can be set to one or more kernels, and the reservation request is verified based on the encrypted reservation request interface by adjusting the kernel parameters.
[0100] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0101] It should be noted that the receiving unit 40, the calculating unit 41, the generating unit 42, and the verifying unit 43 correspond to steps S201 to S204 in Embodiment 1, and the examples and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the contents disclosed in the above Embodiment 1. It should be noted that the above units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above units can also be run in the computer terminal 10 provided in Embodiment 1 as part of the device.
[0102] Example 3
[0103] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal or an electronic device.
[0104] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0105] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the reservation request verification method: receiving registration requests sent by multiple target terminals on the front-end page, wherein each registration request carries registration request information, and the registration request information at least includes: request interface, registration time, and user information; for each registration request, performing hash calculation on the registration time and user information to obtain a target hash value; based on the target hash value, encrypting the request interface, generating an encrypted reservation request interface, and returning the encrypted reservation request interface to the front-end page; receiving a reservation request initiated by the target terminal on the front-end page based on the reservation interface, and verifying the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
[0106] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the verification method of the appointment request: use a preset hash function to hash the registration time to obtain a first hash value of the registration time; use a preset hash function to hash the user information to obtain a second hash value of the user information; based on the first hash value and the second hash value, determine the target hash value.
[0107] Optionally, the computer terminal may execute the program code of the following steps in the reservation request verification method: concatenating the first hash value and the second hash value to obtain an initial hash value; and performing hash calculation on the initial hash value to obtain a target hash value.
[0108] Optionally, the computer terminal may execute the following program codes of the following steps in the reservation request verification method: determining the block length of a preset hash function; when the length of a target hash value is less than the block length, padding the target hash value until the length of the target hash value is equal to the block length, and representing the target hash value whose length is equal to the block length as an initial key; or, when the length of the target hash value is greater than the block length, performing a hash calculation on the target hash value to obtain an initial key whose length is equal to the block length; performing an XOR operation on the initial key and a first character string whose length is equal to the block length to generate a first key; performing an XOR operation on the initial key and a second character string whose length is equal to the block length to generate a second key, wherein the first character string is different from the second character string; and generating an encrypted reservation request interface based on the first key and the second key.
[0109] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the verification method of the reservation request: splicing the first key and the request interface to obtain first spliced data, and performing hash calculation on the first spliced data to obtain a first hash value; splicing the first hash value and the second key to obtain second spliced data, and performing hash calculation on the second spliced data to obtain an encrypted reservation request interface.
[0110] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the reservation request verification method: characterize each encrypted reservation request interface as a target request interface, and add each target request interface to a preset request interface list; splice each encrypted reservation request interface to the request interface to obtain a reservation interface, wherein the target terminal makes a reservation based on the reservation interface and generates a reservation request.
[0111] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for verifying the reservation request: determining whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request; if there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, determining that the reservation request verification is successful; if there is no target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, generating response failure data, and returning the response failure data to the front-end page, determining that the reservation request verification has failed.
[0112] Optionally, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 (only one is shown) processor 502, memory 504, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0113] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for verifying the reservation request in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the verification method for the reservation request mentioned above is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] The processor may call the information and application program stored in the memory through the transmission device to execute the above steps in the above method for verifying the reservation request.
[0115] By using an embodiment of the present application, a scheme for verifying an appointment request is provided. By performing multiple hash calculations on the user request time and identity information, a target hash value can be obtained, and the target hash value is used as a key to perform encryption calculation on the request interface to obtain an encrypted appointment request interface. The encrypted interface is used to verify the appointment request, and batch appointment requests can be effectively identified and intercepted, thereby improving the accuracy of appointment request verification, thereby solving the technical problem in the related art that appointment requests initiated by automated scripts cannot be effectively identified, resulting in low accuracy in verifying the appointment requests.
[0116] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone, a tablet computer, a PDA, and a mobile Internet device (MID). Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations are shown.
[0117] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0118] Example 4
[0119] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the reservation request verification method provided in the first embodiment.
[0120] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0121] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the verification method of the reservation request.
[0122] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0123] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0128] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for verifying a reservation request, characterized in that: Applied to the server, including: Receiving registration requests sent by multiple target terminals on a front-end page, wherein each of the registration requests carries registration request information, and the registration request information at least includes: a request interface, a registration time, and user information; For each registration request, performing hash calculation on the registration time and the user information to obtain a target hash value; Based on the target hash value, the request interface is encrypted to generate an encrypted reservation request interface, and the encrypted reservation request interface is returned to the front-end page; A reservation request initiated by the target terminal on the front-end page based on a reservation interface is received, and the reservation request is verified based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
2. The reservation request verification method according to claim 1, characterized in that: The step of performing hash calculation on the registration time and the user information to obtain a target hash value includes: Using a preset hash function to perform a hash calculation on the registration time to obtain a first hash value of the registration time; Performing a hash calculation on the user information using the preset hash function to obtain a second hash value of the user information; The target hash value is determined based on the first hash value and the second hash value.
3. The reservation request verification method according to claim 2, characterized in that: The step of determining the target hash value based on the first hash value and the second hash value includes: Concatenate the first Hash value and the second Hash value to obtain an initial Hash value; A hash calculation is performed on the initial hash value to obtain the target hash value.
4. The reservation request verification method according to claim 1, characterized in that: The step of encrypting the request interface based on the target hash value to generate an encrypted reservation request interface includes: Determine the block length of the preset hash function; In the case where the length of the target Hash value is less than the block length, padding the target Hash value until the length of the target Hash value is equal to the block length, and representing the target Hash value whose length is equal to the block length as the initial key; or When the length of the target hash value is greater than the block length, performing hash calculation on the target hash value to obtain the initial key whose length is equal to the block length; Performing an XOR operation on the initial key and a first character string having a length equal to the block length to generate a first key; Performing an XOR operation on the initial key and a second string having a length equal to the block length to generate a second key, wherein the first string is different from the second string; The encryption reservation request interface is generated based on the first key and the second key.
5. The reservation request verification method according to claim 4, characterized in that: The step of generating the encrypted reservation request interface based on the first key and the second key includes: Concatenate the first key with the request interface to obtain first concatenated data, and perform hash calculation on the first concatenated data to obtain a first hash value; The first hash value and the second key are concatenated to obtain second concatenated data, and a hash calculation is performed on the second concatenated data to obtain the encrypted reservation request interface.
6. The reservation request verification method according to claim 1, characterized in that: After returning the encrypted reservation request interface to the front-end page, the method further includes: Characterizing each of the encrypted reservation request interfaces as a target request interface, and adding each of the target request interfaces to a preset request interface list; Each of the encrypted reservation request interfaces is spliced to the request interface to obtain the reservation interface, wherein the target terminal makes a reservation based on the reservation interface to generate the reservation request.
7. The reservation request verification method according to claim 6, characterized in that: The step of verifying the reservation request based on the encrypted reservation request interface includes: Determine whether there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, and if there is a target request interface in the preset request interface list that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request, determine that the reservation request is successfully verified; When the target request interface that is identical to the encrypted reservation request interface carried in the reservation interface corresponding to the reservation request does not exist in the preset request interface list, response failure data is generated and returned to the front-end page to determine that the verification of the reservation request has failed.
8. A reservation request verification device, characterized in that: include: A receiving unit, configured to receive registration requests sent by multiple target terminals on a front-end page, wherein each of the registration requests carries registration request information, and the registration request information at least includes: a request interface, a registration time, and user information; A calculation unit, configured to perform a hash calculation on the registration time and the user information for each registration request to obtain a target hash value; A generating unit, configured to encrypt the request interface based on the target hash value, generate an encrypted reservation request interface, and return the encrypted reservation request interface to the front-end page; The verification unit is used to receive a reservation request initiated by the target terminal on the front-end page based on a reservation interface, and verify the reservation request based on the encrypted reservation request interface, wherein the reservation interface is an interface generated based on the request interface.
9. A computer program product, characterized in that The invention comprises a non-volatile computer-readable storage medium storing a computer program, wherein the computer program implements the reservation request verification method according to any one of claims 1 to 7 when executed by a processor.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the reservation request verification method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Single sign-on method, single sign-on system and associated equipment
CN101997685A
Method for realizing terminal authentication based on OMA DM, terminal and server
CN104125565A
User side verification method, system, equipment and medium
CN113806798A
Second killing request method, second killing verification method, device, system and medium
CN115694902A
Identity verification method based on biological characteristics and zero-knowledge proof under web3.0
CN116886315A