Network sharing method and device, system, electronic equipment and storage medium
By utilizing sockets and cross-core communication modules in electronic devices, data can be transmitted from a first central processing unit (CPU) without a network interface card (NIC) to a second CPU with a NIC, solving the network access problem when the processor lacks a NIC and achieving greater convenience in network sharing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2022-03-23
- Publication Date
- 2026-06-23
AI Technical Summary
In electronic devices, when a processor lacks network card capabilities, users cannot access network resources through applications controlled by that processor.
Data is transmitted to the second central processing unit (CPU) via sockets and cross-core communication modules of the first CPU to utilize its physical network interface card (NIC) for network data transmission.
Even if a central processing unit in an electronic device does not have network card capabilities, it can still access network resources through applications controlled by that central processing unit, thus improving the convenience of network sharing.
Smart Images

Figure CN116846977B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a network sharing method, apparatus, system, electronic device, and storage medium. Background Technology
[0002] With the development of science and technology, electronic devices have become indispensable tools in people's daily lives. For example, users can access various network resources through applications running on the operating system of electronic devices. However, when electronic devices have multi-core asymmetric hardware, if one of the processors lacks network card capabilities, users cannot access network resources through applications controlled by that processor. Therefore, how to enable processors without network card capabilities to have networking functionality has become a key focus. Summary of the Invention
[0003] This disclosure provides a network sharing method, apparatus, system, electronic device, and storage medium, with the main purpose of improving the convenience of network sharing.
[0004] According to one aspect of this disclosure, a network sharing method is provided, applied to a first central processing unit (CPU), the first CPU not having a physical network interface card (NIC), comprising:
[0005] Data transmission instructions are obtained through the application controlled by the first central processing unit;
[0006] Obtain the socket corresponding to the data transmission instruction and the shared data corresponding to the data transmission instruction;
[0007] The socket is invoked to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit;
[0008] The first operating system in the second central processing unit and the second operating system in the first central processing unit are heterogeneous multi-core operating systems.
[0009] Optionally, before obtaining data transmission instructions through the application controlled by the first central processing unit, the method further includes:
[0010] Obtain proxy module call information sent by the second central processing unit, wherein the proxy module call information is generated when the second central processing unit calls the proxy module in the first central processing unit;
[0011] The socket is created on the first central processing unit and then transmitted to the second central processing unit.
[0012] Optionally, the first central processing unit further includes a daemon process, and the second central processing unit includes a service process;
[0013] The step of calling the socket to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set includes:
[0014] The socket is invoked to transmit the shared data to the daemon process through the proxy module;
[0015] The daemon process controls the transmission of the shared data to the service process of the second central processing unit via a cross-core communication module set.
[0016] Optionally, the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit.
[0017] The control of the daemon process to transmit the shared data to the service process of the second central processing unit via a cross-core communication module set includes:
[0018] The daemon process is controlled to transmit the shared data through the first asymmetric multi-core communication module to the second asymmetric multi-core communication module of the second central processing unit, so that the service process where the second asymmetric multi-core communication module is located can obtain the shared data.
[0019] Optionally, the socket is a UNIX socket.
[0020] According to one aspect of this disclosure, a network sharing method is provided, applied to a second central processing unit, the second central processing unit being equipped with a physical network interface card (NIC), comprising:
[0021] The shared data sent by the first central processing unit is obtained through the cross-core communication module set; the shared data is the data transmission instruction for the application obtained by the first central processing unit, and the data transmission instruction corresponding to the socket is called to send the data transmission instruction to the second central processing unit through the proxy module of the first central processing unit and the cross-core communication module set. The first central processing unit does not have the physical network card.
[0022] In response to the data transmission command, the shared data is transmitted to the network device based on the physical network interface card.
[0023] Optionally, the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit.
[0024] The process of obtaining shared data sent by the first central processing unit through a cross-core communication module set includes:
[0025] The second asymmetric multi-core communication module obtains the shared data sent by the first central processing unit through the first asymmetric multi-core communication module.
[0026] According to another aspect of this disclosure, a network sharing device is provided, applied to a first central processing unit (CPU), the first CPU not having a physical network interface card (NIC), comprising:
[0027] The instruction acquisition unit is used to acquire data transmission instructions through the application controlled by the first central processing unit;
[0028] The data acquisition unit is used to acquire the socket corresponding to the data transmission instruction and the shared data corresponding to the data transmission instruction;
[0029] The data transmission unit is used to call the socket to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit;
[0030] The first operating system in the second central processing unit and the second operating system in the first central processing unit are heterogeneous multi-core operating systems.
[0031] Optionally, the device further includes an information acquisition unit and a socket establishment unit, used before the application controlled by the first central processing unit acquires data transmission instructions:
[0032] The information acquisition unit is used to acquire proxy module call information sent by the second central processing unit. The proxy module call information is generated when the second central processing unit calls the proxy module in the first central processing unit.
[0033] The socket creation unit is used to create the socket on the first central processing unit and transmit the socket to the second central processing unit.
[0034] Optionally, the first central processing unit further includes a daemon process, and the second central processing unit includes a service process;
[0035] The data transmission unit includes a socket invocation subunit and a process control subunit. The data transmission unit is used to invoke the socket to send the shared data to the second central processing unit via a proxy module and a cross-core communication module set.
[0036] The socket invocation subunit is used to invoke the socket to transmit the shared data to the daemon process through the proxy module;
[0037] The process control subunit is used to control the daemon process to transmit the shared data to the service process of the second central processing unit through a cross-core communication module set.
[0038] Optionally, the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit.
[0039] The process control subunit is used to control the daemon process to transmit the shared data to the service process of the second central processing unit through the cross-core communication module set, specifically for:
[0040] The daemon process is controlled to transmit the shared data through the first asymmetric multi-core communication module to the second asymmetric multi-core communication module of the second central processing unit, so that the service process where the second asymmetric multi-core communication module is located can obtain the shared data.
[0041] Optionally, the socket is a UNIX socket.
[0042] According to another aspect of this disclosure, a network sharing device is provided, applied to a second central processing unit, the second central processing unit being provided with a physical network interface card (NIC), comprising:
[0043] A data sending unit is used to obtain shared data sent by a first central processing unit through a cross-core communication module set; the shared data is the data transmission instruction corresponding to the data transmission instruction obtained by the first central processing unit for the application, and the data transmission instruction is sent to the second central processing unit through the proxy module of the first central processing unit and the cross-core communication module set by calling the socket corresponding to the data transmission instruction; the first central processing unit does not have the physical network card configured.
[0044] The instruction response unit is used to respond to the data transmission instruction and transmit the shared data to the network device based on the physical network card.
[0045] Optionally, the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit.
[0046] The data sending unit includes a data acquisition subunit, which is used to acquire shared data sent by the first central processing unit through a cross-core communication module set:
[0047] The data acquisition subunit is used to acquire shared data sent by the first central processing unit through the first asymmetric multi-core communication module via the second asymmetric multi-core communication module.
[0048] According to another aspect of this disclosure, a network sharing system is provided, the network sharing system comprising a first central processing unit (CPU) as described in any one of the preceding aspects and a second CPU as described in any one of the preceding aspects, wherein the first CPU does not have a physical network interface card (NIC) and the second CPU has a physical NIC.
[0049] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0050] At least one processor; and
[0051] A memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of the preceding aspects.
[0053] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method described in any one of the preceding aspects.
[0054] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the preceding aspects.
[0055] In one or more embodiments of this disclosure, a data transmission instruction is obtained through an application controlled by the first central processing unit (CPU); a socket corresponding to the data transmission instruction and shared data corresponding to the data transmission instruction are obtained; the socket is invoked to send the shared data to a second CPU through a proxy module and a cross-core communication module set, so that the second CPU responds to the data transmission instruction and transmits the shared data to a network device based on the physical network interface card (NIC) in the second CPU; wherein, the first operating system in the second CPU and the second operating system in the first CPU are heterogeneous multi-core operating systems. Therefore, when data transmission is required through a first CPU that does not have a physical NIC, the data to be transmitted can be sent to a second CPU that has a physical NIC by using a socket and a cross-core communication module set, and then the data can be transmitted to a network device through the second CPU. Therefore, even if a CPU in an electronic device does not have NIC capability, network resources can still be accessed through an application controlled by that CPU, thereby improving the convenience of network sharing.
[0056] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0057] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0058] Figure 1 This diagram illustrates the background of a network sharing method provided in an embodiment of the present disclosure.
[0059] Figure 2 This diagram illustrates a system architecture of a network sharing method provided in an embodiment of this disclosure.
[0060] Figure 3 A flowchart illustrating a network sharing method provided in an embodiment of this disclosure is shown.
[0061] Figure 4 A flowchart illustrating a network sharing method provided in an embodiment of this disclosure is shown.
[0062] Figure 5 This illustration shows a data transmission process according to an embodiment of the present disclosure;
[0063] Figure 6 A flowchart illustrating a network sharing method provided in an embodiment of this disclosure is shown.
[0064] Figure 7This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure.
[0065] Figure 8 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure.
[0066] Figure 9 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure.
[0067] Figure 10 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure.
[0068] Figure 11 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure.
[0069] Figure 12 This is a block diagram of an electronic device used to implement the network sharing method of the embodiments of this disclosure. Detailed Implementation
[0070] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0071] With the development of science and technology and the increasing maturity of electronic device technology, the convenience of users' production and life has been improved. In electronic device application scenarios, users can access a wide variety of network resources through applications running on the operating system of the electronic device.
[0072] According to some embodiments, Figure 1 This diagram illustrates a background illustration of a network sharing method provided in an embodiment of this disclosure. For example... Figure 1 As shown, when a user accesses network resources through an application running on the operating system of an electronic device, the central processing unit (CPU) in the electronic device can utilize the TCP / IP 4-layer network architecture to have network card functionality. Consequently, the CPU can have network connectivity, and the user can access network resources through the application controlled by the CPU.
[0073] In some embodiments, Figure 2 This diagram illustrates a system architecture of a network sharing method provided by an embodiment of this disclosure. Figure 2As shown, when electronic device 11 receives a request for network resources in the application, electronic device 11 can send the request to server 13 via network 12. Then, server 13 can obtain the network resources corresponding to the request and send the network resources to electronic device 11 via network 12.
[0074] It's easy to understand that when the TCP / IP Layer 4 network architecture within a central processing unit (CPU) is incomplete, the CPU lacks network interface card (NIC) functionality. In this case, users cannot access network resources through applications controlled by that CPU.
[0075] The present disclosure will now be described in detail with reference to specific embodiments.
[0076] In embodiments of this disclosure, such as Figure 3 As shown, Figure 3 The diagram illustrates a flowchart of a network sharing method provided in an embodiment of this disclosure. This method can be applied, for example, to a first central processing unit (CPU) in a scenario where the CPU does not have a physical network interface card (NIC). The method can be implemented using a computer program and can run on an apparatus for performing network sharing. This computer program can be integrated into an application or run as a standalone utility application.
[0077] The network sharing device can be an electronic device with liquid detection capabilities, including but not limited to: wearable devices, handheld devices, personal computers, tablets, in-vehicle devices, smartphones, computing devices, or other processing devices connected to a wireless modem. In different networks, electronic devices may be called by different names, such as: user equipment, access electronic device, user unit, user station, mobile station, mobile station, remote station, remote electronic device, mobile device, user electronic device, electronic device, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), 5G network, 4G network, 3G network, or electronic devices in future evolved networks.
[0078] Specifically, the network sharing method includes:
[0079] S101, obtains data transmission instructions through the application controlled by the first central processing unit;
[0080] According to some embodiments, a central processing unit (CPU) refers to the final execution unit for information processing and program execution. This CPU can serve as the operational and control core of a computer system. The CPU is a very large-scale integrated circuit and can be composed of components such as logic units, register units, and control units.
[0081] In some embodiments, the first central processing unit (CPU) refers to a CPU without network capabilities. This first CPU does not specifically refer to a particular fixed processor. For example, the first CPU can change when the components it comprises change. The first CPU can also change when the circuitry corresponding to it changes.
[0082] In some embodiments, an application refers to a computer program designed to perform one or more specific tasks. The application does not specifically refer to a particular application. It includes, but is not limited to, music applications, time applications, and so on.
[0083] In some embodiments, a data transmission instruction refers to an instruction obtained by an application controlled by a first central processing unit when an electronic device shares data over a network. This data transmission instruction is not specifically defined by any single instruction. It includes, but is not limited to, voice data transmission instructions, click-to-transmit data transmission instructions, and so on. When the electronic device receives an instruction to modify the data transmission instruction, the data transmission instruction can change.
[0084] It is easy to understand that when an electronic device shares data over a network, it can obtain data transmission instructions through an application controlled by the first central processing unit.
[0085] S102, obtain the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command;
[0086] According to some embodiments, a socket is an abstraction of an endpoint for bidirectional communication between application processes on different hosts in a network. A socket is one end of process communication on the network, providing a mechanism for application-layer processes to exchange data using network protocols. The socket does not specifically refer to a particular fixed socket. For example, when a socket is connected to an application process upstream and a network protocol stack downstream, the socket can be an interface for the application to communicate via network protocols. The socket can also be an interface for the application to interact with the network protocol stack.
[0087] According to some embodiments, shared data refers to the data that an electronic device needs to share when sharing over a network. This shared data does not specifically refer to any single, fixed data. For example, the shared data may change when the application changes. The shared data may also change when the data transmission instructions change.
[0088] It is easy to understand that when an electronic device receives a data transmission command, it can obtain the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command.
[0089] S103, the socket is invoked to send shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit.
[0090] According to some embodiments, a proxy module refers to a module that controls indirect connections between one electronic device and another electronic device. The proxy module is not specifically defined as a single, fixed module. For example, the proxy module can change when the socket changes. It can also change when the first central processing unit changes.
[0091] According to some embodiments, the cross-core communication module RPMSG (OpenAMP) refers to a module used to support inter-core communication between different central processing units (CPUs). This cross-core communication module does not specifically refer to a single, fixed module. For example, when the first CPU changes, the cross-core communication module corresponding to that first CPU can change. When the second CPU changes, the cross-core communication module corresponding to that second CPU can change.
[0092] In some embodiments, the cross-core communication module set refers to a collection comprised of at least one cross-core communication module. This cross-core communication module set does not specifically refer to a single, fixed module. For example, the cross-core communication module set can change when the cross-core communication modules change. It can also change when the data transmission instructions change.
[0093] According to some embodiments, the second central processing unit (CPU) refers to a CPU with networking capabilities. This second CPU does not specifically refer to a particular fixed processor. For example, the second CPU can change when the components it contains change. The second CPU can also change when the circuitry corresponding to it changes.
[0094] According to some embodiments, the first operating system in the second central processing unit and the second operating system in the first central processing unit are heterogeneous multi-core operating systems. A heterogeneous multi-core operating system refers to a system composed of multiple single-core or multi-core processors of different types. A heterogeneous multi-core operating system can be two completely physically isolated operating systems.
[0095] In some embodiments, an operating system refers to a computer program used to manage computer hardware and software resources. This operating system includes, but is not limited to, Android, iOS, and others.
[0096] In some embodiments, the first operating system refers to the operating system configured in the first central processing unit. The first operating system does not specifically refer to a particular fixed operating system. For example, the first operating system may change when the first central processing unit changes. The first operating system may also change when the electronic device receives system modification instructions for the first operating system.
[0097] In some embodiments, the second operating system refers to the operating system configured in a second central processing unit. This second operating system is not specifically defined as a single, fixed operating system. For example, the second operating system may change when the second central processing unit changes. The second operating system may also change when the electronic device receives system modification instructions for that operating system.
[0098] In some embodiments, a physical network interface card (NIC) is a hardware device that connects the network protocol stack in the central processing unit (CPU) kernel space to an external network, transmitting and receiving data in bitstream format (0s and 1s). One end of the physical NIC is the network protocol stack in the kernel space, and the other end is the external network. This physical NIC is not specifically a fixed NIC. For example, the physical NIC can change when the CPU changes.
[0099] According to some embodiments, a network device refers to a physical entity device connected to a network. The network device does not specifically refer to a single fixed device. The network device includes, but is not limited to, computers, hubs, switches, bridges, routers, gateways, network interface cards, wireless access points, printers and modems, fiber optic transceivers, fiber optic cables, etc.
[0100] It is easy to understand that when an electronic device obtains the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command, the electronic device can call the socket to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set. Then, the electronic device can control the second central processing unit to respond to the data transmission command and transmit the shared data to the network device based on the physical network card in the second central processing unit.
[0101] In this embodiment, a data transmission command is obtained through an application controlled by a first central processing unit (CPU). The CPU then obtains the socket corresponding to the data transmission command and the shared data corresponding to the command. The socket is invoked to send the shared data to a second CPU via a proxy module and a cross-core communication module set. This causes the second CPU to respond to the data transmission command and transmit the shared data to a network device based on the physical network interface card (NIC) within the second CPU. Therefore, when data transmission is required through a first CPU that lacks a physical NIC, the data to be transmitted can be sent to a second CPU that has a physical NIC using a socket and a cross-core communication module set. The data can then be transmitted to a network device via the second CPU. Thus, even if a CPU in an electronic device lacks NIC capabilities, network resources can still be accessed through an application controlled by that CPU, thereby improving the convenience of network sharing.
[0102] Please see Figure 4 , Figure 4 This diagram illustrates a flowchart of a network sharing method provided in an embodiment of this disclosure. This method can be applied, for example, to a scenario where a first central processing unit (CPU) does not have a physical network interface card (NIC). Specifically, the network sharing method includes:
[0103] S201, Obtain the proxy module call information sent by the second central processing unit;
[0104] The specific process is as described above, and will not be repeated here.
[0105] According to some embodiments, the proxy module call information refers to the information generated when the second central processing unit calls the proxy module in the first central processing unit. This proxy module call information does not specifically refer to any fixed information. For example, the proxy module call information may change when the proxy module changes. The proxy module call information may also change when the second central processing unit changes.
[0106] For example, when the second central processing unit calls the socket() corresponding to the proxy module usrsock in the first central processing unit, the second central processing unit can pass the call information of socket() to the first central processing unit.
[0107] It is easy to understand that when an electronic device performs network sharing, it can obtain proxy module call information sent by a second central processing unit.
[0108] S202, establish a socket on the first central processing unit and transmit the socket to the second central processing unit;
[0109] The specific process is as described above, and will not be repeated here.
[0110] According to some embodiments, when an electronic device establishes a socket on a first central processing unit, the established socket may be, for example, a UNIX socket. In this case, the first operating system can provide the user space with a seamless network sharing experience, thereby improving the convenience of network sharing.
[0111] In some embodiments, when the second central processing unit (CPU) transmits the call information for socket() to the first CPU, the electronic device can establish a socket on the first CPU, and then the electronic device can send the socket to the second CPU.
[0112] It is easy to understand that when an electronic device obtains the proxy module call information, the electronic device can establish a socket on the first central processing unit and transmit the socket to the second central processing unit.
[0113] S203, obtains data transmission instructions through the application controlled by the first central processing unit;
[0114] The specific process is as described above, and will not be repeated here.
[0115] According to some embodiments, Figure 5 This diagram illustrates a data transmission process according to an embodiment of the present disclosure. Figure 5 As shown, the interactive interface of the application controlled by the first central processing unit includes a data transfer button. When the electronic device detects that the user has clicked the data transfer button, the electronic device can obtain the data transfer command input for that button.
[0116] It is easy to understand that when an electronic device shares data over a network, it can obtain data transmission instructions through an application controlled by the first central processing unit.
[0117] S204, obtain the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command;
[0118] The specific process is as described above, and will not be repeated here.
[0119] According to some embodiments, when an electronic device receives a data transmission command, the socket corresponding to the data transmission command that the electronic device can obtain includes, but is not limited to, socket(), send(), recv(), send(), bind(), etc. For example, when the electronic device receives a data transmission command, it can obtain the socket send() corresponding to the data transmission command. The electronic device can also obtain the socket bind() corresponding to the data transmission command.
[0120] It is easy to understand that when an electronic device receives a data transmission command, it can obtain the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command.
[0121] S205, the socket is invoked to transmit shared data to the daemon process through the proxy module;
[0122] The specific process is as described above, and will not be repeated here.
[0123] According to some embodiments, a daemon process refers to a process that runs in the background of a first central processing unit and is not controlled by any electronic device. The daemon process is independent of the controlling electronic device and periodically performs a certain task or waits to process certain events. The daemon process can run without user input and provide a certain service. The daemon process is not specifically defined as a fixed process. For example, the daemon process can change when the task it performs changes. The daemon process can also change when the first central processing unit changes.
[0124] In some embodiments, the electronic device calls the socket send() function through an application controlled by the first central processing unit, so the electronic device can directly transmit shared data to the daemon usrsock client through the proxy module usrsock.
[0125] It is easy to understand that when an electronic device obtains the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command, the electronic device can call the socket to transmit the shared data to the daemon process through the proxy module.
[0126] S206, the control daemon transmits shared data to the service process of the second central processing unit through the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit;
[0127] The specific process is as described above, and will not be repeated here.
[0128] According to some embodiments, a service process refers to a program in the second central processing unit that is automatically executed by the system and does not require user interaction. The service process is not specifically defined as a single, fixed process. For example, the service process may change when the task it performs changes. The service process may also change when the second central processing unit changes.
[0129] For example, when an electronic device transmits shared data to the daemon process usrsockclient via the proxy module usrsock, the electronic device can control the daemon process usrsockclient to transmit the shared data to the service process usrsock server on the second central processing unit via a cross-core communication module set.
[0130] According to some embodiments, when the electronic device controls the daemon process to transmit shared data to the service process of the second central processing unit via a cross-core communication module set, the electronic device can control the daemon process to transmit the shared data to the second asymmetric multi-core communication module of the second central processing unit via the first asymmetric multi-core communication module, so that the service process containing the second asymmetric multi-core communication module can obtain the shared data. Therefore, the accuracy of the electronic device's transmission of shared data can be improved.
[0131] In some embodiments, an asymmetric multi-core communication module refers to a module that uses a small number of general-purpose processing cores to handle tasks requiring high software flexibility. Simultaneously, this asymmetric multi-core communication module can also employ a large number of hardware accelerators to handle even more tasks.
[0132] In some embodiments, the first asymmetric multi-core communication module refers to the asymmetric multi-core communication module corresponding to the first central processing unit in the cross-core communication module set. This first asymmetric multi-core communication module does not specifically refer to a fixed module. For example, when the first central processing unit changes, the first asymmetric multi-core communication module can change. Similarly, when the cross-core communication module set changes, the first asymmetric multi-core communication module can also change.
[0133] In some embodiments, the second asymmetric multi-core communication module refers to the asymmetric multi-core communication module corresponding to the second central processing unit in the cross-core communication module set. This second asymmetric multi-core communication module does not specifically refer to a fixed module. For example, the second asymmetric multi-core communication module can change when the second central processing unit changes. It can also change when the cross-core communication module set changes.
[0134] For example, when an electronic device transmits shared data to the daemon process usrsockclient via the proxy module usrsock, the electronic device can control the daemon process usrsockclient to transmit the shared data to the second asymmetric multi-core communication module OpenAMP2 via the first asymmetric multi-core communication module OpenAMP1.
[0135] It is easy to understand that when an electronic device calls a socket to transmit shared data to a daemon process through a proxy module, the electronic device can control the daemon process to transmit the shared data to a service process of the second central processing unit through a cross-core communication module set. Then, the electronic device can make the second central processing unit respond to the data transmission command and transmit the shared data to the network device based on the physical network card in the second central processing unit.
[0136] In this embodiment, by acquiring the proxy module call information sent by the second central processing unit (CPU), establishing a socket on the first CPU, and transmitting the socket to the second CPU, the efficiency of acquiring the socket corresponding to the data transmission command can be improved. The application controlled by the first CPU acquires the data transmission command; acquires the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command; transmits the shared data to the daemon process through the proxy module by calling the socket; controls the daemon process to transmit the shared data to the service process of the second CPU through a cross-core communication module set, so that the second CPU responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second CPU. Therefore, when data transmission needs to be performed through the first CPU, which does not have a physical network card, the data to be transmitted can be sent to the second CPU, which has a physical network card, by using a socket and a cross-core communication module set, and then the data can be transmitted to the network device through the second CPU. Therefore, even if a CPU in an electronic device does not have network card capability, network resources can still be accessed through the application controlled by that CPU, thereby improving the convenience of network sharing.
[0137] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0138] Please see Figure 6 , Figure 6 This diagram illustrates a flowchart of a network sharing method provided in an embodiment of the present disclosure. The network sharing method is applied to a scenario where a second central processing unit (CPU) is equipped with a physical network interface card (NIC). Specifically, the network sharing method includes:
[0139] S301, obtains shared data sent by the first central processing unit through a cross-core communication module set;
[0140] According to some embodiments, sharing data refers to the first central processing unit (CPU) obtaining a data transmission instruction for an application and calling the socket corresponding to the data transmission instruction to send the data transmission instruction to the second CPU through the proxy module and cross-core communication module set of the first CPU.
[0141] In some embodiments, when an electronic device obtains shared data sent by a first central processing unit through a cross-core communication module set, the first central processing unit does not have a physical network interface card (NIC).
[0142] According to some embodiments, the cross-core communication module set includes a first asymmetric multi-core communication module in a first central processing unit and a second asymmetric multi-core communication module in a second central processing unit. When an electronic device obtains shared data sent by the first central processing unit through the cross-core communication module set, the electronic device can obtain the shared data sent by the first central processing unit through the first asymmetric multi-core communication module through the second asymmetric multi-core communication module.
[0143] It is easy to understand that when an electronic device shares data over a network, it can obtain the shared data sent by the first central processing unit through a set of cross-core communication modules.
[0144] S302, in response to a data transmission command, transmits shared data to network devices based on the physical network interface card;
[0145] According to some embodiments, when an electronic device transmits shared data to a network device based on a physical network card, the electronic device can encapsulate the data packet corresponding to the shared data in the kernel protocol stack of a second central processing unit, and then the electronic device can send the data packet to the network device based on the physical network card.
[0146] It is easy to understand that when an electronic device receives shared data sent by the first central processing unit, the electronic device can respond to the data transmission command and transmit the shared data to the network device based on the physical network card.
[0147] In this embodiment, shared data sent by the first central processing unit (CPU) is obtained through a cross-core communication module set. In response to a data transmission command, the shared data is transmitted to the network device based on the physical network interface card (NIC). Therefore, when data transmission is required through the first CPU, which lacks a physical NIC, the data to be transmitted can be sent to a second CPU equipped with a physical NIC using sockets and the cross-core communication module set. The second CPU can then transmit the data to the network device. Thus, even if a CPU in an electronic device lacks NIC capabilities, network resources can still be accessed through an application controlled by that CPU.
[0148] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.
[0149] Please see Figure 7This illustration shows a schematic diagram of a network sharing device provided in an exemplary embodiment of the present disclosure. The network sharing device can be implemented as all or part of a device through software, hardware, or a combination of both. The network sharing device is applied to scenarios including a first central processing unit (CPU) that does not have a physical network interface card (NIC). The network sharing device 700 includes an instruction acquisition unit 701, a data acquisition unit 702, and a data transmission unit 703, wherein:
[0150] The instruction acquisition unit 701 is used to acquire data transmission instructions through the application controlled by the first central processing unit;
[0151] The data acquisition unit 702 is used to acquire the socket corresponding to the data transmission command and the shared data corresponding to the data transmission command.
[0152] The data transmission unit 703 is used to call a socket to send shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit;
[0153] Among them, the first operating system in the second central processing unit and the second operating system in the first central processing unit are heterogeneous multi-core operating systems.
[0154] According to some embodiments, Figure 8 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure. Figure 8 As shown, the network sharing device 700 also includes an information acquisition unit 704 and a socket establishment unit 705, used to acquire data transmission instructions before the application controlled by the first central processing unit:
[0155] The information acquisition unit 704 is used to acquire the proxy module call information sent by the second central processing unit. The proxy module call information is generated when the second central processing unit calls the proxy module in the first central processing unit.
[0156] The socket creation unit 705 is used to create a socket on the first central processing unit and transmit the socket to the second central processing unit.
[0157] According to some embodiments, Figure 9 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure. Figure 9 As shown, the first central processing unit also includes a daemon process, and the second central processing unit includes a service process;
[0158] Data transmission unit 703 includes socket invocation subunit 713 and process control subunit 723. Data transmission unit 703 is used to invoke sockets to send shared data to the second central processing unit through proxy module and cross-core communication module set:
[0159] Socket call subunit 713 is used to call the socket to transmit shared data to the daemon process through the proxy module;
[0160] The process control subunit 723 is used to control the daemon process to transmit shared data to the service process of the second central processing unit through the cross-core communication module set.
[0161] According to some embodiments, the cross-core communication module set includes a first asymmetric multi-core communication module in a first central processing unit and a second asymmetric multi-core communication module in a second central processing unit.
[0162] The process control subunit is used to control the daemon process when transmitting shared data to the service process of the second CPU via the cross-core communication module set. Specifically, it is used for:
[0163] The control daemon transmits the shared data through the first asymmetric multi-core communication module to the second asymmetric multi-core communication module of the second central processing unit, so that the service process of the second asymmetric multi-core communication module can obtain the shared data.
[0164] According to some embodiments, the socket is a UNIX socket.
[0165] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0166] In this embodiment, the instruction acquisition unit acquires a data transmission instruction through an application controlled by the first central processing unit (CPU); the data acquisition unit acquires the socket corresponding to the data transmission instruction and the shared data corresponding to the data transmission instruction; the data transmission unit calls the socket to send the shared data to the second CPU through a proxy module and a cross-core communication module set, so that the second CPU responds to the data transmission instruction and transmits the shared data to the network device based on the physical network interface card (NIC) in the second CPU; wherein, the first operating system in the second CPU and the second operating system in the first CPU are heterogeneous multi-core operating systems. Therefore, when data transmission needs to be performed through the first CPU which does not have a physical NIC, the data to be transmitted can be sent to the second CPU which has a physical NIC by using a socket and a cross-core communication module set, and then the data can be transmitted to the network device through the second CPU. Therefore, even if a CPU in an electronic device does not have NIC capability, network resources can still be accessed through an application controlled by that CPU.
[0167] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0168] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.
[0169] Please see Figure 10 This illustration shows a schematic diagram of a network sharing device provided in an exemplary embodiment of the present disclosure. The network sharing device can be implemented as all or part of a device through software, hardware, or a combination of both. The network sharing device is applied to scenarios including a second central processing unit (CPU) equipped with a physical network interface card (NIC). The network sharing device 1000 includes a data transmission unit 1001 and an instruction response unit 1002, wherein:
[0170] The data sending unit 1001 is used to obtain shared data sent by the first central processing unit through the cross-core communication module set; the shared data is the data transmission instruction for the application obtained by the first central processing unit, and the data transmission instruction corresponding to the socket is called to send the data transmission instruction corresponding to the second central processing unit through the proxy module of the first central processing unit and the cross-core communication module set. The first central processing unit does not have a physical network card.
[0171] The instruction response unit 1002 is used to respond to a data transmission instruction and transmit shared data to the network device based on the physical network card.
[0172] According to some embodiments, Figure 11 This diagram illustrates the structure of a network sharing device according to an embodiment of the present disclosure. Figure 11 As shown, the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit;
[0173] The data sending unit 1001 includes a data acquisition subunit 1011, which is used to acquire shared data sent by the first central processing unit through a cross-core communication module set:
[0174] The data acquisition subunit 1011 is used to acquire shared data sent by the first central processing unit through the first asymmetric multi-core communication module via the second asymmetric multi-core communication module.
[0175] The sequence numbers of the embodiments disclosed above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0176] In this embodiment, the data sending unit acquires the shared data sent by the first central processing unit (CPU) through a cross-core communication module set; the instruction response unit, in response to the data transmission instruction, transmits the shared data to the network device based on the physical network interface card (NIC). Therefore, when data transmission is required through the first CPU, which lacks a physical NIC, the data to be transmitted can be sent to a second CPU equipped with a physical NIC using sockets and a cross-core communication module set, and then transmitted to the network device via the second CPU. Thus, even if a CPU in an electronic device lacks NIC capabilities, network resources can still be accessed through an application controlled by that CPU.
[0177] According to embodiments of this disclosure, this disclosure also provides an electronic device, a data transmission system, a readable storage medium, and a computer program product.
[0178] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0179] like Figure 12 As shown, device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1202 or a computer program loaded from storage unit 1208 into random access memory (RAM) 1203. The RAM 1203 may also store various programs and data required for the operation of device 1200. The computing unit 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0180] Multiple components in device 1200 are connected to I / O interface 1205, including: input unit 1206, such as keyboard, mouse, etc.; output unit 1207, such as various types of monitors, speakers, etc.; storage unit 1208, such as disk, optical disk, etc.; and communication unit 1209, such as network card, modem, wireless transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0181] The computing unit 1201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as network sharing methods. For example, in some embodiments, the network sharing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the network sharing method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform network sharing methods by any other suitable means (e.g., by means of firmware).
[0182] The data transmission system described above in this document includes a first central processing unit (CPU) and a second CPU. The first CPU does not have a physical network interface card (NIC), while the second CPU does. The first CPU is used to execute the aforementioned network sharing method. Figures 3 to 5 The steps shown are used by the first central processing unit to perform the network sharing method described above. Figure 6 The steps are shown.
[0183] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0184] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0185] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0186] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0187] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0188] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0189] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0190] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A network sharing method, characterized by, include: Data transmission instructions are obtained through an application controlled by a first central processing unit (CPU), which does not have a physical network interface card (NIC). Obtain the socket corresponding to the data transmission instruction and the shared data corresponding to the data transmission instruction; The socket is invoked to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit; The first operating system in the second central processing unit and the second operating system in the first central processing unit are systems composed of multiple single-core or multi-core processors of different types. The first central processing unit further includes a daemon process, and the second central processing unit includes a service process; the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit; The step of calling the socket to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set includes: The socket is invoked to transmit the shared data to the daemon process through the proxy module; The daemon process is controlled to transmit the shared data through the first asymmetric multi-core communication module to the second asymmetric multi-core communication module of the second central processing unit, so that the service process where the second asymmetric multi-core communication module is located can obtain the shared data.
2. The method of claim 1, wherein, Before the application controlled by the first central processing unit obtains the data transmission instruction, the method further includes: Obtain proxy module call information sent by the second central processing unit, wherein the proxy module call information is generated when the second central processing unit calls the proxy module in the first central processing unit; The socket is created on the first central processing unit and then transmitted to the second central processing unit.
3. The method of claim 1, wherein, The socket in question is a UNIX socket.
4. A network sharing method characterized by, include: The shared data sent by the first central processing unit is obtained through a cross-core communication module set; The shared data is the data transmission instruction obtained by the first central processing unit for the application, and the data transmission instruction corresponding to the socket is called and sent to the second central processing unit through the proxy module and cross-core communication module set of the first central processing unit. The first central processing unit does not have the physical network card, while the second central processing unit has a physical network card. In response to the data transmission command, the shared data is transmitted to the network device based on the physical network interface card; The cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit. The process of obtaining shared data sent by the first central processing unit through a cross-core communication module set includes: The second asymmetric multi-core communication module obtains the shared data sent by the first central processing unit through the first asymmetric multi-core communication module.
5. A network sharing apparatus characterized by comprising: include: The instruction acquisition unit is used to acquire data transmission instructions through an application controlled by the first central processing unit, which does not have a physical network card. The data acquisition unit is used to acquire the socket corresponding to the data transmission instruction and the shared data corresponding to the data transmission instruction; The data transmission unit is used to call the socket to send the shared data to the second central processing unit through the proxy module and the cross-core communication module set, so that the second central processing unit responds to the data transmission command and transmits the shared data to the network device based on the physical network card in the second central processing unit; The first operating system in the second central processing unit and the second operating system in the first central processing unit are systems composed of multiple single-core or multi-core processors of different types. The first central processing unit further includes a daemon process, and the second central processing unit includes a service process; the cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit; The data transmission unit is specifically used for: The socket is invoked to transmit the shared data to the daemon process through the proxy module; The daemon process is controlled to transmit the shared data through the first asymmetric multi-core communication module to the second asymmetric multi-core communication module of the second central processing unit, so that the service process where the second asymmetric multi-core communication module is located can obtain the shared data.
6. A network sharing apparatus characterized by comprising: include: A data transmission unit is used to obtain shared data sent by the first central processing unit through a cross-core communication module set; The shared data is the data transmission instruction obtained by the first central processing unit for the application, and the data transmission instruction corresponding to the socket is called and sent to the second central processing unit through the proxy module and cross-core communication module set of the first central processing unit. The first central processing unit does not have the physical network card, while the second central processing unit has a physical network card. An instruction response unit is configured to respond to the data transmission instruction and transmit the shared data to the network device based on the physical network interface card. The cross-core communication module set includes a first asymmetric multi-core communication module in the first central processing unit and a second asymmetric multi-core communication module in the second central processing unit. The data transmission unit is specifically used for: The second asymmetric multi-core communication module obtains the shared data sent by the first central processing unit through the first asymmetric multi-core communication module.
7. A network sharing system characterized by comprising: The network sharing system includes a first central processing unit as described in any one of claims 1 to 3 and a second central processing unit as described in claim 4, wherein the first central processing unit does not have a physical network card and the second central processing unit has a physical network card.
8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; characterized in that, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3 and the method of claim 4.
9. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 3 and the method according to claim 4.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 3 and the method according to claim 4.