CN-122020628-A - Verification method and device, storage medium and electronic equipment
Abstract
The invention relates to a verification method, a device, a storage medium and electronic equipment, wherein the method comprises the steps of receiving sequence data to be verified, extracting a data type and corresponding configuration information in the sequence data, carrying out data encapsulation on the sequence data based on the data type and corresponding interfaces to obtain encapsulation data, converting the encapsulation data into conversion data in a target format through the configuration information, and comparing and analyzing the conversion data with the encapsulation data to obtain a verification result of the sequence data, wherein the verification result is used for verifying the validity of the sequence data. The invention can verify the equipment corresponding to various different types of data by the verification method of the USB IP platform, thereby meeting the requirement of verification diversity.
Inventors
- LIU GUANGXI
- WU BIN
- ZHOU XIAOPING
Assignees
- 浙江科睿微电子技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260205
Claims (9)
- 1. A method of authentication, comprising: Receiving sequence data to be verified, and extracting a data type and corresponding configuration information in the sequence data; Based on the data type and the corresponding interface, carrying out data encapsulation on the sequence data to obtain encapsulation data, and converting the encapsulation data into conversion data in a target format through the configuration information; And comparing and analyzing the conversion data with the packaging data to obtain a verification result of the sequence data, wherein the verification result is used for verifying the validity of the sequence data.
- 2. The method of claim 1, wherein the sequence data comprises a USB data type and an AHB data type.
- 3. The method of verification according to claim 1, wherein obtaining the package data comprises: If the sequence data is of a USB data type, carrying out data encapsulation on the sequence data by utilizing an interface corresponding to the USB data type to obtain first encapsulated data; And if the sequence data is of an AHB data type, carrying out data encapsulation on the sequence data by utilizing an interface corresponding to the AHB data type to obtain second encapsulated data.
- 4. The authentication method of claim 3, wherein the interface corresponding to the USB data type comprises a PHY type interface, a link type interface and a protocol type interface; The PHY type interface is used for acquiring first sequence information corresponding to the PHY type interface, and performing data encapsulation on the sequence data by utilizing the first sequence information; The link type interface is used for acquiring second sequence information corresponding to the link type interface, and performing data encapsulation on the sequence data by using the second sequence information; the protocol type interface is configured to obtain third sequence information corresponding to the protocol type interface, and perform data encapsulation on the sequence data by using the third sequence information.
- 5. The authentication method according to claim 1, wherein converting the package data into the converted data in the target format by the configuration information includes: If the configuration information is the first configuration information, converting the encapsulation data into conversion data corresponding to a USB data format; And if the configuration information is the second configuration information, converting the encapsulation data into conversion data corresponding to an AHB data format.
- 6. The authentication method of claim 1, wherein obtaining the authentication result of the sequence data comprises: And comparing and analyzing the conversion data with the packaging data, if the conversion data is identical to the data contained in the packaging data, proving that the sequence data is legal data, and if the conversion data is not identical to the data contained in the packaging data, proving that the sequence data is illegal data.
- 7. A verification apparatus implemented by the method of any one of claims 1-6, comprising: a receiving unit for receiving sequence data to be verified; the acquisition unit is used for extracting the data type and the corresponding configuration information in the sequence data; The packaging unit is used for carrying out data packaging on the sequence data based on the data type and the corresponding interface to obtain packaging data; A conversion unit for converting the package data into conversion data of a target format through the configuration information; And the comparison unit is used for comparing and analyzing the conversion data and the packaging data, obtaining a verification result of the sequence data and verifying the validity of the sequence data.
- 8. A computer readable storage medium having stored therein at least one program code loaded and executed by a processor to implement operations performed by a method as recited in any of claims 1-6.
- 9. An electronic device comprising one or more processors and one or more memories, the one or more memories having stored therein at least one piece of program code that is loaded and executed by the one or more processors to implement the operations performed by the method of any of claims 1-6.
Description
Verification method and device, storage medium and electronic equipment Technical Field The present invention relates to the field of data verification technologies, and in particular, to a verification method, a device, a storage medium, and an electronic apparatus. Background As an important transmission interface, USB has characteristics of plug and play, fast transmission speed, strong stability, and the like, and is widely used in life. With the continued advancement of USB technology, the speed has also increased from the initial 12 Mbps to now 4 Gbps with a gradual increase. With the continuous increase of the demands, the functions are continuously and gradually perfected, and the corresponding code complexity is more complex with the improvement of the functions. The existing verification method simply performs data verification, has singleness, and cannot realize the verification function meeting high requirements when the device is verified aiming at more complex codes. Disclosure of Invention In order to solve the problems in the prior art, the invention aims to provide a verification method, a device, a storage medium and electronic equipment, which meet the requirement of verification diversity. In order to achieve the above object, the present invention provides the following solutions: A method of authentication, comprising: Receiving sequence data to be verified, and extracting a data type and corresponding configuration information in the sequence data; Based on the data type and the corresponding interface, carrying out data encapsulation on the sequence data to obtain encapsulation data, and converting the encapsulation data into conversion data in a target format through the configuration information; And comparing and analyzing the conversion data with the packaging data to obtain a verification result of the sequence data, wherein the verification result is used for verifying the validity of the sequence data. Optionally, the sequence data comprises a USB data type and an AHB data type. Optionally, acquiring the package data includes: If the sequence data is of a USB data type, carrying out data encapsulation on the sequence data by utilizing an interface corresponding to the USB data type to obtain first encapsulated data; And if the sequence data is of an AHB data type, carrying out data encapsulation on the sequence data by utilizing an interface corresponding to the AHB data type to obtain second encapsulated data. Optionally, the interfaces corresponding to the USB data types comprise a PHY type interface, a link type interface and a protocol type interface; The PHY type interface is used for acquiring first sequence information corresponding to the PHY type interface, and performing data encapsulation on the sequence data by utilizing the first sequence information; The link type interface is used for acquiring second sequence information corresponding to the link type interface, and performing data encapsulation on the sequence data by using the second sequence information; the protocol type interface is configured to obtain third sequence information corresponding to the protocol type interface, and perform data encapsulation on the sequence data by using the third sequence information. Optionally, converting the encapsulated data into the converted data in the target format through the configuration information includes: If the configuration information is the first configuration information, converting the encapsulation data into conversion data corresponding to a USB data format; And if the configuration information is the second configuration information, converting the encapsulation data into conversion data corresponding to an AHB data format. Optionally, obtaining the verification result of the sequence data includes: And comparing and analyzing the conversion data with the packaging data, if the conversion data is identical to the data contained in the packaging data, proving that the sequence data is legal data, and if the conversion data is not identical to the data contained in the packaging data, proving that the sequence data is illegal data. In order to achieve the above object, the present invention also provides an authentication apparatus, including: a receiving unit for receiving sequence data to be verified; the acquisition unit is used for extracting the data type and the corresponding configuration information in the sequence data; The packaging unit is used for carrying out data packaging on the sequence data based on the data type and the corresponding interface to obtain packaging data; A conversion unit for converting the package data into conversion data of a target format through the configuration information; And the comparison unit is used for comparing and analyzing the conversion data and the packaging data, obtaining a verification result of the sequence data and verifying the validity of the sequence data. To achieve the above object, the prese