Search

CN-121996409-A - Data sharing and synchronization method, system, electronic device and readable storage medium

CN121996409ACN 121996409 ACN121996409 ACN 121996409ACN-121996409-A

Abstract

The application discloses a data sharing and synchronizing method, a data sharing and synchronizing system, electronic equipment and a storage medium, and belongs to the technical field of data processing. Firstly, responding to a buffer area application request of a first module, distributing a shared buffer area, generating a resource access handle for accessing the shared buffer area, and generating a first synchronization signal handle bound with the current use state of the shared buffer area, wherein the initial state of the first synchronization signal handle is not ready. And then, the resource access handle and the first synchronization signal handle are sent to the second module, wherein the first synchronization signal handle with the state in readiness is used for indicating the second module to perform access operation on the shared buffer area based on the resource access handle. The application realizes the technical effects of multiplexing flow and determining time sequence, provides a high-efficiency and reliable solution for cross-module data interaction, and obviously reduces development and maintenance cost while improving system performance.

Inventors

  • Request for anonymity

Assignees

  • 摩尔线程智能科技(北京)股份有限公司

Dates

Publication Date
20260508
Application Date
20251226

Claims (20)

  1. 1. A data sharing and synchronization method, applied to a data sharing and synchronization system, the method comprising: Responding to a buffer area application request of a first module, distributing a shared buffer area, generating a resource access handle for accessing the shared buffer area, and generating a first synchronous signal handle bound with the current use state of the shared buffer area, wherein the initial state of the first synchronous signal handle is not ready; And sending the resource access handle and the first synchronization signal handle to a second module, wherein the first synchronization signal handle with the state in ready is used for indicating the second module to perform access operation on the shared buffer area based on the resource access handle.
  2. 2. The method according to claim 1, characterized in that the method further comprises: generating a second synchronous signal handle corresponding to the asynchronous operation aiming at the asynchronous operation accessing the shared buffer area, wherein the initial state of the second synchronous signal handle is not ready; And sending the second synchronization signal handle to the second module, wherein the second synchronization signal handle in a ready state is used for indicating the second module to perform access operation on the shared buffer based on the resource access handle together with the first synchronization signal handle in a ready state.
  3. 3. The method according to claim 1 or 2, characterized in that the method further comprises: and for the target asynchronous operation accessing the shared buffer, updating the state of a target synchronous signal handle corresponding to the target asynchronous operation from the non-ready state to the ready state in response to the completion of the target asynchronous operation.
  4. 4. The method of claim 3, wherein access operations by the second module to the shared buffer are controlled by a latch attribute, the latch attribute being bound to the target synchronization signal handle for indicating a completion status of the target synchronization signal handle, the method further comprising: And updating the state of the door latch attribute when the state change of the target synchronous signal handle is detected.
  5. 5. The method of claim 2, wherein the asynchronous operation comprises an operation to write data to the shared buffer.
  6. 6. The method according to claim 2, characterized in that the method further comprises: Combining a plurality of synchronous signal handles corresponding to the shared buffer into a single synchronous signal handle, wherein the synchronous signal handles comprise the first synchronous signal handle and at least one second synchronous signal handle, and when the states of the synchronous signal handles are updated to be ready, the single synchronous signal handle is updated to be ready; The providing the second synchronization signal handle to the second module, where the second synchronization signal handle in a ready state is used to instruct the second module to perform an access operation on the shared buffer based on the resource access handle together with the first synchronization signal handle in a ready state, and the method includes: and providing the single synchronous signal handle to the second module, wherein the single synchronous signal handle with the state in ready is used for indicating the second module to perform access operation on the shared buffer based on the resource access handle.
  7. 7. The method of claim 1, further comprising, after the second module performs the access operation: acquiring an output synchronous signal handle for identifying the completion state of the access operation; and executing a recycling operation or a multiplexing operation on the shared buffer area under the condition that the completion state is completed.
  8. 8. The method according to claim 1, wherein the process of allocating the shared buffer comprises: And executing an export process for the shared buffer, wherein the export process comprises a cache consistency maintenance operation.
  9. 9. The method of claim 1, wherein prior to the first access operation, the method further comprises: and executing an attachment flow aiming at the shared buffer area, wherein the attachment flow comprises a cache consistency maintenance operation.
  10. 10. The method of claim 1, wherein during the accessing operation, comprising: and executing a mapping flow aiming at the shared buffer area, wherein the mapping flow comprises a cache consistency maintenance operation.
  11. 11. The method of claim 1, wherein the step of allocating a shared buffer comprises; creating a scattering aggregation list, and caching the scattering aggregation list; The method further comprises the steps of: and returning to the cached scattering aggregation list when other modules except the first module request to access the shared buffer.
  12. 12. The method of claim 1, wherein the first module is a decoding module for writing decoded video frame data to the shared buffer, and the second module is a display module for reading the video frame data from the shared buffer and rendering output.
  13. 13. A dual manager collaboration based data sharing and synchronization system, comprising: A buffer manager, configured to allocate a shared buffer in response to a buffer application request of a first module, generate a resource access handle for accessing the shared buffer, and then provide the resource access handle to a second module; a synchronization manager, configured to generate a first synchronization signal handle bound to a current usage state of the shared buffer, and then provide the first synchronization signal handle to a second module, where an initial state of the first synchronization signal handle is not ready; And the second module performs access operation on the shared buffer area based on the resource access handle under the condition that the state of the first synchronization signal handle is in readiness.
  14. 14. The system of claim 13, wherein the synchronization manager is further configured to: generating a second synchronous signal handle corresponding to the asynchronous operation aiming at the asynchronous operation accessing the shared buffer area, wherein the initial state of the second synchronous signal handle is not ready; And sending the second synchronization signal handle to the second module, wherein the second synchronization signal handle in a ready state is used for indicating the second module to perform access operation on the shared buffer based on the resource access handle together with the first synchronization signal handle in a ready state.
  15. 15. The system of claim 13 or 14, wherein the synchronization manager is further configured to: and for the target asynchronous operation accessing the shared buffer, updating the state of a target synchronous signal handle corresponding to the target asynchronous operation from the non-ready state to the ready state in response to the completion of the target asynchronous operation.
  16. 16. The system of claim 15, wherein access operations by the second module to the shared buffer are controlled by a latch attribute, the latch attribute being bound to the target synchronization signal handle for indicating a completion status of the target synchronization signal handle, the synchronization manager further for: And updating the state of the door latch attribute when the state change of the target synchronous signal handle is detected.
  17. 17. The system of claim 14, wherein the synchronization manager is further configured to: Combining a plurality of synchronous signal handles corresponding to the shared buffer into a single synchronous signal handle, wherein the synchronous signal handles comprise the first synchronous signal handle and at least one second synchronous signal handle, and when the states of the synchronous signal handles are updated to be ready, the single synchronous signal handle is updated to be ready; and providing the single synchronous signal handle to the second module, wherein the single synchronous signal handle with the state in ready is used for indicating the second module to perform access operation on the shared buffer based on the resource access handle.
  18. 18. The system of claim 13, wherein the buffer manager is further configured to: After the second module performs the access operation, an output synchronous signal handle for identifying the completion state of the access operation is obtained; and executing a recycling operation or a multiplexing operation on the shared buffer area under the condition that the completion state is completed.
  19. 19. The system according to claim 13, wherein the buffer manager is specifically configured to: And executing an export process for the shared buffer, wherein the export process comprises a cache consistency maintenance operation.
  20. 20. The system of claim 13, wherein the buffer manager is further configured to: And executing an attaching flow for the shared buffer area before the first access operation, wherein the attaching flow comprises a cache consistency maintenance operation.

Description

Data sharing and synchronization method, system, electronic device and readable storage medium Technical Field The application belongs to the technical field of data processing, and particularly relates to a data sharing and synchronizing method, a data sharing and synchronizing system based on cooperation of double managers, electronic equipment and a readable storage medium. Background In modern computer systems, especially in the fields of multimedia, graphics processing, etc. that require multi-module (including multi-process, multi-device, or multi-operating system) collaboration, pipeline (Pipeline) architecture based data processing has become a mainstream. To improve performance, the industry generally employs shared memory in combination with asynchronous and synchronous techniques. However, in practical engineering implementation, the above-mentioned cross-module collaborative technical scheme has a fundamental defect of fragmentation of the flow. When an application program or a driver developer realizes cross-module data exchange, a plurality of independent and scattered kernel interfaces must be manually and actively called respectively to connect the whole cross-module data processing flow in series. This "splice" implementation places the burden of ensuring process correctness entirely on the developer's shoulders. The developer not only needs to write a large amount of glue codes, but also is extremely easy to cause the problems of data access conflict, synchronization failure and the like due to improper timing coordination. Therefore, the cross-module collaborative development is complex, and typical problems of cross-module interaction such as data access conflict, synchronization failure and the like are extremely easy to be caused by improper timing coordination. Disclosure of Invention The embodiment of the application aims to provide a data sharing and synchronizing method, a data sharing and synchronizing system based on double manager cooperation, electronic equipment and a readable storage medium, which can solve the problems that cross-module cooperation development is complex and cross-module interaction such as data access conflict and synchronization failure is easy to occur due to improper time sequence coordination. In order to solve the technical problems, the application is realized as follows: in a first aspect, an embodiment of the present application provides a data sharing and synchronization method, applied to a data sharing and synchronization system, where the method includes: Responding to a buffer area application request of a first module, distributing a shared buffer area, generating a resource access handle for accessing the shared buffer area, and generating a first synchronous signal handle bound with the current use state of the shared buffer area, wherein the initial state of the first synchronous signal handle is not ready; And sending the resource access handle and the first synchronization signal handle to a second module, wherein the first synchronization signal handle with the state in ready is used for indicating the second module to perform access operation on the shared buffer area based on the resource access handle. In a second aspect, an embodiment of the present application provides a data sharing and synchronization system based on dual manager collaboration, where the system includes: A buffer manager, configured to allocate a shared buffer in response to a buffer application request of a first module, generate a resource access handle for accessing the shared buffer, and then provide the resource access handle to a second module; a synchronization manager, configured to generate a first synchronization signal handle bound to a current usage state of the shared buffer, and then provide the first synchronization signal handle to a second module, where an initial state of the first synchronization signal handle is not ready; And the second module performs access operation on the shared buffer area based on the resource access handle under the condition that the state of the first synchronization signal handle is in readiness. In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction implementing the steps of the method according to the first aspect when executed by the processor. In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect. According to the embodiment of the application, firstly, a shared buffer is allocated in response to a buffer application request of a first module, a resource access handle for accessing the shared buffer is generated, and a first synchronization signal handle bo