[go: up one dir, main page]

CN114860467A - Data transmission method, device and equipment based on kernel space and mobile robot - Google Patents

Data transmission method, device and equipment based on kernel space and mobile robot Download PDF

Info

Publication number
CN114860467A
CN114860467A CN202110153300.3A CN202110153300A CN114860467A CN 114860467 A CN114860467 A CN 114860467A CN 202110153300 A CN202110153300 A CN 202110153300A CN 114860467 A CN114860467 A CN 114860467A
Authority
CN
China
Prior art keywords
data
transmitted
space
file descriptor
kernel space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110153300.3A
Other languages
Chinese (zh)
Inventor
郭小俊
陈秀辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202110153300.3A priority Critical patent/CN114860467A/en
Publication of CN114860467A publication Critical patent/CN114860467A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure discloses a data transmission method, a data transmission device, data transmission equipment and a mobile robot based on a kernel space. One embodiment of the method comprises: acquiring data to be transmitted sent to a second process from a user space where a first process is located, wherein the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted comprises data associated with an invoked software development kit; determining whether the data volume of the data to be transmitted is larger than a preset threshold value; in response to the fact that the data volume of the data to be transmitted is larger than a preset threshold value, acquiring a file descriptor corresponding to the data to be transmitted, wherein the file descriptor is used for indicating a memory address and a data reading length; and sending the data to be transmitted to the second process according to the file descriptor. The implementation mode realizes cross-process communication of large-scale data.

Description

Data transmission method, device and equipment based on kernel space and mobile robot
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data transmission method, a data transmission device, data transmission equipment and a mobile robot based on a kernel space.
Background
An SDK (software development kit) generally refers to a collection of development tools used by a software development engineer to build application software for a particular software package, software framework, hardware platform, operating system, etc. In order to ensure that critical data inside the SDK is not leaked, Inter-Process Communication (IPC) is generally implemented by using a programming interface that defines approval of both a data sending end (e.g., an SDK running Process) and a data receiving end (e.g., a Process that calls the SDK). However, the efficiency is low due to the limited amount of data per transmission.
Disclosure of Invention
The embodiment of the disclosure provides a data transmission method, a data transmission device, data transmission equipment and a mobile robot based on a kernel space.
In a first aspect, an embodiment of the present disclosure provides a kernel space-based data transmission method, where the method includes: acquiring data to be transmitted sent to a second process from a User Space (User Space) where a first process is located, wherein the User Space where the first process is located and the User Space where the second process is located correspond to the same Kernel Space (Kernel), and the data to be transmitted comprises data associated with an invoked software development kit; determining whether the data volume of the data to be transmitted is greater than a preset threshold value; in response to the fact that the data volume of the data to be transmitted is larger than a preset threshold value, obtaining a file descriptor corresponding to the data to be transmitted, wherein the file descriptor is used for indicating a memory address and a data reading length; and sending the data to be transmitted to the second process according to the file descriptor.
In some embodiments, the sending the data to be transmitted to the second process according to the file descriptor includes: creating a data receiving cache region corresponding to the second process in the kernel space; generating a mapping relation between a data receiving cache region and a preset kernel cache region in a kernel space as a first mapping relation according to the file descriptor; acquiring a mapping relation between the data receiving cache region and the address of the user space where the second process is located as a second mapping relation; and storing the data to be transmitted into the kernel cache region so as to transmit the data to be transmitted according to the first mapping relation and the second mapping relation.
In some embodiments, the method further comprises: and transmitting the response data which is stored in the user space where the second process is located and is matched with the data to be transmitted according to the first mapping relation and the second mapping relation.
In some embodiments, the kernel space may include a kernel space of a mobile robot Andriod system.
In some embodiments, the method further comprises: and in response to the fact that the data volume of the data to be transmitted is not larger than the preset threshold value, transmitting the data to be transmitted to the second process through the Andriod interface definition language.
In some embodiments, the data to be transmitted includes map data.
In a second aspect, an embodiment of the present disclosure provides a kernel space-based data transmission apparatus, including: the first obtaining unit is configured to obtain data to be transmitted sent to the second process from a user space where the first process is located, wherein the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted comprises data associated with the called software development kit; a determination unit configured to determine whether a data amount of data to be transmitted is greater than a preset threshold; the second obtaining unit is configured to obtain a file descriptor corresponding to the data to be transmitted in response to the fact that the data volume of the data to be transmitted is larger than a preset threshold value, wherein the file descriptor is used for indicating a memory address and a data reading length; and the first sending unit is configured to send the data to be transmitted to the second process according to the file descriptor.
In some embodiments, the first sending unit is further configured to: creating a data receiving cache region corresponding to the second process in the kernel space; generating a mapping relation between a data receiving cache region and a preset kernel cache region in a kernel space as a first mapping relation according to the file descriptor; acquiring a mapping relation between the data receiving cache region and an address of a user space where a second process is located as a second mapping relation; and storing the data to be transmitted into the kernel cache region so as to transmit the data to be transmitted according to the first mapping relation and the second mapping relation.
In some embodiments, the apparatus further comprises: and the transmission unit is configured to transmit the response data which is stored in the user space where the second process is located and is matched with the data to be transmitted according to the first mapping relation and the second mapping relation.
In some embodiments, the kernel space comprises a kernel space of an Andriod system of the mobile robot.
In some embodiments, the apparatus further comprises: and the second sending unit is configured to send the data to be transmitted to the second process through the Andriod interface definition language in response to the fact that the data volume of the data to be transmitted is not larger than the preset threshold value.
In some embodiments, the data to be transmitted includes map data.
In a third aspect, an embodiment of the present disclosure provides an apparatus, including: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a mobile robot comprising the electronic device as described in the third aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which when executed by a processor implements the method as described in any of the implementations of the first aspect.
According to the data transmission method, device, equipment, mobile robot and medium based on the kernel space, data which are sent to the second process and are associated with the called software development kit are obtained from the user space where the first process corresponding to the same kernel space is located, and the data are sent to the second process according to the obtained file descriptor, so that cross-process transmission of large-scale data is achieved. Moreover, due to the mutual isolation mechanism among the processes, the situation that a user side using the SDK directly obtains key data in the SDK is avoided, and therefore the safety of data transmission is improved.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a kernel space based data transfer method according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of a kernel space based data transfer method according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a kernel space based data transfer method according to the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of a kernel space based data transfer apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the kernel space based data transfer method or kernel space based data transfer apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, a map navigation application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting human-computer interaction, including but not limited to smart phones, tablet computers, laptop portable computers, mobile robots, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for map-like applications on the terminal devices 101, 102, 103. The background server may analyze and process the received data request, and perform corresponding processing according to the request (e.g., extract corresponding data from a database), and may also feed back a generated processing result (e.g., the extracted data) to the terminal device.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the data transmission method based on kernel space provided by the embodiments of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the data transmission apparatus based on kernel space is generally disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a kernel space based data transfer method according to the present disclosure is shown. The data transmission method based on the kernel space comprises the following steps:
step 201, obtaining data to be transmitted sent to a second process from a user space where a first process is located.
In this embodiment, an execution main body (such as an operating system in terminal devices 101, 102, and 103 shown in fig. 1) of the data transmission method based on the kernel space may obtain, from a user space where a first process is located, to-be-transmitted data to be sent by the first process to a second process. And the user space where the first process is located and the user space where the second process is located correspond to the same kernel space. The data to be transmitted may include data associated with the invoked software development kit, such as data obtained through implementation of functionality in the software development kit that is not desired to be exposed. The first process and the second process are typically co-owned by a user program (typically referred to as a non-system-level application).
It should be noted that the kernel space refers to a space where a system kernel runs, and the user space refers to a space where a user program runs. To ensure safety, they are usually isolated. When the user space needs to access kernel resources (such as file operations, access to a network, and the like), in order to break isolation restrictions, the user space needs to be implemented by means of system calls. The system call ensures that all resource access is carried out under the control of the kernel, thereby avoiding unauthorized access of user programs to system resources and improving the safety and stability of the system.
In some optional implementations of the present embodiment, the kernel space may include a kernel space of an Andriod system of a mobile robot. Therefore, the method and the device can be applied to the mobile robot developed based on the Android system.
Based on the optional implementation manner, optionally, the data to be transmitted includes map data. Wherein the map data may include, but is not limited to, at least one of: 2-dimensional map data, 3-dimensional point cloud data and a high-precision map. Due to the fact that the amount of communication of the AIDL (Android Interface definition language) provided by the Android system per se is limited (for example, less than 1M), the method is far insufficient for map data which are required to be transmitted by a mobile robot, and a cross-process data transmission scheme for large-scale data such as maps can be provided by using the scheme.
Step 202, determining whether the data volume of the data to be transmitted is greater than a preset threshold.
In this embodiment, the execution main body may determine whether the data amount of the data to be transmitted is greater than a preset threshold value in various ways. The preset threshold may be determined according to a limit value of a cross-process data transmission manner (e.g., AIDL) provided by the kernel system, for example, 1M.
Step 203, in response to determining that the data amount of the data to be transmitted is greater than the preset threshold, obtaining a file descriptor corresponding to the data to be transmitted.
In this embodiment, in response to determining that the data amount of the data to be transmitted is greater than the preset threshold, the execution main body may obtain the file descriptor corresponding to the data to be transmitted in various manners. The file descriptor may be used to indicate a memory address and a data read length. The data size of the file descriptor is generally smaller than the data size of the data to be transmitted. As an example, the execution subject may obtain a memory address previously allocated to the data to be transmitted. According to the memory address corresponding to the data to be transmitted and the memory space occupied by the data volume of the data to be transmitted, the execution main body can obtain the file descriptor used for indicating the memory address and the data reading length.
And step 204, sending the data to be transmitted to the second process according to the file descriptor.
In this embodiment, according to the file descriptor obtained in step 203, the execution subject may send the data to be transmitted to the second process in various ways. As an example, the execution agent may store the data to be transmitted in a preset kernel cache in response to the first process using a copy _ from _ user () system call. According to the file descriptor obtained in step 203, the executing agent may send the data to be transmitted stored in the kernel cache to the second process in response to the second process calling using a copy _ to _ user () system.
In some optional implementation manners of this embodiment, the execution main body may send the data to be transmitted to the second process according to the following steps:
in the first step, a data receiving buffer zone corresponding to the second process is created in the kernel space.
In these implementations, the execution body (e.g., Binder driver running on the terminal devices 101, 102, and 103 shown in fig. 1) may create a data receiving buffer corresponding to the second process in the kernel space.
And secondly, generating a mapping relation between the data receiving cache region and a preset kernel cache region in the kernel space as a first mapping relation according to the file descriptor.
In these implementations, the execution subject may generate, as the first mapping relationship, a mapping relationship between the data receiving cache created in the first step and a kernel cache preset in a kernel space. The kernel cache region is used for caching data in a kernel space. As an example, this may be accomplished by calling a mmap () system function.
Thus, the association between the generated data receiving cache region and the preset core cache region can be established.
And thirdly, acquiring a mapping relation between the data receiving cache region and the address of the user space where the second process is located as a second mapping relation.
In these implementations, the execution main body may obtain, in various manners, a mapping relationship between the data receiving cache region and an address of the user space where the second process is located as the second mapping relationship. Thus, an association between the generated data reception buffer and the address of the user space in which the second process is located can be established.
And fourthly, storing the data to be transmitted into the kernel cache region so as to transmit the data to be transmitted according to the first mapping relation and the second mapping relation.
In these implementations, the execution body may store the data to be transmitted in the core cache region. As an example, the execution agent may store the data to be transferred in the kernel cache in response to the first process using a copy _ from _ user () system call. Because a first mapping relation exists between the kernel cache region and the data receiving cache region and a second mapping relation exists between the data receiving cache region and the address of the user space where the second process is located, the data to be transmitted is logically equivalent to be transmitted to the user space where the second process is located, and communication between the first process and the second process is achieved.
Based on the optional implementation mode, the communication of large-scale data among the processes can be realized by establishing the memory mapping, the data copying times are reduced, and the data transmission efficiency is improved.
In some optional implementation manners of this embodiment, based on a kernel space of the Andriod system of the mobile robot, in response to determining that a data amount of the data to be transmitted is not greater than a preset threshold, the execution main body may send the data to be transmitted to the second process through an Andriod interface definition language.
Based on the optional implementation manner, when the data volume to be transmitted is small, the data to be transmitted can be sent to the second process by adopting a lighter android interface definition language, so that the resource overhead of the data transmission process is saved.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of a kernel space-based data transmission method according to an embodiment of the present disclosure. In the application scenario of fig. 3, the operating system may first obtain data to be transmitted from the user space 3011 where the first process (e.g., the process running the SDK) 301 is located. Then, the operating system may determine whether the data amount of the data to be transmitted is greater than a preset threshold, for example, 1M. In response to determining that the amount of the data to be transmitted is greater than a preset threshold, the operating system may obtain a file descriptor corresponding to the data to be transmitted. The file descriptor may be determined according to a memory address where the data to be transmitted is stored in the kernel space 303 and a space occupied by the data to be transmitted. Then, the operating system may transmit the data from the kernel space 303 to the user space 3021 where the second process (e.g., the process calling the SDK) 302 is located according to the memory address and the data reading length indicated by the file descriptor.
At present, in one of the prior art, a programming interface that defines approval of both a data sending end (e.g., an SDK running process) and a data receiving end (e.g., a process that calls the SDK) is usually used to implement inter-process communication, which results in low data transmission efficiency. The method provided by the embodiment of the disclosure realizes cross-process transmission of large-scale data through data transfer of the kernel space. Moreover, due to the mutual isolation mechanism among the processes, the situation that a user side using the SDK directly obtains key data in the SDK is avoided, and therefore the safety of data transmission is improved.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a kernel space based data transfer method is shown. The process 400 of the kernel space-based data transmission method includes the following steps:
step 401, obtaining data to be transmitted sent to a second process from a user space where a first process is located.
Step 402, determining whether the data volume of the data to be transmitted is greater than a preset threshold.
Step 403, in response to determining that the data volume of the data to be transmitted is greater than the preset threshold, obtaining a file descriptor corresponding to the data to be transmitted.
Step 404, sending the data to be transmitted to the second process according to the file descriptor.
The steps 401 to 404 are respectively consistent with the steps 201 to 204 and their optional implementation manners in the foregoing embodiment, and the above description on the steps 201 to 204 and their optional implementation manners also applies to the steps 401 to 404, which is not described herein again.
And 405, transmitting the response data which is stored in the user space where the second process is located and is matched with the data to be transmitted according to the first mapping relation and the second mapping relation.
In this embodiment, the second process may respond to the received data to be transmitted, so that the response data matched with the data to be transmitted is stored in the user space where the second process is located. As an example, the data to be transmitted may be a data acquisition request, and the response data may be data to be acquired indicated by the data acquisition request. As another example, the data to be transmitted may be a data processing request, and the response data may be a processing result corresponding to the data processing request.
As an example, an executing subject of the kernel space-based data transfer method (e.g., a Binder driver running on the terminal devices 101, 102, 103 shown in fig. 1) may receive the above-described response data from the above-described kernel cache in response to the first process using a copy _ to _ user () system call. Thus, the execution body of the data transmission method based on the kernel space (e.g., Binder framework in the terminal devices 101, 102, and 103 shown in fig. 1) can perform memory mapping in the kernel space.
Because a first mapping relation exists between the kernel cache region and the data receiving cache region and a second mapping relation exists between the data receiving cache region and the address of the user space where the second process is located, the response data is logically transmitted to the user space where the first process is located, and communication between the first process and the second process is achieved.
As can be seen from fig. 4, a process 400 of the data transmission method based on kernel space in this embodiment represents a step of transmitting response data, which is stored in a user space where a second process is located and is matched with data to be transmitted, according to a first mapping relationship and a second mapping relationship. Therefore, the scheme described in this embodiment can utilize the memory mapping of the kernel space to realize the cross-process bidirectional transmission of a large data volume.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a kernel space-based data transmission apparatus, which corresponds to the method embodiment shown in fig. 2 or fig. 4, and which can be applied in various electronic devices.
As shown in fig. 5, the data transmission apparatus 500 based on kernel space provided in this embodiment includes a first obtaining unit 501, a determining unit 502, a second obtaining unit 503, and a first sending unit 504. The first obtaining unit 501 is configured to obtain data to be transmitted, which is sent to a second process, from a user space where a first process is located, where the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted includes data associated with an invoked software development kit; a determining unit 502 configured to determine whether a data amount of data to be transmitted is greater than a preset threshold; a second obtaining unit 503, configured to, in response to determining that the data amount of the data to be transmitted is greater than a preset threshold, obtain a file descriptor corresponding to the data to be transmitted, where the file descriptor is used to indicate a memory address and a data reading length; a first sending unit 504 configured to send the data to be transmitted to the second process according to the file descriptor.
In the present embodiment, in the kernel space-based data transmission apparatus 500: the detailed processing of the first obtaining unit 501, the determining unit 502, the second obtaining unit 503 and the first sending unit 504 and the technical effects brought by the processing can refer to the related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the first sending unit 504 may be further configured to: creating a data receiving cache region corresponding to the second process in the kernel space; generating a mapping relation between a data receiving cache region and a preset kernel cache region in a kernel space as a first mapping relation according to the file descriptor; acquiring a mapping relation between the data receiving cache region and the address of the user space where the second process is located as a second mapping relation; and storing the data to be transmitted into the kernel cache region so as to transmit the data to be transmitted according to the first mapping relation and the second mapping relation.
In some optional implementations of this embodiment, the kernel space-based data transmission apparatus 500 may further include: and the transmission unit (not shown in fig. 5) is configured to transmit the response data which is stored in the user space where the second process is located and is matched with the data to be transmitted according to the first mapping relation and the second mapping relation.
In some optional implementations of this embodiment, the kernel space may include a kernel space of an Andriod system of a mobile robot.
In some optional implementations of this embodiment, the kernel space-based data transmission apparatus 500 may further include: and a second sending unit (not shown in fig. 5) configured to send the data to be transmitted to the second process through the android interface definition language in response to determining that the data amount of the data to be transmitted is not greater than the preset threshold.
In some optional implementation manners of this embodiment, the data to be transmitted may include map data.
In the apparatus provided in the foregoing embodiment of the present disclosure, the first obtaining unit 501 obtains, from the user space where the first process corresponding to the same kernel space is located, the data associated with the invoked software development kit, which is sent to the second process, and the first sending unit 504 sends the data to the second process according to the file descriptor obtained by the second obtaining unit 503, thereby implementing cross-process communication of large-scale data.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., the terminal of fig. 1) 600 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
The mobile robot provided by the present disclosure may include the above-described electronic device as shown in fig. 6.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled into the terminal device. The computer readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: acquiring data to be transmitted sent to a second process from a user space where the first process is located, wherein the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted comprises data associated with an invoked software development kit; determining whether the data volume of the data to be transmitted is greater than a preset threshold value; in response to the fact that the data volume of the data to be transmitted is larger than a preset threshold value, obtaining a file descriptor corresponding to the data to be transmitted, wherein the file descriptor is used for indicating a memory address and a data reading length; and sending the data to be transmitted to the second process according to the file descriptor.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as "C", Python, or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a first acquisition unit, a determination unit, a second acquisition unit and a first sending unit. For example, the first obtaining unit may be further described as a unit that obtains data to be transmitted sent to the second process from a user space where the first process is located, where the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted includes data associated with the invoked software development kit.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A data transmission method based on kernel space comprises the following steps:
acquiring data to be transmitted sent to a second process from a user space where a first process is located, wherein the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted comprises data associated with an invoked software development kit;
determining whether the data volume of the data to be transmitted is larger than a preset threshold value;
in response to the fact that the data volume of the data to be transmitted is larger than a preset threshold value, obtaining a file descriptor corresponding to the data to be transmitted, wherein the file descriptor is used for indicating a memory address and a data reading length;
and sending the data to be transmitted to a second process according to the file descriptor.
2. The method of claim 1, wherein the sending the data to be transmitted to a second process according to the file descriptor comprises:
creating a data receiving cache region corresponding to the second process in the kernel space;
generating a mapping relation between the data receiving cache region and a preset kernel cache region in the kernel space as a first mapping relation according to the file descriptor;
acquiring a mapping relation between the data receiving cache region and the address of the user space where the second process is located as a second mapping relation;
and storing the data to be transmitted into the kernel cache region so as to transmit the data to be transmitted according to the first mapping relation and the second mapping relation.
3. The method of claim 2, wherein the method further comprises:
and transmitting response data which is stored in the user space where the second process is located and matched with the data to be transmitted according to the first mapping relation and the second mapping relation.
4. The method of any of claims 1-3, wherein the kernel space comprises a kernel space of a mobile robotic Andriod system.
5. The method of claim 4, wherein the method further comprises:
and in response to the fact that the data volume of the data to be transmitted is not larger than the preset threshold value, sending the data to be transmitted to the second process through an Andriod interface definition language.
6. The method of claim 4, wherein the data to be transmitted comprises map data.
7. A kernel space-based data transfer apparatus, comprising:
the device comprises a first obtaining unit and a second obtaining unit, wherein the first obtaining unit is configured to obtain data to be transmitted sent to a second process from a user space where a first process is located, the user space where the first process is located and the user space where the second process is located correspond to the same kernel space, and the data to be transmitted comprises data associated with an invoked software development kit;
a determination unit configured to determine whether a data amount of the data to be transmitted is greater than a preset threshold;
the second obtaining unit is configured to obtain a file descriptor corresponding to the data to be transmitted in response to determining that the data volume of the data to be transmitted is greater than a preset threshold, wherein the file descriptor is used for indicating a memory address and a data reading length;
and the first sending unit is configured to send the data to be transmitted to the second process according to the file descriptor.
8. An apparatus, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A mobile robot comprising the terminal of claim 8.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110153300.3A 2021-02-04 2021-02-04 Data transmission method, device and equipment based on kernel space and mobile robot Pending CN114860467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110153300.3A CN114860467A (en) 2021-02-04 2021-02-04 Data transmission method, device and equipment based on kernel space and mobile robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110153300.3A CN114860467A (en) 2021-02-04 2021-02-04 Data transmission method, device and equipment based on kernel space and mobile robot

Publications (1)

Publication Number Publication Date
CN114860467A true CN114860467A (en) 2022-08-05

Family

ID=82623452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110153300.3A Pending CN114860467A (en) 2021-02-04 2021-02-04 Data transmission method, device and equipment based on kernel space and mobile robot

Country Status (1)

Country Link
CN (1) CN114860467A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467473A (en) * 2010-11-03 2012-05-23 Tcl集团股份有限公司 Method and device for transmitting data between user space and kernel
CN106547631A (en) * 2016-09-26 2017-03-29 腾讯科技(深圳)有限公司 Striding course communication means and device based on Android platform
CN109669784A (en) * 2017-10-13 2019-04-23 华为技术有限公司 A kind of method and system of interprocess communication
CN111181748A (en) * 2018-11-09 2020-05-19 中移(杭州)信息技术有限公司 A method, device and readable medium for reporting positioning information
CN111240853A (en) * 2019-12-26 2020-06-05 天津中科曙光存储科技有限公司 Method and system for bidirectionally transmitting massive data in node

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467473A (en) * 2010-11-03 2012-05-23 Tcl集团股份有限公司 Method and device for transmitting data between user space and kernel
CN106547631A (en) * 2016-09-26 2017-03-29 腾讯科技(深圳)有限公司 Striding course communication means and device based on Android platform
CN109669784A (en) * 2017-10-13 2019-04-23 华为技术有限公司 A kind of method and system of interprocess communication
CN111181748A (en) * 2018-11-09 2020-05-19 中移(杭州)信息技术有限公司 A method, device and readable medium for reporting positioning information
CN111240853A (en) * 2019-12-26 2020-06-05 天津中科曙光存储科技有限公司 Method and system for bidirectionally transmitting massive data in node

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CARSON带你学ANDROID: "Android跨进程通信:图文详解Binder机制原理", Retrieved from the Internet <URL:https://blog.csdn.net/carson_ho/article/details/73560642> *
王汝言;蒋子泉;刘乔寿;吴大鹏;: "Android下Binder进程间通信机制的分析与研究", 计算机技术与发展, no. 09, 10 September 2012 (2012-09-10) *

Similar Documents

Publication Publication Date Title
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN113434241A (en) Page skipping method and device
CN110007936A (en) Data processing method and device
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN114780263B (en) Service invocation methods, devices, equipment, and storage media
CN110618768B (en) Information presentation method and device
CN109697034B (en) Data writing method and device, electronic equipment and storage medium
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN111324376A (en) Function configuration method and device, electronic equipment and computer readable medium
CN112835632A (en) A terminal capability calling method, device and computer storage medium
CN116561013B (en) Test methods, devices, electronic equipment and media based on the target service framework
JP2025078578A (en) Data transmission method, device, equipment and storage medium
CN114860467A (en) Data transmission method, device and equipment based on kernel space and mobile robot
CN113986743B (en) Location information modification method, device, storage medium and electronic device
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN109918209B (en) Method and equipment for communication between threads
CN114513548B (en) Directional call information processing method and device
US20250251931A1 (en) Method for data management, medium, and electronic device
CN110099122B (en) Method and apparatus for sending network request
CN114222005B (en) Request processing method, apparatus, device, computer readable storage medium and product
CN111694679B (en) Message processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination