A network modification method, system, device and computer-readable storage medium
By using ZwCreateFile and ZwDeviceIoControlFile functions to modify network information during the cloud computer driver stage, the problem of long waiting time for users in the existing technology is solved, and a fast connection to cloud services is achieved.
Patent Information
- Application Number
- CN202210231820.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In the driving stage of cloud computers, it is difficult for the existing technology to modify the IP, gateway and subnet mask when the application layer is not started, resulting in a long wait time for users.
By obtaining the modified target network information, the symbolic connection of the NSI device is opened based on ZwCreateFile in the driving stage of the target cloud computer, the target structure is built, and the ZwDeviceIoControlFile function is called to transmit the structure to the target cloud computer to modify its network information.
It realizes that network information can be modified during the cloud computer driver stage, shortening user waiting time and improving user experience.
Smart Images

Figure CN114816540B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cloud computer services, and more specifically, to a network modification method, system, device, and computer-readable storage medium. Background Art
[0002] Currently, in scenarios such as Internet cafes, the technical solutions of cloud diskless and cloud computers are adopted, that is, there is no physical hard disk as the C drive to act as the boot disk, but a network hard disk is used as the boot disk. The problem brought about by this is that the boot speed of diskless may be slower than that of an SSD disk. In a cloud computer environment, the waiting time for users may even be as long as 40 seconds to more than 90 seconds. This is very poor for the user experience. Therefore, a solution is needed to allow users to quickly connect to the cloud computer and enjoy cloud services as soon as possible.
[0003] Based on this, a pre-boot solution is proposed, that is, when the user has not requested the cloud computer environment, multiple cloud computers are pre-opened and paused at a certain stage. There are no application programs or task business programs at this stage, ensuring the cleanliness of the user environment. When the user issues a resource scheduling request, the network such as the IP, gateway, and subnet mask is modified to achieve network connectivity with the user. At the same time, this computer is designated as the IP corresponding to the specified computer number in the specified Internet cafe. Then, after network connectivity, the resource package corresponding to the user's request is sent, such as: game resource package, office resource package, etc. During this process, there is a problem: when the user has not issued a cloud computer request, only the driver is running during the diskless pause stage, and no application programs are running. Then, when a user's resource scheduling request arrives, in order to achieve network connectivity with the user and divide the resources to the specific computer number of the specific Internet cafe, a function is required - to be able to modify the IP, gateway, and subnet mask during the driver stage. However, currently, the technologies for modifying the IP, gateway, and subnet mask all need to be implemented at the application layer after entering the desktop, and there is no open-source solution that can modify the IP, gateway, and subnet mask when the application layer has not been started during the driver stage.
[0004] In summary, how to modify the network during the driver stage of a cloud computer is an urgent problem for those skilled in the art in the current field. Summary of the Invention
[0005] The purpose of the present application is to provide a network modification method, which can, to a certain extent, solve the technical problem of how to modify the network during the driver stage of a cloud computer. The present application also provides a network modification system, device, and computer-readable storage medium.
[0006] To achieve the above purpose, the present application provides the following technical solutions:
[0007] A network modification method includes:
[0008] Obtain the modified target network information;
[0009] During the driver stage of the target cloud computer, open the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile;
[0010] Construct a target structure based on the target network information according to a preset data structure;
[0011] Call the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer, so as to modify the network of the target cloud computer based on the target structure.
[0012] Preferably, the parameters in the data structure include: actionType parameter, subType parameter, subTypeDo parameter, actionArgs parameter, actionArgsEx1 parameter;
[0013] Among them, the actionType parameter is used to represent the type of network information; the subType parameter and the subTypeDo parameter are used to represent the modification type of network information; the actionArgs parameter and the actionArgsEx1 parameter are used to point to pointer memory, and the pointer memory is used to store the target network information;
[0014] The step of calling the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer includes:
[0015] Call the ZwDeviceIoControlFile function with 0x1200013 as the IoControlCode to transfer the target structure to the target cloud computer.
[0016] Preferably, the target network information includes a target IP address and target subnet mask information;
[0017] The step of constructing a target structure based on the target network information according to a preset data structure includes:
[0018] Construct a first target structure based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the first target structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing a target IP and a target subnet mask; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information.
[0019] Preferably, before constructing the target structure based on the target network information according to the preset data structure, it further includes:
[0020] Obtain the original IP address of the target cloud computer;
[0021] Construct a second original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the second original structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address;
[0022] Call the ZwDeviceIoControlFile function to transfer the second original structure to the target cloud computer to release the original IP address of the target cloud computer.
[0023] Preferably, before constructing the second original structure based on the original IP address according to the preset data structure, it further includes:
[0024] Construct a first original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the first original structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address;
[0025] Call the ZwDeviceIoControlFile function to transfer the first original structure to the target cloud computer to activate the original IP address of the target cloud computer.
[0026] Preferably, the target network information includes target gateway information;
[0027] Constructing a target structure based on the target network information according to the preset data structure includes:
[0028] Constructing a second target structure based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the second target structure is a preset value for representing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for representing an operation of issuing a target gateway; the pointer memory pointed to by the actionArgs parameter is used to store the target network information.
[0029] Preferably, before constructing the target structure based on the target network information according to the preset data structure, it further includes:
[0030] Obtaining the original gateway of the target cloud computer;
[0031] Constructing a third original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the third original structure is a preset value for representing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for representing an operation of releasing the original gateway; the pointer memory pointed to by the actionArgs parameter is used to store the original gateway.
[0032] Calling the ZwDeviceIoControlFile function to transfer the third original structure to the target cloud computer to release the original gateway of the target cloud computer.
[0033] A network modification system includes:
[0034] A first acquisition module for acquiring modified target network information;
[0035] A first operation module for opening a symbolic link to the NSI device of the target cloud computer based on ZwCreateFile during the driver stage of the target cloud computer;
[0036] A first construction module for constructing a target structure based on the target network information according to the preset data structure;
[0037] A first transmission module for calling the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure.
[0038] An electronic device includes:
[0039] A memory for storing a computer program;
[0040] A processor for implementing the steps of any of the above network modification methods when executing the computer program.
[0041] A computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of any of the above network modification methods are implemented.
[0042] A network modification method provided by this application includes obtaining modified target network information; during the driver stage of the target cloud computer, opening a symbolic link to the NSI device of the target cloud computer based on ZwCreateFile; constructing a target structure based on the target network information according to a preset data structure; calling the ZwDeviceIoControlFile function to transmit the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure. In this application, during the driver stage of the target cloud computer, a symbolic link to the NSI device of the target cloud computer can be opened based on ZwCreateFile to prepare for modifying the network of the target cloud computer later; and then, according to the preset data structure, a target structure can be constructed based on the target network information, and the ZwDeviceIoControlFile function can be called to transmit the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure; it realizes modifying the network information of the target cloud computer in the driver stage by means of ZwCreateFile and ZwDeviceIoControlFile. In addition, since the used ZwCreateFile and ZwDeviceIoControlFile are standard functions in the computer, the compatibility of this application is good and will not cause abnormalities such as blue screens, ensuring the user experience. A network modification system, device, and computer-readable storage medium provided by this application also solve the corresponding technical problems. Description of the Drawings
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0044] Figure 1 It is the first flowchart of a network modification method provided by an embodiment of this application;
[0045] Figure 2 It is the second flowchart of a network modification method provided by an embodiment of this application;
[0046] Figure 3 It is the third flowchart of a network modification method provided by an embodiment of the present application;
[0047] Figure 4 It is a schematic structural diagram of a network modification system provided by an embodiment of the present application;
[0048] Figure 5 It is a schematic diagram of the hardware composition structure of an electronic device according to an embodiment of the present invention. Specific embodiments
[0049] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0050] Please refer to Figure 1 , Figure 1 It is the first flowchart of a network modification method provided by an embodiment of the present application.
[0051] A network modification method provided by an embodiment of the present application may include the following steps:
[0052] Step S101: Obtain the modified target network information.
[0053] In practical applications, the modified target network information can be obtained first, that is, the network information of the target cloud computer set by the user or the like. The type, content, etc. of the target network information can be determined according to actual needs, and the present application does not make specific limitations here.
[0054] Step S102: At the driver stage of the target cloud computer, open the symbolic connection of the NSI device of the target cloud computer based on ZwCreateFile.
[0055] In practical applications, after obtaining the modified target network information, at the driver stage of the target cloud computer, the symbolic connection of the NSI (Network Service Interface) device of the target cloud computer can be opened based on ZwCreateFile, so as to establish a communication connection with the NSI device of the target cloud computer and prepare for modifying the network information of the target cloud computer based on the target network information.
[0056] Step S103: Construct a target structure based on the target network information according to a preset data structure.
[0057] In practical applications, during the driver stage of the target cloud computer, after opening the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile, a target structure can be constructed based on the target network information according to a preset data structure, so as to encapsulate the target network information with the target structure and prepare for subsequent transmission of the target network information to the target cloud computer.
[0058] Step S104: Call the ZwDeviceIoControlFile function to transmit the target structure to the target cloud computer, so as to modify the network of the target cloud computer based on the target structure.
[0059] In practical applications, after constructing the target structure based on the target network information according to the preset data structure, the ZwDeviceIoControlFile function can be called to transmit the target structure to the target cloud computer, so as to modify the network of the target cloud computer based on the target structure.
[0060] In specific application scenarios, the parameters in the data structure can be determined according to actual needs, and its examples can be as follows:
[0061] typedef struct _NSI_ACTIONS
[0062] {
[0063] CHAR t1
[10] ; / / +0
[0064] PUINT64 npiModuleIds; / / +10
[0065] UINT32 actionType; / / +18
[0066] UIT32 t2; / / +1c
[0067] UIT32 subTypeDo; / / +20
[0068] PUIT64 actionArgs; / / +28
[0069] UINT32 actionAgrsLen; / / +30
[0070] UINT32 t3; / / +34
[0071] PUINT64 actionArgsEx1; / / +38
[0072] UINT32 actionArgsEx1Len; / / +40
[0073] }NSI_ACTIONS, *PNSI_ACTIONS;
[0074] It may include: actionType parameter, subType parameter, subTypeDo parameter, actionArgs parameter, actionArgsEx1 parameter; among them, the actionType parameter is used to characterize the type of network information; the subType parameter and subTypeDo parameter are used to characterize the modification type of network information; the actionArgs parameter and actionArgsEx1 parameter are used to point to pointer memory, and the pointer memory is used to save the target network information; correspondingly, in the process of calling the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer, 0x1200013 can be used as the IoControlCode to call the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer.
[0075] It should be noted that in the process of constructing the target structure based on the target network information according to the preset data structure, not all parameters in the data structure will be applied. At this time, the values of the unused parameters can be set to null, etc., to indicate that the corresponding parameters are not transmitted, etc. This application does not make specific limitations here. In addition, after calling the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer, if the target cloud computer returns a corresponding value, and the return value indicates that the target cloud computer responds correctly to the target structure, it can be determined that the network information of the target cloud computer is successfully modified, etc. This application does not make specific limitations here.
[0076] A network modification method provided by the present application obtains the modified target network information; in the driver stage of the target cloud computer, based on ZwCreateFile, it opens the symbolic link of the NSI device of the target cloud computer; according to a preset data structure, it constructs a target structure based on the target network information; calls the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure. In the present application, in the driver stage of the target cloud computer, the symbolic link of the NSI device of the target cloud computer can be opened based on ZwCreateFile to prepare for modifying the network of the target cloud computer later; and then, according to a preset data structure, a target structure can be constructed based on the target network information, and the ZwDeviceIoControlFile function can be called to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure; it realizes modifying the network information of the target cloud computer in the driver stage by means of ZwCreateFile and ZwDeviceIoControlFile. In addition, because the used ZwCreateFile and ZwDeviceIoControlFile are standard functions in the computer, the compatibility of the present application is good and it will not cause abnormalities such as blue screens, ensuring the user experience.
[0077] Please refer to Figure 2 , Figure 2 which is the second flowchart of a network modification method provided by an embodiment of the present application.
[0078] A network modification method provided by an embodiment of the present application may include the following steps:
[0079] Step S201: Obtain the modified target network information, where the target network information includes the target IP address and the target subnet mask information.
[0080] Step S202: In the driver stage of the target cloud computer, open the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile.
[0081] Step S203: According to a preset data structure, construct a first target structure based on the network information; among them, the value of the actionType parameter in the first target structure is a preset value used to represent the IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target IP and the target subnet mask; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information.
[0082] In practical applications, the target network information may include the target IP address and the target subnet mask information. At this time, in the process of constructing the target structure based on the target network information according to the preset data structure, the first target structure can be constructed based on the network information according to the preset data structure. Among them, the value of the actionType parameter in the first target structure is the preset value used to represent the IP, such as 0xA; the values of the subType parameter and the subTypeDo parameter are the preset values used to represent the operation of sending down the target IP and the target subnet mask, such as the subType parameter is set to 0x1 and the subTypeDo parameter is set to 2; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information.
[0083] Step S204: Call the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure.
[0084] In a specific application scenario, in order to ensure that the target IP address and the target subnet mask information can be successfully set and to ensure compatibility, before constructing the first target structure based on the target network information according to the preset data structure, the original IP address of the target cloud computer can also be activated, that is, the first original structure needs to be constructed based on the original IP address according to the preset data structure. Among them, the value of the actionType parameter in the first original structure is the preset value used to represent the IP, such as set to 0xA; the values of the subType parameter and the subTypeDo parameter are the preset values used to represent the operation of sending down the original IP, such as the subType parameter is set to 0x3 and the subTypeDo parameter is set to 1; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; call the ZwDeviceIoControlFile function to transfer the first original structure to the target cloud computer to activate the original IP address of the target cloud computer.
[0085] In a specific application scenario, in order to avoid conflicts between the original IP address and the target IP address, after activating the original IP address of the target cloud computer and before constructing the first target structure based on the preset data structure for the target network information, it is also necessary to release the original IP address of the target cloud computer, that is, the original IP address of the target cloud computer can be obtained; based on the original IP address, a second original structure is constructed according to the preset data structure; among them, the value of the actionType parameter in the second original structure is a preset value used to represent the IP, for example, set to 0xA; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original IP, for example, the subType parameter is set to 0x3 and the subTypeDo parameter is set to 0; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; and the ZwDeviceIoControlFile function is called to transmit the second original structure to the target cloud computer to release the original IP address of the target cloud computer.
[0086] Please refer to Figure 3 , Figure 3 which is the third flowchart of a network modification method provided by an embodiment of the present application.
[0087] A network modification method provided by an embodiment of the present application may include the following steps:
[0088] Step S301: Obtain the modified target network information, where the target network information includes target gateway information.
[0089] Step S302: In the driver stage of the target cloud computer, open the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile.
[0090] Step S303: Based on the network information, construct a second target structure according to the preset data structure; among them, the value of the actionType parameter in the second target structure is a preset value used to represent the gateway; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target gateway; the pointer memory pointed to by the actionArgs parameter is used to store the target gateway information.
[0091] In practical applications, the target network information may include target gateway information; correspondingly, in the process of constructing a target structure based on the target network information according to a preset data structure, a second target structure may be constructed based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the second target structure is a preset value used to represent a gateway, such as set to 0x10; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of sending down the target gateway, such as the subType parameter is set to 0x3 and the subTypeDo parameter is set to 0; the pointer memory pointed to by the actionArgs parameter is used to store the target gateway information. In addition, the actionArgsEx1 parameter can also be used to store the corresponding information of the target gateway information, such as the storage location of the target gateway information in the memory, that is, the memory of 32 bytes of 0xFF can be pointed to the actionArgsEx1 parameter, etc.
[0092] Step S304: Call the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure.
[0093] In a specific application scenario, in order to ensure the compatibility and security of the target gateway information, before constructing the second target structure based on the target network information according to the preset data structure, it is also necessary to release the original gateway of the target cloud computer, that is, it is necessary to obtain the original gateway of the target cloud computer; construct a third original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the third original structure is a preset value used to represent a gateway, such as set to 0x10; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original gateway, such as the subType parameter is 0x3 for us and the subTypeDo parameter is set to 1; the pointer memory pointed to by the actionArgs parameter is used to store the original gateway; finally, call the ZwDeviceIoControlFile function to transfer the third original structure to the target cloud computer to release the original gateway of the target cloud computer.
[0094] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a network modification system provided by an embodiment of the present application.
[0095] A network modification system provided by an embodiment of the present application may include:
[0096] A first acquisition module 101, configured to acquire modified target network information;
[0097] The first operation module 102 is used to open the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile during the driver stage of the target cloud computer;
[0098] The first construction module 103 is used to construct a target structure based on the target network information according to a preset data structure;
[0099] The first transmission module 104 is used to call the ZwDeviceIoControlFile function to transmit the target structure to the target cloud computer, so as to modify the network of the target cloud computer based on the target structure.
[0100] For a network modification system provided by an embodiment of the present application, the parameters in the data structure include: actionType parameter, subType parameter, subTypeDo parameter, actionArgs parameter, actionArgsEx1 parameter;
[0101] Among them, the actionType parameter is used to represent the type of network information; the subType parameter and the subTypeDo parameter are used to represent the modification type of network information; the actionArgs parameter and the actionArgsEx1 parameter are used to point to pointer memory, and the pointer memory is used to store the target network information;
[0102] Correspondingly, the first transmission module may include:
[0103] The first transmission unit is used to call the ZwDeviceIoControlFile function with 0x1200013 as the IoControlCode to transmit the target structure to the target cloud computer.
[0104] For a network modification system provided by an embodiment of the present application, the target network information includes a target IP address and target subnet mask information;
[0105] The first construction module may include:
[0106] The first construction unit is used to construct a first target structure based on the network information according to a preset data structure; among them, the value of the actionType parameter in the first target structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target IP and the target subnet mask; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information.
[0107] A network modification system provided by an embodiment of the present application may further include:
[0108] A second acquisition module, configured to acquire the original IP address of the target cloud computer before the first construction module constructs a target structure based on the target network information according to a preset data structure.
[0109] A second construction module, configured to construct a second original structure based on the original IP address according to a preset data structure; wherein, the value of the actionType parameter in the second original structure is a preset value for characterizing an IP; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing an operation of releasing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address.
[0110] A second transmission module, configured to call the ZwDeviceIoControlFile function to transmit the second original structure to the target cloud computer to release the original IP address of the target cloud computer.
[0111] A network modification system provided by an embodiment of the present application may further include:
[0112] A third construction module, configured to construct a first original structure based on the original IP address according to a preset data structure before the second construction module constructs a second original structure based on the original IP address according to a preset data structure; wherein, the value of the actionType parameter in the first original structure is a preset value for characterizing an IP; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing an operation of issuing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address.
[0113] A third transmission module, configured to call the ZwDeviceIoControlFile function to transmit the first original structure to the target cloud computer to activate the original IP address of the target cloud computer.
[0114] In a network modification system provided by an embodiment of the present application, the target network information includes target gateway information.
[0115] The first construction module may include:
[0116] A second construction unit, configured to construct a second target structure based on the network information according to a preset data structure; wherein, the value of the actionType parameter in the second target structure is a preset value for characterizing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing an operation of issuing the target gateway; the pointer memory pointed to by the actionArgs parameter is used to store the target gateway information.
[0117] A network modification system provided by an embodiment of the present application may further include:
[0118] A third acquisition module, configured to acquire the original gateway of the target cloud computer before the first construction module constructs a target structure based on target network information according to a preset data structure;
[0119] A fourth construction module, configured to construct a third original structure based on the original IP address according to a preset data structure; wherein, the value of the actionType parameter in the third original structure is a preset value for representing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for representing an operation of releasing the original gateway; the pointer memory pointed to by the actionArgs parameter is used to store the original gateway;
[0120] A fourth transmission module, configured to call the ZwDeviceIoControlFile function to transmit the third original structure to the target cloud computer to release the original gateway of the target cloud computer.
[0121] Based on the hardware implementation of the foregoing program modules, and in order to implement the method of the embodiments of the present invention, the embodiments of the present invention further provide an electronic device, Figure 5 which is a schematic diagram of the hardware composition structure of the electronic device of the embodiments of the present invention, as Figure 5 shown, the electronic device includes:
[0122] A communication interface 1, capable of interacting with other devices such as network devices;
[0123] A processor 2, connected to the communication interface 1 to implement information interaction with other devices, and configured to execute the network modification method of the application provided by the foregoing one or more technical solutions when running a computer program. And the computer program is stored on a memory 3.
[0124] Of course, in actual application, each component in the electronic device is coupled together through a bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. The bus system 4 includes not only a data bus, but also a power bus, a control bus and a status signal bus. However, for the sake of clear illustration, in Figure 5 all kinds of buses are labeled as the bus system 4.
[0125] The memory 3 in the embodiments of the present invention is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program for operating on the electronic device.
[0126] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), a ferromagnetic random access memory (FRAM, ferromagnetic random access memory), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM, Random Access Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as a static random access memory (SRAM, Static Random Access Memory), a synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), a dynamic random access memory (DRAM, Dynamic Random Access Memory), a synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), a double data rate synchronous dynamic random access memory (DDR SDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), an enhanced synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), a sync link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and a direct rambus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present invention is intended to include but not limited to these and any other suitable types of memories.
[0127] The method disclosed in the above embodiments of the present invention can be applied to or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 2 or the instructions in the form of software. The above-mentioned processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute each method, step, and logic block diagram disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed by the hardware decoding processor, or executed by the combination of the hardware and software modules in the decoding processor. The software module may be located in the storage medium, which is located in the memory 3. The processor 2 reads the program in the memory 3 and combines its hardware to complete the steps of the foregoing method.
[0128] When the processor 2 executes the program, it implements the corresponding processes in each method of the embodiments of the present invention. For the sake of brevity, it will not be elaborated here.
[0129] In an exemplary embodiment, the embodiments of the present invention further provide a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as the memory 3 including a stored computer program. The above computer program can be executed by the processor 2 to complete the steps of the foregoing method. The computer-readable storage medium may be a FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM, etc.
[0130] In several embodiments provided in the present application, it should be understood that the disclosed devices, terminals, and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed with each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be electrical, mechanical, or other forms.
[0131] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, in each embodiment of the present invention, all the functional units may be integrated in one processing unit, or each unit may be a separate unit alone, or two or more units may be integrated in one unit. The above-mentioned integrated units may be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0133] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments. The foregoing storage medium includes: various media such as removable storage devices, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0134] Alternatively, if the above-mentioned integrated units of the present invention are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as removable storage devices, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0135] It should also be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0136] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present 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
1. A network modification method, characterized in that, Including: Obtain the modified target network information; During the driver stage of the target cloud computer, open the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile; Construct a target structure based on the target network information according to a preset data structure; The parameters in the data structure include: actionType parameter, subType parameter, subTypeDo parameter, actionArgs parameter, actionArgsEx1 parameter; Call the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer to modify the network of the target cloud computer based on the target structure; Among them, the actionArgs parameter and the actionArgsEx1 parameter are used to point to pointer memory, and the pointer memory is used to store the target network information; The step of calling the ZwDeviceIoControlFile function to transfer the target structure to the target cloud computer includes: Call the ZwDeviceIoControlFile function with 0x1200013 as the IoControlCode to transfer the target structure to the target cloud computer; The step of constructing a target structure based on the target network information according to a preset data structure includes: Construct a first target structure based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the first target structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target IP and the target subnet mask; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information; the target network information includes the target IP address and the target subnet mask information; Before constructing the first target structure based on the network information according to the preset data structure, it further includes: Obtain the original IP address of the target cloud computer; Construct a second original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the second original structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; Call the ZwDeviceIoControlFile function to transfer the second original structure to the target cloud computer to release the original IP address of the target cloud computer; Before constructing the second original structure based on the original IP address according to the preset data structure, the following steps are further included: Construct a first original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the first original structure is a preset value for characterizing an IP; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing the operation of issuing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; Call the ZwDeviceIoControlFile function to transfer the first original structure to the target cloud computer to activate the original IP address of the target cloud computer; Constructing a target structure based on the target network information according to the preset data structure includes: Construct a second target structure based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the second target structure is a preset value for characterizing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing the operation of issuing the target gateway; the pointer memory pointed to by the actionArgs parameter is used to store the target gateway information; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the storage location of the target gateway information in the memory; the target network information includes target gateway information; Before constructing the second target structure based on the network information according to the preset data structure, the following steps are further included: Obtain the original gateway of the target cloud computer; Construct a third original structure based on the original gateway according to the preset data structure; wherein, the value of the actionType parameter in the third original structure is a preset value for characterizing a gateway; the values of the subType parameter and the subTypeDo parameter are preset values for characterizing the operation of releasing the original gateway; the pointer memory pointed to by the actionArgs parameter is used to store the original gateway; Call the ZwDeviceIoControlFile function to transfer the third original structure to the target cloud computer to release the original gateway of the target cloud computer.
2. A network modification system, characterized in that, It includes: A first acquisition module for acquiring the modified target network information; A first operation module for opening the symbolic link of the NSI device of the target cloud computer based on ZwCreateFile during the driver stage of the target cloud computer; A first construction module for constructing a target structure based on the target network information according to the preset data structure; The parameters in the data structure include: actionType parameter, subType parameter, subTypeDo parameter, actionArgs parameter, actionArgsEx1 parameter; The first transmission module is used to call the ZwDeviceIoControlFile function to transmit the target structure to the target cloud computer, so as to modify the network of the target cloud computer based on the target structure; Among them, the actionArgs parameter and the actionArgsEx1 parameter are used to point to pointer memory, and the pointer memory is used to store the target network information; The first transmission module is used to: call the ZwDeviceIoControlFile function by applying 0x1200013 as the IoControlCode, and transmit the target structure to the target cloud computer; The first construction module is used to: construct a first target structure based on the network information according to the preset data structure; among them, the value of the actionType parameter in the first target structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target IP and the target subnet mask; the pointer memory pointed to by the actionArgs parameter is used to store the target IP address; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the target subnet mask information; the target network information includes the target IP address and the target subnet mask information; The network modification system is further used to: before constructing a first target structure based on the network information according to the preset data structure, obtain the original IP address of the target cloud computer; construct a second original structure based on the original IP address according to the preset data structure; among them, the value of the actionType parameter in the second original structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; call the ZwDeviceIoControlFile function to transmit the second original structure to the target cloud computer to release the original IP address of the target cloud computer; The network modification system is further configured to: before constructing a second original structure based on the original IP address according to the preset data structure, construct a first original structure based on the original IP address according to the preset data structure; wherein, the value of the actionType parameter in the first original structure is a preset value used to represent an IP; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the original IP; the pointer memory pointed to by the actionArgs parameter is used to store the original IP address; call the ZwDeviceIoControlFile function to transmit the first original structure to the target cloud computer to activate the original IP address of the target cloud computer; The first construction module is configured to: construct a second target structure based on the network information according to the preset data structure; wherein, the value of the actionType parameter in the second target structure is a preset value used to represent a gateway; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of issuing the target gateway; the pointer memory pointed to by the actionArgs parameter is used to store the target gateway information; the pointer memory pointed to by the actionArgsEx1 parameter is used to store the storage location of the target gateway information in the memory; the target network information includes target gateway information; The network modification system is further configured to: before constructing a second target structure based on the network information according to the preset data structure, obtain the original gateway of the target cloud computer; construct a third original structure based on the original gateway according to the preset data structure; wherein, the value of the actionType parameter in the third original structure is a preset value used to represent a gateway; the values of the subType parameter and the subTypeDo parameter are preset values used to represent the operation of releasing the original gateway; the pointer memory pointed to by the actionArgs parameter is used to store the original gateway; call the ZwDeviceIoControlFile function to transmit the third original structure to the target cloud computer to release the original gateway of the target cloud computer.
3. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the network modification method as claimed in claim 1 when executing the computer program.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the network modification method as claimed in claim 1 are implemented.
Citation Information
Patent Citations
IP address configuration method, cloud server, cloud platform and readable storage medium
CN108347472A