CN114298258A - Offline two-dimensional code generation method - Google Patents
Offline two-dimensional code generation method Download PDFInfo
- Publication number
- CN114298258A CN114298258A CN202111570073.0A CN202111570073A CN114298258A CN 114298258 A CN114298258 A CN 114298258A CN 202111570073 A CN202111570073 A CN 202111570073A CN 114298258 A CN114298258 A CN 114298258A
- Authority
- CN
- China
- Prior art keywords
- dimensional code
- server
- information
- mode
- terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000012795 verification Methods 0.000 claims description 37
- 238000010586 diagram Methods 0.000 description 11
- 238000004590 computer program Methods 0.000 description 7
- 230000001680 brushing effect Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 238000003860 storage Methods 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011010 flushing procedure Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
Images
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The embodiment of the application provides an off-line two-dimensional code generation method, which comprises the following steps: the terminal sends a two-dimensional code request to the server, wherein the two-dimensional code request carries identification information of a user; the terminal receiving server sends the associated information of the user in the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp; the terminal calculates the signature summary information through a private key according to the associated information and keeps the signature summary information in the local; and under the condition that the terminal network is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises registration information, group identification information, a server timestamp, a signature summary, a code swiping mode and a terminal timestamp. When the terminal has no signal or is in outage due to defaulting (no network or poor network), the two-dimensional code can be generated by using a terminal offline mode, so that most users are not influenced to use the two-dimensional code.
Description
Technical Field
The application relates to the technical field of two-dimension codes, in particular to an off-line two-dimension code generation method.
Background
The two-dimensional code has become the general information exchange mode on the mobile device, and the two-dimensional code is with information encoding for the geometric patterns, can sweep convenient discernment of sign indicating number equipment through the camera of mobile device or special use to possess the check-up ability, can normally sweep the sign indicating number under the condition such as sheltering from, defective.
The prior art has several problems in two-dimensional code systems: 1) the generation of the two-dimensional code needs a signature mechanism to prevent the forgery and the falsification of a third party, and in some cases, information contained in the two-dimensional code needs to be encrypted to prevent the leakage, so that a set of safe secret key distribution and protection mechanism is needed for the issuance and the verification of the two-dimensional code. 2) The problem that the two-dimensional code is stolen to be brushed is solved, and under certain scenes, if the two-dimensional code is not limited by using time or times, the problem caused by the stolen brushing is probably caused. 3) Based on the above problems, when the issuance, the use and the verification of the two-dimensional code need to be completed by three parties, for example, in a passing access control system, the above process needs a code swiping party (such as a mobile phone), both the two-dimensional code acquisition party and the online system can operate online in a strong real-time manner, very high requirements are provided for the reliability and the availability of the system, and in an actual use scene, the code swiping party can be extremely unstable due to factors such as network conditions, the two-dimensional code acquisition party is not like a cloud machine room, the reliability is low, and the availability of the code swiping scheme is very low.
The above information disclosed in the background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not form the prior art that is known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the application provides a method for updating a two-dimensional code, and solves the technical problem that in the prior art, a terminal cannot refresh the two-dimensional code under the condition that a network is not good.
According to a first aspect of an embodiment of the present application, there is provided an offline two-dimensional code generation method, including: a terminal sends a two-dimensional code request to a server, wherein the two-dimensional code request carries identification information of a user; the terminal receives the associated information of the user in the server sent by the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp; the terminal calculates signature summary information through a private key according to the associated information and keeps the signature summary information in a local place; and under the condition that the terminal network is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, the signature summary, the code swiping mode and the terminal timestamp.
Optionally, the sending, by the terminal, the two-dimensional code request to the server includes: and logging in the server in an authentication mode when the terminal sends the two-dimension code request for the first time.
Optionally, before receiving that the server sends the association information of the user in the server according to the identification information, the method further includes: the server establishes grouping information according to preset conditions; grouping the users upon receiving the user registration request.
Optionally, the state of the offline-mode two-dimensional code includes a two-dimensional code in an active state and a two-dimensional code in an inactive state.
Optionally, when the terminal network is in an offline state, after the terminal draws the offline-mode two-dimensional code according to the signature summary information, the method further includes: acquiring the off-line mode two-dimensional code by two-dimensional code acquisition equipment; and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is less than or equal to a first preset threshold, the offline-mode two-dimensional code is a valid two-dimensional code.
Optionally, the method further includes: and under the condition that the difference between the local time and the server timestamp is greater than the first preset threshold value, the offline-mode two-dimensional code is an invalid two-dimensional code.
Optionally, before the two-dimensional code acquisition device acquires the offline-mode two-dimensional code, the method further includes: and the two-dimensional code acquisition equipment acquires grouping information and user information in the grouping from the server.
Optionally, the method further includes: and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code fails, the server draws an offline mode two-dimensional code according to the signature summary information, wherein the offline mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, a code refreshing mode and the terminal timestamp.
Optionally, the method further includes: and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code is successful, generating a two-dimensional code in a conventional mode, wherein the two-dimensional code in the conventional mode comprises the registration information, the group identification information, the server timestamp and the signature abstract.
Optionally, the method further includes: acquiring the two-dimension code in the conventional mode by two-dimension code acquisition equipment; and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is less than or equal to a second preset threshold, the conventional mode two-dimensional code is a valid two-dimensional code.
Optionally, the method further includes: and under the condition that the difference between the local time and the server timestamp is greater than the second preset threshold value, the conventional mode two-dimensional code is an invalid two-dimensional code.
According to a first aspect of the embodiments of the present application, an access control system based on an offline two-dimensional code is provided, including: a terminal sends a two-dimensional code request to a server, wherein the two-dimensional code request carries identification information of a user; the terminal receives the associated information of the user in the server sent by the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp; the terminal calculates signature summary information through a private key according to the associated information and keeps the signature summary information in a local place; under the condition that the network of the terminal is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, the signature summary, the code refreshing mode and the terminal timestamp; acquiring the off-line mode two-dimensional code by two-dimensional code acquisition equipment; and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimension code acquisition equipment and the time stamp of the server is less than or equal to a first preset threshold value, verifying that the two-dimension code information is valid, and opening the access control equipment.
Due to the adoption of the technical scheme, the embodiment of the application has the following technical effects: when the terminal has no signal or is in outage due to defaulting (no network or poor network), the two-dimensional code can be generated by using a terminal offline mode, so that most users are not influenced to use the two-dimensional code.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of an alternative off-line two-dimensional code generation method according to an embodiment of the present invention;
FIG. 2 is a block diagram of an alternative two-dimensional code generation and verification system in accordance with embodiments of the present invention;
fig. 3 is a schematic diagram of an alternative two-dimensional code information structure according to an embodiment of the present invention;
FIG. 4 is a flow chart of an alternative two-dimensional code generation according to an embodiment of the present invention;
fig. 5 is a flowchart of an alternative acquisition device for verifying a two-dimensional code according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a sequence of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In this embodiment, an offline two-dimensional code generation method is provided, and fig. 1 is a flowchart of the offline two-dimensional code generation method according to the embodiment of the present invention, as shown in fig. 1, the flow of the offline two-dimensional code generation method includes the following steps:
step S102, the terminal sends a two-dimensional code request to the server, wherein the two-dimensional code request carries identification information of a user.
And step S104, the terminal receiving server sends the associated information of the user in the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp.
And step S106, the terminal calculates the signature summary information through a private key according to the associated information and keeps the signature summary information in the local.
And S108, under the condition that the terminal network is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises registration information, group identification information, a server timestamp, a signature summary, a code refreshing mode and a terminal timestamp.
In this embodiment, the offline two-dimensional code generation method may include, but is not limited to, applying various available two-dimensional code scenes, such as a shopping scene, a passage scene, an entrance guard scene, and the like.
In the entrance guard scene, if the acquisition fails due to factors such as terminal (such as mobile phone) arrearage, network abnormity, server abnormity and the like, the cached information is used for drawing the offline mode two-dimensional code. And then can enter the cell through code brushing.
According to the embodiment provided by the application, the terminal sends a two-dimensional code request to the server, wherein the two-dimensional code request carries identification information of a user; the terminal receiving server sends the associated information of the user in the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp; the terminal calculates the signature summary information through a private key according to the associated information and keeps the signature summary information in the local; and under the condition that the terminal network is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises registration information, group identification information, a server timestamp, a signature summary, a code swiping mode and a terminal timestamp. Namely, under the condition that the terminal network is not good, the terminal can generate the offline mode two-dimensional code according to the cached data.
Optionally, the sending, by the terminal, the two-dimensional code request to the server may include: when the terminal sends a two-dimension code request for the first time, the terminal logs in the server through an authentication mode.
Optionally, before the receiving server sends the associated information of the user in the server according to the identification information, the method may further include: the server establishes grouping information according to preset conditions; upon receiving a user registration request, the users are grouped.
In this embodiment, the terminal needs the server to establish a group and register people in the group to generate the offline two-dimensional code. After the acquisition equipment is installed, the acquisition equipment can be in communication synchronization with the cloud, and the grouping information and the personnel information are synchronized to the local. The grouping information is generally changed rarely, and the personnel information can be changed frequently. The acquisition equipment can also acquire a public key of the cloud end when the acquisition equipment is connected with a network so as to verify the two-dimensional code signature.
Optionally, the state of the offline-mode two-dimensional code may include two states, namely, a two-dimensional code in an active state and a two-dimensional code in an inactive state.
Optionally, when the terminal network is in an offline state, after the terminal draws the offline-mode two-dimensional code according to the signature summary information, the method may further include: the method comprises the steps that two-dimension code acquisition equipment acquires an offline mode two-dimension code; and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is less than or equal to a first preset threshold value, the two-dimensional code in the offline mode is a valid two-dimensional code.
Optionally, the method may further include: and under the condition that the difference between the local time and the server timestamp is greater than a first preset threshold value, the offline mode two-dimensional code is an invalid two-dimensional code.
Optionally, before the two-dimensional code acquisition device acquires the offline-mode two-dimensional code, the method may further include: the two-dimensional code acquisition equipment acquires the grouping information and the user information in the grouping from the server.
Optionally, the method may further include: and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code fails, the server draws the offline mode two-dimensional code according to the signature summary information, wherein the offline mode two-dimensional code comprises registration information, group identification information, a server timestamp, a code refreshing mode and a terminal timestamp.
Optionally, the method may further include: and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code is successful, generating the two-dimensional code in the conventional mode, wherein the two-dimensional code in the conventional mode comprises registration information, group identification information, a server timestamp and a signature abstract.
Optionally, the method may further include: acquiring a two-dimensional code in a conventional mode by two-dimensional code acquisition equipment; and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is less than or equal to a second preset threshold, the two-dimensional code in the conventional mode is a valid two-dimensional code.
Optionally, the method may further include: and under the condition that the difference between the local time and the server timestamp is greater than a second preset threshold value, the two-dimensional code in the conventional mode is an invalid two-dimensional code.
As an optional embodiment, the present application further provides a two-dimensional code generation and verification system. As shown in fig. 2, a two-dimensional code generation and verification system structure diagram.
As shown in fig. 2, the two-dimensional code generation and verification system includes a two-dimensional code acquisition device, a mobile phone (equivalent to a terminal), and a server.
In order to meet the requirement that two-dimensional code verification can be normally carried out under the condition that the network condition of the acquisition equipment is not good or unavailable, firstly, grouping information is established at a server side, and personnel (equivalent to a user) are registered in a group. After the two-dimensional code acquisition equipment is installed, the two-dimensional code acquisition equipment can communicate with a server synchronously, and grouping information and personnel information are synchronized to the local of the two-dimensional code acquisition equipment. The grouping information is generally changed rarely, and the personnel information can be changed frequently. The acquisition equipment can also acquire a public key of the cloud end when the acquisition equipment is connected with a network so as to verify the two-dimensional code signature.
It should be noted that the code-swiping mode is divided into two types: the system comprises a normal mode and an offline mode, wherein the offline mode is divided into a mobile phone offline mode and a server side offline mode; the mobile phone can authenticate and log in when being used for the first time, the server side can return the group ID, the personnel ID and the server side timestamp of the user, the signature summary information of the data is calculated through a private key, the user information is prevented from being maliciously tampered, and the data is cached locally in the mobile phone. When the two-dimension code service is used, a request for refreshing the two-dimension code is tried to be sent to the server side every time, the latest grouping and registration information is obtained, if the obtaining is successful, the latest obtained information is used for drawing the normal mode two-dimension code and updating the cache, and if the obtaining fails due to mobile phone arrearages, network abnormality, server side abnormality and other factors, the cached information is used for drawing the offline mode two-dimension code.
As shown in fig. 3, the two-dimensional code information structure is schematic. The online refresh data structure includes a group ID, a person ID, a server-side timestamp, and a signature digest. The signature computation field includes a group ID, a person ID, a server-side timestamp.
In this embodiment, in order to prevent copying and embezzlement, the normal two-dimensional code mode has a short validity period, generally about 1 minute, because of real-time network refreshing, and can be refreshed again at the end of the period. For the sake of safety, the validity period of the offline two-dimensional code mode is limited, generally about 48 hours, drawing is not performed after more than 48 hours, the user fails to pass, and verification of the acquisition device is not performed.
In this embodiment, as shown in fig. 4, a flowchart of two-dimensional code generation is specifically described as follows.
Step S41, starting to check the network connection status;
step S42, generating client off-line mode code when the network state is in connection state and the last time code-refreshing buffer is checked;
step S43, when the network state is in the connection state and the last time of code refreshing cache is not checked, the code refreshing fails;
step S44, under the condition that the network state is in the connection state and the request is successful in refreshing the two-dimensional code, caching the request result and generating a conventional mode code;
step S45, when the network state is in the connection state and the request for refreshing the two-dimensional code fails, and the last time of code refreshing is successful, generating a server-side offline mode code;
and step S46, when the network state is in the connection state and the request for refreshing the two-dimensional code fails, and the last time of code refreshing cache fails, the code refreshing fails.
In this embodiment, as shown in fig. 5, a flowchart of verifying a two-dimensional code by a collection device is shown. The specific flow is as follows.
Step S51, start;
in step S52, if the signature verification fails, the two-dimensional code is an invalid two-dimensional code.
In step S53, when the signature verification passes and the group verification fails, the two-dimensional code is an invalid two-dimensional code.
Step S54, judging the two-dimension code mode under the condition that the signature verification is passed and the grouping verification is passed;
step S55, when the two-dimensional code mode is the offline mode and the difference between the local time and the server timestamp is greater than 48 hours, the two-dimensional code is an invalid two-dimensional code.
Step S56, when the two-dimensional code mode is the offline mode and the difference between the local time and the server timestamp is not greater than 48 hours, the two-dimensional code is an effective offline mode two-dimensional code.
And step S57, when the two-dimensional code mode is an online mode and the difference between the local time and the server-side timestamp is greater than 1 minute, the two-dimensional code is an invalid two-dimensional code.
And step S58, when the two-dimension code mode is an online mode and the difference between the local time and the server-side timestamp is not more than 1 minute, the online two-dimension code is an effective normal-mode two-dimension code.
As can be seen from fig. 5, the verification of the two-dimensional code is only performed by the code swiping device, and the cloud is not requested, so that the response speed is high, the two-dimensional code can still normally work even in the case of network failure or unavailability of the server, and the code swiping record is stored locally, and the record includes code swiping success and failure, code swiping time information, code swiping mode information, a code swiping user ID, and group ID information. And uploading the code brushing record to the cloud when the network is recovered.
After the record is uploaded to the server, the background can analyze the abnormal statistical code-swiping and send out alarm information, and the statistical strategy is as follows: the individual code swiping failure rate is higher than the recent average value and exceeds a threshold value; the failure rate of the whole code brushing is higher than the recent average value and exceeds a threshold value; the individual offline brushing code rate is higher than the recent average value and exceeds a threshold value; the overall offline brushing code rate is higher than the recent average value and exceeds a threshold value; the difference between the individual code-flushing time and the server-side timestamp is higher than the recent average and occurs multiple times.
The reasons for the alarm generation may be equipment failure, large-area network failure, malicious use of offline codes, malicious use of normal codes, and capability of troubleshooting and restricting user use according to specific information.
In this embodiment, the three terminals can be offline as follows:
the server side: when the server side is in failure or offline for upgrading, the mobile phone can generate the two-dimensional code in the server side offline mode, the two-dimensional code verification of the acquisition side does not depend on the server side, and the recording and uploading are carried out asynchronously, so that the use of a user is not influenced, the starting and synchronization of new equipment are only influenced, and the influence is small.
The mobile phone end: when the mobile phone has no signal or is in a defaulting shutdown state, the two-dimensional code can be generated by using the mobile phone offline mode, so that the use of most users is not influenced, only the user who logs in for the first time and the user who uses the mobile phone for more than 48 hours last time are influenced, and the influence range is small.
Two-dimensional code collection end: the verification process after the two-dimension code is acquired is completed locally, a real-time network request is not relied on, the acquisition equipment is only relied on online when the information is accessed and grouped for the first time, and the frequency of the above conditions is extremely low, so that the verification function of the two-dimension code can be completed under most conditions after the acquisition equipment is offline, and the use of a user is not influenced.
Through the embodiment provided by the application, based on the general passing verification scheme of the two-dimensional code, the mobile phone of the user, the two-dimensional code acquisition verification device and the cloud high-availability scheme which can be offline are provided while the passing function of the two-dimensional code is completed.
According to a first aspect of the embodiments of the present application, an access control system based on an offline two-dimensional code is provided, including: the terminal sends a two-dimensional code request to the server, wherein the two-dimensional code request carries identification information of a user; the terminal receiving server sends the associated information of the user in the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp; the terminal calculates the signature summary information through a private key according to the associated information and keeps the signature summary information in the local; under the condition that the network of the terminal is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises registration information, group identification information, a server timestamp, a signature summary, a code swiping mode and a terminal timestamp; the method comprises the steps that two-dimension code acquisition equipment acquires an offline mode two-dimension code; under the condition that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is smaller than or equal to a first preset threshold value, the two-dimensional code information is verified to be effective, and the access control equipment is opened.
In this embodiment, under the condition that any one of the terminal, the server or the two-dimensional acquisition device is in a non-network state or a network is not good, the generation of the off-line two-dimensional code can be realized, and the entrance guard is opened according to the two-dimensional code.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (12)
1. An off-line two-dimensional code generation method is characterized by comprising the following steps:
a terminal sends a two-dimensional code request to a server, wherein the two-dimensional code request carries identification information of a user;
the terminal receives the associated information of the user in the server sent by the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and a server timestamp;
the terminal calculates signature summary information through a private key according to the associated information and keeps the signature summary information in a local place;
and under the condition that the terminal network is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, the signature summary, the code swiping mode and the terminal timestamp.
2. The method of claim 1, wherein the terminal sends a two-dimensional code request to a server, comprising:
and logging in the server in an authentication mode when the terminal sends the two-dimension code request for the first time.
3. The method of claim 1, wherein before receiving the association information of the user in the server sent by the server according to the identification information, the method further comprises:
the server establishes grouping information according to preset conditions;
upon receiving a user registration request, the users are grouped.
4. The method of any one of claims 1 to 3, wherein the offline mode two-dimensional code state comprises a valid state two-dimensional code and an invalid state two-dimensional code.
5. The method according to claim 1, wherein after the terminal draws an offline-mode two-dimensional code according to the signature summary information in a case where the terminal network is in an offline state, the method further comprises:
acquiring the off-line mode two-dimensional code by two-dimensional code acquisition equipment;
and under the conditions that the signature verification is passed, the grouping verification is passed and the difference between the time of the two-dimension code acquisition equipment and the time stamp of the server is less than or equal to a first preset threshold value, the two-dimension code in the offline mode is a valid two-dimension code.
6. The method of claim 5, further comprising:
and under the condition that the difference between the local time and the server timestamp is greater than the first preset threshold value, the offline-mode two-dimensional code is an invalid two-dimensional code.
7. The method of claim 5, wherein before the two-dimensional code acquisition device acquires the offline-mode two-dimensional code, the method further comprises:
and the two-dimensional code acquisition equipment acquires grouping information and user information in the grouping from the server.
8. The method of claim 1, further comprising:
and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code fails, the server draws an offline mode two-dimensional code according to the signature summary information, wherein the offline mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, a code refreshing mode and the terminal timestamp.
9. The method of claim 1, further comprising:
and under the condition that the terminal network is in an online state and the request for refreshing the two-dimensional code is successful, generating a two-dimensional code in a conventional mode, wherein the two-dimensional code in the conventional mode comprises the registration information, the group identification information, the server timestamp and the signature abstract.
10. The method of claim 9, further comprising:
acquiring the two-dimension code in the conventional mode by two-dimension code acquisition equipment;
and under the conditions that the signature verification is passed, the grouping verification is passed and the difference between the time of the two-dimensional code acquisition equipment and the time stamp of the server is less than or equal to a second preset threshold value, the two-dimensional code in the conventional mode is a valid two-dimensional code.
11. The method of claim 10, further comprising:
and under the condition that the difference between the local time and the server timestamp is greater than the second preset threshold value, the conventional mode two-dimensional code is an invalid two-dimensional code.
12. The utility model provides an access control system based on off-line two-dimensional code which characterized in that includes:
a terminal sends a two-dimensional code request to a server, wherein the two-dimensional code request carries identification information of a user;
the terminal receives the associated information of the user in the server sent by the server according to the identification information, wherein the associated information comprises the registration information of the user, the group identification information of the user and the server timestamp;
the terminal calculates signature summary information through a private key according to the associated information and keeps the signature summary information in a local place;
under the condition that the network of the terminal is in an off-line state, the terminal draws an off-line mode two-dimensional code according to the signature summary information, wherein the off-line mode two-dimensional code comprises the registration information, the group identification information, the server timestamp, the signature summary, the code refreshing mode and the terminal timestamp;
acquiring the off-line mode two-dimensional code by two-dimensional code acquisition equipment;
and under the conditions that the signature verification is passed, the grouping verification is passed, and the difference between the time of the two-dimension code acquisition equipment and the time stamp of the server is smaller than or equal to a first preset threshold value, the two-dimension code information is verified to be valid, and the access control equipment is opened.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111570073.0A CN114298258A (en) | 2021-12-21 | 2021-12-21 | Offline two-dimensional code generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111570073.0A CN114298258A (en) | 2021-12-21 | 2021-12-21 | Offline two-dimensional code generation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114298258A true CN114298258A (en) | 2022-04-08 |
Family
ID=80967311
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111570073.0A Pending CN114298258A (en) | 2021-12-21 | 2021-12-21 | Offline two-dimensional code generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114298258A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115484224A (en) * | 2022-09-16 | 2022-12-16 | 北京奇艺世纪科技有限公司 | Information association method, two-dimensional code generation method, device, electronic equipment and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107194694A (en) * | 2017-04-14 | 2017-09-22 | 广州羊城通有限公司 | A kind of off line method of payment based on Quick Response Code |
CN108234517A (en) * | 2018-01-29 | 2018-06-29 | 成都智元汇信息技术股份有限公司 | A kind of subway based on offline Quick Response Code ticket card is ridden off-line processing system and method |
CN108428271A (en) * | 2018-05-15 | 2018-08-21 | 上海高屋信息科技有限公司 | Double offline identity authorization systems based on Quick Response Code |
CN108712383A (en) * | 2018-04-17 | 2018-10-26 | 新大陆(福建)公共服务有限公司 | A kind of generation method and computer readable storage medium of offline secure Quick Response Code |
CN110298421A (en) * | 2019-06-26 | 2019-10-01 | 云宝宝大数据产业发展有限责任公司 | A kind of online generation, offline generation and the verification method and device of two dimensional code |
CN111506632A (en) * | 2020-04-23 | 2020-08-07 | 腾讯科技(深圳)有限公司 | Data processing method and device |
US20200342439A1 (en) * | 2019-04-25 | 2020-10-29 | Wing Lok Keith LAU | Method, client device and pos terminal for offline transaction |
US20210150169A1 (en) * | 2018-11-28 | 2021-05-20 | Advanced New Technologies Co., Ltd. | Method and device for providing and verifying two-dimensional code |
-
2021
- 2021-12-21 CN CN202111570073.0A patent/CN114298258A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107194694A (en) * | 2017-04-14 | 2017-09-22 | 广州羊城通有限公司 | A kind of off line method of payment based on Quick Response Code |
CN108234517A (en) * | 2018-01-29 | 2018-06-29 | 成都智元汇信息技术股份有限公司 | A kind of subway based on offline Quick Response Code ticket card is ridden off-line processing system and method |
CN108712383A (en) * | 2018-04-17 | 2018-10-26 | 新大陆(福建)公共服务有限公司 | A kind of generation method and computer readable storage medium of offline secure Quick Response Code |
CN108428271A (en) * | 2018-05-15 | 2018-08-21 | 上海高屋信息科技有限公司 | Double offline identity authorization systems based on Quick Response Code |
US20210150169A1 (en) * | 2018-11-28 | 2021-05-20 | Advanced New Technologies Co., Ltd. | Method and device for providing and verifying two-dimensional code |
US20200342439A1 (en) * | 2019-04-25 | 2020-10-29 | Wing Lok Keith LAU | Method, client device and pos terminal for offline transaction |
CN110298421A (en) * | 2019-06-26 | 2019-10-01 | 云宝宝大数据产业发展有限责任公司 | A kind of online generation, offline generation and the verification method and device of two dimensional code |
CN111506632A (en) * | 2020-04-23 | 2020-08-07 | 腾讯科技(深圳)有限公司 | Data processing method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115484224A (en) * | 2022-09-16 | 2022-12-16 | 北京奇艺世纪科技有限公司 | Information association method, two-dimensional code generation method, device, electronic equipment and medium |
CN115484224B (en) * | 2022-09-16 | 2023-09-29 | 北京奇艺世纪科技有限公司 | Information association method, two-dimensional code generation method, device, electronic equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108961475B (en) | Access control deployment method and access control deployment server | |
CN109543065B (en) | Video active identification method combined with block chain | |
CN201508555U (en) | Internet bar management system based on face recognition | |
US8818906B1 (en) | Systems and methods for performing authentication of a customer interacting with a banking platform | |
CN115834253B (en) | Identity verification method, identity verification system, client and server | |
CN109285256A (en) | Computer room based on block chain authentication enter permission give method | |
CN110502889A (en) | Login method, device, computer readable storage medium and computer equipment | |
CN101488256B (en) | Counter employee identity authentication system and method | |
CN114298258A (en) | Offline two-dimensional code generation method | |
CN113904821A (en) | Identity authentication method and device and readable storage medium | |
CN113852628A (en) | Decentralized single sign-on method, decentralized single sign-on device and storage medium | |
CN107659579B (en) | On-site certificate storing method and device and related certificate storing system | |
CN104935555B (en) | client certificate authentication method, server, client and system | |
CN111818025A (en) | User terminal detection method and device | |
CN111654375A (en) | Block chain-based edge calculation security encryption method, device and system | |
CN111327602B (en) | Equipment access processing method, equipment and storage medium | |
US9237167B1 (en) | Systems and methods for performing network counter measures | |
CN113297176B (en) | Database access method based on Internet of things | |
CN111988202B (en) | Node switching method, device and storage medium | |
CN1862556B (en) | Method and apparatus for controlling computer 10g-in by contactless smart card | |
CN115643047A (en) | Block chain identity authentication method based on honest rewards | |
CN113515728A (en) | Internet of things platform software authorization control system and method based on multistage deployment | |
CN115277233B (en) | Hybrid cloud service platform based on data visualization plug-in and access method thereof | |
CN113868699A (en) | UKey-based personal information protection method and system | |
CN101425925A (en) | Method, system and apparatus for providing authentication of data communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |