A data transmission method and device, electronic equipment and storage medium

CN122601634APending Publication Date: 2026-08-18HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510176719.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请提供一种数据传输方法、装置、电子设备及存储介质,以利于解决现有技术中处于不同网段的终端设备的容器无法与外部设备进行通信的问题

Benefits of technology

[0023] Thirdly, embodiments of this application provide an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method described in any of the first aspects above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601634A_ABST
    Figure CN122601634A_ABST
Patent Text Reader

Abstract

The data transmission method and device, the electronic device, and the storage medium provided in the embodiments of the present application are applied to a terminal device, at least one container is created in the terminal device, the method comprises the following steps: receiving a first data packet sent by a sender; analyzing the first data packet to obtain transmission information in the first data packet; determining a target space of the first data packet based on the transmission information of the first data packet and stored space index information; the space index information comprises index information of the at least one created container and index information of the terminal device; the target space comprises a container or the terminal device; and transmitting the first data packet to the target space. The purpose of realizing communication between containers in different network segments and external devices is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically to a data transmission method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of cloud computing technology, containerization is gradually becoming the latest technological trend in the cloud computing field. Containerization is a form of operating system virtualization technology that allows users to run applications in isolated user spaces using the same shared operating system. Therefore, container technology has advantages over virtual machine technology, such as resource saving, flexible deployment, easy expansion, and simplified operation. Container technology provides the ability to package and run applications in a completely isolated environment through a container engine; this isolated environment is usually called a container. Compared to virtual machine technology, container technology is more lightweight, ensuring the consistency of the program's runtime environment, reducing the complexity and cost of configuring development and production environments, and enabling rapid program deployment. Therefore, deploying containers in terminal devices expands the capabilities of these devices. Because the network segment of a container is different from that of an external device, container applications on a terminal device cannot directly communicate with external devices. How to enable containers on a terminal device to communicate with external devices has become a problem that urgently needs to be solved. Summary of the Invention

[0003] In view of this, this application provides a data transmission method, apparatus, electronic device, and storage medium to help solve the problem in the prior art that containers of terminal devices located in different network segments cannot communicate with external devices.

[0004] In a first aspect, embodiments of this application provide a data transmission method applied to a terminal device, wherein at least one container is created in the terminal device. The method includes: receiving a first data packet sent by a sender; parsing the first data packet to obtain transmission information in the first data packet; determining a target space for the first data packet based on the transmission information of the first data packet and stored spatial index information; the spatial index information includes index information of at least one created container and index information of the terminal device; the target space includes the container or the terminal device; and transmitting the first data packet to the target space.

[0005] In this embodiment, the terminal device can transmit the first data packet sent by the sender to the target space, achieving communication between containers in different network segments and external devices. Furthermore, it eliminates the need for assistance from other servers, improving the performance of cross-network segment transmission and reducing transmission latency.

[0006] In one possible implementation of the first aspect, determining the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information includes: determining the first space in at least one search space of the terminal device based on the stored spatial index information; and determining the first space as the target space if a target application exists in the first space based on the transmission information of the first data packet; wherein the target application is an application whose monitored transmission information matches the transmission information of the first data packet.

[0007] In this way, the terminal device can check whether the target application exists in the search space in the terminal device one by one according to the transmission information of the first data packet, and determine the space where the target application exists as the target space of the first data packet, so as to realize cross-network segment transmission and achieve the purpose of data communication between different containers in the terminal device and external devices.

[0008] One possible implementation of the first aspect also includes:

[0009] If the target application does not exist in the first space, the first space is re-determined based on the stored space index information in at least one search space on the terminal device. In this way, the terminal device can check the search spaces one by one to determine the target space of the first data packet based on the transmission information of the first data packet, thereby achieving cross-network segment transmission and realizing the purpose of data communication between different containers in the terminal device and external devices.

[0010] In one possible implementation of the first aspect, determining the first space in at least one searchable space of the terminal device based on stored spatial index information includes:

[0011] Based on the stored spatial index information, and according to preset priority information, a first space is determined from at least one search space on the terminal device; wherein, the priority of the terminal device's index information is higher than the priority of the index information of at least one container in the preset priority information. In this way, according to the preset priority information, the search space with higher priority is preferentially determined as the first space, so as to determine whether the first space is the target space of the first data packet, thereby improving the efficiency of data communication.

[0012] In one possible implementation of the first aspect, before determining the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information, the method further includes:

[0013] The stored addressing information is searched based on the transmission information of the first data packet; the addressing information records the correspondence between the transmission information of the second data packet of the terminal device and the target space of the second data packet; the second data packet is the data packet received by the terminal device and transmitted to the corresponding target space;

[0014] Based on the transmission information of the first data packet and the stored spatial index information, the target space of the first data packet is determined to include:

[0015] If no spatial information matching the transmission information of the first data packet is found in the stored addressing information, the target space of the first data packet is determined based on the transmission information of the first data packet and the stored spatial index information.

[0016] In this way, after parsing the transmission information of the first data packet, we can first search the stored addressing information to see if there is any information that matches the first data packet. Only when there is no information that matches the first data packet in the addressing information, the target space of the first data packet is determined based on the transmission information of the first data packet and the stored spatial index information. This can reduce communication overhead and improve the efficiency of data communication.

[0017] In one possible implementation of the first aspect, it further includes: if spatial information matching the transmission information of the first data packet is found in the stored addressing information, then the spatial information matching the transmission information of the first data packet in the stored addressing information is determined as the target space of the first data packet.

[0018] In this way, the terminal device can determine the target space of the first data packet by querying the addressing information, without having to search for the target space in the existing space of the terminal device based on the stored space index information. This improves the transmission efficiency of the first data packet, thereby improving the efficiency of data communication and reducing communication latency.

[0019] In one possible implementation of the first aspect, the method further includes: updating the stored addressing information based on the transmission information and target space of the first data packet, so that subsequent data packets can directly determine the target space based on the addressing information, thereby improving the efficiency of data communication and reducing communication latency.

[0020] One possible implementation of the first aspect also includes: creating at least one container; and updating the stored space index information based on at least one container. This can meet the user's need for containers and improve the user experience.

[0021] In one possible implementation of the first aspect, the transmission information includes at least one of port information, protocol information, IP address information, and data packet keyword information. This allows the determination of the target space for the first data packet to be based on at least one of the port information, protocol information, IP address information, and data packet keyword information, improving the accuracy of data communication and thus enhancing the user experience.

[0022] Secondly, embodiments of this application provide a data transmission apparatus, comprising: a receiving unit for receiving a first data packet sent by a sender; a processing unit for parsing the first data packet to obtain transmission information in the first data packet; the processing unit is further configured to determine a target space for the first data packet based on the transmission information of the first data packet and stored spatial index information; the spatial index information includes index information of at least one created container and index information of a terminal device; the target space includes a container or a terminal device; and a sending unit for transmitting the first data packet to the target space.

[0023] Thirdly, embodiments of this application provide an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method described in any of the first aspects above.

[0024] Fourthly, embodiments of this application provide a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the method described in any of the first aspects above.

[0025] It is understood that the beneficial effects achieved by the apparatus, electronic equipment, computer-readable storage medium, and computer program product provided in the second to fourth aspects above can be referred to with reference to the beneficial effects in the first aspect and any possible implementation provided above, and will not be repeated here. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1a This is a schematic diagram of a data communication process in some technologies;

[0028] Figure 1b This is a schematic diagram illustrating another data communication process in some technologies;

[0029] Figure 1c This is a schematic diagram of a data communication process in some other technologies;

[0030] Figure 2a This is a schematic diagram of the structure of a data transmission system provided in an embodiment of this application;

[0031] Figure 2bThis is a schematic diagram of the structure of a terminal device 21 provided in an embodiment of this application;

[0032] Figure 2c A software structure block diagram of a terminal device 21 provided in this application embodiment

[0033] Figure 3 A flowchart illustrating a data transmission method provided in an embodiment of this application;

[0034] Figure 4 A flowchart illustrating another data transmission method provided in an embodiment of this application;

[0035] Figure 5 A flowchart illustrating another data transmission method provided in an embodiment of this application;

[0036] Figure 6 A flowchart illustrating another data transmission method provided in an embodiment of this application;

[0037] Figure 7 A flowchart illustrating another data transmission method provided in an embodiment of this application;

[0038] Figure 8 A flowchart illustrating another data transmission method provided in this application embodiment.

[0039] Figure 9 This is a schematic diagram of a data transmission device structure provided in an embodiment of this application;

[0040] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0041] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0042] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0043] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0044] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0045] Before providing a detailed description of the embodiments of this application, the terms used or possibly used in the embodiments of this application will first be explained.

[0046] With the development of cloud computing technology, containerization is gradually becoming the latest technological trend in the cloud computing field. Containerization is a form of operating system virtualization technology that allows users to run applications in isolated user spaces using the same shared operating system. Therefore, container technology has advantages over virtual machine technology, such as resource saving, flexible deployment, easy expansion, and simplified operation. Container technology provides the ability to package and run applications in a completely isolated environment through a container engine; this isolated environment is usually called a container. Compared to virtual machine technology, container technology is more lightweight, ensuring the consistency of the program's runtime environment, reducing the complexity and cost of configuring development and production environments, and enabling rapid program deployment. Therefore, containers are deployed in terminal devices to expand the capabilities of these devices. Because the network segment of the container is different from that of the external device, container applications in the terminal device cannot directly communicate with the external device. How to enable containers on the terminal device to communicate with external devices has become an urgent problem to be solved.

[0047] In some technologies, containers within terminal devices can act as clients to communicate with servers on the external network via NAT (Network Address Translation) devices. For example... Figure 1a The specific process is as follows:

[0048] Step a: The client encapsulates the source IP (Internet Protocol) address of the message into its own internal network IP address and sends it to the NAT device.

[0049] Step b: The NAT device receives the packet and modifies the source IP address in the packet to the IP address of the external server (hereinafter referred to as the external IP address), forwards the packet to the server, and records the mapping information between the internal IP address and the external IP address.

[0050] Step c: After receiving the uplink message, the server replies with a downlink message to the NAT device.

[0051] Step d: Based on the recorded address mapping information, the NAT device modifies the destination IP of the packets received from the external server to the client's internal IP address and forwards the downlink packets to the client.

[0052] In the aforementioned communication process, the container on the terminal device can only act as a client to communicate with the external server. That is, the client must first send data to the external server before data communication can occur. Communication is not possible in scenarios where the container on the terminal device acts as a server, receiving data sent by an external client.

[0053] Furthermore, the aforementioned communication process cannot handle scenarios where the 5-tuples in the uplink and downlink data packets are asymmetrical. For example, in some printer scenarios, the terminal device sends broadcast data packets, but the printer replies with unicast data packets where the source address in the downlink data packet does not match the destination address in the uplink data packet. The NAT device cannot find valid address mapping information to forward the downlink data packet, such as... Figure 1b As shown.

[0054] In other technologies, clients on two different network segments achieve direct communication with the assistance of a NAT traversal server. For example... Figure 1c The specific process is as follows:

[0055] Step a: Client 1 sends a connection request to client 2 via NAT traversal of the server.

[0056] Step b: The NAT traversal server records the external IP addresses and port information of client 2 and client 1, and forwards the external IP address and port information of client 2 to client 1, and forwards the external IP address and port information of client 1 to client 2.

[0057] Step c: Client 1 and Client 2 communicate data based on each other's external IP address and port information, without the need for server forwarding.

[0058] The above communication process requires the assistance of a NAT traversal server to complete data communication, making it impossible to achieve high-performance and low-latency communication.

[0059] To address the aforementioned problems, this application provides a data transmission method. A terminal device creates at least one container. The terminal device receives a first data packet sent by a sender; parses the first data packet to obtain transmission information; determines the target space of the first data packet based on the transmission information and stored space index information; and transmits the first data packet to the target space. In this application embodiment, after receiving the first data packet, the terminal device can parse the transmission information in the first data packet and determine the target space corresponding to the first data packet among multiple spaces contained in the terminal device, thereby transmitting the first data packet to the target space. That is, in this application embodiment, the terminal device can transmit the received first data packet sent by the sender to different spaces, realizing the purpose of communication between containers in different network segments and external devices. Furthermore, it does not require the assistance of other servers, improving the performance of cross-network segment transmission and reducing transmission latency. A detailed description follows.

[0060] In the embodiments of this application, the data transmission method can be applied to a terminal device. Besides mobile phones, the terminal devices involved in the embodiments of this application can also be tablet computers, personal computers (PCs), personal digital assistants (PDAs), and other devices that can use containers.

[0061] It should be noted that in some possible implementations, the terminal device may also be referred to as electronic device, user equipment (UE), etc., and the embodiments of this application do not limit this.

[0062] See Figure 2a This is a schematic diagram of a data transmission system provided in an embodiment of this application. The data transmission system includes a terminal device 21 and a sending device 22.

[0063] In this embodiment, the sending device 22 can be a mobile phone or a printer. Of course, the sending device 22 can also be other devices capable of communicating with the terminal device; this application does not impose any limitations on this. The sending device 22 can send a first data packet to the terminal device 21. The terminal device 21 can receive the first data packet and parse it to obtain the transmission information within it. Based on the transmission information of the first data packet, the destination space of the first data packet is determined, and the first data packet is sent to its destination space, thereby achieving cross-network segment addressing and management of the first data packet and completing the purpose of communication between the sending device 22 and the terminal device.

[0064] refer to Figure 2b This is a schematic diagram of the structure of a terminal device 21 provided in an embodiment of this application.

[0065] like Figure 2b As shown, the terminal device 21 may include a processor 210, an external memory interface 220, an internal memory 221, a display screen 230, an antenna 1, an antenna 2, a mobile communication module 240, and a wireless communication module 250, etc.

[0066] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the terminal device 21. In other embodiments, the terminal device 21 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0067] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0068] The controller can serve as the central nervous system and command center of the terminal device 21. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0069] Video codecs are used to compress or decompress digital video. Terminal device 21 may support one or more video codecs. Thus, terminal device 21 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, etc.

[0070] NPU stands for Neural Network (NN) Computing Processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in terminal devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0071] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0072] In some embodiments, the processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0073] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to a display screen 230, a camera 220, a wireless communication module 260, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0074] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the terminal device 21. In other embodiments of this application, the terminal device 21 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0075] The external storage interface 220 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device 21. The external storage card communicates with the processor 210 through the external storage interface 220 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0076] Internal memory 221 can be used to store computer executable program code, including instructions. Processor 210 executes various functional applications and data processing of terminal device 21 by running the instructions stored in internal memory 221. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc. The data storage area may store data created during the use of terminal device 21 (such as audio data, phone book, etc.). In addition, internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 210 executes various functional applications and data processing of terminal device 21 by running instructions stored in internal memory 221 and / or instructions stored in memory located in the processor.

[0077] The terminal device 21 implements display functions through a GPU, a display screen 230, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 230 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0078] The display screen 230 is used to display images, videos, etc. The display screen 230 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 21 may include one or N display screens 230, where N is a positive integer greater than 1.

[0079] The display screen 230 of terminal device 21 can display a series of graphical user interfaces (GUIs), which serve as the main screen of terminal device 21. Generally, the size of the display screen 230 of terminal device 21 is fixed, and only a limited number of controls can be displayed on the display screen 230. A control is a GUI element, a software component contained in an application, that controls all data processed by the application and interactive operations related to that data. Users can interact with controls through direct manipulation, thereby reading or editing information related to the application. Generally, controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets. For example, in this embodiment, the display screen 230 can display virtual buttons (one-click arrangement, start arrangement, scene arrangement).

[0080] Terminal device 21 can perform shooting functions through ISP, camera, video codec, GPU, display 230 and application processor.

[0081] The ISP (Image Signal Processor) is used to process data fed back from the camera 220. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set within the camera 220.

[0082] The wireless communication function of the terminal device 21 can be implemented through antenna 1, antenna 2, mobile communication module 240, wireless communication module 250, modem processor and baseband processor, etc.

[0083] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 21 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0084] The mobile communication module 240 can provide solutions for wireless communication, including 2G / 3G / 2G / 5G, applied to the terminal device 21. The mobile communication module 240 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 240 may be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 240 and at least some modules of the processor 210 may be housed in the same device.

[0085] The wireless communication module 250 can provide solutions for wireless communication applications on the terminal device 21, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 250 can be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 210. The wireless communication module 250 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0086] In some embodiments, the WiFi module in the wireless communication module 250 is used to provide network access to the terminal device 21 in accordance with Wi-Fi related standard protocols. The terminal device 21 can access the Wi-Fi access point through the WiFi module and thus access the Internet. The WiFi module can also act as a Wi-Fi wireless access point, providing Wi-Fi network access to other devices. The Bluetooth module in the wireless communication module 250 is used to enable short-range communication between the terminal device 21 and other devices.

[0087] The WiFi module can be an integrated circuit or a Wi-Fi chip, and the Bluetooth module can be an integrated circuit or a Bluetooth chip. The WiFi module and Bluetooth module can each be separate chips or integrated circuits, or they can be integrated together. For example, in one embodiment, the WiFi module and Bluetooth module can be integrated onto the same chip. In another embodiment, the WiFi module, Bluetooth module, and processor can also be integrated onto the same chip.

[0088] In addition, an operating system runs on top of the aforementioned components. Examples include HarmonyOS, iOS, Android, and Windows. Applications can be installed and run on this operating system.

[0089] Figure 2c This is a software structure block diagram of a terminal device 21 according to an embodiment of this application.

[0090] The layered architecture of terminal device 21 divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the software structure of the terminal device can be the Android system. It should be understood that the software structure of the terminal device can also be other systems, such as HarmonyOS, iOS, etc. In this case, the software structure of the terminal device can be divided according to the actual operating system, and this application embodiment does not limit this. For ease of description, the following description uses the Android operating system as an example. The Android system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer can include a series of application packages.

[0091] like Figure 2c As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, and video.

[0092] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0093] like Figure 2c As shown, the application framework layer may include a container manager, window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0094] In some embodiments, the container manager can manage containers created on the terminal device, such as starting and stopping container services and managing the configuration of container services.

[0095] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0096] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.

[0097] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0098] The phone manager is used to provide communication functions for terminal device 21. For example, it manages call status (including connection, hang-up, etc.).

[0099] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0100] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.

[0101] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0102] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0103] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0104] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0105] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0106] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0107] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0108] A 2D graphics engine is a graphics engine for 2D drawing.

[0109] The kernel layer is the layer between hardware and software. At a minimum, the kernel layer includes an addressing processing module, display driver, camera driver, audio driver, and sensor driver.

[0110] In some embodiments, the kernel layer can create containers, add the container's index information to the spatial index information, and store the spatial index information. The kernel layer can parse received data packets to obtain the data packet's transmission information, such as the data packet's port information. Based on the data packet's transmission information, the kernel layer can determine the target space corresponding to the data packet and transmit the data packet to the target space.

[0111] Understandable Figure 2c The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the terminal device 21. In other embodiments of this application, the terminal device 21 may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.

[0112] See Figure 3 This is a schematic flowchart illustrating a data transmission method provided in an embodiment of this application. This method can be applied to the aforementioned terminal device. The terminal device has at least one container created, such as... Figure 3 As shown, the method includes:

[0113] Step S301: Receive the first data packet sent by the sender.

[0114] In this embodiment, to extend the performance of the terminal device, the terminal device may pre-create at least one container. A container is a virtualization technology that allows processes to run independently on the same device. Namespace technology is a kernel-level feature that allows global system resources to be isolated into independent views, so that processes running in different namespaces obtain different resources. Namespaces within a container are a technique for isolating and separating resources between different containers and between a container and the host operating system. Each namespace provides a different type of isolation, allowing processes and resources within a container to run in a virtualized environment, independent of the host and other containers. That is, when at least one container is created in the terminal device, the space within the terminal device is divided into at least two spaces: at least one container space and a host space. The resources in the at least two spaces are independent of each other, and the processes running in the at least two spaces are also independent of each other. In other words, the terminal device contains a host and at least one container, and the host and at least one container run independently of each other.

[0115] When the sender needs to communicate with the terminal device, it can send the first data packet to the terminal device.

[0116] Step S302: Parse the first data packet to obtain the transmission information in the first data packet.

[0117] In this embodiment, since at least one container is created in the terminal device, the space of the terminal device is divided into a host space and at least one container space. Different applications can run in each space of the terminal device, implementing different functions. After receiving the first data packet, it is necessary to determine which application in which space the first data packet is sent to. Therefore, the terminal device can parse the first data packet to obtain the transmission information in the first data packet.

[0118] In some embodiments, the transmission information includes at least one of port information, protocol information, IP (Internet Protocol) address information, and data packet keyword information. The data packet keyword information is used to describe the content of the data packet.

[0119] It should be understood that the transmitted information may also include other information, and the embodiments of this application do not limit this.

[0120] In some embodiments, the port information within a data packet is typically unchanged during transmission. Therefore, to ensure the accuracy of communication in the first data packet, the transmitted information may include port information. This means the terminal device can parse the first data packet and obtain the port information within it.

[0121] In some embodiments, to improve the transmission accuracy of the first data packet, the transmission information may include port information and protocol information. In this case, parsing the first data packet to obtain the transmission information in the first data packet includes:

[0122] The first data packet is parsed to obtain the port information and protocol information within it. In other words, the terminal device can parse the first data packet to obtain the port information and protocol information carried within it, so that the terminal device can determine the target space corresponding to the first data packet based on the port information and protocol information.

[0123] Step S303: Determine the target space of the first data packet based on the transmission information of the first data packet and the stored space index information.

[0124] The spatial index information includes index information of the at least one created container and index information of the terminal device. The target space includes the host of the container or the terminal device.

[0125] In this embodiment, after the terminal device parses the transmission information of the first data packet, it needs to determine which space within it the first data packet is sent to. Therefore, the terminal device stores space index information for each existing space. The terminal device can use the stored space index information to query which application in the existing spaces of the terminal device is listening to the first data packet, thereby determining the target space of the first data packet.

[0126] In some embodiments, determining the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information includes:

[0127] Based on the stored spatial index information, a first space is determined in at least one space to be searched on the terminal device.

[0128] Based on the transmission information of the first data packet, if a target application exists in the first space, then the first space is determined as the target space.

[0129] The target application is the application that matches the monitored transmission information with the transmission information of the first data packet.

[0130] That is, the terminal device stores spatial index information for each existing space. Thus, the terminal device can determine the first space from at least one existing space to be searched based on the stored spatial index information. The space to be searched is a space within the terminal device where the target application has not been detected to exist. In some embodiments, the terminal device can determine the first space from at least one space to be searched according to the storage order of the stored spatial index information.

[0131] After identifying the first space, the sender can search for a target application within that space whose transmission information matches that of the first data packet, based on the transmission information of the first data packet. For example, if the transmission information includes port information, a socket search can be performed to check if a target application within the first space has a listening port number that matches the port information of the first data packet. If a target application exists, it means the sender needs to communicate with the target application in the current first space, and in this case, the first space can be designated as the target space.

[0132] In other embodiments, when determining the first space within the space to be searched, the search can be performed either according to the storage order of the stored space index information or according to a preset priority. In this case, determining the first space within at least one space to be searched on the terminal device based on the stored space index information includes:

[0133] Based on the stored spatial index information, and according to the preset priority information, the first space is determined in at least one space to be searched on the terminal device.

[0134] Among them, the priority of the index information of the terminal device in the preset priority information is higher than the priority of the index information of at least one container.

[0135] In this embodiment, when pre-setting priority information, the priority of the terminal device's index information can be set to the highest, meaning the priority of the terminal device's index information is higher than the priority of the index information of the containers created in the terminal device. In other words, based on the stored space index information and according to the preset priority information, the space with the highest priority among at least one searchable space in the terminal device is determined as the first space.

[0136] Specifically, when at least one search space on the terminal device contains the terminal device's host space, the host space of the terminal device with the highest priority can be determined as the first space according to preset priority information. This allows for the detection of the presence of the target application among applications running in the terminal device's host space, ensuring the timeliness of communication between applications in the terminal device's host space.

[0137] As one possible implementation, if the target application is not found in the first space, it means that there is no application listening to the port information of the first data packet in the current first space, and it is necessary to re-determine whether the target application exists in other spaces. In this case, the above method also includes: if the target application does not exist in the first space, then based on the stored space index information, re-determine the first space in at least one search space of the terminal device.

[0138] In other words, if the target application does not exist in the first space, it means that no application in the first space is listening to the transmission information of the first data packet. This means that the transmission information listened to by the applications in the first space does not match the transmission information of the first data packet, indicating that the first data packet was not sent to the application in the current first space. Based on this, when it is determined that the target application does not exist in the first space, the terminal device can, based on the stored space index information, re-determine the first space in at least one search space on the terminal device, so as to determine whether the target application exists in the newly determined first space. Here, the search space is the space on the terminal device where the existence of the target application is not yet determined; therefore, the search space does not include spaces that have already been determined as the first space. The terminal device can, based on the stored space index information, re-determine the first space in at least one search space on the terminal device. After re-determining the first space, the terminal device can re-check whether the target application exists in the first space. If it does not exist, then, based on the stored space index information, the first space is re-determined again in at least one search space on the terminal device, and the search for the target application in the first space is re-checked until the target application is detected in the first space, at which point the first space is determined as the target space.

[0139] For example, suppose a terminal device contains two containers, container 1 and container 2. The terminal device includes a host space (a), a space (b) for container 1, and a space (c) for container 2. The terminal device can store space index information including the indexes of host space a, space b, and space c. Transmission information includes port information. After receiving the first data packet, the terminal device can parse the first data packet to obtain its port information. The terminal device can determine the first space in the search space based on the stored space index information. Since no target application is detected in host spaces a, b, and c, the search space in the terminal device includes host spaces a, b, and c. Assuming the pre-priority information records that the priorities of host spaces a, b, and c decrease sequentially, the terminal device can determine host space a as the first space based on the stored space index information and the pre-priority information. The terminal device can detect whether the port number being listened to by the application in host space a matches the port information of the first data packet. For example, if the port number in the first data packet is k, the terminal device can detect whether an application listening on port number k exists in host space a. If it exists, it means the first data packet is sent to the application in host space a. In this case, host space a can be used as the target space, and the first data packet can be transmitted to the target application in host space a, as shown in the reference. Figure 4 As shown.

[0140] If it doesn't exist, it means the first data packet wasn't sent to the application in host space a. In this case, the terminal device can update the first space. Since the existence of the target application has already been checked in host space a, the search spaces for the terminal device are updated to spaces b and c, excluding host space a. The terminal device can determine space b as the first space based on the stored space index information and preset priority information. The terminal device can check if the port number being listened to by the application in space b matches the port information of the first data packet. For example, if the port number in the first data packet's port information is k, the terminal device can check if an application listening on port number k exists in space b. If it does, it means the first data packet was sent to the application in space b. In this case, space b can be used as the target space, and the first data packet can be transmitted to the target application in space b, as per [reference needed]. Figure 4 As shown.

[0141] If the first data packet does not exist, it means that the first data packet was not sent to the application in space b. In this case, the terminal device can update the first space. Since the existence of the target application has already been checked in both host spaces a and b, the space to be searched by the terminal device is updated to space c, which does not include host spaces a and b. The terminal device can determine space c as the first space based on the stored space index information and according to preset priority information. The terminal device can check whether the port number being listened to by the application in space c matches the port information of the first data packet. For example, if the port number in the port information of the first data packet is k, the terminal device can check whether an application listening on port number k exists in space c. If it exists, it means that the first data packet was sent to the application in space c. In this case, space c can be used as the target space, and the first data packet can be transmitted to the target application in space c.

[0142] If it does not exist, it means that the first data packet was not sent to the terminal device, and the terminal device discards the first data packet and no longer processes it.

[0143] In some embodiments, when the transmission information includes port information and protocol information, determining the target space of the first data packet based on the transmission information of the first data packet and the stored space index information includes:

[0144] Based on the port information, protocol information, and stored space index information of the first data packet, the target space of the first data packet is determined.

[0145] In this embodiment, after the terminal device parses the port information and protocol information of the first data packet, in order to improve the accuracy of data communication, the terminal device can determine the target space of the first data packet based on the port information, protocol information, and stored space index information. For example, the terminal device can determine the first space from at least one space to be searched based on the stored space index information. Based on the port information and protocol information of the first data packet, it checks whether there is a target application in the first space whose listening port number matches the port information of the first data packet and which uses the protocol information of the first data packet for communication. If it exists, the first space is determined as the target space. If it does not exist, the first space is re-determined, and the first space is re-checked for the existence of a target application.

[0146] Step S304: Transmit the first data packet to the target space.

[0147] In this embodiment of the application, after determining the target space, the terminal device can transmit the first data packet to the target space so that the target application in the target space can receive the first data packet.

[0148] In some embodiments, if the target space is the host space of the terminal device, the first data packet can be sent directly to the target application.

[0149] If the target space is a container space, the terminal device can transmit the first data packet to the target space. In some embodiments, the terminal device can modify the destination address in the first data packet to the address information of the target space, thereby transmitting the first data packet to the target space. For ease of implementation, in some embodiments, the container address can be bridging network interface card (NIC) information. That is, when the terminal device creates a container, it records the NIC information corresponding to that container. In this way, the terminal device can modify the destination address information of the first data packet to the NIC information corresponding to the target space and send the first data packet to the target space.

[0150] As one possible implementation, before determining the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information in step S303, such as... Figure 5 As shown, the above method also includes:

[0151] Step S305: Search for the stored addressing information based on the transmission information of the first data packet.

[0152] The addressing information records the correspondence between the transmission information of the second data packet from the terminal device and the destination space of the second data packet. The second data packet is the data packet received by the terminal device and transmitted to the corresponding destination space.

[0153] At this point, step S303 above determines the target space of the first data packet based on the transmission information of the first data packet and the stored space index information, including:

[0154] If no spatial information matching the transmission information of the first data packet is found in the stored addressing information, the target space of the first data packet is determined based on the transmission information of the first data packet and the stored spatial index information.

[0155] In other words, the terminal device can store addressing information, which records the transmission information of the second data packet already transmitted to the corresponding target space and the corresponding information between the target spaces. After receiving the first data packet and parsing its transmission information, the terminal device, in order to reduce communication overhead and improve data communication efficiency, can first search the stored addressing information for information that matches the first data packet. That is, the terminal device can search the addressing information for an entry whose transmission information matches the transmission information of the first data packet. If no match is found, it means that the terminal device is receiving the first data packet for the first time, and the terminal device needs to determine the target space of the first data packet based on its transmission information and the stored space index information.

[0156] In some embodiments, to improve the accuracy of data transmission, the transmission information includes port information and protocol information. In this case, the addressing information can record the correspondence between the port information, protocol information, and corresponding target space of the second data packet. Thus, the terminal device needs to search the addressing information based on the port information and protocol information of the first data packet to determine if there is a match in the addressing information where both the port information and protocol information match those of the first data packet. If not, the terminal device needs to determine the target space of the first data packet based on the port information of the first data packet and the stored space index information.

[0157] As one possible implementation, refer to Figure 5 As shown, the above method also includes:

[0158] Step S306: If spatial information matching the transmission information of the first data packet is found in the stored addressing information, then the spatial information matching the transmission information of the first data packet in the stored addressing information is determined as the target space of the first data packet.

[0159] In other words, if the terminal device finds a match in the addressing information that corresponds to the transmission information of the first data packet, then it can determine the target space of the first data packet based on the spatial information within that match, and thus transmit the first data packet to the target space. This allows the terminal device to determine the target space of the first data packet simply by querying the addressing information, eliminating the need to search for the target space within the terminal device's existing space using stored spatial index information. This improves the transmission efficiency of the first data packet, thereby increasing the efficiency of data communication and reducing communication latency.

[0160] In some embodiments, to improve the accuracy of data transmission, the transmission information includes port information and protocol information. Specifically, the addressing information records the correspondence between the port information, protocol information, and corresponding target space of the second data packet. The terminal device searches the addressing information based on the port information and protocol information of the first data packet to determine if there exists a matching item in the addressing information where both the port information and protocol information match those of the first data packet. For example, it determines if there exists an item in the addressing information where both the port information and protocol information are the same as those of the first data packet. If such an item exists, it can be identified as a matching item matching the first data packet, and the terminal device can determine the target space of the first data packet from the matching item.

[0161] For example, the transmitted information includes port information and protocol information. The terminal device stores addressing information, which records the port information, protocol information, and corresponding information between the target space and the target space of the second data packet a; the port information, protocol information, and corresponding information between the target space and the target space of the second data packet b; and the port information, protocol information, and corresponding information between the target space and the target space of the second data packet c. The terminal device receives the first data packet and parses it to obtain its port information and protocol information. The terminal device can search for the addressing information based on the port information and protocol information of the first data packet, and check if there is a matching item in the addressing information that matches the first data packet. If the port information and protocol information of the second data packet a, the second data packet b, and the second data packet c recorded in the addressing information are all different from the port information and protocol information of the first data packet, it can be determined that no space information matching the port information of the first data packet has been found in the stored addressing information. The terminal device can determine the target space of the first data packet based on the port information of the first data packet and the stored space index information.

[0162] Alternatively, if the terminal device determines from the port and protocol information of the second data packet a, second data packet b, and second data packet c recorded in the addressing information that the port and protocol information of the second data packet a is the same as that of the first data packet, then it can be determined that there is a matching item in the addressing information that matches the port and protocol information of the first data packet. The first data packet can be considered a subsequent message data packet of the second data packet a, and the terminal device can determine the target space corresponding to the second data packet a as the target space of the first data packet. The terminal device can then transmit the first data packet to the corresponding target space.

[0163] As one possible implementation, such as Figure 6 As shown, the above method also includes:

[0164] Step S307: Update the stored addressing information based on the transmission information and target space of the first data packet.

[0165] In other words, when the terminal device cannot find spatial information matching the transmission information of the first data packet in the addressing information, it can determine the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information, and then transmit the first data packet to the target space. To facilitate the rapid transmission of subsequent data packets of the first data packet to the target space and improve data communication efficiency, the stored addressing information can be updated based on the transmission information of the first data packet and the target space. That is, after determining the target space of the first data packet, the terminal device can store the transmission information of the first data packet and the corresponding information between the target space and the target space in the addressing information, thus updating the addressing information. In this way, when the terminal device receives subsequent data packets of the first data packet, it can directly determine the target space by looking up the addressing information, without needing to search for the target space based on the spatial index information, thereby improving the efficiency of data communication.

[0166] As one possible implementation, such as Figure 7 As shown, the above method also includes:

[0167] Step S308: Create at least one container.

[0168] In this embodiment of the application, in order to meet the needs of users, at least one container is created in the terminal device, and at least one container forms an independent space through namespace.

[0169] Step S309: Update the stored space index information based on at least one container.

[0170] In this embodiment, when a terminal device creates at least one container, it can determine the index information for each container. The terminal device can store the index information of at least one container in spatial index information so that the corresponding container can be found later based on the index information recorded in the spatial index information.

[0171] Thus, in this embodiment, after receiving the first data packet, the terminal device can parse the first data packet to obtain its transmission information. Based on this information, it can determine the target space of the first data packet and transmit it to the corresponding target space, achieving communication between containers on different network segments and external devices. Furthermore, it eliminates the need for other servers, improving cross-network segment transmission performance, increasing transmission speed, and reducing transmission latency. Moreover, even if the IP 5-tuple of the first data packet received by the terminal device does not match the IP 5-tuple of the data packet sent by the terminal device to the sender, the terminal device can still transmit the first data packet to the corresponding target space by parsing the transmission information in the first data packet, such as port information and protocol information. This further ensures data communication between the terminal device and external devices, improves cross-network segment transmission performance, increases transmission speed, and reduces transmission latency.

[0172] refer to Figure 8 This is a flowchart illustrating another data transmission method provided in an embodiment of this application. The method is used in a terminal device, and the software structure diagram of the terminal device can be found here. Figure 2c As shown. Figure 8 As shown, the method includes:

[0173] Step S801: The kernel layer of the terminal device creates at least one container.

[0174] Step S802: The kernel layer of the terminal device updates the stored space index information based on at least one container.

[0175] Step S803: The kernel layer of the terminal device receives the first data packet sent by the sender.

[0176] Step S804: The kernel layer of the terminal device parses the first data packet to obtain the transmission information in the first data packet.

[0177] In some embodiments, the kernel layer of the terminal device parses the first data packet to obtain the port information and protocol information in the first data packet.

[0178] Step S805: The kernel layer of the terminal device searches for the stored addressing information based on the transmission information of the first data packet.

[0179] The addressing information records the correspondence between the transmission information of the second data packet from the terminal device and the destination space of the second data packet. The second data packet is the data packet received by the terminal device and transmitted to the corresponding destination space.

[0180] The kernel layer of the terminal device executes different steps depending on the search result. If no spatial information matching the transmission information of the first data packet is found in the addressing information, steps S806a-S807 and S808 are executed. If spatial information matching the transmission information of the first data packet is found in the addressing information, steps S806b and S808 are executed.

[0181] Step S806a: If no spatial information matching the transmission information of the first data packet is found in the stored addressing information, the kernel layer of the terminal device determines the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information.

[0182] Step S806b: If spatial information matching the transmission information of the first data packet is found in the stored addressing information, the kernel layer of the terminal device determines the spatial information matching the transmission information of the first data packet in the stored addressing information as the target space of the first data packet.

[0183] Step S807: The kernel layer of the terminal device updates the stored addressing information based on the transmission information and target space of the first data packet.

[0184] Step S808: The kernel layer of the terminal device transmits the first data packet to the target space.

[0185] See Figure 9 This is a schematic diagram of a data transmission device provided in an embodiment of this application. The data transmission device is applied to a terminal device, which has at least one container. Figure 9 As shown, the data transmission device includes:

[0186] The receiving unit 901 is used to receive the first data packet sent by the sender.

[0187] The processing unit 902 is used to parse the first data packet to obtain the transmission information in the first data packet.

[0188] The processing unit 902 is also used to determine the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information.

[0189] The spatial index information includes the index information of the at least one created container and the index information of the terminal device; the target space includes the host of the container or the terminal device.

[0190] The sending unit 903 is used to transmit the first data packet to the target space.

[0191] As one possible implementation, the processing unit 902 is specifically used to determine a first space in at least one searchable space of the terminal device based on the stored space index information.

[0192] Based on the transmission information of the first data packet, if a target application exists in the first space, then the first space is determined as the target space.

[0193] The target application is the application that matches the monitored transmission information with the transmission information of the first data packet.

[0194] As one possible implementation, the processing unit 902 is also configured to, if the target application does not exist in the first space, redetermine the first space in at least one search space of the terminal device based on the stored space index information.

[0195] As one possible implementation, the processing unit 902 is specifically used to determine a first space in at least one searchable space of the terminal device based on the stored space index information and according to preset priority information.

[0196] Among them, the priority of the index information of the terminal device in the preset priority information is higher than the priority of the index information of at least one container.

[0197] As one possible implementation, the processing unit 902 is also used to look up the stored addressing information based on the transmission information of the first data packet.

[0198] The addressing information records the correspondence between the transmission information of the second data packet from the terminal device and the destination space of the second data packet. The second data packet is the data packet received by the terminal device and transmitted to the corresponding destination space.

[0199] At this time, the processing unit 902 determines the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information. Specifically, if no spatial information matching the transmission information of the first data packet is found in the stored addressing information, the target space of the first data packet is determined based on the transmission information of the first data packet and the stored spatial index information.

[0200] As one possible implementation, the processing unit 902 is further configured to determine the spatial information in the stored addressing information that matches the transmission information of the first data packet as the target space of the first data packet if spatial information matching the transmission information of the first data packet is found in the stored addressing information.

[0201] As one possible implementation, the processing unit 902 is also used to update the stored addressing information based on the transmission information and target space of the first data packet.

[0202] As one possible implementation, processing unit 902 is also used to create at least one container. The stored spatial index information is then updated based on the at least one container.

[0203] As one possible implementation, the transmitted information includes at least one of port information, protocol information, IP address information, and data packet keyword information.

[0204] Corresponding to the above embodiments, this application also provides an electronic device. Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device may include a processor 1001, a memory 1002, and a communication unit 1003. These components communicate through one or more buses. Those skilled in the art will understand that the structure of the server shown in the figure does not constitute a limitation on the embodiment of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0205] The communication unit 1003 is used to establish a communication channel, enabling the storage device to communicate with other devices. It can receive user data sent by other devices or send user data to other devices.

[0206] The processor 1001 serves as the control center of the storage device, connecting various parts of the electronic device via various interfaces and lines. It executes software programs and / or modules stored in the memory 1002, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor may be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 1001 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0207] The memory 1002 is used to store the execution instructions of the processor 1001. The memory 1002 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0208] When the execution instructions in memory 1002 are executed by processor 1001, the electronic device is able to perform some or all of the steps in the embodiments shown above.

[0209] In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program, when executed, may include some or all of the steps of the various embodiments of the transmission method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0210] This application also provides a computer program product containing executable instructions that, when run on a terminal device, cause the terminal device to execute the data transmission method provided in the foregoing embodiments.

[0211] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.

[0212] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the device embodiments and terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

Claims

1. A data transmission method, characterized in that, Applied to a terminal device, wherein at least one container is created in the terminal device, the method includes: Receive the first data packet sent by the sender; Parse the first data packet to obtain the transmission information in the first data packet; Based on the transmission information of the first data packet and the stored spatial index information, the target space of the first data packet is determined; the spatial index information includes the index information of the at least one created container and the index information of the terminal device; the target space includes the container or the host of the terminal device. The first data packet is transmitted to the target space.

2. The method according to claim 1, characterized in that, The step of determining the target space of the first data packet based on its transmission information and stored spatial index information includes: Based on the stored spatial index information, a first space is determined in at least one searchable space of the terminal device; Based on the transmission information of the first data packet, if a target application exists in the first space, then the first space is determined as the target space; wherein, the target application is the application whose monitored transmission information matches the transmission information of the first data packet.

3. The method according to claim 2, characterized in that, Also includes: If the target application does not exist in the first space, the first space is re-determined in at least one search space of the terminal device based on the stored space index information.

4. The method according to claim 2 or 3, characterized in that, Determining the first space in at least one searchable space of the terminal device based on the stored spatial index information includes: Based on the stored space index information, a first space is determined in at least one search space of the terminal device according to preset priority information; wherein, the priority of the index information of the terminal device is higher than the priority of the index information of the at least one container in the preset priority information.

5. The method according to any one of claims 1-4, characterized in that, Before determining the target space of the first data packet based on the port information and stored space index information of the first data packet, the method further includes: Based on the transmission information of the first data packet, the stored addressing information is searched; the addressing information records the correspondence between the transmission information of the second data packet of the terminal device and the target space of the second data packet; the second data packet is a data packet received by the terminal device and transmitted to the corresponding target space; The step of determining the target space of the first data packet based on its transmission information and stored spatial index information includes: If no spatial information matching the transmission information of the first data packet is found in the stored addressing information, the target space of the first data packet is determined based on the transmission information of the first data packet and the stored spatial index information.

6. The method according to claim 5, characterized in that, Also includes: If spatial information matching the transmission information of the first data packet is found in the stored addressing information, then the spatial information matching the transmission information of the first data packet in the stored addressing information is determined as the target space of the first data packet.

7. The method according to claim 5, characterized in that, Also includes: Based on the transmission information and target space of the first data packet, update the stored addressing information.

8. The method according to any one of claims 1-7, characterized in that, Also includes: Create at least one container; Update the stored spatial index information based on the at least one container.

9. The method according to any one of claims 1-8, characterized in that, The transmission information includes at least one of port information, protocol information, IP address information, and data packet keyword information.

10. A data transmission device, characterized in that, include: The receiving unit is used to receive the first data packet sent by the sender; The processing unit is used to parse the first data packet to obtain the transmission information in the first data packet; The processing unit is further configured to determine the target space of the first data packet based on the transmission information of the first data packet and the stored spatial index information; the spatial index information includes the index information of the at least one created container and the index information of the terminal device; The target space includes the container or the terminal device; A sending unit is used to transmit the first data packet to the target space.

11. An electronic device, characterized in that, The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to perform the method according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1-9.