A method and apparatus for cross-device sensor data management based on shared memory.
By managing sensor data through shared memory, users can access the data simply by providing the sensor name, which solves the network dependency problem between sensor devices and processing platforms, and enables low-latency cross-device data sharing and low resource consumption.
Patent Information
- Application Number
- CN202111642193.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-12-29
AI Technical Summary
When sensor devices interact with processing platform devices running the ROS software architecture, they require network interfaces, which leads to tight network bandwidth, limited IP address resources, and low efficiency in inter-process communication.
By adopting a shared memory-based approach, sensors are registered by management devices, memory space is requested, and address information is bound. Users only need to provide the sensor name to access the data, and cross-device data sharing is achieved between management devices through address mapping.
It solves the address conflict problem caused by too many sensors, reduces the system's network resource consumption and CPU usage, and achieves low-latency data transmission and cross-platform and cross-interface data sharing.
Smart Images

Figure CN114490118B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor management technology, and in particular to a method and apparatus for cross-device sensor data management based on shared memory. Background Technology
[0002] Generally, sensor devices must rely on network interfaces to interact with processing platform devices running the ROS software architecture. In other words, multiple devices based on the ROS software architecture must connect via a network to form a complete system. When there are a large number of sensor devices, network bandwidth and IP address resources become extremely scarce, and the requirements for the number of network ports on the devices also increase. Furthermore, inter-process communication also relies on network transmission, involving a large amount of data copying, resulting in low data transmission efficiency. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method and apparatus for cross-device sensor data management based on shared memory.
[0004] To solve the above technical problems, the technical solution of the present invention is as follows:
[0005] A shared-memory-based, cross-device sensor data management method includes,
[0006] Users register sensors in the management device;
[0007] After receiving the registration information, the management device requests memory space to store the corresponding sensor data. Once the request is successful, the address information of the memory space is bound to the corresponding sensor information and stored in the management device.
[0008] When a user needs to access data from a target sensor, they enter the name of the target sensor into the management device.
[0009] After receiving the name of the target sensor, the management device checks if a sensor with the same name exists. If it does, it obtains the address information of the memory space that stores the corresponding sensor data and maps it to the user process. The user then accesses the target sensor's data based on the mapped address information.
[0010] As a preferred embodiment of the shared memory-based cross-device sensor data management method of the present invention, the management device includes a plurality of devices, which are interconnected.
[0011] As a preferred embodiment of the shared memory-based cross-device sensor data management method of the present invention, wherein: the user registers the sensor in the management device, including...
[0012] Users input the registration information of the sensors to be registered into the appropriate management device, based on the sensor type.
[0013] As a preferred embodiment of the shared memory-based cross-device sensor data management method of the present invention, the registration information includes the sensor's name information, read / write attributes, and required data space.
[0014] As a preferred embodiment of the shared memory-based cross-device sensor data management method of the present invention, the method further includes: after the management device receives the name of the target sensor, it queries whether a sensor with the same name exists. If it does, it obtains the address information of the memory space storing the corresponding sensor data and maps it to the user process. After the user accesses the target sensor data according to the mapped address information, the method further includes...
[0015] If no sensor with the same name exists in the currently managed device, then query other managed devices to see if a sensor with the same name exists.
[0016] If it exists, obtain the ID of the management device with the same name, and obtain the address information of the memory space storing the corresponding sensor data, and map it into the user process;
[0017] Users provide the ID of the management device with the same name as the sensor, as well as the address of the memory space in the management device where the target sensor data is stored, to access the target sensor data.
[0018] This invention also discloses a shared memory-based, cross-device sensor data management device, comprising several management devices interconnected via device communication interfaces, each of which includes,
[0019] The memory management node module is used to receive sensor information to be registered input by the user, apply for corresponding memory space based on the sensor information, and obtain the address information of the corresponding memory space after successful application.
[0020] The sensor management node module is used to store sensor data in the corresponding memory space, bind and store sensor information with the address information of the corresponding memory space, and when it receives the name of the target sensor input by the user, it queries whether there is a sensor with the same name, and if there is, it obtains the address information of the memory space storing the corresponding sensor data and maps it to the user process.
[0021] The cross-device communication driver module is used to query the sensor data stored in the sensor management node module of other management devices and the address information of the memory space corresponding to the sensor information.
[0022] As a preferred embodiment of the shared memory-based cross-device sensor data management device of the present invention, the sensor information includes the sensor's name information, read / write attributes, and required data space.
[0023] As a preferred embodiment of the shared memory-based cross-device sensor data management device of the present invention, the device communication interface between the management devices includes a PCIe interface, a serial interface, and a USB interface.
[0024] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the shared memory-based cross-device sensor data management method described in any of the above embodiments.
[0025] The present invention also discloses a computer-readable storage medium storing a computer program thereon, characterized in that: when the program is executed by a processor, it implements the cross-device sensor data management method based on shared memory as described in any of the above schemes.
[0026] The beneficial effects of this invention are:
[0027] (1) In this invention, the sensor device is no longer required to have a network port to share data, and no IP address is required. When accessing sensor data, only the sensor name needs to be provided, which effectively solves the problem of address conflict caused by too many sensors. Moreover, it realizes cross-platform and cross-interface data sharing, reduces the bandwidth occupation of system network resources and the usage of system CPU, and also reduces hardware design costs.
[0028] (2) In this invention, data communication between multiple processes is achieved through address mapping, sharing the same memory space, realizing low-latency data transmission and providing system real-time performance. Attached Figure Description
[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 A flowchart illustrating the cross-device sensor data management method based on shared memory provided by the present invention;
[0031] Figure 2 A schematic diagram of the operational framework of the shared memory-based cross-device sensor data management device provided by the present invention;
[0032] Figure 3 This is a schematic diagram of the structure of the management device in the shared memory-based cross-device sensor data management device provided by the present invention. Detailed Implementation
[0033] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
[0034] See Figure 1 This is a flowchart illustrating a cross-device sensor data management method based on shared memory provided in this embodiment. The method includes steps S101 to S106, which are described in detail below:
[0035] Step S101: The user registers the sensor in the management device.
[0036] Several management devices are configured. Different sensors are compatible with different management devices. When registering a sensor, the user must select the appropriate management device based on the sensor category. In this embodiment, the management device is a device motherboard. Due to space and size limitations, there will be many device motherboards connecting various sensors, and these motherboards are interconnected. Different sensors are compatible with different motherboards; for example, a sensor with a PCIe interface cannot be connected to a motherboard without a PCIe interface.
[0037] After selecting a compatible management device, users can register the sensor through the corresponding management device's registration interface. Registration requires providing the sensor's name, read / write attributes, and required data space.
[0038] Step S102: After receiving the registration information, the management device requests memory space for storing the corresponding sensor data. After the request is successful, the address information of the memory space is bound to the corresponding sensor information and stored in the management device.
[0039] Specifically, after receiving the sensor's registration information, the management device first requests the corresponding memory space based on the registration information. If the request is successful, the sensor data is stored in the requested memory space, and the address information of the memory space is bound to the sensor information before being stored in the management device.
[0040] Step S103: When the user needs to access the data of the target sensor, he enters the name of the target sensor into the management device.
[0041] Step S104: After receiving the name of the target sensor, the management device queries whether there is a sensor with the same name. If there is, it obtains the address information of the memory space storing the corresponding sensor data and maps it to the user process. The user accesses the data of the target sensor according to the mapped address information.
[0042] Specifically, after a user provides the name of the sensor they want to access to the management device through the query interface, the query interface will check whether there is a sensor with the same name in the current management device. If it exists, it will return the address information of the memory space bound to the target sensor and map it to the user process. From then on, the user process can access the data of the target sensor through the mapped address information.
[0043] Step S105: If there is no sensor with the same name in the current managed device, query other managed devices to see if there is a sensor with the same name. If there is, obtain the number of the managed device with the same name and obtain the address information of the memory space storing the corresponding sensor data, and map it to the user process.
[0044] Specifically, if there is no sensor with the same name in the current managed device, the remote query interface can be called to query whether there is a sensor with the same name as the target sensor in other remote managed devices connected to the current managed device. If it exists, the number of the remote managed device with the same name and the address information of the memory space storing the corresponding sensor data are returned and mapped to the user process.
[0045] It should be noted that the corresponding number for each managed device can be generated by the software.
[0046] Step S106: The user provides the number of the management device with the same name as the sensor and the address information of the memory space in the management device where the target sensor data is stored, so as to access the target sensor data.
[0047] Specifically, if the target sensor is to be accessed later, the current management device is provided with the number of the remote management device that has a sensor with the same name and the address information of the memory space in the management device that stores the target sensor data. The sensor data stored in the corresponding management device is then retrieved to complete a data read operation.
[0048] Therefore, by using the above management method to manage sensor data, sensor devices do not need IP addresses; they can access the target sensor's data simply by providing the sensor's name, effectively solving the address conflict problem caused by an excessive number of sensors. Simultaneously, data communication between multiple processes is achieved through address mapping, sharing the same memory space and realizing low-latency data transmission.
[0049] This embodiment also provides a shared memory-based, cross-device sensor data management device. This device includes several management devices interconnected via device communication interfaces. Each management device includes a memory management node module 110, a sensor management node module 120, and a cross-device communication driver module 130. See also... Figure 3 This is a structural diagram of each management device.
[0050] Specifically, the memory management node module 110 receives the sensor information to be registered input by the user, requests the corresponding memory space based on the sensor information, and obtains the address information of the corresponding memory space after successful request. The sensor information to be registered input by the user includes the sensor's name, read / write attributes, and the required data space.
[0051] The sensor management node module 120 is used to store sensor data in the corresponding memory space and bind and store sensor information with the address information of the corresponding memory space. In addition, when the management device receives the name of the target sensor input by the user, the sensor management node module 120 can query whether there is a sensor with the same name, and if so, obtain the address information of the memory space storing the corresponding sensor data and map it into the user process.
[0052] The cross-device communication driver module 130 is used to query the sensor data stored in the sensor management node module of other management devices and the address information of the memory space corresponding to the sensor information.
[0053] The communication interfaces between management devices include, but are not limited to: PCIe interface, serial interface, and USB interface.
[0054] See Figure 2The diagram below illustrates the operational framework of the aforementioned management device. As shown, the operating system kernel of the management device loads the memory management node module 110, the sensor node module 120, and the cross-device communication driver module 130. Users can then register a sensor through the registration interface, providing the sensor's name, read / write attributes, and required data space. The memory management node module 110 first requests the corresponding memory space based on the registration information. If the request is successful, it binds the address information of the corresponding memory space with the sensor information, and the sensor management node module 120 records this, storing the sensor and its associated memory space address information in the management device. When other users want to access sensor data, they must first provide the name of the sensor they wish to access through the query interface. Then, the system checks if a sensor with the same name exists in the sensor management node module 120. If it does, it returns the address information of the memory space bound to the target sensor and maps it to the user process. The user process can then access the target sensor's data through this mapped address information. If no sensor with the same name exists on the current management device, the remote query interface can be called. The cross-device communication driver module 130 queries whether a sensor with the same name exists on the remote management device. If it exists, the address information of the memory space where the sensor data is stored on the remote management device and the number of the remote management device with the same name are returned and mapped to the user process. After that, when accessing the sensor data, the remote data access interface needs to be called, and the sensor name, memory space address information, remote management device number and other information need to be provided to complete a data read operation.
[0055] This embodiment also provides a computer device, the components of which may include, but are not limited to: one or more processors or processing units, system memory, and buses connecting different system components (including system memory and processing units).
[0056] A bus refers to one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0057] Computer systems / servers typically include a variety of computer system-readable media. These media can be any available media that can be accessed by the computer system / server, including volatile and non-volatile media, and removable and non-removable media.
[0058] System memory may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The computer device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system may be used to read and write non-removable, non-volatile magnetic media. Disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to a bus via one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of embodiments of the present invention.
[0059] A program / utility having a set (at least one) of program modules can be stored, for example, in memory. Such program modules include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of this invention.
[0060] Computer devices can also communicate with one or more external devices (such as keyboards, pointing devices, monitors, etc.). This communication can be done through input / output (I / O) interfaces. Furthermore, computer devices can communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapters.
[0061] The processing unit executes the functions and / or methods described in the embodiments of the present invention by running programs stored in the system memory.
[0062] The aforementioned computer program can be stored in a computer storage medium, that is, the computer storage medium is encoded with a computer program, which, when executed by one or more computers, causes one or more computers to perform the method flow and / or device operation shown in the above embodiments of the present invention.
[0063] With the development of time and technology, the meaning of "medium" has become increasingly broad. The dissemination of computer programs is no longer limited to tangible media; they can also be downloaded directly from the network. Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: electrical connections having 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 thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0064] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0065] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0066] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0067] In addition to the above embodiments, the present invention may have other implementation methods; all technical solutions formed by equivalent substitution or equivalent transformation fall within the protection scope claimed by the present invention.
Claims
1. A cross-device sensor data management method based on shared memory, characterized in that: include, Users register sensors in the management devices; wherein, the management devices include several devices, and the several management devices are interconnected; After receiving the registration information, the management device requests memory space to store the corresponding sensor data. Once the request is successful, the address information of the memory space is bound to the corresponding sensor information and stored in the management device. When a user needs to access data from a target sensor, they enter the name of the target sensor into the management device. After receiving the name of the target sensor, the management device checks whether there is a sensor with the same name. If there is, it obtains the address information of the memory space that stores the corresponding sensor data and maps it to the user process. The user then accesses the data of the target sensor based on the mapped address information. If no sensor with the same name exists in the currently managed device, then query other managed devices to see if a sensor with the same name exists. If it exists, obtain the ID of the management device with the same name, and obtain the address information of the memory space storing the corresponding sensor data, and map it into the user process; Users provide the ID of the management device with the same name as the sensor, as well as the address of the memory space in the management device where the target sensor data is stored, to access the target sensor data.
2. The cross-device sensor data management method based on shared memory according to claim 1, characterized in that: The user's registration of sensors in the management device includes, Users input the registration information of the sensors to be registered into the appropriate management device, based on the sensor type.
3. The cross-device sensor data management method based on shared memory according to claim 2, characterized in that: The registration information includes the sensor's name, read / write attributes, and required data space.
4. A cross-device sensor data management device based on shared memory, characterized in that: It includes several management devices interconnected via device communication interfaces, each of which includes, The memory management node module is used to receive sensor information to be registered input by the user, apply for corresponding memory space based on the sensor information, and obtain the address information of the corresponding memory space after successful application. The sensor management node module is used to store sensor data in the corresponding memory space, bind and store sensor information with the address information of the corresponding memory space, and when it receives the name of the target sensor input by the user, it queries whether there is a sensor with the same name, and if there is, it obtains the address information of the memory space storing the corresponding sensor data and maps it to the user process. The cross-device communication driver module is used to query whether a sensor with the same name exists in other managed devices when no sensor with the same name exists in the current managed device. If a sensor with the same name exists, the module obtains the ID of the managed device that has the sensor with the same name and the address information of the memory space that stores the corresponding sensor data, and maps it to the user process.
5. The cross-device sensor data management device based on shared memory according to claim 4, characterized in that: The sensor information includes the sensor's name, read / write attributes, and required data space.
6. The cross-device sensor data management device based on shared memory according to claim 4, characterized in that: The device communication interfaces between the management devices include PCIe interface, serial interface, and USB interface.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the method as described in any one of claims 1 to 3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
USB camera data acquisition method and device, electronic equipment and storage medium
CN112616024A