Client deployment method, client-based message processing method and system

Through container technology, the client and the host share the file system, and the VLAN tag is used to realize many-to-many message sending and receiving, which solves the problems of complex client deployment and low packet processing efficiency, and significantly improves the packet processing efficiency.

CN114880070BActive Publication Date: 2025-04-25WUHAN SIPU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210449304.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-04-25
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

The existing container-based clients do not share a file system with the host, resulting in the client system needing separate installation and deployment, and the packet processing efficiency is low.

Method used

By using container technology to create a minimum file system image and map the host's read-only system directory to the client, the client and the host share the same file system. At the same time, external VLAN tags and internal VLAN tags are used to realize many-to-many packet transmission and reception between the host physical interface and the client virtual interface.

Benefits of technology

It realizes the file system shared by the client and the host, simplifies the client deployment process, and greatly improves the efficiency of message processing through a many-to-many message sending and receiving mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880070B_ABST
    Figure CN114880070B_ABST
Patent Text Reader

Abstract

The present application provides a client deployment method, a client-based message processing method and system. The client is deployed in a host machine through container technology, and the read-only system directory of the host machine is mapped to the client machine, so that the client machine and the host machine share a file system; at the same time, the physical interface or sub-interface of the host machine is configured to the client machine. The client-based message processing method realizes many-to-many message reception and transmission between the host machine physical interface and the client machine virtual interface through external VLAN tags and internal VLAN tags, so that the message processing of the client machine is not limited by the number of physical interfaces of the host machine, which greatly improves the efficiency of message processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer virtualization, and in particular to a client deployment method, a client-based message processing method and system. Background Art

[0002] In the field of computer virtualization technology, the physical host running the virtual machine is called the host, and the virtual machine running on the host is called the client. Existing clients are generally based on hypervisor (virtual machine monitor) virtualization technology or container-based virtualization technology. Among them, the container-based client packages and isolates the user space, allowing multiple clients to run on the same host and share the host's operating system kernel. It has the advantages of fast startup, high resource utilization, and low performance overhead, and is widely used in the field of computer virtualization technology.

[0003] At present, the client based on container is equivalent to the process-level virtualization provided by the host operating system, which is a paravirtualization technology. The client does not share a file system with the host, and the client system needs to be installed and deployed separately. In addition, when processing messages, the existing client based on container still needs to switch between the kernel space and user space of the host to transmit message data, resulting in low message processing efficiency. Summary of the invention

[0004] In order to solve the problem that the existing client does not share a file system with the host, the client system needs to be installed and deployed separately, and the existing client-based message processing efficiency is low, the present application provides a client deployment method, a client-based message processing method and system through the following aspects.

[0005] A first aspect of the present application provides a method for deploying a client, comprising: using container technology to create a minimum file system image corresponding to a host machine;

[0006] Create a new client, and establish the corresponding communication directory and storage directory, map the host's read-only system directory to obtain the client's read-only system directory, and map the host's writable directory to the communication directory and storage directory to obtain the startup parameters;

[0007] Configure the host's physical interface or sub-interface to the client, obtain the client's virtual interface identifier according to the configuration sequence, and create a corresponding interface directory under the client's communication directory;

[0008] According to the startup parameters and the minimum file system image, the client is started, the interface directory is read, and the virtual interface of the client is initialized.

[0009] Optionally, use container technology to create a minimal file system image corresponding to the host machine, including:

[0010] Start the DOCKER service process;

[0011] According to the BUSYBOX environment of the host machine, use the DOCKER build command to create a minimum file system image.

[0012] The second aspect of the present application provides a message processing method based on a client, the message processing method is applied to a message processing system, the message processing system includes a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to the client machine deployment method provided in the first aspect of the present application; the message processing method includes: the host machine receives a message to be processed, and obtains an input interface corresponding to the message to be processed;

[0013] The host machine determines whether the inbound interface is allocated to the target client, wherein the target client is any client deployed in the host machine;

[0014] If the inbound interface is assigned to the target client, the host machine obtains the virtual interface identifier of the target client, generates an internal VLAN tag, and fills the internal VLAN tag into the message to be processed to obtain an intermediate processing message, and sends the intermediate processing message to the target client;

[0015] The target client receives the intermediate processing message, strips off the internal VLAN tag in the intermediate processing message, restores it to the message to be processed, and obtains the corresponding virtual interface according to the internal VLAN tag;

[0016] The target client identifies the incoming interface corresponding to the message to be processed as a virtual interface and performs corresponding service processing.

[0017] Optionally, the message processing method further includes: if the inbound interface is not allocated to the target client, the host machine determines whether there is an external VLAN tag in the message to be processed;

[0018] If there is an external VLAN tag in the message to be processed, the host obtains the sub-interface according to the external VLAN tag;

[0019] The host machine identifies the sub-interface as the input interface corresponding to the message to be processed, and simultaneously strips the external VLAN tag in the message to be processed, and continues to execute the step of determining whether the input interface is allocated to the target client.

[0020] Optionally, the message processing method further includes:

[0021] If there is no external VLAN tag in the message to be processed, the host machine performs corresponding service processing according to the message to be processed.

[0022] Optionally, the message processing method further comprises: after the target client completes the corresponding service processing, generating a message to be sent, wherein an internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client;

[0023] The host receives the message to be sent, removes the internal VLAN tag in the message to be sent, and finds the corresponding output interface according to the internal VLAN tag;

[0024] The host determines whether the interface is a sub-interface;

[0025] If the outgoing interface is not a sub-interface, the host sends the message to be sent through the outgoing interface.

[0026] Optionally, the message processing method also includes: if the outgoing interface is a sub-interface, the host machine fills the corresponding external VLAN tag in the message to be sent according to the sub-interface, obtains the target sending message, and sends the target message through the physical interface corresponding to the sub-interface.

[0027] The third aspect of the present application provides a client-based message processing system, comprising a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to the client machine deployment method provided in the first aspect of the present application;

[0028] The host machine is configured to: receive the message to be processed, obtain the input interface corresponding to the message to be processed; determine whether the input interface is allocated to the target client, wherein the target client is any client deployed in the host machine;

[0029] If the inbound interface is assigned to the target client, the host machine is configured to: obtain the virtual interface identifier of the target client, generate an internal VLAN tag, and fill the internal VLAN tag into the message to be processed to obtain an intermediate processing message, and send the intermediate processing message to the target client;

[0030] The client is configured to: receive the intermediate processing message, strip the internal VLAN tag in the intermediate processing message, restore it to the message to be processed, and obtain the corresponding virtual interface according to the internal VLAN tag; mark the input interface corresponding to the message to be processed as the virtual interface, and perform corresponding business processing.

[0031] Optionally, if the incoming interface is not assigned to a target client, the host is configured as follows:

[0032] Determine whether there is an external VLAN tag in the message to be processed;

[0033] If there is an external VLAN tag in the message to be processed, the sub-interface is obtained according to the external VLAN tag; the sub-interface is identified as the input interface corresponding to the message to be processed, and the external VLAN tag in the message to be processed is stripped, and the step of determining whether the input interface is assigned to the target client is continued;

[0034] If there is no external VLAN tag in the message to be processed, corresponding service processing is performed according to the message to be processed;

[0035] Optionally, the client is configured to: generate a message to be sent after completing the corresponding service processing, wherein an internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client;

[0036] The host machine is configured to: receive a message to be sent, strip the internal VLAN tag in the message to be sent, and find the corresponding output interface according to the internal VLAN tag; determine whether the output interface is a sub-interface;

[0037] If the outgoing interface is not a sub-interface, the host is configured to: send the message to be sent through the outgoing interface;

[0038] If the outgoing interface is a sub-interface, the host machine is configured to fill the corresponding external VLAN tag in the to-be-sent message according to the sub-interface, obtain the target sending message, and send the target message out through the physical interface corresponding to the sub-interface.

[0039] The present application provides a client deployment method, a client-based message processing method and system. The client is deployed in the host through container technology, and the read-only system directory of the host is mapped to the client at a ratio of 1:1, so that the client and the host share a file system; at the same time, the physical interface or sub-interface of the host is configured to the client. The client-based message processing method realizes many-to-many message reception and transmission between the host physical interface and the client virtual interface through external VLAN tags and internal VLAN tags, so that the message processing of the client is not limited by the number of physical interfaces of the host, greatly improving the efficiency of message processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic diagram of a workflow of a client deployment method provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of a workflow of a message processing method based on a client provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of the message header and VLAN tag data structure in a client-based message processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0044] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0045] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0046] In order to solve the problem that the existing client does not share a file system with the host, the client system needs to be installed and deployed separately, and the existing client-based message processing efficiency is low, the present application provides a client deployment method, a client-based message processing method and system through the following embodiments.

[0047] See also Figure 1 The first embodiment of the present application discloses a client deployment method, including steps 11 to 14.

[0048] Step 11, use container technology to create a minimum file system image corresponding to the host. This embodiment uses DOCKER container technology to deploy the client. First, the host starts the DOCKER service process; the process will respond to subsequent client configuration operations. According to the BUSYBOX environment of the host, the host uses the DOCKER build command to create a minimum file system image.

[0049] DOCKER is an open source application container engine that allows developers to package their applications and dependent packages into a portable image and then publish them to any popular Linux or Windows operating system machine. It can also be virtualized. The container is completely sandboxed and there is no interface between them.

[0050] Step 12, create a new client, and establish corresponding communication directories and storage directories, map the host's read-only system directory to obtain the client's read-only system directory, and map the host's writable directory to the communication directory and storage directory to obtain startup parameters. The read-only system directory includes the system directory that the host depends on when running.

[0051] Step 13, configure the physical interface or sub-interface of the host machine to the client machine, obtain the virtual interface identifier of the client machine according to the configuration sequence, and simultaneously establish a corresponding interface directory under the communication directory of the client machine.

[0052] Exemplarily, the user creates a new client on demand and sets the name of the client to guest_1. The host creates a directory with the same name in the / var / run / vsys / directory as a communication directory, and creates a sock_1 shared memory folder in the directory to facilitate message exchange between the client and the host. When the host binds the physical port ge1 to the client, it is also necessary to create a ge1 directory in the directory for the client to read the interface and interface MAC information assigned to it. The host can also bind sub-interfaces to the client; wherein, sub-interfaces are multiple logical interfaces virtualized from a physical interface through protocols and technologies. One client corresponds to one vhost (virtual host) data channel.

[0053] For example, the host machine's physical interface ge0 establishes two sub-interfaces ge0.1 and ge0.10. If the host machine binds ge0.10 to the client first and ge0.1 to the client second, then in the sequential bitmap data corresponding to the host machine, the virtual interface corresponding to the ge0.10 interface is identified as 1, that is, the ID in the corresponding sequential bitmap is 1, and the interface name on the client is ge0; the virtual interface corresponding to the ge0.1 interface is identified as 2, that is, the ID in the corresponding sequential bitmap is 2, and the interface name on the client is ge1.

[0054] The host allocates the storage directory / mnt / vsys / guest_1 to the client as data storage. The following directories of the host / lib, / lib64, / bin, / sbin, / usr / lib64, / usr / bin, / usr / sbin, / usr / share, / var / local_ro, / sys / kernel / mm / hugepages, / sys / devices / system / node are mapped to the client as read-only system directories in a 1:1 ratio, and the startup parameters are:

[0055] "docker run-it -d\

[0056] --env docker_ID=%d\

[0057] --name=%s\

[0058] --net=none\

[0059] --privileged=true\

[0060] --cap-add sys_ptrace\

[0061] -v / dev: / dev\

[0062] -v / lib: / lib:ro\

[0063] -v / lib64: / lib64:ro\

[0064] -v / bin: / bin:ro\

[0065] -v / sbin: / sbin:ro\

[0066] -v / etc: / etc\

[0067] -v / var / empty: / var / empty\

[0068] -v / usr / lib64: / usr / lib64:ro\

[0069] -v / usr / bin: / usr / bin:ro\

[0070] -v / usr / sbin: / usr / sbin:ro\

[0071] -v / usr / share: / usr / share:ro\

[0072] -v / var / local_ro: / var / local_ro:ro\

[0073] -v / dpdk_huge: / dpdk_huge\

[0074] -v / sys / kernel / mm / hugepages: / sys / kernel / mm / hugepages\

[0075] -v / sys / devices / system / node: / sys / devices / system / node\

[0076] -v / mnt / vsys / guest_1: / mnt / \

[0077] -v / var / run / vsys / guest_1: / var / run / vsys / \

[0078] %s %s / sbin / init".

[0079] Step 14, starting the client according to the startup parameters and the minimum file system image, reading the interface directory, and initializing the virtual interface of the client.

[0080] The client obtained by the client deployment method provided by the embodiment of the present application shares the same file system with the host, omitting the process of deploying the client system. At the same time, the host physical interface or sub-interface is bound to the client data channel, avoiding the limitation of the number of physical interfaces of the host and increasing the application scenarios of the host.

[0081] Exemplarily, the client deployment method provided in this embodiment can be used to virtualize the firewall system on the host machine. In the operator's environment, the access device generally has a very high hardware configuration. If only one firewall system is supported, the user usage is limited, which will cause a waste of resources. Using the client deployment method provided in this embodiment to virtualize the host machine, multiple independent firewall systems can be provided to the outside, more users can be supported, and the computing resources and storage resources of the access device can be effectively utilized.

[0082] When processing messages, existing container-based clients still need to switch between the kernel space and user space of the host machine to transmit message data, resulting in low message processing efficiency. Moreover, the existing client-based message processing methods can only handle simple operations such as message exchange, and cannot handle detailed operations such as message analysis and protection. Exemplarily, the firewall system needs to process 4-7 layer message inspection, analysis and recording operations, and needs to release and intercept messages based on status. The second embodiment of the present application, based on the client deployed based on the first embodiment, provides a client-based message processing method that can solve the above-mentioned problems such as low message processing efficiency and inability to process messages in detail.

[0083] The client-based message processing method provided in the second embodiment of the present application is applied to a message processing system, wherein the message processing system includes a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to the client machine deployment method described in the first embodiment of the present application, which is equivalent to the message processing system providing multiple independent host machine systems to the outside. Exemplarily, the host machine system is a firewall system, and the message processing system is equivalent to providing multiple independent firewall systems with the same functions to the outside. See Figure 2 The client-based message processing method provided in this embodiment includes steps 21-25.

[0084] Step 21, the host receives the message to be processed and obtains the input interface corresponding to the message to be processed. In this embodiment, the host network card driver adopts DPDK (Intel Data Plane Development Kit) driver. The network card driver DPDK receives the message to be processed and finds the corresponding input interface on the host according to the MAC header in the message header of the message to be processed.

[0085] Among them, DPDK is a data plane development tool set provided by Intel, which provides library functions and driver support for efficient data packet processing in user space under the Intel architecture (IA) processor architecture. It is different from the Linux system, which is designed for universality, but focuses on high-performance processing of data packets in network applications. It has been verified that it can run on most Linux operating systems. DPDK uses BSDLicense, which greatly facilitates enterprises to implement their own protocol stacks or applications based on it.

[0086] Step 22: The host determines whether the input interface is allocated to the target client, wherein the target client is any client deployed in the host.

[0087] Step 23, if the input interface is assigned to the target client, the host obtains the virtual interface identifier of the target client, generates an internal VLAN tag, and fills the internal VLAN tag into the message to be processed to obtain an intermediate processing message, and sends the intermediate processing message to the target client.

[0088] In this embodiment, many-to-many message transmission and reception between the host and the client is realized through VLAN (Virtual Local Area Network) technology. Among them, VLAN is a group of logical devices and users. These devices and users are not restricted by physical locations. They can be organized according to factors such as functions, departments and applications. The communication between them is as if they are in the same network segment, hence the name virtual local area network. Since the switch port has two VLAN attributes, one is VLAN ID, which is used for VLAN to set VLAN Tag for data packets; the other is VLAN Tag, which is used for VLAN Tag data packets allowed to pass through by VLAN. Ports with different VLAN IDs can build VLANs by allowing VLAN Tags to each other.

[0089] See also Figure 3 , is a schematic diagram of the packet header and VLAN tag data structure in the client-based packet processing method provided in an embodiment of the present application. Figure 3 As shown, the message header generally includes a MAC header (Destination Address+SourceAddress+Type / len). If a VLAN tag (Tag) needs to be added to the message, the VLAN tag is inserted into the MAC header.

[0090] Exemplarily, the host generates an internal VLAN tag according to the virtual interface identifier, i.e., the sequential ID, in the sequential bitmap data formed during the client deployment process. The internal VLAN tag is only used to identify the interface between the host and the client. The host adds the internal VLAN tag to the message header, and the client removes the internal VLAN tag after receiving the message. The internal VLAN tag will not be released to the network outside the message processing system. The host adds the internal VLAN tag to the message to be processed, obtains the intermediate processing message, sends the intermediate processing message to the data channel corresponding to the target client, and the target client receives the intermediate processing message from the data channel. In this embodiment, the virtual network card of the client is driven by DPDK.

[0091] Step 24, the target client receives the intermediate processing message, strips off the internal VLAN tag in the intermediate processing message, restores it to the message to be processed, and obtains the corresponding virtual interface according to the internal VLAN tag.

[0092] Step 25: The target client identifies the incoming interface corresponding to the message to be processed as a virtual interface and performs corresponding service processing.

[0093] The DPDK driver of the target client receives the intermediate processing message from the data channel, then strips off the internal VLAN tag, restores it to the message to be processed, and searches for the virtual interface based on the internal VLAN tag. The target client identifies the incoming interface of the message to be processed as the virtual interface and performs service processing.

[0094] In one implementation, if the incoming interface found by the message to be processed is not assigned to the client, it is further determined whether there is an external VLAN tag in the message header of the message to be processed. The external VLAN tag is relative to the internal VLAN tag in this embodiment, and is used to distinguish whether it is a VLAN tag contained in the message to be processed itself (corresponding to the external VLAN tag) or a VLAN tag used to identify the interface between the host and the client in the message processing system (corresponding to the internal VLAN tag). Figure 2 The message processing method provided in this embodiment also includes steps 26-28.

[0095] Step 26: If the inbound interface is not assigned to the target client, the host determines whether there is an external VLAN tag in the message to be processed.

[0096] Step 27: If the message to be processed contains an external VLAN tag, the host machine obtains the sub-interface according to the external VLAN tag.

[0097] In step 28, the host machine identifies the sub-interface as the input interface corresponding to the message to be processed, and simultaneously strips the external VLAN tag in the message to be processed, and continues to execute the step of determining whether the input interface is assigned to the target client, that is, jumps back to step 22 to continue execution.

[0098] In this embodiment, the host machine will allocate a VLAN tag when establishing a sub-interface. If the received message to be processed has an external VLAN tag, the system will find the corresponding sub-interface according to the ID value in the external VLAN tag, mark it as the inbound interface in step 22, and then re-execute steps 22-25.

[0099] For example, sub-interfaces ge0.1 and ge0.10 are established on the physical interface ge0 of the device. If ge0 receives two packets with external VLAN tags, one with an external VLAN tag of 1 and the other with an external VLAN tag of 10, the ge0 interface will strip the external VLAN tag of the packet with the external VLAN tag of 1 and send it to the sub-interface ge0.1, and strip the external VLAN tag of the packet with the external VLAN tag of 10 and send it to ge0.10.

[0100] Internal VLAN tag means that if the host binds sub-interface ge0.10 to the client first and sub-interface ge0.1 to the client second, then in the sequence bitmap data of the host, the virtual interface identifier corresponding to sub-interface ge0.10, that is, the sequence ID is 1, and the virtual interface on the client is ge0; the virtual interface identifier corresponding to sub-interface ge0.1, that is, the sequence ID is 2, and the virtual interface on the client is ge1. At this time, if there is a message to be processed sent by the host physical interface ge0 to sub-interface ge0.10, in order to ensure that the message to be processed is accurately sent to the virtual interface ge0 of the client, the internal VLAN tag is added to the message header of the message to be processed again to obtain the intermediate processing message, in which the internal VLAN tag is set to the sequence ID of ge0.10, that is, 1. Then, after receiving the intermediate processing message, the virtual interface ge0 of the client will strip off the internal VLAN tag header and restore it to the message to be processed.

[0101] In some embodiments, there is a situation where there is no external VLAN tag in the message to be processed. Figure 2 The message processing method provided in this embodiment also includes step 29: if there is no external VLAN tag in the message to be processed, the host machine performs corresponding service processing according to the message to be processed.

[0102] The client-based message processing method provided in this embodiment realizes many-to-many message reception and transmission between the host machine physical interface and the client machine virtual interface through external VLAN tags and internal VLAN tags, so that the message processing of the client machine is not limited by the number of physical interfaces of the host machine, and the message processing efficiency is greatly improved. At the same time, the client machine and the host machine share the same file system, and the client machine can perform complex message processing operations.

[0103] After processing the service corresponding to the message to be processed, the client generates a message to be sent and sends the message to be sent according to steps 31-35.

[0104] Step 31: After the target client completes the corresponding service processing, it generates a message to be sent, wherein the internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client.

[0105] Step 32: The host receives the message to be sent, removes the internal VLAN tag in the message to be sent, and finds the corresponding output interface according to the internal VLAN tag.

[0106] The target client sends the message to be sent to the corresponding data channel connected to the host. The host traverses the data channel of each client. When receiving the message to be sent from the data channel of a client, the internal VLAN tag is stripped off, and the interface associated with the internal VLAN tag is found from the sequence bitmap data according to the internal VLAN tag, and set as the outbound interface of the message to be sent.

[0107] Step 33, the host determines whether the outgoing interface is a sub-interface. Corresponding to the step of the message processing system receiving the message to be processed, the outgoing interface found according to the internal VLAN tag may be a sub-interface or a physical interface, so it is necessary to determine according to the outgoing interface before proceeding to the next step of message sending.

[0108] Step 34: If the outgoing interface is not a sub-interface, the host sends the message to be sent through the outgoing interface. If the outgoing interface is a physical interface, the host directly sends the message to be sent through the outgoing interface.

[0109] Step 35, if the outgoing interface is a sub-interface, the host machine fills the corresponding external VLAN tag in the message to be sent according to the sub-interface, obtains the target message to be sent, and sends the target message through the physical interface corresponding to the sub-interface.

[0110] If the outgoing interface is a sub-interface, the host adds an external VLAN tag to the message to be sent according to the VLAN tag of the sub-interface to obtain the target message, and sets the outgoing interface of the target message to the physical interface associated with the sub-interface. The host sends the target message from the corresponding physical interface to the external device.

[0111] It should be noted that if the input interface in this embodiment is not assigned to the target client and there is no external VLAN tag in the message to be processed, and the host machine performs corresponding business processing based on the message to be processed, then the host machine generates a message to be sent after processing the corresponding business, and sends the message to be sent directly from the output interface corresponding to the input interface to the external device.

[0112] The third embodiment of the present application provides a client-based message processing system, including a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to the client deployment method provided in the first embodiment of the present application.

[0113] The host machine is configured to: receive the message to be processed, obtain the input interface corresponding to the message to be processed; and determine whether the input interface is allocated to a target client, wherein the target client is any client deployed in the host machine.

[0114] If the input interface is assigned to the target client, the host is configured to: obtain the virtual interface identifier of the target client, generate an internal VLAN tag, and fill the internal VLAN tag into the message to be processed, obtain an intermediate processing message, and send the intermediate processing message to the target client.

[0115] The client is configured to: receive the intermediate processing message, strip the internal VLAN tag in the intermediate processing message, restore it to the message to be processed, and obtain the corresponding virtual interface according to the internal VLAN tag; mark the input interface corresponding to the message to be processed as the virtual interface, and perform corresponding business processing.

[0116] In some embodiments, if the input interface is not assigned to the target client, the host machine is configured to: determine whether there is an external VLAN tag in the message to be processed; if there is an external VLAN tag in the message to be processed, obtain a sub-interface based on the external VLAN tag; identify the sub-interface as the input interface corresponding to the message to be processed, and at the same time strip off the external VLAN tag in the message to be processed, and continue to execute the step of determining whether the input interface is assigned to the target client; if there is no external VLAN tag in the message to be processed, perform corresponding business processing according to the message to be processed.

[0117] In some embodiments, the client is configured to: generate a message to be sent after completing corresponding service processing, wherein an internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client.

[0118] The host machine is configured to: receive a message to be sent, strip an internal VLAN tag in the message to be sent, and find a corresponding output interface according to the internal VLAN tag; and determine whether the output interface is a sub-interface.

[0119] If the outgoing interface is not a sub-interface, the host machine is configured to send the message to be sent through the outgoing interface.

[0120] If the outgoing interface is a sub-interface, the host machine is configured to fill the corresponding external VLAN tag in the to-be-sent message according to the sub-interface, obtain the target sending message, and send the target message out through the physical interface corresponding to the sub-interface.

[0121] The effects of applying the client-based message processing method in the above system can be found in the description of the first and second embodiments of the present application, and will not be repeated here.

[0122] In a specific implementation, the present application also provides a computer-readable storage medium, which includes instructions. The computer-readable storage medium set in any device can implement the following when it is executed on a computer: Figure 1 to Figure 2The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0123] The various illustrative logic units and circuits described in the embodiments of the present application can be implemented or operated by a general-purpose processor, a digital information processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or the design of any combination of the above functions. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any traditional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital information processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital information processor core, or any other similar configuration to implement.

[0124] The steps of the method described in the embodiments of the present application can be directly embedded in hardware, a software unit executed by a processor, or a combination of the two. The software unit can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a UE. Optionally, the processor and the storage medium can also be arranged in different components in the UE.

[0125] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0127] The same or similar parts between the various embodiments of this specification can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

[0128] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.

[0129] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.

Claims

1. A message processing method based on a client, characterized in that: The message processing method is applied to a message processing system, the message processing system includes a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to a client machine deployment method, and the client machine deployment method includes: using container technology to create a minimum file system image corresponding to the host machine; Create a new client, and establish a corresponding communication directory and storage directory, map the read-only system directory of the host machine to obtain the read-only system directory of the client machine, and map the writable directory of the host machine to the communication directory and the storage directory to obtain startup parameters; Configure the physical interface or sub-interface of the host machine to the client machine, obtain the virtual interface identifier of the client machine according to the configuration order, and simultaneously establish a corresponding interface directory under the communication directory of the client machine; According to the startup parameters and the minimum file system image, the client is started, the interface directory is read, and the virtual interface of the client is initialized; The message processing method comprises: The host receives the message to be processed and obtains the input interface corresponding to the message to be processed; The host machine determines whether the input interface is allocated to a target client, wherein the target client is any client deployed in the host machine; If the inbound interface is assigned to the target client, the host machine obtains the virtual interface identifier of the target client, generates an internal VLAN tag, and fills the internal VLAN tag into the message to be processed to obtain an intermediate processing message, and sends the intermediate processing message to the target client; The target client receives the intermediate processing message, strips off the internal VLAN tag in the intermediate processing message, restores it to the message to be processed, and obtains the corresponding virtual interface according to the internal VLAN tag; The target client identifies the incoming interface corresponding to the message to be processed as the virtual interface, and performs corresponding service processing.

2. The method for processing messages based on a client according to claim 1, characterized in that: The method of using container technology to create a minimum file system image corresponding to the host machine includes: Start the DOCKER service process; According to the BUSYBOX environment of the host machine, the minimum file system image is created using the build command of DOCKER.

3. The method for processing messages based on a client according to claim 1, characterized in that: The message processing method further includes: If the inbound interface is not allocated to the target client, the host determines whether there is an external VLAN tag in the message to be processed; If the external VLAN tag exists in the message to be processed, the host machine obtains the sub-interface according to the external VLAN tag; The host machine identifies the sub-interface as the inbound interface corresponding to the message to be processed, and simultaneously strips off the external VLAN tag in the message to be processed, and continues to execute the step of determining whether the inbound interface is allocated to the target client.

4. The method for processing messages based on a client according to claim 3, characterized in that: The message processing method further includes: If the external VLAN tag does not exist in the message to be processed, the host machine performs corresponding service processing according to the message to be processed.

5. The method for processing messages based on a client according to claim 3, characterized in that: The message processing method further includes: After the target client completes the corresponding service processing, a message to be sent is generated, wherein the internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client; The host receives the message to be sent, removes the internal VLAN tag in the message to be sent, and finds a corresponding output interface according to the internal VLAN tag; The host machine determines whether the outgoing interface is the sub-interface; If the outgoing interface is not the sub-interface, the host machine sends the message to be sent through the outgoing interface.

6. The method for processing messages based on a client according to claim 5, characterized in that: The message processing method further includes: If the outgoing interface is the sub-interface, the host machine fills the corresponding external VLAN tag in the message to be sent according to the sub-interface, obtains a target sending message, and sends the target sending message through the physical interface corresponding to the sub-interface.

7. A client-based message processing system, characterized in that: The system comprises a host machine and at least one client machine, wherein the client machine is deployed in the host machine according to a client machine deployment method, and the client machine deployment method comprises: using container technology to create a minimum file system image corresponding to the host machine; Create a new client, and establish a corresponding communication directory and storage directory, map the read-only system directory of the host machine to obtain the read-only system directory of the client machine, and map the writable directory of the host machine to the communication directory and the storage directory to obtain startup parameters; Configure the physical interface or sub-interface of the host machine to the client machine, obtain the virtual interface identifier of the client machine according to the configuration order, and simultaneously establish a corresponding interface directory under the communication directory of the client machine; According to the startup parameters and the minimum file system image, the client is started, the interface directory is read, and the virtual interface of the client is initialized; The host machine is configured to: receive a message to be processed, obtain an input interface corresponding to the message to be processed; determine whether the input interface is allocated to a target client, wherein the target client is any client deployed in the host machine; If the inbound interface is assigned to the target client, the host machine is configured to: obtain the virtual interface identifier of the target client, generate an internal VLAN tag, and fill the internal VLAN tag into the message to be processed to obtain an intermediate processing message, and send the intermediate processing message to the target client; The client is configured to: receive the intermediate processing message, strip off the internal VLAN tag in the intermediate processing message, restore it to the message to be processed, and obtain the corresponding virtual interface according to the internal VLAN tag; identify the input interface corresponding to the message to be processed as the virtual interface, and perform corresponding business processing.

8. The message processing system according to claim 7, characterized in that: If the inbound interface is not assigned to the target client, the host machine is configured as follows: Determining whether there is an external VLAN tag in the message to be processed; If the external VLAN tag exists in the message to be processed, a sub-interface is obtained according to the external VLAN tag; the sub-interface is identified as the input interface corresponding to the message to be processed, and the external VLAN tag in the message to be processed is stripped off, and the step of determining whether the input interface is assigned to the target client is continued; If the external VLAN tag does not exist in the message to be processed, corresponding service processing is performed according to the message to be processed.

9. The message processing system according to claim 8, characterized in that: The client is configured to: generate a message to be sent after completing the corresponding service processing, wherein the internal VLAN tag in the message to be sent is filled according to the virtual interface identifier of the target client; The host machine is configured to: receive the message to be sent, strip the internal VLAN tag in the message to be sent, and find the corresponding output interface according to the internal VLAN tag; determine whether the output interface is the sub-interface; If the outgoing interface is not the sub-interface, the host machine is configured to: send the message to be sent through the outgoing interface; If the outgoing interface is the sub-interface, the host machine is configured to fill the corresponding external VLAN tag in the message to be sent according to the sub-interface, obtain a target sending message, and send the target sending message through the physical interface corresponding to the sub-interface.

Citation Information

Patent Citations

  • Multi-instance graphic desktop running and switching method based on container technology

    CN110837405A

  • Data network microsegmentation

    US9560081B1