CN118158196A - Control method and electronic equipment - Google Patents
Control method and electronic equipment Download PDFInfo
- Publication number
- CN118158196A CN118158196A CN202410353626.4A CN202410353626A CN118158196A CN 118158196 A CN118158196 A CN 118158196A CN 202410353626 A CN202410353626 A CN 202410353626A CN 118158196 A CN118158196 A CN 118158196A
- Authority
- CN
- China
- Prior art keywords
- address
- target
- modification instruction
- network
- communication connection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000012986 modification Methods 0.000 claims abstract description 86
- 230000004048 modification Effects 0.000 claims abstract description 86
- 238000004891 communication Methods 0.000 claims abstract description 70
- 230000004044 response Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 8
- 238000013459 approach Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Landscapes
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a control method and electronic equipment, wherein the method comprises the following steps: obtaining target information corresponding to second equipment on first equipment, wherein the target information at least comprises a first IP address of the second equipment; establishing a communication connection with the second device at least through the first IP address; and sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a control method and an electronic device.
Background
When the server leaves the factory, its baseboard management controller BMC (Baseboard Management Controller) has a default IPv4 address. The user needs to configure his IPv4 address before deploying the server.
At present, a mode of setting up dynamic host configuration protocol DHCP (Dynamic Host Configuration Protocol) equipment is adopted, and an IPv4 address is set for the BMC of each server through the DHCP equipment.
However, this solution requires additional deployment of DHCP devices, which has a problem of high implementation complexity.
Disclosure of Invention
In view of this, the present application provides a control method and an electronic device, as follows:
a control method, comprising:
obtaining target information corresponding to second equipment on first equipment, wherein the target information at least comprises a first IP address of the second equipment;
Establishing a communication connection with the second device at least through the first IP address;
And sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
In the above method, preferably, the target information further includes: a target device identification of the second device, the target device identification being used to uniquely characterize the second device;
wherein the network address is obtained based on the target device identification.
The method, preferably, obtains the network address based on the target device identifier, including:
Inquiring whether configuration information corresponding to the target equipment identifier exists in an address configuration file, wherein the configuration information at least comprises the equipment identifier and a network address;
And if the configuration information corresponding to the target equipment identifier is queried, acquiring the network address from the configuration information corresponding to the target equipment identifier.
In the above method, preferably, the configuration information corresponding to the target device identifier further includes: access information of the second device;
Wherein the address modification instruction further includes: and the access information of the second device is used for enabling the second device to modify the second IP address into the network address under the condition that the access information is verified to meet the access condition.
In the above method, preferably, the access information of the second device includes: a user name and password of the second device;
wherein the access information satisfies an access condition, comprising: the username matches the second device and the password matches the username.
In the above method, preferably, obtaining, on the first device, target information corresponding to the second device includes:
And sending a service discovery instruction to a second device on the first device, so that the second device responds to the service discovery instruction and sends a discovery information packet to the first device, wherein the discovery information packet comprises the target information.
In the above method, preferably, the first IP address is an address of IPv 6; the second IP address is an address of IPv 4.
Preferably, the method sends an address modification instruction to the second device through the communication connection, including:
And sending an address modification instruction to a baseboard management controller in the second device through the communication connection, so that the baseboard management controller modifies a second IP address into the network address.
The above method, preferably, after establishing a communication connection with the second device, before sending an address modification instruction to the second device through the communication connection, the method further includes:
detecting whether a second IP address of the second device meets a communication fault condition corresponding to the target network or not on the first device;
In response to the second IP address satisfying the communication failure condition, performing the: and sending an address modification instruction to the second equipment through the communication connection.
An electronic device as a first device, the first device comprising: a communication module and a processor; wherein:
The processor obtains target information corresponding to the second equipment by utilizing the communication module, wherein the target information at least comprises a first IP address; establishing a communication connection with the second device using the communication module at least through the first IP address; and sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
According to the control method and the electronic device disclosed by the application, the target information corresponding to the second device is obtained from the first device, the target information comprises the first IP address with the longer address length of the second device, and based on the target information, the communication connection with the second device is established at least through the first IP address, so that the address modification instruction can be sent to the second device through the communication connection, and the second device can modify the second IP address with the shorter address length into the network address contained in the address modification instruction. Therefore, the first IP address of the second device can be directly utilized on the first device to configure the second IP address for the second device, and DHCP (dynamic host configuration protocol) equipment is not required to be configured for the second device in the process, so that equipment deployment can be reduced, and the implementation complexity of address configuration is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a control method according to a first embodiment of the present application;
FIG. 2 is a diagram illustrating an address configuration file according to an embodiment of the present application;
FIG. 3 is another flow chart of a control method according to the first embodiment of the present application;
Fig. 4 is a schematic structural diagram of a control device according to a second embodiment of the present application;
fig. 5 is another schematic structural diagram of a control device according to a second embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
FIG. 7 is a diagram of a prior art architecture for modifying IP addresses for servers;
FIG. 8 is a diagram of an architecture for modifying IP addresses for servers in the present application;
Fig. 9 is a flow chart of modifying an IP address for a server in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, a flowchart of a control method according to a first embodiment of the present application is provided, where the method may be applied to an electronic device, and the electronic device may be used as a first device to connect to a second device that needs address configuration. For example, the first device may be a notebook or a mobile phone, and the second device may be a personal computer PC (Personal Computer), a server, or the like, which needs to be configured with an IP address. The technical scheme in the embodiment is mainly used for reducing the implementation complexity of configuring the IP address for the equipment.
Specifically, the method in this embodiment may include the following steps:
Step 101: and obtaining target information corresponding to the second equipment on the first equipment.
Wherein the target information comprises at least a first IP address of the second device. The object of this embodiment is to configure a second IP address for a second device. The address length of the first IP address is greater than the address length of the second IP address. For example, the first IP address is the address of IPV6 and the second IP address is the address of IPV 4. The address of IPV6 has 128 bits and the address of IPV4 has 32 bits.
In one implementation, in step 101, the target information corresponding to the second device may be obtained by:
And sending a service discovery instruction to the second device on the first device, so that the second device responds to the service discovery instruction to send a discovery information packet to the first device, and the discovery information packet comprises target information.
For example, taking a notebook as a server to configure an address of an IPV4, a service discovery instruction is broadcasted on the notebook based on a simple service discovery protocol SSDP (SIMPLE SERVICE Discovery Protocol), so that a server in a communication range of the notebook can receive the service discovery instruction, and the server feeds back a discovery packet to the notebook according to the service discovery instruction, where an address of an IPV6 of the server is included.
It should be noted that, the target information may include, in addition to the second IP address, other information, such as the target device identifier of the second device and the information of the target device type. The target device identification is used to uniquely characterize the second device, for example, the target device information may be a device serial number SN (serial number) of the second device and the target device type may be a device type MT (Machine Type).
Step 102: a communication connection is established with the second device at least through the first IP address.
For example, in this embodiment, the communication connection between the baseboard management controller BMC (baseboard management controller) in the first device and the second device may be established through the address of the IPV 6.
Step 103: and sending an address modification instruction to the second device through the communication connection so that the second device modifies the second IP address to be a network address.
Wherein the address modification instruction at least comprises a network address. Based on this, in step 103, an address modification instruction may be sent to the baseboard management controller of the second device through the communication connection, so that the baseboard management controller modifies the second IP address to the network address in the address modification instruction.
Specifically, an address modification instruction is generated on the first device according to the network address, and then the address modification instruction is sent to the second device, so that the second device modifies the second IP address into the network address in the address modification instruction.
For example, an address modification instruction is generated on the notebook according to "192.168.1.80", the address modification instruction is sent to the BMC of the server through a communication connection with the BMC of the server, and the address of IPV4 of the server is modified to "192.168.1.80" by the BMC of the server according to the address modification instruction.
In one implementation manner, the target information corresponding to the second device obtained on the first device may further include a target device identifier, such as SN, of the second device, based on which a network address may be obtained on the first device based on the target device identifier, so as to generate an address modification instruction according to the network address.
Specifically, the network address may be obtained on the first device by:
Inquiring whether configuration information corresponding to a target device identifier exists in a preset address configuration file, wherein the configuration information at least comprises the device identifier and a network address; if the configuration information corresponding to the target equipment identifier is queried, the network address is obtained from the configuration information corresponding to the target equipment identifier.
For example, as shown in fig. 2, the address configuration file may be referred to as a configuration file, and includes a plurality of pieces of configuration information, where each piece of configuration information includes a device identifier of a device to be configured and a network address of the device to be configured, and the network address is an address of IPV 4. The first device may then generate an address modification instruction according to the related address information, where the address modification instruction may include information such as an address mask, a gateway address, etc. besides the network address, so that after the address modification instruction is sent to the second device, the second device configures related address content for the second device according to the address modification instruction, for example, configures information such as a network address, an address mask, a gateway address, etc. of the second device.
For example, based on the SSDP broadcast service discovery instruction on the notebook, a server in the communication range of the notebook can receive the service discovery instruction, and the server feeds back a discovery information packet to the notebook according to the service discovery instruction, wherein the discovery information packet includes information such as an address, a device serial number, a device type and the like of an IPV6 of the server. After that, the notebook establishes communication connection with the BMC of the server through the address of the IPV6 of the server, and searches corresponding information such as the IPV4 address, the address mask, the gateway address and the like in a preset address configuration file according to the equipment serial number, based on the information, the notebook generates an address modification instruction according to the information such as the IPV4 address, the address mask, the gateway address and the like, and sends the address modification instruction to the BMC of the server through the communication connection with the BMC of the server, the BMC of the server configures the address of the IPV4 of the server as '192.168.1.80' according to the address modification instruction, configures the address mask of the server as '255.255.255.0', and configures the gateway address of the server as '192.168.1.1'.
In addition, the configuration information corresponding to the target device identifier may further include: access information of the second device. The access information is used by the second device to perform validity verification on the first device. Based on this, in this embodiment, when the address modification instruction is generated, the access information of the second device is added to the address modification instruction, so that the address modification instruction sent by the first device to the second device may further include the access information of the second device, further after the second device receives the address modification instruction, the second device may verify whether the access information meets the access condition, if the access information does not meet the access condition, it indicates that the address modification of the first device to the second device is illegal, at this time, the second IP address of the second device is not allowed to be modified, if the access information meets the access condition, it indicates that the address modification of the first device to the second device is legal, and if the access information meets the access condition, the second device may modify the second IP address to be a network address carried in the address modification instruction, and may, of course, also configure the address mask, gateway address and other information of the second device according to the address modification instruction.
In a specific implementation, the access information of the second device may include: a user name and a password of the second device. Based on this, the access information satisfies the access condition, may include: the user name matches the second device and the password matches the user name. For example, the user name in the address modification instruction matches the user name of the second device, and the password in the address modification instruction matches the user name in the address modification instruction (i.e., the user name of the second device). For example, the user name of the second device corresponds to a preset password, and the matching of the password in the address modification instruction and the user name in the address modification instruction means that: the password in the address modification instruction is consistent with the preset password corresponding to the user name in the address modification instruction.
For example, taking the access information of the second device as a user name and a password as an example, when the address modification instruction is generated on the notebook, the user name and the password of the server are added into the address modification instruction, so that after the BMC of the server receives the address modification instruction, the BMC of the server can verify whether the user name in the address modification instruction is consistent with the user name of the server or not, verify that the password in the address modification instruction is consistent with the password corresponding to the user name of the server, and if the user name and the password are verified to be consistent, the access condition is met, the BMC of the server can modify the address of the IPV4 into the IPV4 address carried in the address modification instruction, and the BMC of the server can configure the address mask, the gateway address and other information of the second device according to the address modification instruction. If the user names are verified to be inconsistent or the user names are verified to be consistent but the passwords are inconsistent, the access condition is not met, and the current flow can be ended without allowing the IPV4 address of the server to be modified.
As can be seen from the foregoing technical solutions, in the control method provided in the first embodiment of the present application, target information corresponding to the second device is obtained on the first device, where the target information includes a first IP address with a longer address length of the second device, and based on the target information, a communication connection is established between the first IP address and the second device, so that an address modification instruction may be sent to the second device through the communication connection, and further the second device modifies the second IP address with a shorter address length into a network address included in the address modification instruction. Therefore, in this embodiment, the first IP address of the second device may be directly used on the first device to configure the second IP address for the second device, and in this process, DHCP devices do not need to be configured for the second device, so that device deployment may be reduced, and implementation complexity of address configuration may be reduced.
In one implementation, the following steps may be performed after step 102 and before step 103 in this embodiment, as shown in fig. 3:
Step 104: detecting whether the second IP address of the second device meets the communication fault condition corresponding to the target network on the first device, responding to the second IP address meeting the communication fault condition, executing step 103, and ending the current flow if the second IP address does not meet the communication fault condition.
It can be seen that, the second device is configured with a factory default IP address or is configured with a new IP address again when entering the historical network after factory, based on this, when the second device is used to enter the target network in this embodiment, whether the current second IP address of the second device meets the communication fault condition corresponding to the target network may be first performed on the first device, if the communication fault condition is not met, the current second IP address of the second device is not required to be modified again, and only when the communication fault condition is met, step 103 is performed to modify the second IP address of the second device, so that the second device can use the modified second IP address to normally communicate in the target network.
It should be noted that, the communication fault condition corresponding to the target network may be: the second IP address of the second device is not in the same network segment as the IP addresses of other network access devices in the target network. For example, the address of the current IPV4 of the second device does not match the address mask of the target network.
Specifically, in this embodiment, after the first device establishes a communication connection with the second device, the first device sends an address obtaining instruction to the second device, so that the second device sends the second IP address to the first device, and the first device detects whether the received second IP address meets a communication failure condition, for example, whether the received second IP address is in the same network segment as the target network, and if the communication failure condition is not met, the first device sends an address modifying instruction to the second device, so that the second device modifies the second IP address to be a network address in the address modifying instruction.
Or in this embodiment, after the first device and the second device establish communication connection, the first device sends the address mask of the target network to the second device, the second device compares the second IP address of the first device with the address mask of the target network, and if the second IP address is not in the same network segment as the target network, the second device sends a modification request instruction to the first device, and the first device sends an address modification instruction to the second device, so that the second device modifies the second IP address to be the network address in the address modification instruction.
Referring to fig. 4, a schematic structural diagram of a control device according to a second embodiment of the present application is provided, where the control device may be configured in an electronic device, and the electronic device may be used as a first device to connect to a second device that needs address configuration. For example, the first device may be a notebook or a mobile phone, and the second device may be a personal computer PC (Personal Computer), a server, or the like, which needs to be configured with an IP address. The technical scheme in the embodiment is mainly used for reducing the implementation complexity of configuring the IP address for the equipment.
Specifically, the apparatus in this embodiment may include the following units:
An information obtaining unit 401, configured to obtain, on a first device, target information corresponding to a second device, where the target information includes at least a first IP address of the second device;
a connection establishment unit 402, configured to establish a communication connection with the second device at least through the first IP address;
An instruction sending unit 403, configured to send an address modification instruction to the second device through the communication connection, where the address modification instruction at least includes a network address, so that the second device modifies a second IP address to the network address, and an address length of the second IP address is smaller than an address length of the first IP address.
As can be seen from the above technical solution, in the control device provided by the second embodiment of the present application, the first IP address of the second device may be directly used on the first device to configure the second IP address for the second device, and in this process, DHCP equipment is not required to be configured for the second device, so that device deployment may be reduced, and implementation complexity of address configuration may be reduced.
In one implementation, the target information further includes: a target device identification of the second device, the target device identification being used to uniquely characterize the second device; wherein the network address is obtained based on the target device identification.
In one implementation, the instruction sending unit 403 is further configured to: the network address is obtained based on the target device identification. The instruction sending unit 403 is specifically configured to, when obtaining the network address based on the target device identifier: inquiring whether configuration information corresponding to the target equipment identifier exists in an address configuration file, wherein the configuration information at least comprises the equipment identifier and a network address; and if the configuration information corresponding to the target equipment identifier is queried, acquiring the network address from the configuration information corresponding to the target equipment identifier.
In one implementation, the configuration information corresponding to the target device identifier further includes: access information of the second device; wherein the address modification instruction further includes: and the access information of the second device is used for enabling the second device to modify the second IP address into the network address under the condition that the access information is verified to meet the access condition.
In one implementation, the access information of the second device includes: a user name and password of the second device; wherein the access information satisfies an access condition, comprising: the username matches the second device and the password matches the username.
In one implementation, the information obtaining unit 401 is specifically configured to: and sending a service discovery instruction to a second device on the first device, so that the second device responds to the service discovery instruction and sends a discovery information packet to the first device, wherein the discovery information packet comprises the target information.
In one implementation, the first IP address is an address of IPv 6; the second IP address is an address of IPv 4.
In one implementation, the instruction sending unit 403 is specifically configured to, when sending an address modification instruction to the second device through the communication connection: and sending an address modification instruction to a baseboard management controller in the second device through the communication connection, so that the baseboard management controller modifies a second IP address into the network address.
In one implementation, the following units may be further included in this embodiment, as shown in fig. 5:
A condition detecting unit 404, configured to detect, on the first device, whether a second IP address of the second device meets a communication failure condition corresponding to the target network, before the instruction sending unit 403 sends an address modification instruction to the second device through the communication connection after the connection establishment unit 402 establishes the communication connection with the second device; in response to the second IP address satisfying the communication failure condition, the instruction transmitting unit 403 is triggered.
It should be noted that, the specific implementation of each unit in this embodiment may refer to the corresponding content in the foregoing, which is not described in detail herein.
Referring to fig. 6, a schematic structural diagram of an electronic device according to a third embodiment of the present application is provided, where the electronic device is used as a first device and a second device to communicate, and the first device may include the following structures:
A communication module 601 and a processor 602; wherein:
The processor 602 obtains target information corresponding to the second device by using the communication module 601, where the target information includes at least a first IP address; establishing a communication connection with the second device using the communication module 601 at least through the first IP address; and sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
As can be seen from the foregoing technical solution, in the electronic device provided in the third embodiment of the present application, target information corresponding to a second device is obtained on a first device, where the target information includes a first IP address with a longer address length of the second device, and based on the target information, a communication connection is established between the first IP address and the second device, so that an address modification instruction can be sent to the second device through the communication connection, and further the second device modifies the second IP address with a shorter address length into a network address included in the address modification instruction. Therefore, in this embodiment, the first IP address of the second device may be directly used on the first device to configure the second IP address for the second device, and in this process, DHCP devices do not need to be configured for the second device, so that device deployment may be reduced, and implementation complexity of address configuration may be reduced.
Taking a scenario that a server needs to configure an IPV4 address for network access as an example, the following describes in detail a technical scheme of the present application:
First, the BMC is a core component of server management, and a user typically needs to connect to the BMC through an IP address to manage a server, such as firmware upgrade, server setup, and the like. When the server leaves the factory, the BMC uses a default IP address, and users usually need to set the IP address before deploying and using the server.
Currently, the following modes are adopted to set the IP address:
In one mode, the Web interface provided by the BMC can be directly realized through one-to-one manual modification, but the operation complexity of the scheme is improved, and the setting efficiency is lower.
In another approach, batch modification is performed using a software tool. As shown in fig. 7, for example, the BMC of the PC is connected to the target network having the DHCP function so that each BMC in the target network can be automatically assigned a unique IP address.
However, in this scheme, a DHCP server needs to be installed in the network to pre-allocate an IP address, and if the IP address of the BMC has been changed to a static IP address, there may be a case that the server is connected to the network: problems of IP address collision, and problems of DHCP assigned IP addresses (operating computers) not being on a logical network, etc. These problems may result in failure to connect to the BMC through the IP address, resulting in subsequent operation failures.
In view of this, in connection with the architecture shown in fig. 8, the present application proposes the following procedure, as shown in fig. 9:
step 1: acquiring an IPV6 address and an SN of a server by using an SSDP on a PC, and connecting the PC to a BMC of the server through the IPV6 address of the server;
step 2: reading an address configuration file on a PC;
Step 3: and acquiring an IPV4 address corresponding to the SN on the PC according to the address configuration file, generating an address modification instruction according to the IPV4 address, and after sending the address modification instruction to the server, modifying the IPV4 address of the server by the server according to the address modification instruction sent by the PC.
Note that, the IPV6 address of the server is obtained by the MAC calculation of the server, so that uniqueness is ensured when shipped from the factory. In the application, the DHCP server is not required to be erected, and the BMC is only required to be connected to the target network through the switch.
In a specific implementation, an address configuration file is stored on the PC, as shown in fig. 2, where each piece of configuration information may include: device identification such as SN, network address such as IPV4 address, address Mask such as Mask, user name such as User name, password such as Password, etc.
In summary, in the present application, an address configuration file is predefined on the PC, and one item of SN, MAC, IPV is used as a key in the address configuration file. Furthermore, the IPV6 address of the server is obtained on the PC through the reply packet of the SSDP (i.e. the discovery packet in the foregoing), and the server may return information such as SN, MT, etc. in the reply packet of the SSDP. In this way, the information such as the user name and the password in the address configuration file is used on the PC to create a communication connection with the BMC of the server based on the IPV6 address, the address modification instruction is generated on the PC by using the IPv4 related information fields (such as the fields of the network address IPV4, the address MASK, the GATEWAY address GATEWAY and the like) in the address configuration file, and after the address modification instruction is sent to the BMC of the server, the BMC sets the IPV4 address of the BMC according to the address modification instruction under the condition that the user name and the password meet the access condition.
Therefore, the scheme of setting the IPV4 address for the server is convenient and efficient to use, does not need to additionally erect a DHCP server, and does not have the problems of IP conflict and IP address not in one network segment.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A control method, comprising:
obtaining target information corresponding to second equipment on first equipment, wherein the target information at least comprises a first IP address of the second equipment;
Establishing a communication connection with the second device at least through the first IP address;
And sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
2. The method of claim 1, the target information further comprising: a target device identification of the second device, the target device identification being used to uniquely characterize the second device;
wherein the network address is obtained based on the target device identification.
3. The method of claim 2, obtaining the network address based on the target device identification, comprising:
Inquiring whether configuration information corresponding to the target equipment identifier exists in an address configuration file, wherein the configuration information at least comprises the equipment identifier and a network address;
And if the configuration information corresponding to the target equipment identifier is queried, acquiring the network address from the configuration information corresponding to the target equipment identifier.
4. The method of claim 3, the target device identifying corresponding configuration information further comprising: access information of the second device;
Wherein the address modification instruction further includes: and the access information of the second device is used for enabling the second device to modify the second IP address into the network address under the condition that the access information is verified to meet the access condition.
5. The method of claim 4, the access information of the second device comprising: a user name and password of the second device;
wherein the access information satisfies an access condition, comprising: the username matches the second device and the password matches the username.
6. The method of claim 1, obtaining, on the first device, target information corresponding to the second device, comprising:
And sending a service discovery instruction to a second device on the first device, so that the second device responds to the service discovery instruction and sends a discovery information packet to the first device, wherein the discovery information packet comprises the target information.
7. The method of claim 1, the first IP address being an address of IPv 6; the second IP address is an address of IPv 4.
8. The method of claim 1, sending an address modification instruction to the second device over the communication connection, comprising:
And sending an address modification instruction to a baseboard management controller in the second device through the communication connection, so that the baseboard management controller modifies a second IP address into the network address.
9. The method of claim 1, after establishing a communication connection with the second device, prior to sending an address modification instruction to the second device over the communication connection, the method further comprising:
detecting whether a second IP address of the second device meets a communication fault condition corresponding to the target network or not on the first device;
In response to the second IP address satisfying the communication failure condition, performing the: and sending an address modification instruction to the second equipment through the communication connection.
10. An electronic device as a first device, the first device comprising: a communication module and a processor; wherein:
The processor obtains target information corresponding to the second equipment by utilizing the communication module, wherein the target information at least comprises a first IP address; establishing a communication connection with the second device using the communication module at least through the first IP address; and sending an address modification instruction to the second device through the communication connection, wherein the address modification instruction at least comprises a network address, so that the second device modifies a second IP address into the network address, and the address length of the second IP address is smaller than that of the first IP address.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410353626.4A CN118158196A (en) | 2024-03-26 | 2024-03-26 | Control method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410353626.4A CN118158196A (en) | 2024-03-26 | 2024-03-26 | Control method and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118158196A true CN118158196A (en) | 2024-06-07 |
Family
ID=91294706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410353626.4A Pending CN118158196A (en) | 2024-03-26 | 2024-03-26 | Control method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118158196A (en) |
-
2024
- 2024-03-26 CN CN202410353626.4A patent/CN118158196A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10505908B2 (en) | System and method for automatic wireless connection between a portable terminal and a digital device | |
CN107592209B (en) | Method and system for automatically configuring IP address information by multi-network card server | |
US7720057B2 (en) | Packet relay apparatus and control method for data relay apparatus | |
CN109644522B (en) | Method and system for securely loading devices over a wireless network | |
CN101465856B (en) | Method and system for controlling user access | |
US8605582B2 (en) | IP network system and its access control method, IP address distributing device, and IP address distributing method | |
JP2003348116A (en) | Address automatic setting system for in-home network | |
EP1125422A1 (en) | Digital network modem and configuration system for a digital network modem | |
EP1774702A1 (en) | System, network entities and computer programs for configuration management of a dynamic host configuration protocol framework | |
EP2408140B1 (en) | Method, control point, apparatus and communication system for configuring access right | |
CN114553592B (en) | Method, equipment and storage medium for equipment identity verification | |
US9805175B2 (en) | Method, apparatus and system for software management | |
CN111194035B (en) | Network connection method, device and storage medium | |
CN106301847B (en) | Access point interface configuration recovery method and device and home gateway | |
JP2006129355A (en) | Information processor, data transmission system, data transmission method, and program for performing the data transmission method on the information processor | |
WO2009079896A1 (en) | User access authentication method based on dynamic host configuration protocol | |
CN118158196A (en) | Control method and electronic equipment | |
JP2003318939A (en) | Communication system and control method thereof | |
CN113965444B (en) | Remote recovery method and device for home gateway | |
CN114785534A (en) | Communication method and device | |
CN113556337A (en) | Terminal address identification method, network system, electronic device and storage medium | |
CN101594696B (en) | Trust check method for discovering access controller | |
CN107888383B (en) | Login authentication method and device | |
KR100513296B1 (en) | Apparatus, system and method for controlling network access | |
EP1355476A1 (en) | Processing device for address allocation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |