Disclosure of Invention
The embodiment of the invention aims to provide a device access method, a device and equipment so as to reduce the potential safety hazard of server-side equipment. The specific technical scheme is as follows:
the embodiment of the invention provides a device access method, which is applied to server-side equipment and comprises the following steps:
randomly generating access information for accessing the client equipment to the server equipment in the starting process as random access information, and determining that the server equipment works in a random access information mode;
searching client equipment existing in a local area network where the server equipment is located to serve as first type client equipment;
sending the random access information to the first type of client equipment so that the first type of client equipment is accessed to the server equipment according to the random access information;
and under the condition that the server side equipment works in the random access information mode, rejecting a remote access request to the server side equipment.
In an embodiment of the present invention, the step of sending the random access information to the first class of client devices includes:
judging whether the number of the first type of client equipment exceeds the number of access channels of the server equipment;
if so, selecting the client devices with the number of the access channels from the first type of client devices, and sending the random access information to the selected client devices;
and if not, sending the random access information to the first type of client equipment.
In an embodiment of the present invention, the device access method further includes:
and acquiring a modification instruction for modifying the random access information, modifying the random access information according to the modification instruction, and determining that the server equipment works in a non-random access information mode.
In an embodiment of the present invention, the obtaining a modification instruction for modifying the random access information includes:
and obtaining a modification instruction which is locally generated in the server-side equipment and modifies the random access information.
In an embodiment of the present invention, after the modifying the random access information according to the modification instruction, the method further includes:
storing the access information before modification and the access information after modification;
sending the modified access information to second type client side equipment so that the second type client side is accessed to the server side equipment according to the modified access information when accessing the server side equipment next time, wherein the second type client side equipment is as follows: the client device has successfully accessed the server device.
The embodiment of the invention provides a device access device, which is applied to server-side equipment, and comprises:
the access information generation module is used for randomly generating access information for accessing the client equipment to the server equipment in the starting process as random access information and determining that the server equipment works in a random access information mode;
the device searching module is used for searching client devices existing in a local area network where the server device is located and used as first-class client devices;
an access information sending module, configured to send the random access information to the first class of client devices, so that the first class of client devices access the server device according to the random access information;
and the access request rejecting module is used for rejecting the remote access request to the server equipment under the condition that the server equipment works in the random access information mode.
In an embodiment of the present invention, the access information sending module is specifically configured to:
judging whether the number of the first type of client equipment exceeds the number of access channels of the server equipment;
if so, selecting the client devices with the number of the access channels from the first type of client devices, and sending the random access information to the selected client devices;
and if not, sending the random access information to the first type of client equipment.
In an embodiment of the present invention, the device access apparatus further includes:
a modification instruction obtaining module, configured to obtain a modification instruction for modifying the random access information;
an access information modifying module, configured to modify the random access information according to the modification instruction;
and the information module determining module is used for determining that the server side equipment works in a non-random access information mode.
In an embodiment of the present invention, the access information modification module is specifically configured to obtain a modification instruction which is locally generated by the server device and modifies the random access information.
In an embodiment of the present invention, the device access apparatus further includes:
an access information processing module, configured to store the access information before modification and the access information after modification after the access information modification module modifies the random access information, and send the modified access information to a second type of client device, so that the second type of client accesses the server device according to the modified access information when accessing the server device next time, where the second type of client device is: the client device has successfully accessed the server device.
The embodiment of the invention also provides server equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the equipment access methods when executing the program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned device access methods.
Embodiments of the present invention further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute any of the above-mentioned device access methods.
As can be seen from the above, when the solution provided by the embodiment of the present invention is applied to access a device, a server device randomly generates access information for a client device to access the server device in a starting process, and the access information is used as random access information, and determines that a mode in which the server device operates in this case is a random access information mode. And then searching client equipment existing in the local area network, and sending the random access information to the searched client equipment, so that the searched client equipment is accessed to the server equipment according to the random access information. In addition, when the server device works in the random access information mode, the remote access request to the server device is refused. Therefore, when the scheme provided by the embodiment of the invention is applied to equipment access, no operation is required to be performed by a user in the whole access process, so that the process of inputting access information by the user cannot be involved, the access information cannot be seen by other users, and once the server equipment works in a random access information mode, the server equipment cannot be remotely accessed.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic flow chart of a device access method provided in an embodiment of the present invention is applied to a server device, where the method includes:
s101: in the starting process, access information for accessing the client equipment to the server equipment is randomly generated to serve as random access information, and the server equipment is determined to work in a random access information mode.
The access information refers to information that the client device needs to use to access the server device. For example, the access information may be a login password and/or a login user name.
In an embodiment of the present invention, the random access information may be access information that is randomly generated during a first power-on starting process of the server device and is used for the client device to access the server device.
The above-mentioned operation of the server device in the random access information mode can be understood as follows: the client device needs to use the above-mentioned mode of accessing the server device using the random access information.
S102, searching client equipment existing in a local area network where the server equipment is located, and taking the client equipment as first-class client equipment.
A local area network may be understood as a network in which a server device and a client device are communicatively connected.
For example, the server device may be a hard disk recorder, the client device may be a video data acquisition device, and accordingly, the hard disk recorder and the video data acquisition device perform video data interaction in the local area network
The server device may be a router, the client device may be a mobile terminal, and accordingly, the router and the mobile terminal perform data interaction in the local area network.
The server device may start to search for the client device existing in the local area network where the server device is located when a certain condition is satisfied. For example, the server device may search for a client device existing in the local area network in which the server device is located after being successfully started; client equipment existing in a local area network can be searched according to preset interval time; or after receiving the search instruction, searching the client devices existing in the local area network where the client devices are located.
S103, the random access information is sent to the first type of client equipment, so that the first type of client equipment is accessed to the server equipment according to the random access information.
And sending the random access information to first-class client equipment, and after receiving the random access information, the first-class client equipment can access the server equipment by taking the random access information as access information. Therefore, when the station is seen from the client device side, the client device can obtain the access information for accessing the server device without inputting the access information to the client device by a user, and then the device is accessed.
S104: and under the condition that the server-side equipment works in the random access information mode, rejecting the remote access request to the server-side equipment.
Since the access of the client device to the server device also belongs to a case of accessing the server device through a network, that is, a case of remotely accessing the server device, in view of this, in an embodiment of the present invention, the remote access request to the server device may be understood as a remote access request other than an access request to the server device by the client device.
The number of client devices existing in the local area network may exceed the maximum number of client devices that can be accessed by the server device, and thus in one implementation, the step of sending the access information to the first type of client device in the step S103 may include the following steps a 1-A3;
a1, determining whether the number of the first type client devices exceeds the number of the access channels of the server device, if yes, executing the following step a2, and if no, executing the following step A3.
The access channel refers to a channel which is provided on the server device and used for accessing the client device. An access channel is used to access a client device.
A2, selecting client devices with access channels from the first class of client devices, and sending the random access information to the selected client devices.
In one implementation, the server device may randomly select a number of client devices with access channels from the first class of client devices, and send the random access information to the selected client devices.
In another implementation manner, when the server device determines that the number of the first-class client devices exceeds the number of access channels of the server device, the server device may send prompt information for selecting the client device to be accessed to a worker, after the worker sees the prompt information, the worker may select the client device that wants to access the server device through the first-class client devices, and the first-class client devices send information of the client device selected by the user, for example, an identifier of the client device, to the server device, and accordingly, the server device determines the client device to be accessed.
A3, sending the random access information to the first type client device.
When the number of the first type client devices does not exceed the number of the access channels of the server device, the server device is indicated to be capable of allowing all the first type clients to access, and therefore the random access information can be directly sent to the first type client devices.
In an embodiment of the present invention, the server device may need to perform information interaction with a network server of a network end in an operation process, and therefore, the remote access request to the server device may be a remote access request to the server device by the network server. Specifically, the following steps B1-B3 may be utilized to establish a communication connection between the server device and the network server:
b1, obtaining the configuration information for communication connection with the network server.
The configuration information may be understood as information for configuring the network, for example, the configuration information may be an IP (Internet Protocol) address, a MAC (Media Access Control) address, and the like.
B2, determining whether the access information is the random access information, and if the determination result is no, executing the following B3.
Since the random access information is randomly generated by the server device during the starting process, in order to let the staff know the random access information, the server device usually displays the random access information to the staff after starting. However, in practical applications, the inventor finds that when the random access information is presented to the staff, the random access information may be seen by people other than the staff, which causes the random access information to be leaked, and reduces the security of the data interaction system. At this time, if the communication connection with the network server is established, a person other than the worker can access the client device to the server device by using the random access information, so that the data interaction system is remotely attacked. Therefore, the safety of the server-side equipment can be greatly improved in the random access information mode, namely under the condition that the client-side equipment needs to use the random access information for equipment access.
And B3, performing network configuration according to the configuration information, and establishing communication connection with the network server.
Since the random access information may need to be modified, in an embodiment of the present invention, a modification instruction for modifying the random access information may be obtained, and the random access information may be modified according to the modification instruction. After the random access information is modified, the client device can not access the server device by using the random access information, and the server can not be considered to work in the random access information mode any more, so that the server device can be determined to work in the non-random access information mode.
Specifically, the modification instruction may carry modified access information, and after receiving the modification instruction, the server device may analyze the modification instruction to obtain modified access information, and modify the random access information into the modified access information.
In another embodiment of the present invention, the obtaining of the modification instruction may specifically be obtaining a modification instruction which is locally generated by a server device and modifies the random access information. That is, in this case, modifying the random access information is an access information modification performed locally at the server device, that is, the random access information modification can be performed only locally at the server device. Therefore, the random access information can be effectively prevented from being modified because the server-side equipment is subjected to remote attack, and the safety of the server-side equipment is ensured.
On the basis of the above situation, in an embodiment of the present invention, after the random access information is modified according to the modification instruction, the access information may be further processed according to the following steps C1 and C2.
C1, storing the access information before modification and the access information after modification.
Because the client device is accessed to the server device according to the access information, after the access information is modified, the access information in the second type of client device which is successfully accessed to the server device is inconsistent with the modified access information in the server device, and at this time, an access fault may occur between the second type of client device and the server device, the access information before modification can be stored, so that the access information in the server device and the second type of client device is consistent, and the second type of client device can be ensured to be normally accessed to the server device in the access process.
After receiving the modification instruction for modifying the access information, the server device may copy the access information before modification, modify the access information obtained by copying according to the modification instruction to obtain the modified access information, and further store the access information before modification and the access information after modification.
The server-side equipment can also generate new access information according to the modification instruction based on the access information before modification, so as to obtain the modified access information and store the access information before modification and the modified access information.
And C2, sending the modified access information to the second type of client device, so that the second type of client device accesses the server device according to the modified access information when accessing the server device next time.
The second type of client equipment is as follows: a client device that has successfully accessed a server device.
The modified access information is sent to the second type of client side equipment, the second type of client side can access the server side equipment according to the modified access information when the server side equipment is accessed next time, and the second type of client side does not need to perform re-access according to the modified access information after the access information is modified in the current access process, so that the condition that the access process is interrupted can be avoided.
After the client device accesses the server device, the client device may preview data sent by each client device that has successfully accessed the server device in a multi-screen manner, and since the access sequence of the client device accessing the server device may not be the sequence intended by the operator, this may result in that the sequence of data displayed on each preview screen is not the sequence intended by the operator, based on which, in an embodiment of the present invention, the data displayed on each screen may be adjusted by using the following steps D1-D2:
d1, when previewing the data sent by the client device that has successfully accessed the server device in the multi-screen mode, adjusting the client device from which the data displayed on each screen comes.
Wherein, one picture corresponds to one client device.
And D2, previewing the data sent by the client device which has successfully accessed the server device in a multi-screen mode according to the adjustment result.
Specifically, after receiving an adjustment instruction from a worker, the server device may adjust the client device from which the data displayed on each screen comes. For example, currently, 4 data sent by the second type of client devices are previewed in a 4-screen manner, where a screen 1 previews data sent by a client device a, a screen 2 previews data sent by a client device B, a screen 3 previews data sent by a client device C, and a screen 4 previews data sent by a client D, when a worker wants to exchange data displayed on the screens 1 and 4, the worker can click and drag the screen 1 to a position where the screen 4 is located, after determining a drag operation of the worker, the server device displays data sent by the client device D on the screen 1, and displays data sent by the client device a on the screen 4.
The server-side device can also adjust the client-side device from which the data displayed on each picture comes according to the similarity between the data sent by each second-class client-side device, and display the data with high similarity in the adjacent pictures. For example, in a video data interaction system, a plurality of video data acquisition devices are generally used to acquire video data at the same position and at different angles, and the similarity between the video data acquired at the same position and at different angles is very high, so that the server device can adjust the video data acquisition device from which the data displayed by each picture comes according to the similarity between the video data sent by each video data acquisition device, and display the video data acquired by the video data acquisition device and having high similarity through adjacent pictures.
As can be seen from the above, when the solutions provided in the above embodiments are applied to device access, the server device randomly generates access information for the client device to access the server device in a starting process, as random access information, and determines that the mode in which the server device operates in this case is a random access information mode. And then searching client equipment existing in the local area network, and sending the random access information to the searched client equipment, so that the searched client equipment is accessed to the server equipment according to the random access information. In addition, when the server device works in the random access information mode, the remote access request to the server device is refused. It can be seen that, when the solutions provided by the above embodiments are applied to device access, no operation is required by a user in the whole access process, so that the process of inputting access information by the user is not involved, and further the access information is not seen by other users.
Referring to fig. 2, a schematic structural diagram of an apparatus access device provided in an embodiment of the present invention is shown, where the apparatus includes:
an accessinformation generation module 201, configured to randomly generate access information for a client device to access the server device in a starting process, as random access information, and determine that the server device operates in a random access information mode;
thedevice searching module 202 is configured to search for a client device existing in a local area network where the server device is located, as a first type of client device;
an accessinformation sending module 203, configured to send the random access information to the first class of client devices, so that the first class of client devices accesses the server device according to the random access information;
an accessrequest rejecting module 204, configured to reject the remote access request to the server device when the server device operates in the random access information mode.
In an embodiment of the present invention, the accessinformation sending module 201 is specifically configured to:
judging whether the number of the first type of client equipment exceeds the number of access channels of the server equipment;
if so, selecting the client devices with the number of the access channels from the first type of client devices, and sending the random access information to the selected client devices;
and if not, sending the random access information to the first type of client equipment.
In an embodiment of the present invention, the device access apparatus further includes:
a modification instruction obtaining module, configured to obtain a modification instruction for modifying the random access information;
an access information modifying module, configured to modify the random access information according to the modification instruction;
and the information module determining module is used for determining that the server side equipment works in a non-random access information mode.
In an embodiment of the present invention, the access information modification module is specifically configured to obtain a modification instruction which is locally generated by the server device and modifies the random access information.
In an embodiment of the present invention, the device access apparatus further includes:
an access information processing module, configured to store the access information before modification and the access information after modification after the access information modification module modifies the random access information, and send the modified access information to a second type of client device, so that the second type of client accesses the server device according to the modified access information when accessing the server device next time, where the second type of client device is: the client device has successfully accessed the server device.
As can be seen from the above, when the solutions provided in the above embodiments are applied to device access, the server device randomly generates access information for the client device to access the server device in a starting process, as random access information, and determines that the mode in which the server device operates in this case is a random access information mode. And then searching client equipment existing in the local area network, and sending the random access information to the searched client equipment, so that the searched client equipment is accessed to the server equipment according to the random access information. In addition, when the server device works in the random access information mode, the remote access request to the server device is refused. It can be seen that, when the solutions provided by the above embodiments are applied to device access, no operation is required by a user in the whole access process, so that the process of inputting access information by the user is not involved, and further the access information is not seen by other users.
The embodiment of the present invention further provides a server device, as shown in fig. 3, which includes aprocessor 001, acommunication interface 002, amemory 003 and acommunication bus 004, wherein theprocessor 001, thecommunication interface 002 and thememory 003 complete mutual communication through thecommunication bus 004,
amemory 003 for storing a computer program;
theprocessor 001 is configured to implement the device access method provided in the embodiment of the present invention when executing the program stored in thememory 003.
Specifically, the device access method includes:
randomly generating access information for accessing the client equipment to the server equipment in the starting process as random access information, and determining that the server equipment works in a random access information mode;
searching client equipment existing in a local area network where the server equipment is located to serve as first type client equipment;
sending the random access information to the first type of client equipment so that the first type of client equipment is accessed to the server equipment according to the random access information;
and under the condition that the server side equipment works in the random access information mode, rejecting a remote access request to the server side equipment.
It should be noted that, other embodiments of the method for implementing device access by theprocessor 001 executing the program stored in thememory 003 are the same as the embodiments provided in the foregoing method embodiments, and are not described again here.
When the server-side equipment provided by the embodiment of the invention is applied to equipment access, no operation is required to be carried out by a user in the whole access process, so that the process of inputting access information by the user cannot be involved, and further, the access information cannot be seen by other users.
The communication bus mentioned in the above-mentioned server device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the server-side equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the device access method provided by the embodiment of the present invention.
Specifically, the device access method includes:
randomly generating access information for accessing the client equipment to the server equipment in the starting process as random access information, and determining that the server equipment works in a random access information mode;
searching client equipment existing in a local area network where the server equipment is located to serve as first type client equipment;
sending the random access information to the first type of client equipment so that the first type of client equipment is accessed to the server equipment according to the random access information;
and under the condition that the server side equipment works in the random access information mode, rejecting a remote access request to the server side equipment.
It should be noted that other embodiments of the device access method implemented by the computer-readable storage medium are the same as the embodiments provided in the foregoing method embodiments, and are not described herein again.
When the device is accessed by executing the computer program stored in the machine-readable storage medium provided by the embodiment, in the whole access process, no operation is required by a user, so that the process of inputting access information by the user is not involved, and further, the access information is not seen by other users.
In yet another embodiment provided by the present invention, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the device access method provided by the above-mentioned embodiment.
Specifically, the device access method includes:
randomly generating access information for accessing the client equipment to the server equipment in the starting process as random access information, and determining that the server equipment works in a random access information mode;
searching client equipment existing in a local area network where the server equipment is located to serve as first type client equipment;
sending the random access information to the first type of client equipment so that the first type of client equipment is accessed to the server equipment according to the random access information;
and under the condition that the server side equipment works in the random access information mode, rejecting a remote access request to the server side equipment.
It should be noted that other embodiments of the method for implementing device access by using the computer program product are the same as the embodiments provided in the foregoing method embodiments, and are not described herein again.
When the computer program product provided by this embodiment runs on a computer and performs device access, in the whole access process, no operation is required by a user, so that the process of inputting access information by the user is not involved, and further the access information is not seen by other users.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the server device, the computer-readable storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.