Disclosure of Invention
The invention provides a method for detecting the safety performance of an electronic seal, which is used for at least solving the problems of low working efficiency caused by the fact that data query, record result and print report are not supported in the related technology.
Therefore, the technical scheme provided by the invention is as follows:
a method for detecting the safety performance of an electronic seal aims at the safety performance detection of the electronic seal in a published state and comprises seal checking, data verification, identity authentication detection, access control detection, information reading detection, information verification detection and key updating detection; the method specifically comprises the following steps:
the seal checking module is used for receiving a corresponding instruction of a user, reading all electronic seals in the current working area, storing the serial numbers of the electronic seals and displaying the serial numbers of the electronic seals in a pull-down menu corresponding to the storage codes in the seal label code area;
seal checking, namely receiving a corresponding instruction of a user, acquiring a seal number selected from a pull-down menu corresponding to a current storage code, and reading data of a seal represented by the seal number; if the read data is correctly returned, prompting that the checking is successful; if the data is not returned, prompting that the checking fails;
data verification, namely receiving a corresponding instruction of a user, requesting a set number of random numbers from the electronic seal, starting a verification pseudo-random number interface, inputting the requested random numbers into the verification pseudo-random number interface for verification, and prompting that the data verification fails if the probability of the random numbers passing the verification is smaller than a set value, otherwise, the data verification succeeds; and outputting the verification result to an input field of the random number verification area;
identity authentication detection, receiving corresponding instructions of a user, performing encryption server and reader-writer state detection and seal matching detection, if successful, continuing execution, and if failed, ending, and not performing subsequent steps;
access control detection, namely receiving data selected or filled by a USER, placing the data in a USER data area, receiving a corresponding instruction of the USER, writing the data in the USER data area into a pre-designed data storage structure, and performing access control detection;
reading and detecting information, receiving a corresponding instruction of a user, and reading data in the electronic seal by calling an interface operation controller and an antenna;
information verification detection, namely receiving a corresponding instruction of a user, reading data in the electronic seal, and storing verification after reading; the storage verification specifically comprises the following steps: acquiring data filled in the USER data area by a USER, and comparing the data with the read decrypted data; if the comparison fails, the information verification detection fails;
and key updating detection, receiving a corresponding instruction of a user, and executing the following steps:
detecting the states of the GX1, the encryption server and the reader-writer and detecting the seal matching, if the detection is successful, continuing to execute, and if the detection is failed, locking detection fails;
GX2, acquiring a new key and an original key by calling an interface provided by an encryption server, and if the key acquisition fails, failing to detect the key update;
GX3, writing a new key into the reserved area through a calling interface, and if the writing fails, failing to update and detect the key;
GX4, downloading the new key to the controller through a calling interface, and if downloading fails, failing in key updating detection;
if all of the above steps GX1, GX2, GX3 and GX4 are successfully executed, the key update detection is successful.
Optionally, in the seal verification step, if the data is not returned, repeated verification is performed, and if the verification still fails after repeated verification for multiple times, the process is ended.
Optionally, in the step of identity authentication detection, the encryption server and the reader/writer state detection and the seal matching detection are performed, and the method specifically includes the following SF1 step and/or SF2 step:
SF1, updating the error key to the reader through the key issuing interface, at this time, writing data into the chip, and detecting that the error key is used for writing data into the electronic seal; if the data is successfully written, prompting that the identity authentication detection fails;
SF2, obtaining a correct initial key through a key issuing interface, updating the correct initial key into a reader-writer, writing data into a chip at the moment, and detecting that the correct initial key is used for writing the data into an electronic seal; if the data is successfully written, the identity authentication is prompted to be successful, otherwise, the identity authentication detection fails.
Optionally, the access control detection specifically sequentially executes the following steps:
FW1, encryption server and reader/writer state detection and seal matching detection, if successful, continuing execution, and if failed, failing access control detection;
FW2, which calls the interface of the encryption server to encrypt the data storage structure; if the encryption processing fails, the access control detection fails;
FW3, writing the encrypted data into the USER data area of the electronic seal by calling the service interface; if the data writing fails, the access control detection fails;
and if the three steps are executed successfully in sequence, the access control detection is successful.
Optionally, the reading of the data in the electronic seal specifically includes the following steps:
DQ1, encryption server and reader-writer state detection and seal matching detection, and the successful execution continues, and the failure information reading detection fails;
DQ2, setting a data reading structure, configuring related data into the structure, calling a provided data reading function interface, and reading data in an EPC area; if the read data is not returned, reading the EPC data fails;
DQ3, setting a data reading structure, configuring related data into the structure, calling a provided data reading function interface, and reading data in the TID area; if the read data is not returned, the TID data reading fails;
DQ4, setting a data reading structure, configuring related data into the structure, calling a provided data reading function interface, and reading data in a USER area; if the read data is not returned, the USER data is failed to be read;
and if the four steps are successfully executed, the information reading detection is successful.
Optionally, before detecting the security performance of the electronic seal in the issued state, receiving an initialization setting performed by a user;
if the user selects to issue, the electronic seal safety performance detection aiming at the issued state is carried out;
if the user selects not to issue and not to deactivate, the corresponding electronic seal safety performance detection comprises seal checking, locking detection, unlocking detection and information reading detection;
if the user selects not to issue and inactivate, the corresponding electronic seal safety performance detection comprises seal checking, locking detection, unlocking detection, information reading detection and inactivation detection.
Optionally, the lock detection includes the following steps:
the SD1 receives the electronic seal number selected by the user and provides a correct password and an incorrect password for the user;
SD2, encryption server and reader-writer state detection and seal matching detection, if successful, the execution is continued, and if failed, the locking detection is failed;
SD3, locking USER area test, writing access password into REV area; the USER area is not locked by using a password for testing, and if the locking is successful, the locking is tested to be failed; locking the USER area by using an error password for testing, and if the locking is successful, the locking is tested to be failed; using correct password to lock the test, if the locking fails, the locking test is failed; if all three small steps in the step are successfully detected, the detection of locking the USER area is successful;
SD4, locking access test, writing access password into REV area; the password locking access test is not used, and if the locking is successful, the locking test is failed; locking the access area by using an error password, and if the locking is successful, the locking detection is failed; locking the access area by using a correct password, and if the locking fails, the locking detection is failed; if the detection of all the three small steps in the step is successful, the detection of the lock access is successful;
the above steps SD2, SD3, and SD4 are all performed successfully, the lock detection is successful.
Optionally, the unlocking detection includes the following steps:
JS1, detecting the states of the encryption server and the reader-writer, and detecting seal matching, if the detection is successfully executed continuously, and if the detection is failed to be locked;
JS2, detecting an unlocked USER area, testing without using a password to unlock the USER area, and if unlocking is successful, failing to unlock the USER area; using a wrong password to unlock the USER area test, and if unlocking is successful, failing to unlock the USER area; unlocking the USER area test by using a correct password, and if the unlocking fails, the USER area unlocking test fails; if the detection of the three sub-steps is successful, the detection of unlocking the USER area is successful;
JS3, detecting an unlocking access area, testing without using a password to unlock the access area, and if unlocking is successful, detecting failure of unlocking the access area; unlocking detection of the access area by using the wrong password, and if unlocking is successful, detecting failure of unlocking the access area; unlocking detection of the access area by using a correct password, and if unlocking fails, detecting the unlocking detection of the access area fails; if the detection of the three sub-steps is successful, the unlocking access detection is successful;
and if the steps JS1, JS2 and JS3 are successfully executed, the unlocking detection is successful.
Optionally, the inactivation detection comprises the following steps:
MH1, receiving the corresponding instruction of the user, and acquiring the inactivation password;
MH2, calling the interface to write the right inactivation password into REV area; if the writing fails, the inactivation detection fails;
MH3, calling an interface to use an error inactivation password to carry out inactivation detection; if the inactivation is successful, the inactivation detection fails;
MH4 calls the interface to use the right inactivation password to carry out inactivation detection, if the inactivation fails, the inactivation detection fails;
and if the detection of the four steps is successful, the inactivation detection is successful.
Optionally, the method for detecting the security performance of the electronic seal is implemented based on the following devices;
the device comprises a reader-writer, an antenna, a wireless scanning gun and a computer; the reader-writer is connected with the computer through a first USB data interface to transmit data; the reader-writer is also connected with the antenna through a corresponding radio frequency data transmission line, and the antenna is used for transmitting radio frequency signals to read and write data of the electronic seal; the wireless scanning gun is used for scanning the two-dimensional code on the front surface of the ultrahigh frequency electronic seal to acquire data therein, and is connected with the computer through a second USB data interface to perform data transmission; the computer is used for running detection software, configuring detection parameters through the information input and output component of the computer and outputting detection results.
The invention has the following beneficial effects:
the invention has the advantages that when the states set by the user during initialization are different, the corresponding detection contents are different, single-step detection can be realized, automatic detection can also be realized, the detection process is simplified, the detection process has a clear structure under the condition of not reducing the detection contents, the query result is supported, the detection document is printed, the like, great convenience is brought to operators, and the working efficiency is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all 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 application.
It should be noted that, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown or described herein.
Fig. 1 is a flow chart of initialization logic for an embodiment of the present invention, as shown in fig. 1,
firstly, the method comprises the following steps: connecting encryption servers
The user sets the correct IP address and port, clicks the login button, and the detection software logs in the encryption server by calling the login interface of the encryption server provided by the third party. The log-in result is output in the log column, if the log-in fails, an error code is returned to search the cause and eliminate the fault.
II, secondly: connection reader-writer
And a user clicks a button for connecting the reader-writer, the detection software is connected to the reader-writer by calling a request connection interface provided by the ultrahigh-frequency single-channel reader-writer, a connection result is output in a log column, and if the connection fails, an error code is returned so as to search for reasons and eliminate faults. After the connection is successful, the updating power frequency button is changed from an unavailable state to an available state, at the moment, the power frequency value needing to be set can be input into the corresponding input box, and the current power frequency value can be updated by clicking the updating power frequency button.
Thirdly, the method comprises the following steps: set state
The user needs to select the seal release state, which includes two types of release state and non-release state, the seal in the release state can not be inactivated, the non-release seal supports inactivation, and the user also needs to select whether to perform inactivation detection. And selecting different states, wherein the seal detection process corresponds to different detection processes.
Fourthly, the method comprises the following steps: logic flow diagram
Flow analysis: after the user opens the detection software for the first time, the correct IP address and port are set, after the user successfully logs in the encryption server by clicking the button, the user can click the button to connect the reader-writer, after the reader-writer is successfully connected, the updating power and frequency can be set, and then the issuing state and whether to be inactivated or not are selected according to the requirement, so that the initialization work is completed.
FIG. 2 is a flow chart of seal detection logic according to an embodiment of the present invention, as shown in FIG. 2:
firstly, the method comprises the following steps: analysis of detection procedure
When the states set by the user during initialization are different, the corresponding detection contents are different:
when the selection is issued: the detection function comprises 8 steps of seal checking, data verification, identity authentication, access control, information reading, information verification and key updating.
Selection without release and inactivation: the detection function comprises 5 steps of seal checking, locking detection, unlocking detection and information reading.
Selection without release and inactivation: the detection function comprises 6 steps of seal checking, locking detection, unlocking detection, information reading and inactivation detection.
II, secondly: single step detection process
This section details the logic in performing each of the functions.
Key setting
The user selects the type of the key firstly when entering the seal detection page, the key is divided into a public key and a private key, and the state of the key is selected automatically according to the current electronic seal.
Seal scanning
A user scans the two-dimensional code pattern on the front surface of the electronic seal through a scanning gun, obtains serial number data, transmits the serial number data to detection software through a USB data line, displays the serial number data in a scanning code input field in a seal label code area, collects data for later seal check detection, and enables the user to know the serial number of the seal in operation.
Seal checking
And clicking a seal checking button by a user, calling an interface function by detection software, controlling a reader-writer and an antenna, reading all seals in the current working area, storing the serial numbers of the seals and displaying the serial numbers in a pull-down menu corresponding to the storage codes in the seal label code area.
Seal verification
The user clicks a seal checking button, the detection software acquires a seal number selected from a pull-down menu of the current storage code, the data of the seal represented by the seal number is read by using a reader-writer and an antenna by calling a data interface function, if the read data is correctly returned, the checking is successful, if the data is not returned, the checking is failed, and the checking can be repeated for multiple times.
Lock detection
The user selects the electronic seal number to obtain a correct password and an incorrect password. And clicking a locking detection button, and controlling the controller and the antenna to perform locking test on the seal by the detection software. The test flow comprises the following steps:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, and if the detection is successfully continued, the detection of the failed locking fails.
Locking the USER area detection and writing the access password into the REV area. The USER area is locked without using the password for testing, and if the locking is successful, the locking detection fails; the USER area is locked by using the error password for testing, and if the locking is successful, the locking detection fails; using correct password to lock the test, if the locking fails, the locking detection fails; and if the detection of the three small steps is successful, the detection of the locked USER area is successful.
The access test is locked, and the access password is written to the REV area. If the password locking access test is not used, and the locking is successful, the locking detection fails; locking the access area by using the error password, and if the locking is successful, the locking detection fails; and locking the access area by using the correct password, and if the locking fails, failing to detect the locking. And if the detection of the three small steps is successful, the locking access detection is successful.
And when the three steps are successfully executed, the locking detection is successful.
Unlock detection
The user clicks the locking detection button, the detection software controls the controller and the antenna to carry out unlocking detection on the seal, and the test flow comprises the following steps:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, and if the detection is successfully continued, the detection of the failed locking fails.
Detecting an unlocking USER area, testing without using a password to unlock the USER area, and if the unlocking is successful, failing to unlock the USER area; and (4) unlocking the USER area by using the wrong password for testing, and if the unlocking is successful, failing to unlock the USER area. And unlocking the USER area test by using the correct password, and if the unlocking fails, unlocking the USER area test fails. And if the detection of the three small steps is successful, the detection of unlocking the USER area is successful.
Unlocking the access area detection, unlocking the access area test without using a password, and if the unlocking is successful, the unlocking of the access area detection fails; unlocking the access area detection by using the wrong password, and if the unlocking is successful, the unlocking of the access area detection fails; and unlocking the access area detection by using the correct password, and if the unlocking fails, the unlocking of the access area detection fails. And if the detection of the three small steps is successful, the unlocking access detection is successful.
And if the three steps are successfully executed, the unlocking detection is successful.
Data validation
The user clicks a data verification button, the detection software requests a certain number of random numbers from the electronic seal through calling the interface, controls the controller and the antenna, inputs the requested random numbers into the verification interface for verification according to the provided verification pseudo-random number interface, and if the probability that the random numbers pass the verification is less than 90%, the verification is failed, otherwise, the verification is successful. The authentication result is output to an input field of the random number authentication area.
Identity authentication
And clicking an identity authentication button by a user, and controlling the reader-writer and the antenna by the detection software through a calling interface to carry out identity authentication. The method comprises the following main steps:
and (4) detecting the states of the encryption server and the reader-writer and performing seal matching detection, and if the execution is successfully continued, failing identity authentication detection fails.
And updating the error key into a reader-writer through a key issuing interface, writing data into the chip at the moment, and detecting that the data is written into the electronic seal by using the error key. If the data writing is successful, the identity authentication detection fails.
And acquiring a correct initial key through the interface, updating the initial key into the reader-writer, writing data into the chip at the moment, and detecting that the correct key is used for writing the data into the electronic seal. If the data is successfully written, the identity authentication is successful, otherwise, the identity authentication detection fails.
Access control
The USER firstly selects or fills data in the USER data area, clicks an access control button, and the detection software writes the data in the USER data area into a designed data storage structure to perform access control detection, and the main steps comprise:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, and if the detection is successfully continued, the detection of the failed access control fails.
And carrying out encryption processing on the data storage structure by calling an interface of the encryption server. If the encryption process fails, the access control detection fails.
And writing the encrypted data into a USER data area of the electronic seal by calling the service interface, operating the controller and the antenna. If the write data fails, the access control detection fails.
And if the three steps are executed successfully in sequence, the access control detection is successful.
Information reading
And clicking an information reading button by a user, and reading the data in the electronic seal by the detection software by calling the interface operation controller and the antenna. The method comprises the following main steps:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, successfully continuing to execute, and failing to read and detect the failure information.
And setting a data reading structure, configuring related data into the structure, and calling a provided data reading function interface to read the data in the EPC area. If the read data is not returned, reading the EPC data fails.
And setting a data reading structure body, configuring related data into the structure body, calling the provided data reading function interface, and reading the data of the TID zone. If the read data is not returned, the TID data reading fails.
And setting a data reading structure body, configuring related data into the structure body, calling the provided data reading function interface, and reading the data in the USER area. If the read data is not returned, reading the USER data fails.
If the four steps are successfully executed, the information reading and detection are successful.
Information verification
And clicking an information verification button by a user, operating the controller and the antenna by the detection software through calling an interface, reading the data in the electronic seal, and storing and verifying the read data. The method comprises the following main steps:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, successfully continuing to execute, and failing to verify and detect the failure information.
And calling the function of the encryption library, reading the data stored in the electronic seal, decrypting and storing. If the information fails, the information verification detection fails.
And acquiring the data filled in the USER data area by the USER, and comparing the data with the decrypted data in the previous step. If the comparison fails, the information verification detection fails.
The three steps are successfully executed, and the information verification and detection are successful.
Key renewal
And (4) clicking the key update by a user, and operating the controller and the antenna by the detection software through calling the interface to read and write data in the electronic seal. The method comprises the following main steps:
and detecting the states of the encryption server and the reader-writer and matching and detecting the seal, and if the detection is successfully continued, the detection of the failed locking fails.
And acquiring a new key and an original key by calling an interface provided by the encryption server, wherein if the key acquisition fails, the key updating detection fails.
And writing the new key into the reserved area through the calling interface, wherein if the writing fails, the key updating detection fails.
Downloading the new key to the controller through a calling interface, wherein the key updating detection fails when the downloading fails.
The four steps are successfully executed, and the key updating detection is successful.
Inactivation assay
The user clicks the key to update, the detection software operates the controller and the antenna by calling the interface, and reads and writes the data in the electronic seal, and the main steps are as follows:
and clicking the inactivation detection by the user, and acquiring an inactivation password by the detection software.
The detection software calls the interface to write the correct deactivation password to the REV area. If the write fails, the deactivation detection fails.
And the detection software calls an interface to use the wrong inactivation password to carry out inactivation detection, and if the inactivation is successful, the inactivation detection fails.
And the detection software calls an interface to use a correct inactivation password to carry out inactivation detection, and if inactivation fails, the inactivation detection fails.
The four steps are successful in detection, and the inactivation detection is successful.
Automatic verification display
And (3) automatic verification display: mainly, in the detection process, the detection result is displayed in a gray square block behind the corresponding detection step.
Single self test
Single self-test: and in the area of the seal label code, using the currently selected electronic seal in the drop-down list corresponding to the storage code to automatically detect the complete process. And after the detection is completed, a report document of the detection result of the selected electronic seal can be generated by clicking a report generation button under the single self-test.
Multiple self-test
A plurality of self-tests: in the area of the seal label code, all seals which are rolled out by using the seal rolling function are automatically detected. And after the detection is finished, a detection result report document of the electronic seal which just finishes the detection can be generated through a plurality of report generation buttons below the self-detection.
Generating reports
A single or multiple sealed test result report document is generated. Each seal generates a test result report document.
Thirdly, the method comprises the following steps: logic flow diagram
Analyzing a flow chart:
the seal detection logic service flow chart is mainly used for describing the flow of a seal detection service module of ultrahigh frequency electronic seal detection software. In the initialized service logic, when different issuing states and inactivation states are selected, the seal detection will perform different detection processes:
when the issued state is selected, the detected contents include: seal checking, data verification, identity authentication, access control, information reading, information verification and key updating.
When the unpublished state is selected and inactivation is not required, the detected content includes: seal checking, lock detection, unlock detection and information reading.
When the unpublished state is selected and inactivation is desired, the detected content includes: seal checking, locking detection, unlocking detection, information reading and inactivation detection.
FIG. 3 is a logic flow diagram of an auxiliary function according to an embodiment of the present invention, as shown in FIG. 3:
firstly, the method comprises the following steps: auxiliary function page operations
The seal is scanned using a scanning gun and the seal is clicked for confirmation.
And in the key recovery, clicking a one-key recovery key to recover the key.
Clicking to begin scanning in the power frequency sweep will display the frequency points of the sweep in the underlying planar coordinate system.
All logs printed in the execution steps are output in the log column in real time.
II, secondly: detailed detection procedure
Seal validation
The main contents are as follows: and scanning the two-dimensional code on the front surface of the electronic seal by using a scanning gun, comparing and confirming the scanning code and the storage code, and executing one-key recovery and scanning functions after successful confirmation.
One-key recovery
The process comprises the following steps:
and (4) detecting the states of the encryption server and the reader-writer, continuing to execute successfully, and failing to recover and detect the failed key.
The detection software obtains the serial number, the public key and the private key through the function interface. If the acquisition fails, the key recovery fails.
The detection software obtains the wrong key by calling the interface to attempt to write data and download the key to the controller. And if the key recovery detection fails, the key recovery detection fails.
The detection software attempts to write the data and update the correct key to the controller by calling the interface. And if the key recovery detection fails, the key recovery detection fails.
And if the four steps are successful, the key recovery detection is successful.
Start scanning
The method comprises the following steps:
and (4) detecting the states of the encryption server and the reader-writer, and if the states of the encryption server and the reader-writer are detected successfully, continuing to execute the encryption server and the reader-writer, and if the states of the encryption server and the reader-writer are detected failed, scanning fails.
And the detection software acquires the frequency range, the power range and the step data set by the user through the interface. And displaying prompt information to the user. If the scan fails, the scan fails.
And sequentially setting the power and frequency of each test through the step length, calling an interface to perform read-write operation on the electronic seal through a read-write controller and an antenna, and displaying the result in a two-dimensional coordinate system. If the read-write operation fails, the scanning fails.
If the three steps are successfully executed, the scanning is successfully executed.
Thirdly, the method comprises the following steps: logic flow diagram
Flow analysis: the auxiliary function is mainly to help recover the key and frequency range scan when the key is wrong. Firstly, a scanning gun is used for scanning the two-dimensional code on the front surface of the electronic seal, then seal confirmation is carried out, and after the confirmation is successful, the functions of key recovery and frequency scanning can be executed.
The embodiment of the invention also provides a storage medium which comprises a stored program, wherein when the program runs, the device where the storage medium is located is controlled to execute any one of the electronic seal safety performance detection methods.
The embodiment of the invention also provides a processor, wherein the processor is used for running the program, and the method for detecting the safety performance of the electronic seal is executed when the program runs.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.