Method, computer program, electronic storage medium, and device for providing a single piece of data - Patents.com
The method allocates memory based on state to reuse last supplied data for continuous updates, addressing inefficiencies in 'zero copy' techniques by reducing redundant copying and maintaining consistency in data transmission.
Patent Information
- Application Number
- JP2022520385
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-10-04
- Filing Date
- 2020-08-19
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-08-19
AI Technical Summary
Existing 'zero copy' techniques in communication systems prevent subsequent modifications to data, leading to undefined behavior and inefficient use of computational resources when continuously updating datasets for applications like autonomous driving.
A method that allocates memory based on the state of the memory means, allowing continuous updates without copying by reusing the last supplied memory for new data, ensuring consistency and avoiding redundant data copying.
Enables efficient data transmission by avoiding unnecessary copying, reducing computational resource consumption, and maintaining data consistency in systems with continuous data updates.
Smart Images

Figure 0007571132000001 
Figure 0007571132000002 
Figure 0007571132000003
Abstract
Description
[Technical field]
[0001] The present invention provides a method for providing data, more generally a single data, in a communication system. The present invention further provides a corresponding computer program, an electronic storage medium, and a corresponding device.
[0002] In systems where large amounts of data are processed, copying data is an expensive affair, i.e. in some cases a process that requires a large proportion of the available computing resources. In systems for driver assistance or automated driving, for example, several gigabytes per second are processed. If copying data is avoided as much as possible, valuable computing resources (for example in the form of computing time) can therefore be saved. [Background technology]
[0003] On systems with multiple computational cores or different contexts of execution (e.g. different tasks on an OSEK operating system), it is known to use a communication middleware to ensure consistent transmission of data between parallel parts of an application. The participants of a communication middleware are producers and consumers. In this regard, producers store data in the communication middleware, which may be done by dropping the data in a memory managed by the middleware. Consumers make use of the stored data, which may be done by reading the corresponding memory managed by the middleware.
[0004] To avoid copying, it is known to use so-called "zero copy" techniques, especially for storing data. A communication middleware based on the "zero copy" technique typically proceeds in two stages: in a first step, the producer requests a memory or memory means from the communication middleware. In a second step, the producer writes the data to be provided into the requested memory.
[0005] In "zero copy" approaches, storing data in memory typically removes the producer's ability to modify the stored data: consumers read this instance of the data exactly, so post-mortem modification of the data results in undefined behavior, also known in the literature as a data race. Summary of the Invention
[0006] An application case for a producer is in this case the continuous compilation of a data set that is to be provided (transmitted) periodically to one or more consumers. In the field of autonomous driving this can be for example a model of the surrounding environment that is constantly updated and provided to one or more consumers every 100 milliseconds.
[0007] Such successive edits assume that each iteration restarts with the last state of the data and further modifies these data, which is not possible or permitted with commonly used "zero copy" approaches.
[0008] Therefore, in applications where a data set is continuously edited and each last state is referenced as a new starting point for changes, copying of data cannot be avoided at all or always, despite the "zero copy" approach.
[0009] With this in mind, the present invention provides a method for providing a single data in a communication system, comprising: allocating memory means for updating data in the memory means; updating the data in the allocated memory means with the single datum; providing the allocated memory means with the updated data for reading.
[0010] The method is characterized in that in the allocating step, the memory means is allocated in dependence on the state of the memory means. In this respect the allocating step may be performed in response to a request signal representative of a request of the memory means to provide the single datum. Such a signal may be output by a producer of the single datum to be provided. The request signal could for example be realised as a function call in a programming language.
[0011] A communication system may be understood here as a system comprising at least one producer and one communication middleware. A producer in a communication system is a communication source, i.e. it generates a single data item, which may be provided by the communication middleware. A recipient of the generated single data item may be a consumer. A consumer is a communication receiver.
[0012] A communications middleware may be understood here as an abstraction layer within a software system, which makes available to producers and consumers an interface for supplying or receiving data, and in this respect typically abstracts access to the underlying hardware layers and hardware management.
[0013] Allocating a memory means may here be understood as providing a portion of physical memory such that the allocating producer gains access to the physical memory for storing the single datum to be provided. Typically, allocating not only involves providing a portion of physical memory, but also ensuring that no other producers or possibly consumers gain access to the allocated portion of physical memory, thereby ensuring that dropping of the single datum to be provided within the allocated memory means can be done consistently.
[0014] This method has the advantage that the allocation can be done depending on the state of the memory means, so that in the case of an application where a data set is continuously updated by one producer, the previously supplied memory means can be used, thus starting again with the last supplied data and updating these data with the single data to be supplied, without previously copying the last supplied data to the newly allocated memory means.
[0015] That is, even in applications where a single data set is continuously updated by a single producer, copying can be avoided under certain circumstances. According to one embodiment of the method of the present invention, in the step of allocating, the memory means is the last used memory means.
[0016] This embodiment has the advantage that in applications where the last delivered data is continuously updated by the single data to be delivered and is delivered periodically, copying of the last delivered data is avoided, since the allocated memory means is the last used memory means and therefore already contains the last delivered data.
[0017] According to one embodiment of the method of the invention, in the allocating step, the last used memory means is allocated if the state of the last used memory means indicates that this memory means is available for use.
[0018] A memory means may be available if none of the consumers of the memory means are active or if all consumers of the memory means have processed the data currently stored in the memory means.
[0019] Whether a consumer of the memory means is active or whether all consumers of the memory means have finished processing the data currently stored in the memory means can be determined and checked by measures customary in the art, used for this purpose, for example in communication middleware.
[0020] According to one embodiment of the method of the present invention, if in the allocating step the status of the last used memory means indicates that this memory means is not available, a new memory means is requested and the contents of the last used memory means are copied to the newly requested memory means.
[0021] A memory means may not be available if one consumer of the memory means is active or if all consumers of the memory means have not finished processing the data currently stored in the memory means.
[0022] A further aspect of the invention is a computer program arranged to carry out all the steps of the method according to the invention. A further aspect of the invention is an electronic storage medium having stored thereon a computer program according to the invention.
[0023] A further aspect of the invention is a device or electronic control unit arranged to carry out all the steps of the method according to the invention. Hereinafter, an embodiment of the present invention will be described in more detail with reference to the drawings. [Brief description of the drawings]
[0024] [Figure 1] FIG. 1 is a flow diagram of a first embodiment of a method for providing single data according to the prior art; [Diagram 2] FIG. 2 is a flow diagram of a second embodiment of a method for providing single data according to the prior art; [Diagram 3]FIG. 2 is a flow diagram of one embodiment of a method for providing single data in accordance with the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0025] FIG. 1 shows a flow diagram of a first embodiment of a method for providing single data according to the prior art. The method 100 represents one embodiment of a method for providing (transmitting) a single data based on a "zero copy" approach. The method 100 comprises a step 101 of allocating memory means. Such memory means may for example be part of the physical memory of a computer. It may also be part of the physical memory of an embedded computing device, for example an electronic control unit for controlling a vehicle. The allocation 101 of the memory means may be performed via a so-called communication middleware.
[0026] The method 100 further includes a step 102 of writing the single data to be provided in the allocated memory means, in which a producer of the single data to be provided writes the single data to be provided in the allocated memory means. Typically, this writing 102 transfers editing rights, particularly writing rights, of the single data from the producer to the communication middleware.
[0027] The method 100 further comprises a step 103 of transmitting the piece of data to be provided, which takes place via the middleware and via measures that are usual in the art for the transmission of piece of data, which measures depend inter alia on the communication infrastructure and the communication protocol used.
[0028] FIG. 2 shows a flow diagram of a second embodiment 200 of a method for providing a single data according to the prior art. Method 200 represents one embodiment of a method for providing (transmitting) single data based on a "zero copy" approach in the context of an application where a single producer continuously updates data (data set) with the single data to be provided and the updated data should be provided periodically. Such an application may arise, for example, in the context of autonomous driving where a constantly updated ambient environment model via fusion of sensor data of ambient environment sensors is provided to a consumer (e.g., another software component) periodically, for example every 100 milliseconds.
[0029] The method 200 comprises a step 201 of updating the data (data set) with a single data to be provided. The single data to be provided may originate from the reception of new sensor data of an environmental sensor. It is also conceivable that the single data to be provided is the fusion result of the aforementioned method for fusing sensor data of multiple environmental sensors.
[0030] According to this embodiment, the updating of the data takes place at the producer of the single data to be supplied, i.e. in a memory area managed by the producer among others. The method 200 further comprises a step 202 of allocating memory means. Such memory means may for example be part of the physical memory of a computer. It may also be part of the physical memory of an embedded computing device, for example an electronic control unit for controlling a vehicle. The allocating 202 of the memory means may be performed via a so-called communication middleware.
[0031] The method 200 further includes a step 203 of writing updated data, including the single data to be provided, to the allocated memory means, where the producer of the single data to be provided writes the single data to be provided to the allocated memory means, typically transferring writing or editing rights for the single data from the producer to the middleware.
[0032] The method 200 further comprises a step 204 of transmitting the single data to be provided, which is performed via the middleware and via measures that are usual in the art for transmitting single data, which measures depend inter alia on the communication infrastructure and the communication protocol used.
[0033] In particular in the writing step 203, according to this embodiment, the entire data set (data set) needs to be written or copied to the allocated memory means, which in some circumstances results in copying, despite the application of the "zero copy" approach. In this case, depending on the size of the data set to be copied and depending on the frequency of periodic supply, especially in the field of autonomous driving, a significant consumption of computing resources occurs just for the copying process.
[0034] FIG. 3 illustrates a flow diagram of one embodiment of a method 300 for providing a single piece of data in accordance with the present invention. The method 300 includes a step 301 of allocating memory means having a single last provided datum.
[0035] The essence of the invention is to provide this last delivered single data without copies on the one hand and in such a way that the consistency properties of the communication system are not compromised on the other hand. For this purpose, the method 300 intends to take into account the state of the last used memory means in the allocating step 301. For this purpose, in step 310 it is first checked whether the last used memory means is available.
[0036] A memory means may be available if none of the consumers of the memory means are active or if all consumers of the memory means have processed the data currently stored in the memory means.
[0037] If the last used memory means is available, the method 300 continues with step 311, where the last used memory means is allocated. A memory means cannot be available if one consumer of the memory means is active or if all consumers of the memory means have not finished processing the data currently stored in the memory cells.
[0038] If the last used memory means is not available, method 300 continues with step 321 where a new memory means is allocated, which typically does not contain the last delivered data. In order for the newly allocated memory means to deliver data updated with the single data to be delivered, the last delivered data is copied from the last delivered memory means to the newly allocated memory means in step 322. In step 323, the newly allocated memory means with the last delivered data is made available to the requesting producer.
[0039] The request for memory means can be made by the middleware: to the producer, the allocation of memory means is in this case transparent. The method 300 further comprises a step 302 of updating data in the requested memory means with the single data to be provided. Unlike the second embodiment 200 of the method for providing single data according to the prior art, the updating of the data is performed in the memory means of the middleware, which allows updating the data with the single data to be provided without copying the data in cases where the last used memory means is available.
[0040] The method 300 further comprises a step 303 of transmitting the single data to be provided, which takes place via the middleware and via measures that are usual in the art for the transmission of single data, which measures depend inter alia on the communication infrastructure and the communication protocol used.
Claims
1. A method (300) for providing a single piece of data using a communication middleware according to a "zero copy" approach in a communication system having multiple computation cores or different contexts, comprising: - allocating (301) memory means by said communications middleware for updating of data in said memory means by said producer in response to a request signal of said producer; - updating (302) said data in said memory means allocated by said communications middleware with said single datum; - providing (303) for reading by a consumer memory means allocated by said communications middleware, In the allocating step (301), the memory means are allocated depending on the state of the memory means, In the step of allocating, the memory means is the last used memory means; The method (300), wherein in the allocating step (301), if the status of the last used memory means indicates that the memory means is available, if no consumers of the memory means are active and / or if all consumers of the memory means have finished processing the data in the memory means, the last used memory means is allocated (311).
2. 2. The method (300) of claim 1, wherein in the allocating step (301), if the status of the last used memory means indicates that the memory means is not available, if one consumer of the memory means is active and / or if all consumers of the memory means have not finished processing the data in the memory means, a new memory means is requested (321) and the contents of the last used memory means are copied to the new memory means.
3. A computer program configured to perform all the steps of the method (300) according to claim 1 or 2.
4. A machine-readable storage medium having stored thereon the computer program of claim 3.
5. An apparatus configured to perform all the steps of the method (300) according to claim 1 or 2.
Citation Information
Patent Citations
Computer apparatus and allotment of usable memory to memory space thereof
JP1990222045A
Memory control method
JP1992223539A
Storage system provided with encryption function, and method for guaranteeing data
JP2009009407A
Mobile device programming system and method
US20050124332A1
Streaming engine with early and late address and loop count registers to track architectural state
US20180173634A1
