A verification method, device, computer equipment and readable storage medium
By using random code verification and data transmission in the inspection system, the problem of easy stolen verification codes and packet civilized text transmission in the inspection system is solved, and the security protection of inspection equipment and servers is achieved.
Patent Information
- Application Number
- CN202210203872.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-03-03
AI Technical Summary
The verification codes sent by the server in the existing inspection system and the messages transmitted are plain text, which are easily stolen by others, resulting in illegal access to the inspection equipment and servers.
Use random codes for verification and data transmission in the inspection session. By matching the random code in the data request message with the session value, a new random code is generated, and a random code and inspection data are carried in the data request response message. If the number of illegal events exceeds the threshold, it will be added to the blacklist.
It effectively protects the verification code and message delivery process, prevents illegal access, and improves the security of the system.
Smart Images

Figure CN114500098B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data encryption technology, and in particular to a verification method, device, computer equipment and readable storage medium. Background Art
[0002] At present, the inspector uses the inspector code and password assigned by the enterprise to log in to the inspection device. After the inspection device is successfully verified, it can receive the verification code sent by the server. After the inspector enters the verification code, the server verification is successful, and then the inspection session is established, so that the inspection device and the server can transmit data messages to each other. The inspector uses the mobile handheld device on the inspection device to scan the material code on the material, and selects the current material status on the screen of the mobile handheld device according to the current situation of the scanned material, such as normal, need to be replaced, increase or decrease, and then the inspection device sends the material status to the server in the form of a message for the server to store. Data request messages can also be sent through the inspection device to view the usage and statistics of existing materials stored in the server. However, the verification code currently sent by the server to the inspection device is in plain text, and the message transmitted in the inspection session is not protected, which makes it easy for the verification code or message to be stolen by others, and then illegally access the inspection device and server. Therefore, how to protect the transmission process of the verification code and message has become a problem of concern to enterprises. Summary of the invention
[0003] Based on this, it is necessary to provide a verification method, device, computer equipment and readable storage medium to address the above technical problems.
[0004] In a first aspect, a verification method is provided, the method being applied to a server in a patrol inspection system, the method comprising:
[0005] Receive a data request message sent by the inspection terminal through the inspection session;
[0006] If the data request message carries a first random code, and the first random code is the same as the session value in the inspection session, generating a second random code, and setting the session value in the inspection session to the second random code;
[0007] A data request response message is sent to the inspection terminal, where the data request response message carries the second random code and inspection data.
[0008] As an optional implementation, the method further includes:
[0009] If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one;
[0010] If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
[0011] As an optional implementation, the method further includes:
[0012] When the inspector identity is authenticated by the inspection terminal, a third random code is generated, and a session value in the random code session is set to the third random code;
[0013] A random code message is sent to the inspection terminal through the random code session, wherein the random code message carries the third random code.
[0014] As an optional implementation, the method further includes:
[0015] Receive a patrol session establishment request message sent by the patrol terminal, wherein the patrol session establishment request message carries the third random code, a first media access control bit MAC address corresponding to the patrol terminal, a first Internet Protocol IP address, and a first terminal patrol officer code;
[0016] If the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address, and the first terminal inspector code are respectively the same as the second MAC address, the second IP address, and the second terminal inspector code corresponding to the inspection terminal stored in the server, then the inspection session is established with the inspection terminal;
[0017] Generate a fourth random code, and set the session value in the inspection session to the fourth random code;
[0018] A patrol session establishment success message is sent to the patrol terminal, where the patrol session establishment success message carries the fourth random code.
[0019] As an optional implementation manner, the random code generated by the server is unique within a preset time period.
[0020] In a second aspect, a verification method is provided, the method being applied to an inspection terminal in an inspection system, the method comprising:
[0021] Obtaining a session value in an inspection session to obtain a first random code;
[0022] Sending a data request message to a server through the inspection session, wherein the data request message carries the first random code;
[0023] receiving, through the inspection session, a data request response message sent by the server, wherein the data request response message carries a second random code and inspection data;
[0024] The session value in the inspection session is set to the second random code.
[0025] As an optional implementation, the method further includes:
[0026] Receiving a random code message sent by the server through a random code session, wherein the random code message carries a third random code;
[0027] The session value in the random code session is set to the third random code.
[0028] As an optional implementation, the method further includes:
[0029] Obtaining a session value in the random code session to obtain a third random code;
[0030] A patrol session establishment request message is sent to the server, wherein the patrol session establishment request message carries the third random code, the first media access control bit MAC address, the first Internet Protocol IP address and the first terminal inspector code.
[0031] Receive a patrol session establishment success message sent by the server, wherein the patrol session establishment success message carries a fourth random code;
[0032] The inspection session is established with the server, and the session value in the inspection session is set to the fourth random code.
[0033] In a third aspect, a verification device is provided, the device being applied to a server in a patrol inspection system, the device comprising:
[0034] A first receiving device, used for receiving a data request message sent by the inspection terminal through an inspection session;
[0035] a first generating device, configured to generate a second random code if the data request message carries a first random code, and the first random code is the same as a session value in the inspection session, and set the session value in the inspection session to the second random code;
[0036] The first sending device is used to send a data request response message to the inspection terminal, wherein the data request response message carries the second random code and inspection data.
[0037] As an optional implementation manner, the device further includes:
[0038] A monitoring device, configured to increase the number of illegal events corresponding to the inspection terminal by one if the data request message does not carry the first random code, or if the first random code carried in the data request message is different from the session value in the inspection session;
[0039] The processing device is used to add the inspection terminal to a blacklist if the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold.
[0040] As an optional implementation manner, the device further includes:
[0041] The second generating means is used to generate a third random code when the inspector identity verification is sent by the inspection terminal, and set the session value in the random code session to the third random code;
[0042] The second sending device is used to send a random code message to the inspection terminal through the random code session, and the random code message carries the third random code.
[0043] As an optional implementation manner, the device further includes:
[0044] A second receiving device is used to receive a patrol session establishment request message sent by the patrol terminal, wherein the patrol session establishment request message carries the third random code, a first media access control bit MAC address corresponding to the patrol terminal, a first Internet Protocol IP address and a first terminal patrolman code;
[0045] a first establishing means for establishing the inspection session with the inspection terminal if the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address and the first terminal inspector code are respectively the same as the second MAC address, the second IP address and the second terminal inspector code corresponding to the inspection terminal stored in the server;
[0046] A third generating device, used for generating a fourth random code, and setting the session value in the inspection session to the fourth random code;
[0047] The third sending device is used to send a patrol session establishment success message to the patrol terminal, and the patrol session establishment success message carries the fourth random code.
[0048] As an optional implementation manner, the random code generated by the server is unique within a preset time period.
[0049] In a fourth aspect, a verification device is provided, the device being applied to an inspection terminal in an inspection system, the device comprising:
[0050] A first acquisition device is used to acquire a session value in an inspection session to obtain a first random code;
[0051] a fourth sending device, configured to send a data request message to a server through the inspection session, wherein the data request message carries the first random code;
[0052] A third receiving device, used for receiving a data request response message sent by the server through the inspection session, wherein the data request response message carries a second random code and inspection data;
[0053] The first setting device is used to set the session value in the inspection session as the second random code.
[0054] As an optional implementation manner, the device further includes:
[0055] a fourth receiving device, configured to receive a random code message sent by the server through a random code session, wherein the random code message carries a third random code;
[0056] The second setting device is used to set the session value in the random code session to the third random code.
[0057] As an optional implementation manner, the device further includes:
[0058] The second acquisition means is used to acquire the session value in the random code session to obtain a third random code;
[0059] The fifth sending device is used to send a patrol session establishment request message to the server, wherein the patrol session establishment request message carries the third random code, the first media access control bit MAC address, the first Internet Protocol IP address and the first terminal inspector code.
[0060] A fifth receiving device, used to receive a patrol session establishment success message sent by the server, wherein the patrol session establishment success message carries a fourth random code;
[0061] The second establishing device is used to establish the inspection session with the server and set the session value in the inspection session to the fourth random code.
[0062] In a fifth aspect, a patrol inspection system is provided, the patrol inspection system comprising: the server as described in the third aspect and the patrol inspection terminal as described in the fourth aspect.
[0063] In a sixth aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the computer program, the method steps described in any one of the first and second aspects are implemented.
[0064] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps as described in any one of the first aspect and the second aspect are implemented.
[0065] The present application provides a verification method, apparatus, computer device, and readable storage medium. The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0066] The method is applied to a server and an inspection terminal in an inspection system. The inspection terminal obtains a session value in an inspection session and obtains a first random code. The server sends a data request message to the server through the inspection session. The data request message carries a first random code. The server receives a data request message sent by the inspection terminal through the inspection session. If the data request message carries a first random code and the first random code is the same as the session value in the inspection session, a second random code is generated and the session value in the inspection session is set to the second random code. The server sends a data request response message to the inspection terminal. The data request response message carries a second random code and inspection data. The inspection terminal receives a data request response message sent by the server through the inspection session. The data request response message carries a second random code and inspection data. The method adds a random code protection means to the message transmitted in the inspection session. Compared with the plain text verification of the prior art, the method is not easy to cause the message to be stolen by others, thereby illegally accessing the inspection device and the server.
[0067] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 A flowchart of a flowchart of a verification method provided in an embodiment of the present application;
[0070] Figure 2 A flowchart of a flowchart of a verification method provided in an embodiment of the present application;
[0071] Figure 3 A flowchart of establishing an inspection session provided in an embodiment of the present application;
[0072] Figure 4 A flowchart of establishing an inspection session provided in an embodiment of the present application;
[0073] Figure 5 A flowchart of a flowchart of a verification method provided in an embodiment of the present application;
[0074] Figure 6 A flowchart of establishing an inspection session provided in an embodiment of the present application;
[0075] Figure 7 A flowchart of establishing an inspection session provided in an embodiment of the present application;
[0076] Figure 8 A schematic diagram of the structure of a verification device provided in an embodiment of the present application;
[0077] Fig. 9 A schematic diagram of the structure of a verification device provided in an embodiment of the present application;
[0078] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0080] The verification method provided in the embodiment of the present application can be applied to the inspection system. The inspection system includes a server and an inspection terminal. The inspection terminal is used to send the inspector's identity authentication information to the server, and the server receives the inspector's identity authentication information and verifies the inspector's identity authentication information. If the inspector's identity authentication information is verified, the server generates a random code and sets the session value of the random code session to the random code. The inspection terminal receives the random code and adds the random code to the inspection session establishment request message. The server receives the inspection session establishment request message, obtains the random code and determines whether the random code is the same as the session value. If the random code is the same as the session value, a new random code is generated, and the session value of the random code session is set to the random code. The server adds the random code to the inspection session establishment request response message and sends it to the inspection terminal. The inspection terminal receives the inspection session establishment request response message, obtains the random code to establish the inspection session, and sets the session value of the inspection session to the random code. When the inspector initiates a data request to the server through the inspection terminal, the inspection terminal can add the random code to the data request message and send it to the server. The server receives the data request message, obtains the random code, and determines whether the random code is the same as the session value stored in the server. If the random code is the same as the session value, the server generates a new random code, sets the session value of the inspection session to the random code, and adds the random code and the inspection data to the data request response message. The server sends the data request response message to the inspection terminal, which receives the data request response message, obtains the random code and the inspection data, and sets the session value of the inspection session to the random code for the next data request.
[0081] A verification method provided in an embodiment of the present application will be described in detail below in conjunction with a specific implementation method. The method is applied to a server in an inspection system. Figure 1 A flowchart of a verification method provided in an embodiment of the present application, such as Figure 1 As shown, the specific steps are as follows:
[0082] Step 101: receiving a data request message sent by an inspection terminal through an inspection session.
[0083] In implementation, after the inspection session is established (the establishment process of the inspection session is shown in steps 301-302 and 401-404), when the inspector needs to obtain the inspection data stored in the server through the inspection terminal, the inspector can send a data request message to the server through the terminal device. Correspondingly, the server receives the data request message sent by the inspection terminal through the inspection session. Among them, the data request message contains the inspection data that the inspector needs to query or operate through the inspection terminal in the specific inspection work.
[0084] Step 102: If the data request message carries a first random code, and the first random code is the same as the session value in the inspection session, a second random code is generated, and the session value in the inspection session is set to the second random code.
[0085] In implementation, after the server receives the data request message, if the header of the data request message contains the first random code, and the first random code is the same as the session value in the inspection session, it means that the first random code verification is successful. In order to prevent the first random code from being misused, after the server completes the first random code verification, the first random code becomes invalid, and then generates a second random code, and sets the session value in the inspection session to the second random code for verification of the second random code.
[0086] Step 103: Send a data request response message to the inspection terminal, wherein the data request response message carries a second random code and inspection data.
[0087] In implementation, the server sends a data request response message to the inspection terminal according to the data request message sent by the inspection terminal, wherein the data request response message carries the second random code and the inspection data corresponding to the data request message.
[0088] As an optional implementation, Figure 2 As shown, if the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the processing steps are as follows:
[0089] Step 201: If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one.
[0090] In implementation, if the data request message does not carry the first random code, that is, the data request message carries an empty random code or the first random code carried in the data request message is different from the session value in the inspection session, that is, the first random code is an invalid disguised random code, then the random code verification fails. Accordingly, the server increases the number of illegal events corresponding to the inspection terminal by one.
[0091] Preferably, if the random code verification fails, the server may not return a data request response message or may return an empty message to the inspection terminal.
[0092] Step 202: If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
[0093] In implementation, after the server adds one to the number of illegal events corresponding to the inspection terminal, it can further determine whether the number of illegal events of the inspection terminal is greater than or equal to the preset illegal number threshold. If the number of illegal events corresponding to the inspection terminal is greater than or equal to the preset illegal number threshold, the inspection terminal is added to the blacklist.
[0094] Preferably, if the number of illegal events corresponding to the inspection terminal is greater than or equal to the preset illegal number threshold, the server can remotely lock the inspection terminal according to the MAC (Media Access Control Address) or IP (Internet Protocol Address) of the inspection terminal that sent the message. The server can classify illegal events into general illegal events, major illegal events, and directly blocked and blacklisted events, and write the relevant information and data of illegal events into the black box and sandbox for subsequent monitoring.
[0095] As an optional implementation, Figure 3 As shown in the figure, the steps to establish an inspection session are as follows:
[0096] Step 301: When the inspector identity authentication is sent through the inspection terminal, a third random code is generated, and the session value in the random code session is set to the third random code.
[0097] In implementation, after receiving the inspection authorization designated by the enterprise, the inspector can obtain the terminal inspector code. The inspector logs in to the inspection terminal according to the terminal inspector code and password to complete the preliminary inspector identity authentication. At this time, the inspection terminal can establish a random code session with the server, and send the inspector's identity authentication related information, such as the inspector's terminal inspector code and password, to the server in the form of a message. The server can verify the terminal inspector code and password in the message. If the server verification is successful, the server can generate a third random code. The third random code is used to verify the inspection session establishment request message. The server sets the session value in the random code session to the third random code to determine whether the third random code carried in the subsequent message sent by the inspection device matches the session value in the random code session.
[0098] Step 302: Send a random code message to the inspection terminal through a random code session, wherein the random code message carries a third random code.
[0099] In implementation, the server sends a random code message to the inspection terminal through a random code session, and the random code message carries the third random code.
[0100] As an optional implementation, Figure 4 As shown, the steps of establishing the inspection session also include:
[0101] Step 401: Receive a patrol session establishment request message sent by a patrol terminal, wherein the patrol session establishment request message carries a third random code, a first MAC address corresponding to the patrol terminal, a first IP address, and a first terminal patrolman code.
[0102] In implementation, when the inspector accesses the server through the inspection terminal, the inspection terminal sends an inspection session establishment request message to the server. Correspondingly, the server can receive the inspection session establishment request message sent by the inspection terminal, and the inspection session establishment request message carries the third random code, the first MAC address corresponding to the inspection terminal, the first IP address and the first terminal inspector code.
[0103] Optionally, the inspection session establishment request message may directly carry a third random code, a first MAC address corresponding to the inspection terminal, a first IP address and a first terminal inspector code, or may carry an inspection session establishment request code generated based on a preset algorithm by the third random code, the first MAC address corresponding to the inspection terminal, the first IP address and the first terminal inspector code.
[0104] Step 402: If the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address and the first terminal inspector code are respectively the same as the second MAC address, the second IP address and the second terminal inspector code corresponding to the inspection terminal stored in the server, then an inspection session is established with the inspection terminal.
[0105] In implementation, if the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address and the first terminal inspector code are respectively the same as the second MAC address, the second IP address and the second terminal inspector code corresponding to the inspection terminal stored in the server, then it means that the third random code, the first MAC address, the first IP address and the first terminal inspector code are verified successfully, and the corresponding server establishes an inspection session with the inspection terminal.
[0106] Optionally, in the case where the inspection session establishment request code is carried in the inspection establishment request message, the server parses the inspection session establishment request code to obtain the third random code, the first media access control bit MAC address corresponding to the inspection terminal, the first Internet Protocol IP address and the first terminal inspector code, and then the server verifies the above information to establish an inspection session with the inspection terminal.
[0107] Step 403: Generate a fourth random code, and set the session value in the inspection session to the fourth random code.
[0108] In implementation, after the server inspection terminal establishes an inspection session, the server generates a fourth random code and sets the session value in the inspection session to the fourth random code. The fourth random code is used by the server to verify the data request message sent by the inspection terminal to prevent information leakage or other terminals from illegally obtaining inspection data during the data request and response process between the server and the inspection terminal.
[0109] Step 404: Send a message indicating that the inspection session is successfully established to the inspection terminal, wherein the message indicating that the inspection session is successfully established carries a fourth random code.
[0110] In implementation, the server sends a patrol session establishment success message to the patrol terminal, and the patrol session establishment success message carries a fourth random code for verification of the data request message.
[0111] As an optional implementation, the random code generated by the server is unique within a preset time period.
[0112] In implementation, the server can add an 8-bit random code to the header of the message. Each time the 8-bit random code triggers a response operation, the 8-bit random code will be dynamically refreshed and a new 8-bit random code will be generated again. In order to reduce the probability that an illegal terminal sends a random code generated on the same day to the server to obtain inspection information, this solution stipulates that the random code cannot be repeated within one natural day.
[0113] An embodiment of the present application provides a verification method, which is applied to an inspection terminal in an inspection system. Figure 5 A flowchart of a verification method provided in an embodiment of the present application, such as Figure 6 As shown, the specific steps are as follows:
[0114] Step 501, obtain a session value in an inspection session to obtain a first random code.
[0115] In implementation, after the inspection session is established (see steps 601-602 and 701-704 for the inspection session establishment steps), the inspection terminal obtains the session value in the inspection session and obtains the first random code. For example, when the server receives a message sent by the inspection terminal last time, if the server verification is successful, a first random code is generated. The random code is attached to the response message and sent to the inspection terminal, and the inspection terminal stores the first random code as the session value in the inspection session. Before the inspection terminal sends a data request message to the server, it can first obtain the session value in the inspection session and obtain the first random code. The first random code is then attached to the data request message for server verification.
[0116] Step 502: Send a data request message to the server through the inspection session, wherein the data request message carries a first random code.
[0117] In implementation, the inspection terminal sends a data request message to the server through the inspection session, wherein the data request message carries the first random code.
[0118] Step 503: Receive a data request response message sent by the server through the inspection session, wherein the data request response message carries a second random code and inspection data.
[0119] In implementation, after the server receives the data request message, if the first random code is successfully verified, the server generates a second random code, adds the second random code to the header of the data request response message, and sends the data request response message to the inspection terminal. The inspection terminal receives the data request response message sent by the server through the inspection session. The data request response message carries the second random code and the inspection data corresponding to the data request message.
[0120] Step 504: Set the session value in the inspection session to the second random code.
[0121] In implementation, the inspection terminal sets the session value in the inspection session as the second random code, so that the second random code is attached to the data request message when sending a data request message to the server next time.
[0122] As an optional implementation, Figure 6 As shown in the figure, the steps to establish an inspection session are as follows:
[0123] Step 601: Receive a random code message sent by a server through a random code session, wherein the random code message carries a third random code.
[0124] In implementation, after the server verifies the terminal inspector code and password, the server can generate a third random code. The server adds the third random code to the header of the random code message and sends it to the inspection terminal. The inspection terminal receives the random code message sent by the server through the random code session. Among them, the random code message carries the third random code.
[0125] Step 602: Set the session value in the random code session to the third random code.
[0126] In implementation, the inspection terminal sets the session value in the random code session to the third random code, so that the third random code can be obtained later, added to the header of the data request message, and then sent to the server to complete the data request.
[0127] As an optional implementation, Figure 7 As shown in the figure, the steps to establish an inspection session are as follows:
[0128] Step 701: Obtain a session value in a random code session to obtain a third random code.
[0129] In implementation, when the inspector accesses the server through the inspection terminal, the inspection terminal obtains the session value in the random code session to obtain the third random code.
[0130] Step 702: Send a patrol session establishment request message to the server, wherein the patrol session establishment request message carries a third random code, a first media access control bit MAC address, a first Internet Protocol IP address and a first terminal patrolman code.
[0131] In implementation, the inspection terminal sends an inspection session establishment request message to the server, wherein the inspection session establishment request message carries a third random code, a first media access control bit MAC address, a first Internet Protocol IP address and a first terminal inspector code.
[0132] Optionally, the inspection session establishment request message may directly carry a third random code, the first media access control bit MAC address corresponding to the inspection terminal, the first Internet Protocol IP address and the first terminal inspector code, or may carry a inspection session establishment request code generated based on a preset algorithm by the third random code, the first media access control bit MAC address corresponding to the inspection terminal, the first Internet Protocol IP address and the first terminal inspector code.
[0133] Step 703: Receive a patrol session establishment success message sent by the server, wherein the patrol session establishment success message carries a fourth random code.
[0134] In implementation, the inspection terminal receives a successful inspection session establishment message sent by the server, wherein the successful inspection session establishment message carries a fourth random code for verification of the data request message.
[0135] Step 704: Establish an inspection session with the server, and set the session value in the inspection session to the fourth random code.
[0136] In implementation, the inspection terminal establishes an inspection session with the server and sets the session value in the inspection session to the fourth random code so that the third random code can be subsequently obtained and added to the header of the data request message, which is then sent to the server to complete the data request.
[0137] Optionally, a verification method provided in an embodiment of the present application may be applied to a communication system, which includes a mobile phone and a base station. The specific steps are as follows:
[0138] Step 1001, when sending user identity authentication via a mobile phone, if the user identity authentication passes, the base station generates an identity authentication random code and sets the session value in the identity authentication random code session as the identity authentication random code.
[0139] Step 1002: The base station sends an identity authentication random code message to the mobile phone through an identity authentication random code session, wherein the identity authentication random code message carries an identity authentication random code.
[0140] Step 1003: The mobile phone sends a communication session establishment request message to the base station. The communication session establishment request message carries an identity authentication random code, a first MAC address corresponding to the mobile phone, a first IP address, and a first user code.
[0141] Step 1004: the base station receives a communication session establishment request message sent by the mobile phone.
[0142] Step 1005: If the authentication random code is the same as the session value in the authentication random code session, and the first MAC address, the first IP address and the first user code are respectively the same as the second MAC address, the second IP address and the second user code corresponding to the mobile phone stored in the base station, then the base station establishes a communication session with the mobile phone.
[0143] Step 1006: The base station generates a communication random code and sets a session value in the communication session as the communication random code.
[0144] Step 1007: The base station sends a communication session establishment success message to the mobile phone, wherein the communication session establishment success message carries a communication random code.
[0145] Step 1008: The mobile phone receives a communication session establishment success message sent by the base station.
[0146] Step 1009: The mobile phone establishes a communication session with the base station, and sets the session value in the communication session as the communication random code.
[0147] Step 1010: The mobile phone sends a data request message to the base station to request to obtain communication data, wherein the data request message carries a communication random code.
[0148] Step 1011: The base station receives a data request message.
[0149] Step 1012: If the communication random code carried in the data request message is the same as the session value in the communication session, the base station generates a new communication random code and sets the session value in the communication session to the new communication random code.
[0150] Step 1013: The base station sends a data request response message to the mobile phone, wherein the data request response message carries a new communication random code and communication data.
[0151] Step 1014: The mobile phone receives the data request response message to receive the communication data, and sets the session value in the communication session as a new communication random code.
[0152] The embodiment of the present application provides a verification method, which is applied to a server and an inspection terminal in an inspection system. The inspection terminal obtains a session value in an inspection session and obtains a first random code. The server sends a data request message to the server through the inspection session. The data request message carries a first random code. The server receives a data request message sent by the inspection terminal through the inspection session. If the data request message carries a first random code and the first random code is the same as the session value in the inspection session, a second random code is generated and the session value in the inspection session is set to the second random code. The server sends a data request response message to the inspection terminal. The data request response message carries a second random code and inspection data. The inspection terminal receives a data request response message sent by the server through the inspection session. The data request response message carries a second random code and inspection data. The method adds a random code protection means to the message transmitted in the inspection session. Compared with the plain text verification of the prior art, the method is not easy to cause the message to be stolen by others, and then illegally access the inspection device and server.
[0153] It should be understood that although Figures 1 to 7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1 to 7 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0154] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0155] The present application also provides a verification device, which is applied to a server in a patrol inspection system, such as Figure 8 As shown, the device comprises:
[0156] The first receiving means 810 is used to receive a data request message sent by the inspection terminal through the inspection session;
[0157] The first generating means 820 is configured to generate a second random code if the data request message carries a first random code, and if the first random code is the same as a session value in the inspection session, and set the session value in the inspection session to the second random code;
[0158] The first sending device 830 is used to send a data request response message to the inspection terminal, where the data request response message carries a second random code and inspection data.
[0159] As an optional implementation, the device also includes:
[0160] A monitoring device, configured to increase the number of illegal events corresponding to the inspection terminal by one if the data request message does not carry the first random code, or if the first random code carried in the data request message is different from the session value in the inspection session;
[0161] The processing device is used to add the inspection terminal to a blacklist if the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold.
[0162] As an optional implementation, the device also includes:
[0163] The second generating means is used to generate a third random code when the inspector's identity is authenticated through the inspection terminal, and to set the session value in the random code session to the third random code.
[0164] The second sending device is used to send a random code message to the inspection terminal through a random code session, wherein the random code message carries a third random code.
[0165] As an optional implementation, the device also includes:
[0166] The second receiving device is used to receive the inspection session establishment request message sent by the inspection terminal, which carries a third random code, the first media access control bit MAC address corresponding to the inspection terminal, the first Internet Protocol IP address and the first terminal inspector code.
[0167] The first establishing device is used to establish an inspection session with the inspection terminal if the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address and the first terminal inspector code are respectively the same as the second MAC address, the second IP address and the second terminal inspector code corresponding to the inspection terminal stored in the server.
[0168] The third generating device is used to generate a fourth random code and set the session value in the inspection session to the fourth random code.
[0169] The third sending device is used to send a message of successful establishment of an inspection session to the inspection terminal, and the message of successful establishment of the inspection session carries a fourth random code.
[0170] As an optional implementation manner, the random code generated by the server is unique within a preset time period.
[0171] The present application also provides a verification device, which is applied to a patrol terminal in a patrol system, such as Fig. 9 As shown, the device comprises:
[0172] The first obtaining means 910 is used to obtain a session value in the inspection session to obtain a first random code.
[0173] The fourth sending device 920 is used to send a data request message to the server through the inspection session, and the data request message carries the first random code.
[0174] The third receiving device 930 is used to receive a data request response message sent by the server through the inspection session, and the data request response message carries a second random code and inspection data.
[0175] The first setting device 940 is used to set the session value in the inspection session to the second random code.
[0176] As an optional implementation, the device further includes:
[0177] The fourth receiving device is used to receive a random code message sent by the server through a random code session, wherein the random code message carries a third random code.
[0178] The second setting device is used to set the session value in the random code session to a third random code.
[0179] As an optional implementation, the device further includes:
[0180] The second acquisition device is used to acquire the session value in the random code session to obtain a third random code.
[0181] The fifth sending device is used to send a patrol session establishment request message to the server, wherein the patrol session establishment request message carries a third random code, a first media access control bit MAC address, a first Internet Protocol IP address and a first terminal inspector code.
[0182] The fifth receiving device is used to receive the inspection session establishment success message sent by the server, and the inspection session establishment success message carries a fourth random code.
[0183] The second establishing device is used to establish an inspection session with the server and set the session value in the inspection session to a fourth random code.
[0184] The embodiment of the present application provides a verification device, which is applied to the inspection terminal and the server in the inspection system, wherein the first acquisition device is used to acquire the session value in the inspection session and obtain the first random code. The fourth sending device is used to send a data request message to the server through the inspection session, and the data request message carries the first random code. The first receiving device is used to receive the data request message sent by the inspection terminal through the inspection session. The first generating device is used to generate a second random code if the data request message carries the first random code and the first random code is the same as the session value in the inspection session, and set the session value in the inspection session to the second random code. The first sending device is used to send a data request response message to the inspection terminal, and the data request response message carries the second random code and inspection data. The third receiving device is used to receive the data request response message sent by the server through the inspection session, and the data request response message carries the second random code and inspection data. The first setting device is used to set the session value in the inspection session to the second random code. The device adds a random code protection method to the message transmitted in the inspection session. Compared with the plain text verification in the prior art, the device is not prone to the situation where the message is stolen by others and then the inspection equipment and server are illegally accessed.
[0185] For the specific definition of the verification device, please refer to the definition of the verification method above, which will not be repeated here. Each module in the above verification device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0186] In one embodiment, a computer device is provided, such as Fig.10 As shown, it includes a memory and a processor, the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned verification method steps when executing the computer program.
[0187] In one embodiment, a computer-readable storage medium stores a computer program, which implements the steps of the above verification method when executed by a processor.
[0188] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0189] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0190] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0191] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0192] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0193] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A verification method, characterized in that: The method is applied to a server in a patrol inspection system, and the method comprises: Receive a data request message sent by the inspection terminal through the inspection session; If the data request message carries a first random code, and the first random code is the same as the session value in the inspection session, generating a second random code, and setting the session value in the inspection session to the second random code; Sending a data request response message to the inspection terminal, wherein the data request response message carries the second random code and inspection data; If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one; If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
2. The method according to claim 1, characterized in that: The method further comprises: When the inspector identity is authenticated by the inspection terminal, a third random code is generated, and a session value in the random code session is set to the third random code; A random code message is sent to the inspection terminal through the random code session, wherein the random code message carries the third random code.
3. The method according to claim 2, characterized in that The method further comprises: Receive a patrol session establishment request message sent by the patrol terminal, wherein the patrol session establishment request message carries the third random code, a first media access control bit MAC address corresponding to the patrol terminal, a first Internet Protocol IP address, and a first terminal patrol officer code; If the third random code is the same as the session value in the random code session, and the first MAC address, the first IP address, and the first terminal inspector code are respectively the same as the second MAC address, the second IP address, and the second terminal inspector code corresponding to the inspection terminal stored in the server, then the inspection session is established with the inspection terminal; Generate a fourth random code, and set the session value in the inspection session to the fourth random code; A patrol session establishment success message is sent to the patrol terminal, where the patrol session establishment success message carries the fourth random code.
4. The method according to claim 1, characterized in that: The random code generated by the server is unique within a preset time period.
5. A verification method, characterized in that: The method is applied to an inspection terminal in an inspection system, and the method comprises: Obtaining a session value in an inspection session to obtain a first random code; Sending a data request message to a server through the inspection session, wherein the data request message carries the first random code; receiving, through the inspection session, a data request response message sent by the server, wherein the data request response message carries a second random code and inspection data; Setting the session value in the inspection session to the second random code; If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one; If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
6. The method according to claim 5, characterized in that The method further comprises: Receiving a random code message sent by the server through a random code session, wherein the random code message carries a third random code; The session value in the random code session is set to the third random code.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining a session value in the random code session to obtain a third random code; Sending a patrol session establishment request message to the server, wherein the patrol session establishment request message carries the third random code, the first media access control bit MAC address, the first Internet Protocol IP address and the first terminal inspector code; Receive a patrol session establishment success message sent by the server, wherein the patrol session establishment success message carries a fourth random code; The inspection session is established with the server, and the session value in the inspection session is set to the fourth random code.
8. A verification device, characterized in that: The device is applied to a server in a patrol inspection system, and the device comprises: A first receiving device, used for receiving a data request message sent by the inspection terminal through an inspection session; a first generating device, configured to generate a second random code if the data request message carries a first random code, and if the first random code is the same as a session value in the inspection session, and to set the session value in the inspection session to the second random code; A first sending device, used to send a data request response message to the inspection terminal, wherein the data request response message carries the second random code and inspection data; If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one; If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
9. A verification device, characterized in that: The device is applied to an inspection terminal in an inspection system, and the device comprises: A first acquisition device is used to acquire a session value in an inspection session to obtain a first random code; a fourth sending device, configured to send a data request message to a server through the inspection session, wherein the data request message carries the first random code; A third receiving device, used for receiving a data request response message sent by the server through the inspection session, wherein the data request response message carries a second random code and inspection data; a first setting device, configured to set a session value in the inspection session to the second random code; If the data request message does not carry the first random code, or the first random code carried in the data request message is different from the session value in the inspection session, the number of illegal events corresponding to the inspection terminal is increased by one; If the number of illegal events corresponding to the inspection terminal is greater than or equal to a preset illegal number threshold, the inspection terminal is added to a blacklist.
Citation Information
Patent Citations
Random code verification system based on mobile terminal and verification method thereof
CN103037323A
Authentication method and wireless connection device
CN103425923A
User-convenient authentication method and apparatus using a mobile authentication application
CN104662864A
Terminal authentication processing method and device, and terminal authentication method, device and system
CN106341372A
A method and a device for decrypting data
CN109831464A
