A method, system, device and storage medium for generating state identification information
By receiving configuration information and subscription instructions, generating status identification information and monitoring target devices, the problem of data interaction errors between devices is solved, and the accuracy and reliability of data acquisition are achieved.
Patent Information
- Application Number
- CN201910205254.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-18
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2039-03-18
AI Technical Summary
In the prior art, data interaction errors between devices occur frequently, especially in the absence of corresponding data acquisition paths for device data nodes, resulting in data acquisition failure or major errors.
By receiving configuration information, the local equipment and network architecture are configured separately, status identification information is generated, data information corresponding to the device is recorded, and target equipment is monitored through subscription instructions to ensure accurate data interaction between devices.
It effectively solves the problem of data interaction errors between devices, ensures the accuracy and reliability of data acquisition, and avoids confusion and coverage.
Smart Images

Figure CN111726236B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet, and in particular to a method, system, device and storage medium for generating status identification information. Background Art
[0002] Until now, data interaction errors often occur when establishing networks between devices. For example, in the widely used container field (service discovery and data storage system), the interaction data often cannot obtain the data to be processed from each device data node in the network. Especially in the later data interaction process, due to the lack of data acquisition paths corresponding to device data nodes, data acquisition fails or major errors occur.
[0003] For example, when configuring flow rules, if the value of the cookie is not specified, the default value is 0. When a large number of flow tables need to be generated to form a table, because all the cookies in them will be set to 0, and the flow tables are not classified, the search results will generate a large number of flow table search results during the search process. In some extreme environments, because many field data of the flow table are the same, confusion will occur, and the newly generated flow table will overwrite the original flow table.
[0004] Specifically, for example, when configuring the security group, if the cookies are not the same, the user first sends a flow table to open 80 ports, and then the user sends a flow table to open 50 to 100 ports. The final result is that only one flow table for 80 ports will be left, and the network using the 80 ports here is in a normal connection state, but in fact there is a problem with the configuration, because the ports should be open at 50 to 100. On the contrary, if the cookies in the flow table are the same, the original flow table will be overwritten, and the subsequent user will delete the flow table for port 80, which will cause the network of 80 ports here to be blocked. Therefore, regardless of whether the cookies in the flow table are the same, an interaction error will occur. Therefore, the inventors have found that there are at least the following problems in the prior art. Since the device status in the network cannot be identified, there will be a technical problem of data interaction errors. Summary of the invention
[0005] The present invention provides a method for generating state identification information, the method comprising:
[0006] Receiving a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0007] According to the local configuration information and the network configuration information, the local device and its network architecture are configured to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information;
[0008] The state identification information is generated according to the local configuration and the network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and the network architecture corresponding to the configuration device.
[0009] Optionally, after the step of configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain the configured device step, the method further includes:
[0010] Receive subscription instructions that meet predetermined rules;
[0011] Subscribe to the network architecture corresponding to other devices in the network according to the subscription instruction;
[0012] Acquire a target device in the network, wherein the target device is another device having the same network architecture as the configuration device;
[0013] The target device in the network is monitored.
[0014] Optionally, after the step of monitoring the target device in the network, the method further comprises:
[0015] The data information of the local configuration corresponding to the target device is recorded in the state identification information of the local device.
[0016] Optionally, the state identification information is a code flow table, wherein the code flow table records a flow table identification code, local configuration data information and network architecture data information corresponding to the local device, and local configuration data information corresponding to the target device.
[0017] Optionally, the local configuration information is configuration information for creating a virtual machine.
[0018] Optionally, the network configuration information is configuration information for creating a VPC network architecture and / or configuration information for creating a network security group.
[0019] The present invention also provides another method for generating status identification information, the method comprising:
[0020] Creating a configuration instruction with configuration information according to a user request, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0021] The configuration instruction is sent to a local device so that the local device receives the configuration instruction with configuration information, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device; and the local device and its network architecture are configured according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; state identification information is generated according to the local configuration and network architecture of the configured device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configured device.
[0022] Optionally, after respectively configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain the step of configuring the device, the method includes:
[0023] Create subscription instructions that meet predetermined rules based on user requests;
[0024] The subscription instruction is sent to the local device so that the local device receives the subscription instruction that complies with the predetermined rules; the network architecture corresponding to other devices in the network is subscribed according to the subscription instruction; the target device in the network is obtained, wherein the target device is other device having the same network architecture as the configuration device; and the target device in the network is monitored.
[0025] The present application provides a state identification information generation system, the system comprising: a controller and an ETCD component, and a local device;
[0026] The controller is used to create a configuration instruction with configuration information according to a user request, and send the configuration instruction to the local device, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device;
[0027] The ETCD component is used to obtain the configuration instruction with configuration information sent by the controller and received in the local device; and configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; and is also used to generate status identification information according to the local configuration and network architecture of the configured device, wherein the status identification information is data information recording the local configuration and network architecture corresponding to the configured device.
[0028] Optionally, the system further includes: at least one other device;
[0029] The controller is further used to create a subscription instruction according to a user request and send it to a local device;
[0030] The ETCD component is also used to receive subscription instructions that comply with predetermined rules; subscribe to the network architecture corresponding to other devices in the network according to the subscription instructions; obtain the target device in the network, wherein the target device is other devices having the same network architecture as the configuration device; and monitor the target device in the network.
[0031] Optionally, the data processing ETCD component is further used to record data information corresponding to the local configuration of the target device in the status identification information of the local device.
[0032] The present application provides a state identification information generating device, the device comprising:
[0033] A receiving module, configured to receive a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0034] A configuration module, configured to configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information;
[0035] A generation module is used to generate state identification information according to the local configuration and network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configuration device.
[0036] Optionally, the device further comprises:
[0037] The receiving module is used to receive a subscription instruction that complies with a predetermined rule;
[0038] A subscription module, used to subscribe to the network architecture corresponding to other devices in the network according to the subscription instruction;
[0039] An acquisition module, used to acquire a target device in the network, wherein the target device is another device having the same network architecture as the configuration device;
[0040] A monitoring module is used to monitor the target device in the network.
[0041] Optionally, the device further comprises:
[0042] The recording module is used to record the data information of the local configuration corresponding to the target device in the state identification information of the local device.
[0043] Optionally, the present application also provides another state identification information generating device, the device comprising: a processor and a memory;
[0044] The memory stores an application program executable by the processor, which is used to enable the processor to execute the steps of the state identification information generating method.
[0045] Optionally, when the program is executed by a processor, the steps of the state identification information generating method are implemented.
[0046] As can be seen above, based on the above embodiments, by recording local configuration and network architecture data information, devices in the network can recognize each other, thereby solving the technical problem of data interaction errors caused by the inability to recognize data interaction between network devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of an application scenario 100 of an embodiment of the present application;
[0048] Figure 2 A schematic diagram of an application scenario 200 of an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a state identification information generation method process 300 in one embodiment of the present application;
[0050] Figure 4 A schematic diagram of a state identification information generation method process 400 in one embodiment of the present application;
[0051] Figure 5 A schematic diagram of a process 500 of a method for generating state identification information in one embodiment of the present application;
[0052] Figure 6 A schematic diagram of a process 600 of a method for generating state identification information in one embodiment of the present application;
[0053] Figure 7 A schematic diagram of a state identification information generation method process 700 in one embodiment of the present application;
[0054] Figure 8 This is a schematic diagram of the encoding data structure of a code stream table in one embodiment of the present application;
[0055] Fig. 9 This is a schematic diagram of a one-dimensional data structure of an ETCD key in an embodiment of the present application;
[0056] Fig.10 This is a schematic diagram of another dimension data structure of ETCD key in one embodiment of the present application;
[0057] Fig.11This is a schematic diagram of the architecture 800 of a state identification information generating device in one embodiment of the present application;
[0058] Fig.12 Schematic diagram of the architecture 900 of a state identification information generating device in one embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0060] Figure 1 FIG. 1 is a schematic diagram of an application scenario 100 according to an embodiment of the present application. Figure 1 As shown, in this embodiment, the controller 110 (i.e., Open vSwitch controller, wherein Open vSwitch is an open virtual switch standard) generates configuration information through settings by the user or the controller 110, and the configuration information includes local configuration information and network configuration information, wherein the local configuration information is data information for configuring the local device 120 itself, and the network configuration information is data information for configuring the network architecture of the local device 120. The configuration information generates a corresponding configuration instruction and sends it to the local device 120 or other devices 130 in the network, Figure 1 The ETCD component 140 performs corresponding local configuration or network architecture configuration on the configuration information received by the local device 120 and / or other devices 130. It should be noted that the ETCD component 140 can be set up in an independent device and run independently, or it can be installed in one of the local devices or other devices in the network and run.
[0061] The ETCD component 140 is a service discovery and data storage system in the container domain.
[0062] Figure 2 FIG. 2 is a schematic diagram of an application scenario 200 according to an embodiment of the present application. Figure 2 As shown, based on Figure 1 In the embodiment, this embodiment is a schematic diagram of the thread of the present invention, wherein the web server (Web Server) receives the configuration information, generates the data of the configuration information in the manner of openflow, and at the same time, the ETCD component 140 obtains the data of the configuration information to monitor the ETCD component 140 and the status monitor to achieve the purpose of discovering the service. In the virtual machine scenario, a virtual machine management module can be set, and the virtual machine management module can be implemented by Libvirt to control and manage the status of the local device 120 in the status monitor.
[0063] OpenFlow is an Internet communication protocol that belongs to the data link layer and can control the forwarding plane of an Internet switch or router to change the Internet path taken by Internet data packets.
[0064] Libvirt is an open source API, daemon, and management tool for managing virtualization platforms.
[0065] API (Application Programming Interface) is a set of predefined functions that aims to provide applications and developers with the ability to access a set of routines based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism.
[0066] Figure 3 FIG. 3 is a schematic diagram of a state identification information generation method process 300 in one embodiment of the present application. Figure 3 As shown, in one embodiment, the present application provides a method for generating state identification information, the method comprising:
[0067] S101, receiving a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0068] In this step, it is necessary to receive a configuration instruction with configuration information, wherein the configuration information is a preset configuration requirement. The configuration requirement can be set by the user or generated by a program in the controller. Among them, the configuration information includes two parts, one part is the local configuration (i.e., local configuration), and the other part is the configuration of the network architecture (i.e., network architecture). It should be pointed out that both the local configuration and the network architecture configuration are for one device, i.e., the local device mentioned above. The local device is an abstract concept, which is not necessarily an independent device, but may also be a virtual data node set up under the network architecture.
[0069] S102, configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information;
[0070] In this step, the local device is configured according to the local configuration information and the network configuration information. Correspondingly, the configuration of the local device refers to the configuration of itself and the configuration of its network architecture. After the local device is configured, it will become a configured device that meets the predetermined local configuration in the predetermined network architecture.
[0071] S103, generating state identification information according to the local configuration and the network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and the network architecture corresponding to the configuration device.
[0072] In this step, state identification information is generated based on the local configuration and network architecture data of the configuration device. The state identification information records data information corresponding to the local configuration and network architecture that can be called and read in the network.
[0073] In this embodiment, a configuration instruction with configuration information can be received and a local device in the network can be configured according to the configuration instruction. Configuring the local device includes two levels: local configuration and network architecture configuration. After configuring the local device according to the configuration information, a configured device that conforms to the configuration information is obtained. The configuration status of the configured device is then recorded to generate status identification information, where the status identification information also includes data information at the local configuration and network architecture levels. Based on the status identification information, the status of the local device and the status of its network architecture at this time can be obtained. Using this data information in subsequent data interactions, the local device can be identified. Based on the identification of the local device, there will be no confusion in its data interaction in the network, thereby avoiding errors in data interaction.
[0074] Figure 4 FIG. 4 is a schematic diagram of a state identification information generation method process 400 in one embodiment of the present application. Figure 4 As shown, in one embodiment, the present application provides a method for generating state identification information. After the local device and its network architecture are configured according to the local configuration information and the network configuration information to obtain the configuration device step, the method includes:
[0075] S201, receiving a subscription instruction that complies with a predetermined rule;
[0076] In this step, in the network structure established by the configuration device, a subscription instruction may be received. The subscription instruction here is an instruction for monitoring other devices in the network structure.
[0077] S202, subscribing to the network architecture corresponding to other devices in the network according to the subscription instruction;
[0078] In this step, the network architecture corresponding to other devices is subscribed in the network. It should be noted that the other devices may be one or more devices in the network, or may be part of the other devices or all of the other devices. The above judgment should be made according to the pre-set in the subscription instruction.
[0079] S203, acquiring a target device in the network, wherein the target device is another device having the same network architecture as the configuration device;
[0080] In this step, the same network architecture may mean that the other devices and the local device belong to the same security group or the same cloud. Similarly, the other devices here may be one or more.
[0081] S204, monitoring the target device in the network.
[0082] In this step, when it is determined that the target device and the local device in the network belong to the same network architecture, that is, the target device should belong to the same security group or the same cloud, then the target device can be monitored in real time through the network.
[0083] In this embodiment, a target device with the same network architecture in the same network is obtained through a subscription instruction, and the target device and the local device may belong to the same security group or the same cloud. Then, other devices in the network are monitored.
[0084] In one embodiment, after the step of monitoring the target device in the network, the method further comprises:
[0085] The data information of the local configuration corresponding to the target device is recorded in the state identification information of the local device.
[0086] In this embodiment, in order to provide the local configuration of the target device, the local device can record the local configuration data information of the monitored target device in its own identification information state, so that the local configuration of the target device can be obtained through the local device from the network, and then control instructions can be sent to the local device, and the local device can make further network calls or controls on the target device.
[0087] In one embodiment, the state identification information is a code flow table, wherein the state identification information is a code flow table, wherein the code flow table records a flow table identification code, local configuration data information and network architecture data information corresponding to the local device, and local configuration data information corresponding to the target device.
[0088] This embodiment provides a specific implementation of the state identification information in the form of a code stream table.
[0089] In one embodiment, the local configuration information is configuration information for creating a virtual machine.
[0090] This embodiment provides a specific implementation method for creating a virtual machine configuration by using local configuration.
[0091] In one embodiment, the network configuration information is configuration information for creating a VPC network architecture and / or configuration information for creating a network security group.
[0092] This embodiment provides an implementation method for specific configuration of a network architecture.
[0093] Figure 5 FIG. 5 is a schematic diagram of a state identification information generation method process 500 in one embodiment of the present application. Figure 5 As shown, the present application also provides a method for generating state identification information, the method comprising:
[0094] S301, creating a configuration instruction with configuration information according to a user request, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0095] In this step, the user can directly set the configuration information, or automatically generate configuration instructions according to predetermined settings.
[0096] S302, sending the configuration instruction to the local device so that the local device receives the configuration instruction with configuration information, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device; and configuring the local device and its network architecture according to the local configuration information and the network configuration information respectively to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; generating state identification information according to the local configuration and network architecture of the configured device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configured device.
[0097] In this step, configuration information and configuration instructions are sent to the local device, and then the local device generates state identification information according to the steps in the above embodiment.
[0098] This embodiment provides a specific implementation method for generating a configuration instruction with configuration information, wherein a user generates a configuration instruction with configuration information according to a preset setting, and sends the configuration instruction to a local device. The local device configures the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configuration device, wherein the configuration device is a local device configured in accordance with the configuration information, and generates state identification information according to the local configuration and the network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and the network architecture corresponding to the configuration device.
[0099] Figure 6 FIG. 6 is a schematic diagram of a state identification information generation method process 600 in one embodiment of the present application. Figure 6As shown, in one embodiment, after the local device and its network architecture are configured according to the local configuration information and the network configuration information to obtain the configuration device step, the method includes:
[0100] S401, creating a subscription instruction that complies with a predetermined rule according to a user request;
[0101] This step provides a specific implementation method for creating a subscription instruction. The subscription instruction can be a setting made by the user, or a subscription instruction automatically generated according to a pre-set setting.
[0102] S402, sending the subscription instruction to the local device so that the local device receives the subscription instruction that complies with predetermined rules; subscribing to the network architecture corresponding to other devices in the network according to the subscription instruction; obtaining the target device in the network, wherein the target device is other device having the same network architecture as the configuration device; monitoring the target device in the network.
[0103] This step provides an implementation method of creating a subscription instruction and then sending the subscription instruction to the local device so that the local device performs subsequent steps.
[0104] This embodiment provides a method for creating a subscription instruction, through which a local device receives a subscription instruction that complies with predetermined rules; subscribes to status identification information of other devices in the network according to the subscription instruction; obtains a target device among the other devices according to the status identification information of the other devices, wherein the target device is another device having the same network architecture data information as the local device; and monitors the specific implementation method of the target device in the network.
[0105] Working process and basic principle:
[0106] In order to better illustrate the technical solution of the present invention, the technical solution of the present invention is described below by taking the creation of a virtual machine as an example. It should be pointed out that the embodiment of creating a virtual machine is only for better illustrating the present invention and is not a specific limitation of the present invention.
[0107] Figure 7 FIG. 7 is a schematic diagram of a state identification information generation method process 700 in one embodiment of the present application. Figure 7 As shown, in one embodiment, the method includes:
[0108] S501, receiving a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0109] The ETCD mechanism commonly used in the container network field can be used for service discovery, and the virtual network uses the ETCD component for service discovery. Specifically, the controller writes the local configuration information and network configuration information to be created into the ETCD key in the form of a two-dimensional code. Among them, the local configuration information is one dimension in the data structure, and the network configuration information is also recorded in the data structure of another dimension. The above method can avoid the problem that the ETCD key setting is too simple, only a single key value is stored, and the data of one dimension is missing, which makes it impossible to realize the lightweight service discovery mechanism brought by ETCD. The specific operation method will be explained in detail later, so I will not repeat it here.
[0110] Among them, local configuration information can be understood as information for creating a virtual machine, including IP-address (IP address), mac (Media Access Control), host IP-address (IP address), virtual machine backend device name, etc. The above configuration information corresponding to the creation of the network vpc network architecture is written into the first dimension of the ETCD key, such as: / ovs / v1 / nodes / 12.12.12.1 / vms / 1000 / 192.168.100.10. The first dimension of the ETCD key contains the IP address of the host.
[0111] vni: VXLAN Network Identifier.
[0112] VPC, which stands for Virtual Private Cloud, is a concept defined for the basic network (classic network) of the public cloud.
[0113] The local network configuration information can be understood as the configuration information for creating a vpc network architecture and / or the configuration information for the network security group. The configuration information corresponding to creating a network vpc network architecture includes subnet, gateway, vni (VXLAN network identifier), etc. For example, to create a vpc with vni of 1000, its configuration information is written into the first dimension of the ETCD key, such as: / ovs / v1 / nodes / 12.12.12.1 / vpcs / 1000. The first dimension of the ETCD key contains the IP address of the host.
[0114] S502, configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information;
[0115] Configure the local device according to the ETCD key in the above steps, that is, create the network architecture of the virtual machine and the local device.
[0116] S503, receiving a subscription instruction that complies with a predetermined rule;
[0117] The controller creates a subscription instruction according to a predetermined rule and sends the created subscription instruction to the local device. The local device receives the subscription instruction, and the purpose of the subscription instruction is to enable the local device to subscribe to other devices in the network.
[0118] S504, subscribing to the network architecture corresponding to other devices in the network according to the subscription instruction;
[0119] Other devices also record their corresponding network architecture data information.
[0120] S505, acquiring a target device in the network, wherein the target device is another device having the same network architecture as the configuration device;
[0121] The same network architecture data information in this step can be understood as the vpc network architecture or security group SG (Secure Group) of the local device is the same as other devices. Other devices that meet the above description are target devices, and the target device may be one or more of the other devices.
[0122] S506: Monitor the target device in the network.
[0123] This step is to monitor the target device. It should be noted that only other devices belonging to the same vpc network architecture or security group can be monitored.
[0124] For example, if you subscribe to the key: / etcdctl watch --prefix / ovs / v1 / vpcs / 1000, the local device is already monitoring the target device with vni 1000 and vpc.
[0125] S507: Record the data information of the local configuration corresponding to the target device in the state identification information of the local device.
[0126] The state identification information not only records the local configuration data information and network architecture data information of the local device, but also records the local configuration data information of the target device.
[0127] For example, the controller writes the virtual machine configuration information and vpc configuration information of the local device saved on the ETCD key, that is, the data information of the local configuration and network architecture, to the second dimension of the ETCD key.
[0128] For example: / ovs / v1 / vpcs / 1000; then the local configuration data information of the local device is / ovs / v1 / vpcs / 1000, which can be saved as / ovs / v1 / vpcs / 1000 / vms / 192.168.100.10 on the local device, and the local configuration data information corresponding to the target device can be automatically recorded in the state identification information of the local device. The target device can now create a virtual machine through the above method to generate the corresponding state identification information.
[0129] Figure 8 This is a schematic diagram of the encoding data structure of the code flow table in one embodiment of the present application, such as Figure 8 As shown, a specific design scheme for state identification information in the form of a code stream table is provided below.
[0130] The cookie value is 64 bits wide and is expressed as a hexadecimal number: 0xFFFFFFFFFFFFFF, corresponding to cookies [0..63]. The cookies involved in the vpc network are divided and designed as follows:
[0131] System flow table (i.e., flow table identification code), where bits 60 to 63 are represented as hexadecimal 0x0, bits 16 to 19 are represented as tableid, and bits 0 to 15 are represented as the flow table sequence number within the same table.
[0132] The vpc granular flow table (i.e., network architecture data information) has 60 to 63 bits represented as hexadecimal 0x1, 36 to 59 bits represented as vni, 32 to 35 bits set to 0 as reserved bits, and the remaining low-order 0 to 31 bits set to 0.
[0133] vm granular flow table 1 (i.e. local configuration data information), where bits 60 to 63 are represented as hexadecimal 0x2, bits 36 to 59 are represented as vni, bits 32 to 35 are reserved and set to 0, and the remaining low bits 0 to 31 represent the IP address of the virtual machine on this host. (The host here can be understood as a local device)
[0134] vm granular flow table 2 (i.e., the local configuration data information corresponding to the target device), where bits 60 to 63 are represented as hexadecimal 0x3, bits 36 to 59 are represented as vni, bits 32 to 35 are reserved and set to 0, and the remaining low bits 0 to 31 represent the IP addresses of virtual machines on other hosts belonging to the same vpc. (Here, other hosts can be understood as other devices)
[0135] The flow table related to the security group (that is, the network architecture data information) has 60 to 63 bits represented by hexadecimal 0x4, 36 to 59 bits represented by vni, 24 to 35 bits represented by the security group id, 8 to 23 bits represented by the priority of the security group rule, and the remaining 0 to 7 bits represented by the rule id of the security group rule.
[0136] According to the above cookie design, the algorithm for generating the corresponding cookie is given below.
[0137] Cookie configuration of system flow table;
[0138] Form ID: XX;
[0139] Flow table index: XX
[0140] The number of digits occupied by the form ID;
[0141] The cookie configuration includes the table ID and flow table index, as well as related configurations.
[0142] So the following flow table can be formed and sent down
[0143] Cookies for vpc granular flow tables,
[0144] The flow table starts to configure values;
[0145] vni configuration;
[0146] vpc initial configuration;
[0147] Cookie also needs to configure vni configuration and flow table start configuration;
[0148] So the following flow table can be formed and sent down
[0149] "The cookie itself is configured,
[0150] Cookie of vm granular flow table 1;
[0151] Flow table initial configuration;
[0152] vni configuration
[0153] Virtual machine IP configuration;
[0154] Virtual machine IP data type configuration;
[0155] Generate the corresponding cookie
[0156] So the following flow table can be formed and sent down
[0157] Cookies of target device granularity flow table 2,
[0158] Flow table initial configuration;
[0159] vni configuration;
[0160] IP settings of the target device;
[0161] Generate the corresponding cookie.
[0162] So the following flow table can be formed and sent down
[0163] Cookies configured as above;
[0164] Cookies for security group-related flow tables,
[0165] Configure security groups;
[0166] So the following flow table can be formed and sent down
[0167] Configure security group cookies;
[0168] Through the design of the above cookies, and with the help of bit operations, we can reversely find out the fields that make up the cookie.
[0169] You can also perform batch operations on flow tables. For example, if you want to delete a flow table of a certain vpc granularity, you can delete these flow tables in batches by taking out the vni field from the cookie through bit operations.
[0170] According to the above cookie design, flow table conflicts or overwriting can also be avoided.
[0171] For example, when adding security group rules, the following scenario may occur: the user first issues a rule to open port 80, and then adds a rule to open ports 50 to 100 (range). At this time, the rule id can be increased by 1 to generate a rule with a different cookie to open port 80, thereby effectively avoiding flow table conflicts and overwriting of the original flow table. If the user deletes a rule for port 80, it will not cause port 80 to be inaccessible.
[0172] Fig. 9 This is a schematic diagram of a one-dimensional data structure of an ETCD key in an embodiment of the present application, such as Fig. 9 As shown, the following is a design of the first dimension of the specific data structure of an ETCD key:
[0173] The ETCD key is designed with two dimensions: the node dimension and the vpc dimension. The values of the two dimensions have a cross-correlated relationship.
[0174] The key of the node dimension mainly refers to the information on the local device, including VM information and VPC information. VM mainly refers to which VMs are included on the local device, and VPC information refers to which VPCs are included on the host. VPC is identified by VNI, as shown in the following figure.
[0175] According to the architecture in the figure above, the following cross-related keys can be designed:
[0176] Identify which virtual machines a node contains;
[0177] Identify which vpcs a node contains
[0178] Identifies which node and which vpc a virtual machine belongs to.
[0179] Fig.10 This is a schematic diagram of another dimension data structure of ETCD key in one embodiment of the present application, such as Fig. 9 As shown, the following is a design of the second dimension of the specific data structure of the etcd key:
[0180] The key of the vpc (identified by vni) dimension includes VM information and SG security group information, which respectively indicate which VMs and security groups the vpc includes. The security group includes VM information and rule information.
[0181] According to the architecture in the figure above, the following cross-related keys can be designed:
[0182] Identify the virtual machines under a certain vpc;
[0183] Identify which security groups a certain vpc contains;
[0184] Identify which VMs are included in a security group
[0185] Identify which VPC and security group a VM belongs to
[0186] Identify the rules of a security group
[0187] Identifies which security group a rule belongs to
[0188] Through the above etcd two-dimensional key design, you can perform the following search:
[0189] Which VPCs are on a certain host?
[0190] Which VMs are on a certain host?
[0191] Which VMs are included in a certain VPC?
[0192] Which VPC of which host machine a certain VM belongs to;
[0193] Which security groups a certain vpc contains?
[0194] Which VMs are included in a security group?
[0195] Which security group of which vpc a certain VM belongs to;
[0196] Which host, which vpc, and which security group does a certain VM belong to?
[0197] What rules a security group has;
[0198] Which security group a rule belongs to;
[0199] In this way, in the virtual network, a mechanism similar to rabbitMQ-based service discovery can be implemented.
[0200] In addition, the above method can also be applied to other operations such as deleting a virtual machine, adding a virtual machine to a security group, removing a virtual machine from a security group, adding security group rules, and deleting security group rules.
[0201] In one embodiment, the present application also provides a state identification information generation system, the system comprising: a controller and an ETCD component, and a local device;
[0202] The controller is used to create a configuration instruction with configuration information according to a user request, and send the configuration instruction to the local device, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device;
[0203] The ETCD component is used to obtain the configuration instruction with configuration information sent by the controller and received in the local device; and configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; and is also used to generate status identification information according to the local configuration and network architecture of the configured device, wherein the status identification information is data information recording the local configuration and network architecture corresponding to the configured device.
[0204] In one embodiment, the system further comprises: at least one other device;
[0205] The controller is further used to create a subscription instruction according to a user request and send it to a local device;
[0206] The ETCD component is also used to receive subscription instructions that comply with predetermined rules; subscribe to the network architecture corresponding to other devices in the network according to the subscription instructions; obtain the target device in the network, wherein the target device is other devices having the same network architecture as the configuration device; and monitor the target device in the network.
[0207] In one embodiment, the data processing ETCD component is further used to record the data information of the local configuration corresponding to the target device in the state identification information of the local device.
[0208] Fig.11 FIG. 8 is a schematic diagram of an architecture 800 of a state identification information generating device in one embodiment of the present application. Fig.11 As shown, in one embodiment, the present application further provides a state identification information generating device, the device comprising:
[0209] A receiving module 101 is used to receive a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device;
[0210] A configuration module 102, configured to configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information;
[0211] The generating module 103 is used to generate state identification information according to the local configuration and the network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and the network architecture corresponding to the configuration device.
[0212] Fig.12 FIG. 9 is a schematic diagram of the architecture 900 of a state identification information generating device in one embodiment of the present application. Fig.12 As shown, in one embodiment, the device further includes:
[0213] The receiving module 101 is used to receive a subscription instruction that complies with a predetermined rule;
[0214] Subscription module 202, used to subscribe to the network architecture corresponding to other devices in the network according to the subscription instruction;
[0215] The acquisition module 203 is used to acquire a target device in the network, wherein the target device is another device having the same network architecture as the configuration device;
[0216] The monitoring module 204 is used to monitor the target device in the network.
[0217] In one embodiment, the device further comprises:
[0218] The recording module 301 is used to record the data information of the local configuration corresponding to the target device in the state identification information of the local device.
[0219] In one embodiment, the present application further provides a state identification information generating device, the device comprising: a processor and a memory;
[0220] The memory stores an application program executable by the processor, which is used to enable the processor to execute the step of generating the status identification information.
[0221] In one embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the state identification information generating step is implemented.
[0222] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating state identification information, characterized in that: The method includes: Receiving a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device; According to the local configuration information and the network configuration information, the local device and its network architecture are configured to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; Generate state identification information according to the local configuration and network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configuration device; the state identification information is used to identify the configuration device during data interaction; Wherein, after configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain the configuration device step, the method further includes: Monitoring a target device in a network, wherein the target device is another device having the same network architecture as the configuration device; The data information of the local configuration corresponding to the target device is recorded in the state identification information of the local device.
2. The method for generating state identification information according to claim 1, characterized in that: The target device in the monitoring network includes: Receive subscription instructions that meet predetermined rules; Subscribe to the network architecture corresponding to other devices in the network according to the subscription instruction; Get the target device in the network; The target device in the network is monitored.
3. The method for generating state identification information according to claim 1, characterized in that: The state identification information is a code flow table, wherein the code flow table records a flow table identification code, local configuration data information and network architecture data information corresponding to the local device, and local configuration data information corresponding to the target device.
4. The method for generating state identification information according to any one of claims 1 to 3, characterized in that: The local configuration information is configuration information for creating a virtual machine.
5. The method for generating state identification information according to claim 4, characterized in that: The network configuration information is configuration information for creating a VPC network architecture and / or configuration information for creating a network security group.
6. A method for generating state identification information, characterized in that: The method includes: Creating a configuration instruction with configuration information according to a user request, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device; The configuration instruction is sent to a local device so that the local device receives the configuration instruction with configuration information, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device; and the local device and its network architecture are configured according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; state identification information is generated according to the local configuration and network architecture of the configured device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configured device; the state identification information is used to identify the configured device during data interaction; Wherein, after configuring the local device and its network architecture according to the local configuration information and the network configuration information to obtain the configuration device step, the method further includes: Monitoring a target device in a network, wherein the target device is another device having the same network architecture as the configuration device; The data information of the local configuration corresponding to the target device is recorded in the state identification information of the local device.
7. The method for generating state identification information according to claim 6, characterized in that: The target device in the monitoring network includes: Create subscription instructions that meet predetermined rules based on user requests; The subscription instruction is sent to the local device so that the local device receives the subscription instruction that complies with the predetermined rules; the network architecture corresponding to other devices in the network is subscribed according to the subscription instruction; the target device in the network is acquired; and the target device in the network is monitored.
8. A state identification information generation system, characterized in that: The system includes: controller and ETCD components, and local equipment; The controller is used to create a configuration instruction with configuration information according to a user request, and send the configuration instruction to the local device, wherein the configuration information includes local configuration information for configuring the local device and network configuration information for configuring the network architecture of the local device; The ETCD component is used to obtain the configuration instruction with configuration information sent by the controller received in the local device; and configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configuration device, wherein the configuration device is a local device configured in accordance with the configuration information; and is also used to generate state identification information according to the local configuration and network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configuration device; the state identification information is used to identify the configuration device during data interaction; The system further includes: at least one other device; The ETCD component is also used to monitor the target device in the network; wherein the target device is other devices having the same network architecture as the configuration device; and the data information of the local configuration corresponding to the target device is recorded in the status identification information of the local device.
9. The state recognition information generating system according to claim 8, characterized in that: The controller is further used to create a subscription instruction according to a user request and send it to a local device; The ETCD component is also used to receive subscription instructions that comply with predetermined rules; subscribe to the network architecture corresponding to other devices in the network according to the subscription instructions; obtain the target device in the network, and monitor the target device in the network.
10. A state identification information generating device, characterized in that: The device includes: A receiving module, configured to receive a configuration instruction having configuration information, wherein the configuration information includes local configuration information for configuring a local device and network configuration information for configuring a network architecture of the local device; A configuration module, configured to configure the local device and its network architecture according to the local configuration information and the network configuration information to obtain a configured device, wherein the configured device is a local device configured in accordance with the configuration information; A generating module, configured to generate state identification information according to the local configuration and network architecture of the configuration device, wherein the state identification information is data information recording the local configuration and network architecture corresponding to the configuration device; the state identification information is used to identify the configuration device during data interaction; The device further comprises: A monitoring module, used to monitor a target device in the network; wherein the target device is another device having the same network architecture as the configuration device; The recording module is used to record the data information of the local configuration corresponding to the target device in the state identification information of the local device.
11. The state identification information generating device according to claim 10, characterized in that: The device also includes: The receiving module is used to receive a subscription instruction that complies with a predetermined rule; A subscription module, used to subscribe to the network architecture corresponding to other devices in the network according to the subscription instruction; An acquisition module, used to acquire a target device in the network; A monitoring module is used to monitor the target device in the network.
12. A state identification information generating device, characterized in that: The device comprises: a processor and a memory; The memory stores an application program executable by the processor, which is used to enable the processor to execute the steps of the state identification information generating method according to any one of claims 1 to 5.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the state identification information generating method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Virtualization management platform
CN106230954A
Virtual machine management method and device
CN108322325A