Disclosure of Invention
The embodiment of the invention provides an authentication method of hardware equipment, which is used for realizing the authentication of the hardware equipment and improving the reliability of the authentication of the hardware equipment and user experience.
In a first aspect, an embodiment of the present invention provides an authentication method for a hardware device, where the method includes:
the authentication page receives authentication parameters sent by a third-party page and initiates a first http request to an authentication background according to the authentication parameters;
the authentication background sends a universal identification code UUID to the authentication page according to the first http request;
the authentication page initiates a second http request to a local server according to the authentication parameter and the UUID;
the local server acquires equipment information through a private interface according to the authentication parameters and the UUID and sends the equipment information to an authentication background;
and the authentication background sends the equipment information to a third party background, so that the third party background authenticates the equipment according to the equipment information and sends an authentication result to a third party page for display.
Further, before the authentication page receives the authentication parameters sent by the third-party page and initiates the first http request to the authentication background according to the authentication parameters, the method further comprises:
a local server is created to listen for http requests from native.
Further, before the authentication page receives the authentication parameters sent by the third-party page and initiates the first http request to the authentication background according to the authentication parameters, the method further comprises:
receiving authentication operation input by a user in a third-party page;
and skipping to an authentication page according to the authentication operation, and sending the authentication parameters to the authentication page.
Further, the local server collects device information through a private interface according to the authentication parameter and the UUID, and sends the device information to an authentication background, including:
the local server analyzes the authentication parameters and the UUID;
and acquiring equipment information through a private interface according to the analysis result, and sending the equipment information to an authentication background.
Further, the device information includes a device manufacturer, a device brand, a system version, imei, and imsi.
In a second aspect, an embodiment of the present invention further provides an authentication apparatus for a hardware device, where the apparatus includes:
the first http request initiating module is arranged in the authentication page and used for receiving the authentication parameters sent by the third-party page and initiating a first http request to the authentication background according to the authentication parameters;
the UUID sending module is arranged in the authentication background and used for sending a universal identification code UUID to the authentication page according to the first http request;
the second http request initiating module is arranged in the authentication page and used for initiating a second http request to the local server according to the authentication parameters and the UUID;
the equipment information acquisition module is arranged in the local server and used for acquiring equipment information through a private interface according to the authentication parameters and the UUID and sending the equipment information to the authentication background;
and the equipment information sending module is arranged in the authentication background and used for sending the equipment information to the third-party background, so that the third-party background authenticates the equipment according to the equipment information and sends an authentication result to a third-party page for display.
Further, still include:
and the local server creating module is used for creating a local server to monitor the http request from the local server.
Further, still include:
the authentication operation receiving module is arranged in the third-party page and used for receiving the authentication operation input by the user;
and the authentication parameter sending module is arranged in the third-party page and used for skipping to the authentication page according to the authentication operation and sending the authentication parameters to the authentication page.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the authentication method for the hardware device according to the embodiment of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for authenticating a hardware device according to the embodiment of the present invention.
In the embodiment of the invention, an authentication page receives authentication parameters sent by a third-party page, a first http request is sent to an authentication background according to the authentication parameters, the authentication background sends a universal identification code UUID to the authentication page according to the first http request, the authentication page sends a second http request to a local server according to the authentication parameters and the UUID, the local server collects equipment information through a private interface according to the authentication parameters and the UUID and sends the equipment information to the authentication background, and the authentication background sends the equipment information to the third-party background, so that the third-party background authenticates the equipment information and sends an authentication result to the third-party page for display. The authentication method of the hardware equipment provided by the embodiment of the invention initiates the second http request to the local server and collects the equipment information through the private interface to complete the authentication of the hardware equipment, so that the reliability of the authentication of the hardware equipment and the user experience can be improved.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an authentication method for a hardware device according to an embodiment of the present invention, where the present embodiment is applicable to a case of authenticating the hardware device, and the method may be executed by an authentication apparatus for the hardware device, where the authentication apparatus may be composed of hardware and/or software, and may be generally integrated in a computer, a server, a mobile terminal (e.g., a mobile phone, a tablet), and all terminals including an authentication function for the hardware device. As shown in fig. 1, the method specifically includes the following steps:
and step 110, the authentication page receives the authentication parameters sent by the third-party page and initiates a first http request to the authentication background according to the authentication parameters.
The authentication page may be a page autonomously developed by using HTML5 technology. The third party pages may be pages developed by third party technicians using HTML5 technology. The authentication parameters may include a third party campaign ID, an authentication application ID, and a registration code (e.g., a cell phone number, an identification number, etc.). The authentication background is a server background corresponding to the authentication application.
Specifically, after the user clicks the authorization operation on the third-party page, the network page jumps to the authentication page from the third-party page and sends the authentication parameters to the authentication page, and after receiving the authentication parameters, the authentication page initiates a first http request to the authentication background according to the authentication parameters.
And step 120, the authentication background sends a universal identification code UUID to the authentication page according to the first http request.
The Universal Unique Identifier (UUID) may be generated by the authentication background according to the authentication parameters. Specifically, the authentication background generates a UUID according to the authentication parameters in the first http request, and sends the generated UUID to the authentication page.
And step 130, the authentication page sends a second http request to the local server according to the authentication parameters and the UUID.
The local server may be automatically started after the terminal is started up, and is used for monitoring the http request of the local server. Specifically, after receiving the UUID sent by the authentication background, the authentication page initiates a second http request to the local server according to the authentication parameter and the UUID.
And 140, the local server acquires equipment information through a private interface according to the authentication parameters and the UUID, and sends the equipment information to an authentication background.
The device information may include device manufacturer, device brand, system version, imei, and imsi, among others. The private interface may be developed in cooperation with a hardware vendor to gather device information. And the local server calls a private interface according to the authentication parameters and the UUID in the second http request, acquires the equipment information through the private interface and sends the equipment information to the authentication background.
And 150, the authentication background sends the equipment information to a third-party background, so that the third-party background authenticates the equipment according to the equipment information and sends an authentication result to a third-party page for display.
The third-party background may be a background developed by a third-party technician and corresponding to the third-party page. The authentication result may include an authorized and an unauthorized. And after receiving the equipment information, the authentication background sends the equipment information to a third-party background, and the third-party background authenticates the equipment according to the received equipment information, identifies whether the equipment has the authority, and sends an authentication result to a third-party page for displaying.
In this embodiment, the authentication background may directly authenticate the hardware information, synchronize the authentication result to the third-party background, and finally send the authentication result to the third-party page for display.
Optionally, before the authentication page receives the authentication parameter sent by the third-party page and initiates the first http request to the authentication background according to the authentication parameter, the method further includes the following steps: a local server is created to listen for http requests from native.
Optionally, before the authentication page receives the authentication parameter sent by the third-party page and initiates the first http request to the authentication background according to the authentication parameter, the following page is further included: receiving authentication operation input by a user in a third-party page; and skipping to an authentication page according to the authentication operation, and sending the authentication parameters to the authentication page.
In this embodiment, when a third party hosts a certain event and a user participating in the event needs hardware authentication, the user enters a third-party page through the terminal device and performs authentication operation in the third-party page, and the terminal device jumps from the third-party page to the authentication page according to the authentication operation and sends authentication parameters from the third-party page to the authentication page.
Fig. 2 is a block diagram of an authentication method for a hardware device according to an embodiment of the present invention, as shown in fig. 2, when a user participates in an activity, a third party H5 page is opened through a browser application in a terminal device, an authentication operation is clicked in the third party H5 page to trigger a check, the page of the browser application is skipped from the H5 third party page to an authentication page, an http request is initiated to a local server, the local server in the authentication application reports authentication parameters to an authentication application background, the authentication application background synchronizes hardware information to an H5 third party background, the H5 third party background authenticates the hardware information, and sends an authentication result to an H5 third party page for display.
Fig. 3 is a signaling diagram of an authentication method for a hardware device according to an embodiment of the present invention, as shown in fig. 3, after an authentication application starts a local server, the authentication application monitors a local http request. When a user participates in an activity, an H5 activity page jumps to an H5 authentication page, an H5 authentication page reports authentication parameters to an authentication application background and returns UUID, an H5 authentication page initiates an http request to a local server according to the UUID, the local server collects the authentication parameters (namely hardware information) according to the http request and reports the authentication parameters to the authentication application background, the authentication application background authenticates the authentication parameters and synchronizes the authentication result to an H5 server, and the H5 server returns the authentication result to a front end for displaying.
According to the technical scheme of the embodiment, the authentication page receives authentication parameters sent by a third-party page, a first http request is sent to the authentication background according to the authentication parameters, the authentication background sends a universal identification code UUID to the authentication page according to the first http request, the authentication page sends a second http request to the local server according to the authentication parameters and the UUID, the local server collects equipment information through a private interface according to the authentication parameters and the UUID and sends the equipment information to the authentication background, and the authentication background sends the equipment information to the third-party background, so that the third-party background authenticates equipment according to the equipment information and sends an authentication result to the third-party page for display. The authentication method of the hardware equipment provided by the embodiment of the invention initiates the second http request to the local server and collects the equipment information through the private interface to complete the authentication of the hardware equipment, so that the reliability of the authentication of the hardware equipment and the user experience can be improved.
Example two
Fig. 4 is a schematic structural diagram of an authentication apparatus of a hardware device according to a second embodiment of the present invention. As shown in fig. 4, the apparatus includes: the system comprises a first http request initiating module 210, a UUID sending module 220, a second http request initiating module 230, a device information collecting module 240 and a device information sending module 250.
The first http request initiating module 210 is arranged in the authentication page, and is configured to receive the authentication parameter sent by the third-party page, and initiate a first http request to the authentication background according to the authentication parameter;
the UUID sending module 220 is arranged in the authentication background and used for sending the universal identification code UUID to the authentication page according to the first http request;
a second http request initiating module 230, configured to initiate a second http request to the local server according to the authentication parameter and the UUID;
the equipment information acquisition module 240 is arranged in the local server and used for acquiring equipment information through a private interface according to the authentication parameters and the UUID and sending the equipment information to the authentication background;
and the device information sending module 250 is arranged in the authentication background and used for sending the device information to the third-party background, so that the third-party background authenticates the device according to the device information and sends the authentication result to the third-party page for display.
Optionally, the method further includes:
and the local server creating module is used for creating a local server to monitor the http request from the local server.
Optionally, the method further includes:
the authentication operation receiving module is arranged in the third-party page and used for receiving the authentication operation input by the user;
and the authentication parameter sending module is arranged in the third-party page and used for skipping to the authentication page according to the authentication operation and sending the authentication parameters to the authentication page.
Optionally, the device information acquiring module 240 is further configured to:
the local server analyzes the authentication parameters and the UUID;
and acquiring equipment information through a private interface according to the analysis result, and sending the equipment information to an authentication background.
Optionally, the device information includes a device manufacturer, a device brand, a system version, imei, and imsi.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For details not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present invention.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a computer device according to a third embodiment of the present invention. FIG. 5 illustrates a block diagram of a computer device 512 suitable for use in implementing embodiments of the present invention. The computer device 512 shown in FIG. 5 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention. Device 512 is typically a computing device that assumes the authentication functionality of a hardware device.
As shown in FIG. 5, computer device 512 is in the form of a general purpose computing device. Components of computer device 512 may include, but are not limited to: one or more processors 516, a storage device 528, and a bus 518 that couples the various system components including the storage device 528 and the processors 516.
Bus 518 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Computer device 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 512 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 528 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 530 and/or cache Memory 532. The computer device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 534 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 518 through one or more data media interfaces. Storage 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 536 having a set (at least one) of program modules 526 may be stored, for example, in storage 528, such program modules 526 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may include an implementation of a network environment. Program modules 526 generally perform the functions and/or methodologies of the described embodiments of the invention.
Computer device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, camera, display 524, etc.), with one or more devices that enable a user to interact with computer device 512, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 512 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 522. Further, computer device 512 may also communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via Network adapter 520. As shown, the network adapter 520 communicates with the other modules of the computer device 512 via the bus 518. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the computer device 512, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 516 executes various functional applications and data processing by executing programs stored in the storage device 528, for example, to implement the authentication method of the hardware device provided by the above-described embodiment of the present invention.
Example four
The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for authenticating a hardware device according to the fourth embodiment of the present invention.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiment of the present invention is not limited to the method operations described above, and may also perform related operations in the authentication method for a hardware device provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.