CN111367687A - Inter-process data communication method and device - Google Patents

Inter-process data communication method and device Download PDF

Info

Publication number
CN111367687A
CN111367687A CN202010130109.2A CN202010130109A CN111367687A CN 111367687 A CN111367687 A CN 111367687A CN 202010130109 A CN202010130109 A CN 202010130109A CN 111367687 A CN111367687 A CN 111367687A
Authority
CN
China
Prior art keywords
data
reading
cache queue
read
application
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
CN202010130109.2A
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.)
Ropt Technology Group Co ltd
Original Assignee
Ropt Technology Group 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 Ropt Technology Group Co ltd filed Critical Ropt Technology Group Co ltd
Priority to CN202010130109.2A priority Critical patent/CN111367687A/en
Publication of CN111367687A publication Critical patent/CN111367687A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses an inter-process data communication method and device. One embodiment of the method comprises: creating a data sharing buffer queue; in response to receiving shared data sent by at least one data writing process, storing the shared data into a data sharing cache queue; in response to receiving a data reading application sent by at least one data reading process and used for reading data from a data sharing cache queue, determining whether the data reading application meets a reading condition; and if the data meets the reading condition, sending the data corresponding to the data reading application in the data sharing cache queue to a target data reading process, wherein the target data reading process is the data reading process corresponding to the data reading application. The implementation mode realizes the separation of shared data management and service logic, a plurality of processes can simultaneously and concurrently process one piece of streaming data, and supports other processes to access to acquire needed data in real time, thereby improving the real-time performance of data transmission.

Description

Inter-process data communication method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for interprocess data communication.
Background
The existing inter-process communication comprises methods of pipelines, networks, single file mapping, simple memory sharing, third-party memory databases and the like. Most of the methods cannot realize large-amount data communication and are only used for small-amount data communication. Although a large amount of data can be communicated by the file mapping and shared memory, the real-time performance of data flow is limited, and a receiving process cannot acquire data at the first time but needs to read the data through continuous polling, so that the real-time transmission fluency of the data is influenced.
Disclosure of Invention
An object of the embodiments of the present application is to provide an improved inter-process data communication method and apparatus, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides an inter-process data communication method, where the method includes: creating a data sharing buffer queue; in response to receiving shared data sent by at least one data writing process, storing the shared data into a data sharing cache queue; in response to receiving a data reading application sent by at least one data reading process and used for reading data from a data sharing cache queue, determining whether the data reading application meets a reading condition; and if the data meets the reading condition, sending the data corresponding to the data reading application in the data sharing cache queue to a target data reading process, wherein the target data reading process is the data reading process corresponding to the data reading application.
In some embodiments, the method further comprises: and if the reading condition is not met, sending a notice for representing that no data meeting the reading condition currently exists to the target data reading process.
In some embodiments, after sending a notification to the target data reading process to characterize that no data currently meeting the read condition exists, the method further comprises: and in response to determining that the data meeting the reading condition is newly stored in the data sharing cache queue, sending a notification for representing that the data meeting the reading condition currently exists to the target data reading process.
In some embodiments, determining whether the data read application meets the read condition comprises: acquiring state information for recording the state of a data sharing cache queue in real time; and determining whether the data reading application meets the reading condition or not based on the state information.
In some embodiments, the status information includes at least one of: the method comprises the steps of obtaining the total storage capacity of a data sharing cache queue, the residual storage capacity of the data sharing cache queue, the index of a data block in the data sharing cache queue and the identification of a process connected to the data sharing cache queue.
In some embodiments, the method further comprises: and if the data meets the reading condition, marking the positions of the data respectively read by at least one data reading process in the data sharing cache queue.
In a second aspect, an embodiment of the present application provides a multi-process communication system, including: the data sharing method comprises a data sharing process, at least one data writing process and at least one data reading process, wherein the data sharing process is used for executing the method described in any embodiment of the first aspect.
In a third aspect, an embodiment of the present application provides an inter-process data communication apparatus, including: the creating module is used for creating a data sharing cache queue; the receiving module is used for responding to the received shared data sent by at least one data writing process and storing the shared data into a data sharing cache queue; the determining module is used for responding to a data reading application which is sent by at least one data reading process and used for reading data from the data sharing cache queue, and determining whether the data reading application meets the reading condition; and the first sending module is used for sending the data corresponding to the data reading application in the data sharing cache queue to a target data reading process if the reading condition is met, wherein the target data reading process is the data reading process corresponding to the data reading application.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any one of the implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the interprocess data communication method and device provided by the embodiment of the application, the shared data are stored in the data sharing cache queue by establishing the data sharing cache queue, and a plurality of processes can write data into the data sharing cache queue or read data at the same time, so that the separation of shared data management and service logic is realized, the plurality of processes can simultaneously and concurrently process a piece of streaming data, and other processes are supported to access to acquire needed data in real time, so that the real-time performance of data transmission is improved.
Drawings
Other features, objects and advantages of the present application 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 the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a method of interprocess data communication according to the application;
FIG. 3 is a timing diagram of one embodiment of a multi-process communication system according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of an interprocess data communication apparatus according to the application;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following 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 the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
FIG. 1 illustrates an exemplary system architecture 100 to which the inter-process data communication method of embodiments of the present application may be applied.
As shown in fig. 1, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is the medium used to provide communication links between terminal devices 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. Various communication client applications, such as a search-type application, a web browser application, a shopping-type application, an instant messaging tool, etc., may be installed on the terminal device 101.
The terminal device 101 may be various electronic devices including, but not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc.
The server 103 may be a server that provides various services, such as a data processing server that processes data uploaded by the terminal apparatus 101. The data processing server can store, read and the like the received data.
It should be noted that the inter-process data communication method provided in the embodiment of the present application may be executed by the terminal device 101 or the server 103, and accordingly, the inter-process data communication apparatus may be disposed in the terminal device 101 or the server 103.
It should be understood that the number of data servers, networks, and host servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, intermediate devices, and servers, as desired for implementation. In the case where data does not need to be retrieved from or sent to a remote location, the system architecture described above may not include a network, including only a server or terminal device.
With continued reference to FIG. 2, a flow 200 of one embodiment of an interprocess data communication method according to the present application is shown. The method comprises the following steps:
step 201, a data sharing buffer queue is created.
In this embodiment, an executing body (for example, the intermediate device or the terminal device or the server shown in fig. 1) of the inter-process data communication method may create a data sharing cache queue. The data sharing buffer queue is used for storing shared data. Generally, the data sharing buffer queue may be located in the memory of the execution subject, and an input and an output of the data sharing buffer queue may be defined while the data sharing buffer queue is created. The data sharing queue may be a bidirectional buffer queue so that no conflict occurs between data stream writes and reads. It should be noted that the number of the data sharing buffer queues may be one or more.
In general, a data sharing process may be provided in the execution subject, and the process may create and manage a data sharing buffer queue.
Step 202, in response to receiving the shared data sent by at least one data writing process, storing the shared data in a data sharing buffer queue.
In this embodiment, the execution subject may store the shared data into the data sharing buffer queue in response to receiving the shared data sent by the at least one data writing process. The data writing process is used for storing shared data into the data sharing cache queue, and the shared data can be shared by a plurality of processes. As an example, the data writing process may be a network video receiving process, and the process may receive video data and store the video data as shared data in the data sharing buffer queue.
Step 203, in response to receiving a data reading application sent by at least one data reading process for reading data from the data sharing buffer queue, determining whether the data reading application meets a reading condition.
In this embodiment, the execution subject may determine whether the data read application meets the read condition in response to receiving a data read application sent by at least one data read process for reading data from the data shared cache queue. As an example, the read conditions may include, but are not limited to, at least one of: the data sharing cache queue comprises the applied data, and a data reading process corresponding to the data reading application has a preset data reading permission. The data reading applications may include, but are not limited to, at least one of the following new types: identification of the data reading process, type of data to be read, etc.
The data reading process may be a process provided in the execution main body, or may be a process in an electronic device communicatively connected to the execution main body. It should be noted that the data reading process and the data writing process may be the same process, that is, one process may both read data and write data.
In some optional implementations of this embodiment, step 203 may be performed as follows:
first, state information for recording the state of the data sharing buffer queue in real time is acquired. The state information may include various information, among others.
Optionally, the status information may include, but is not limited to, at least one of: the method comprises the steps of obtaining the total storage capacity of a data sharing cache queue, the residual storage capacity of the data sharing cache queue, the index of a data block in the data sharing cache queue and the identification of a process connected to the data sharing cache queue. Through the enumerated state information, the execution main body can obtain the current storage space state of the data sharing cache queue in real time, the efficiency of using the data sharing cache queue is improved, and the data can be accurately obtained from the data sharing cache queue through the index and the process identification.
Then, based on the state information, it is determined whether the data read application meets the read condition. As an example, when the state information includes a remaining storage amount of the data-sharing buffer queue, the read condition may be whether the data-sharing buffer queue is currently full.
In this optional implementation manner, by setting the state information, the execution main body can obtain the state of the data sharing cache queue in time, which is helpful for improving the efficiency of managing the data sharing cache queue, and determine whether the read condition is met based on the state information, so that the data can be more flexibly and accurately sent to the data reading process.
And step 204, if the read conditions are met, sending the data corresponding to the data read application in the data sharing cache queue to the target data read process.
In this embodiment, if the read condition is met, the execution subject may send the data corresponding to the data read application in the data sharing buffer queue to the target data read process. The target data reading process is a data reading process corresponding to the data reading application. Specifically, the execution main body may determine, according to the data reading application (for example, according to a process identifier included in the data reading application), a data reading process corresponding to the data reading application from the plurality of data reading processes, determine data currently required to be sent to the target data reading process (for example, determine data to be read by the target data reading process according to an index of the data block), and send the data to the target data reading process.
As an example, it is assumed that process a is a network video receiving process, process B is a decoding playing process, process C is a video saving process, and process D is a data sharing process. The network video received by the process a is written into the data sharing cache queue created by the sharing process D according to a predetermined format, the process D performs data block management of the data sharing cache queue (i.e. the above steps 201 to 204), and when the cache is full, the earliest video data is discarded in a bidirectional queue manner. And the processes B and C simultaneously apply for reading the video data from the process D, and after the process D allows, the processes B and C circularly read the video data. Therefore, data can be read from the data sharing buffer queue by a plurality of processes at the same time.
In some optional implementations of this embodiment, step 204 may further include the following steps:
and if the data meets the reading condition, marking the positions of the data respectively read by at least one data reading process in the data sharing cache queue. By the implementation mode, the storage position of the currently read data can be recorded in real time, so that the data can be accurately extracted, and the continuity of the read data is kept.
In some optional implementation manners of this embodiment, the executing main body may further perform the following steps:
and if the reading condition is not met, sending a notice for representing that no data meeting the reading condition currently exists to the target data reading process. The target data reading process may stop reading data from the data-sharing buffer queue after receiving the synchronization notification. The implementation mode enables the target data reading process to stop reading data by sending the notice to the target data reading process, thereby avoiding communication resource waste caused by continuous data application of the target data reading process under the condition that no data can be read.
In some optional implementation manners of this embodiment, after sending a notification for characterizing that there is no data that meets the reading condition to the target data reading process, the executing body may further perform the following steps:
and in response to determining that the data meeting the reading condition is newly stored in the data sharing cache queue, sending a notification for representing that the data meeting the reading condition currently exists to the target data reading process. As an example, when the reading condition is that the data sharing buffer queue is not empty, if the data is stored in the data sharing buffer queue again, a notification is sent to the target data reading process, and after receiving the notification, the target data reading process continues to read the data from the data sharing buffer queue. The realization mode can lead the target data reading process to read the data again in time after the data reading is interrupted, thereby improving the real-time property of the data reading.
According to the method provided by the embodiment of the application, the data sharing cache queue is created, the shared data is stored in the data sharing cache queue, and the multiple processes can write data into the data sharing cache queue or read data from the data sharing cache queue at the same time, so that the separation of shared data management and business logic is realized, the multiple processes can concurrently process a copy of stream data at the same time, and other processes are supported to access to obtain the required data in real time, so that the real-time performance of data transmission is improved.
With further reference to fig. 3, a timing diagram of one embodiment of a multi-process communication system in accordance with the present application is shown.
The system comprises: the system comprises a data sharing process, at least one data writing process and at least one data reading process. The data sharing process is configured to perform the method described in the embodiment corresponding to fig. 2, that is, the data sharing process is configured to manage the data contribution buffer queue. The data sharing process, the at least one data writing process, and the at least one data reading process may be disposed in the same electronic device (for example, the server or the terminal device shown in fig. 1), or may be disposed in different electronic devices, which is not limited in this embodiment.
As shown in fig. 3, in step 301, the data sharing process creates a data sharing buffer queue.
In this embodiment, step 301 is substantially the same as step 201 in the embodiment corresponding to fig. 2, and is not described here again.
In step 302, any one of the at least one data write process writes shared data to the data-sharing buffer queue.
In step 303, the data sharing process stores the shared data in the data sharing buffer queue in response to receiving the shared data sent by the at least one data writing process.
In this embodiment, step 303 is substantially the same as step 202 in the corresponding embodiment of fig. 2, and is not described herein again.
In step 304, at least one data reading process sends a data reading application to the data sharing process for reading data from the data sharing buffer queue.
In step 305, the data sharing process determines whether the data read request meets the read condition in response to receiving the data read request.
In this embodiment, step 305 is substantially the same as step 203 in the corresponding embodiment of fig. 2, and is not described herein again.
In step 306, if the read condition is met, the data sharing process sends the data corresponding to the data read application in the data sharing buffer queue to the target data read process.
The target data reading process is a data reading process corresponding to the data reading application. In this embodiment, step 306 is substantially the same as step 204 in the corresponding embodiment of fig. 2, and is not described herein again.
It should be noted that, various processes in the embodiments of the present application generally refer to entities of programs that are running, and sending data to a data reading process described in the embodiments of the present application refers to sending data to a storage space used by the data reading process.
In the system provided by the above embodiment of the present application, a data sharing process, at least one data writing process, and at least one data reading process are set in the electronic device, a data sharing cache queue is created by the data sharing process, and the data sharing cache queue is managed, so that separation of shared data management and service logic is achieved, a plurality of processes can concurrently process a copy of stream data, and access of other processes is supported to obtain needed data in real time, thereby improving real-time performance of data transmission.
With further reference to fig. 4, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of an inter-process data communication apparatus, which corresponds to the method embodiment shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 4, the interprocess data communication apparatus 400 of the present embodiment includes: a creating module 401, configured to create a data sharing cache queue; a receiving module 402, configured to store shared data in a data sharing cache queue in response to receiving the shared data sent by at least one data writing process; a determining module 403, configured to determine, in response to receiving a data reading application sent by at least one data reading process and used for reading data from the data sharing cache queue, whether the data reading application meets a reading condition; a first sending module 404, configured to send, if the read condition is met, the data corresponding to the data read application in the data sharing cache queue to a target data read process, where the target data read process is a data read process corresponding to the data read application.
In this embodiment, the creating module 401 may create a data sharing buffer queue. The data sharing buffer queue is used for storing shared data. Generally, the data sharing buffer queue may be located in the memory of the apparatus 400, and an ingress and an egress of the data sharing buffer queue may be defined while the data sharing buffer queue is created. The data sharing queue may be a bidirectional buffer queue so that no conflict occurs between data stream writes and reads. It should be noted that the number of the data sharing buffer queues may be one or more.
In this embodiment, the receiving module 402 may store the shared data in the data sharing buffer queue in response to receiving the shared data sent by at least one data writing process. The data writing process is used for storing shared data into the data sharing cache queue, and the shared data can be shared by a plurality of processes. As an example, the data writing process may be a network video receiving process, and the process may receive video data and store the video data as shared data in the data sharing buffer queue.
In this embodiment, the determining module 403 may determine whether the data read application meets the read condition in response to receiving a data read application sent by at least one data read process for reading data from the data sharing cache queue. As an example, the read conditions may include, but are not limited to, at least one of: the data sharing cache queue comprises the applied data, and a data reading process corresponding to the data reading application has a preset data reading permission. The data reading applications may include, but are not limited to, at least one of the following new types: identification of the data reading process, type of data to be read, etc.
The data reading process may be a process provided in the apparatus 400, or may be a process in an electronic device communicatively connected to the apparatus 400. It should be noted that the data reading process and the data writing process may be the same process, that is, one process may both read data and write data.
In this embodiment, the first sending module 404 may send the data corresponding to the data reading application in the data sharing buffer queue to the target data reading process. The target data reading process is a data reading process corresponding to the data reading application. Specifically, the first sending module 404 may determine, according to the data reading application (for example, according to a process identifier included in the data reading application), a data reading process corresponding to the data reading application from the multiple data reading processes, determine data that needs to be currently sent to the target data reading process (for example, determine data to be read by the target data reading process according to an index of the data block), and send the data to the target data reading process.
In some optional implementations of this embodiment, the apparatus 400 may further include: and a second sending module (not shown in the figure) for sending a notification for representing that no data meeting the reading condition currently exists to the target data reading process if the reading condition is not met.
In some optional implementations of this embodiment, the apparatus 400 may further include: and a third sending module (not shown in the figure) for sending a notification for representing that the data meeting the reading condition currently exists to the target data reading process in response to determining that the data meeting the reading condition is newly stored in the data sharing buffer queue.
In some optional implementations of this embodiment, the determining module 403 may include: a recording unit (not shown in the figure) for acquiring status information for recording the status of the data sharing buffer queue in real time; and a determining unit (not shown in the figure) for determining whether the data reading application meets the reading condition based on the state information.
In some optional implementations of this embodiment, the status information includes at least one of: the method comprises the steps of obtaining the total storage capacity of a data sharing cache queue, the residual storage capacity of the data sharing cache queue, the index of a data block in the data sharing cache queue and the identification of a process connected to the data sharing cache queue.
In some optional implementations of this embodiment, the apparatus 400 may further include: and a marking module (not shown in the figure) for marking the positions of the data read by the at least one data reading process in the data sharing buffer queue if the reading condition is met.
According to the device provided by the embodiment of the application, the data sharing cache queue is created, the shared data is stored in the data sharing cache queue, and the multiple processes can write data into the data sharing cache queue or read data from the data sharing cache queue at the same time, so that the separation of shared data management and service logic is realized, the multiple processes can concurrently process a copy of stream data at the same time, and other processes are supported to access to obtain the required data in real time, so that the real-time performance of data transmission is improved.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
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 through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable storage medium described herein can 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 the present application, 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 this application, however, a computer readable signal medium may include 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 storage 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 storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language 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 application. 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 which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a creation module, a reception module, a determination module, and a first transmission module. Where the names of these modules do not in some cases constitute a limitation on the unit itself, for example, the creation module may also be described as a "module for creating a data-sharing cache queue".
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: creating a data sharing buffer queue; in response to receiving shared data sent by at least one data writing process, storing the shared data into a data sharing cache queue; in response to receiving a data reading application sent by at least one data reading process and used for reading data from a data sharing cache queue, determining whether the data reading application meets a reading condition; and if the data meets the reading condition, sending the data corresponding to the data reading application in the data sharing cache queue to a target data reading process, wherein the target data reading process is the data reading process corresponding to the data reading application.
The above description is only a preferred embodiment of the application 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 herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. An inter-process data communication method, the method comprising:
creating a data sharing buffer queue;
in response to receiving shared data sent by at least one data writing process, storing the shared data into the data sharing cache queue;
in response to receiving a data reading application sent by at least one data reading process and used for reading data from the data sharing cache queue, determining whether the data reading application meets a reading condition;
and if the read condition is met, sending the data corresponding to the data read application in the data sharing cache queue to a target data read process, wherein the target data read process is the data read process corresponding to the data read application.
2. The method of claim 1, further comprising:
and if the reading condition is not met, sending a notice for representing that no data meeting the reading condition currently exists to the target data reading process.
3. The method of claim 2, wherein after the sending the notification characterizing that no data currently meeting the read condition to the target data reading process, the method further comprises:
and in response to determining that the data meeting the reading condition is newly stored in the data sharing cache queue, sending a notification for representing that the data meeting the reading condition currently exists to the target data reading process.
4. The method of claim 1, wherein the determining whether the data read request meets a read condition comprises:
acquiring state information for recording the state of the data sharing cache queue in real time;
and determining whether the data reading application meets the reading condition or not based on the state information.
5. The method of claim 4, wherein the status information comprises at least one of: the method comprises the steps of obtaining the total storage capacity of a data sharing cache queue, the residual storage capacity of the data sharing cache queue, the index of a data block in the data sharing cache queue and the identification of a process connected to the data sharing cache queue.
6. The method according to one of claims 1 to 5, characterized in that the method further comprises:
and if the read conditions are met, marking the positions of the data read by the at least one data reading process in the data sharing cache queue.
7. A multi-process communication system, the system comprising: data sharing process, at least one data writing process and at least one data reading process, wherein the data sharing process is configured to perform the method of one of claims 1 to 6.
8. An apparatus for interprocess data communication, the apparatus comprising:
the creating module is used for creating a data sharing cache queue;
the receiving module is used for responding to the received shared data sent by at least one data writing process and storing the shared data into the data sharing cache queue;
the determining module is used for responding to a data reading application which is sent by at least one data reading process and used for reading data from the data sharing cache queue, and determining whether the data reading application meets a reading condition;
and the first sending module is used for sending the data corresponding to the data reading application in the data sharing cache queue to a target data reading process if the reading condition is met, wherein the target data reading process is the data reading process corresponding to the data reading application.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
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.
10. A computer-readable storage 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.
CN202010130109.2A 2020-02-28 2020-02-28 Inter-process data communication method and device Pending CN111367687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010130109.2A CN111367687A (en) 2020-02-28 2020-02-28 Inter-process data communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010130109.2A CN111367687A (en) 2020-02-28 2020-02-28 Inter-process data communication method and device

Publications (1)

Publication Number Publication Date
CN111367687A true CN111367687A (en) 2020-07-03

Family

ID=71210997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010130109.2A Pending CN111367687A (en) 2020-02-28 2020-02-28 Inter-process data communication method and device

Country Status (1)

Country Link
CN (1) CN111367687A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153133A (en) * 2020-09-18 2020-12-29 苏州浪潮智能科技有限公司 Data sharing method, device and medium
CN112506676A (en) * 2020-12-02 2021-03-16 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium
CN113779080A (en) * 2020-11-26 2021-12-10 北京沃东天骏信息技术有限公司 Method and apparatus for transmitting data
CN113779545A (en) * 2021-08-27 2021-12-10 深圳市优必选科技股份有限公司 Data cross-process sharing method, terminal equipment and computer readable storage medium
WO2022021896A1 (en) * 2020-07-30 2022-02-03 华为技术有限公司 Interprocess communication method and apparatus
CN114138419A (en) * 2021-12-07 2022-03-04 北京睿芯高通量科技有限公司 Openresty-based cross-type inter-service data sharing method and system
CN114928652A (en) * 2022-04-29 2022-08-19 高德软件有限公司 Map data transmission method, map data transmission device, electronic apparatus, storage medium, and program
CN115529453A (en) * 2022-08-10 2022-12-27 北京罗克维尔斯科技有限公司 Vehicle-mounted camera testing method and device
WO2023050673A1 (en) * 2021-09-28 2023-04-06 上海商汤智能科技有限公司 Image caching method and apparatus, and electronic device, storage medium and computer program product
CN117931485A (en) * 2024-03-22 2024-04-26 摩尔线程智能科技(北京)有限责任公司 Data transmission system and method, electronic equipment and storage medium
CN117931485B (en) * 2024-03-22 2024-06-07 摩尔线程智能科技(北京)有限责任公司 Data transmission system and method, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331148A (en) * 2016-09-14 2017-01-11 郑州云海信息技术有限公司 Cache management method and cache management device for data reading by clients
CN106776056A (en) * 2016-11-10 2017-05-31 北京像素软件科技股份有限公司 Game data processing method, device and server
US20180191706A1 (en) * 2016-12-29 2018-07-05 Yahoo Holdings, Inc. Controlling access to a shared resource

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331148A (en) * 2016-09-14 2017-01-11 郑州云海信息技术有限公司 Cache management method and cache management device for data reading by clients
CN106776056A (en) * 2016-11-10 2017-05-31 北京像素软件科技股份有限公司 Game data processing method, device and server
US20180191706A1 (en) * 2016-12-29 2018-07-05 Yahoo Holdings, Inc. Controlling access to a shared resource

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022021896A1 (en) * 2020-07-30 2022-02-03 华为技术有限公司 Interprocess communication method and apparatus
CN112153133A (en) * 2020-09-18 2020-12-29 苏州浪潮智能科技有限公司 Data sharing method, device and medium
CN112153133B (en) * 2020-09-18 2022-12-27 苏州浪潮智能科技有限公司 Data sharing method, device and medium
CN113779080A (en) * 2020-11-26 2021-12-10 北京沃东天骏信息技术有限公司 Method and apparatus for transmitting data
CN112506676A (en) * 2020-12-02 2021-03-16 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium
CN112506676B (en) * 2020-12-02 2024-04-05 深圳市广和通无线股份有限公司 Inter-process data transmission method, computer device and storage medium
CN113779545A (en) * 2021-08-27 2021-12-10 深圳市优必选科技股份有限公司 Data cross-process sharing method, terminal equipment and computer readable storage medium
WO2023050673A1 (en) * 2021-09-28 2023-04-06 上海商汤智能科技有限公司 Image caching method and apparatus, and electronic device, storage medium and computer program product
CN114138419A (en) * 2021-12-07 2022-03-04 北京睿芯高通量科技有限公司 Openresty-based cross-type inter-service data sharing method and system
CN114138419B (en) * 2021-12-07 2022-09-23 北京睿芯高通量科技有限公司 Openresty-based cross-type inter-service data sharing method and system
CN114928652A (en) * 2022-04-29 2022-08-19 高德软件有限公司 Map data transmission method, map data transmission device, electronic apparatus, storage medium, and program
CN115529453A (en) * 2022-08-10 2022-12-27 北京罗克维尔斯科技有限公司 Vehicle-mounted camera testing method and device
CN117931485A (en) * 2024-03-22 2024-04-26 摩尔线程智能科技(北京)有限责任公司 Data transmission system and method, electronic equipment and storage medium
CN117931485B (en) * 2024-03-22 2024-06-07 摩尔线程智能科技(北京)有限责任公司 Data transmission system and method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111367687A (en) Inter-process data communication method and device
CN108282529B (en) System, method and device for publishing and subscribing data
US20140297769A1 (en) Retrieving messages in order in a distributed publish/subscribe system
CN112433920A (en) Buried point data reporting method, device, equipment and medium
CN110955640B (en) Cross-system data file processing method, device, server and storage medium
CN110460584B (en) Access request processing method and device, electronic equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112015816A (en) Data synchronization method, device, medium and electronic equipment
CN112596920A (en) Message processing method and device, electronic equipment and storage medium
CN110636367A (en) Video loading method and device, terminal equipment and medium
CN111917661A (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN116627333A (en) Log caching method and device, electronic equipment and computer readable storage medium
CN112689020B (en) Message transmission method, message middleware, electronic equipment and storage medium
CN111596864A (en) Method, device, server and storage medium for data delayed deletion
CN114465919B (en) Network service testing method, system, electronic equipment and storage medium
CN115269063A (en) Process creation method, system, device and medium
WO2020224295A1 (en) Information management method, device, and system
CN114189750A (en) Playing method of multi-format file and related device
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN113783830B (en) Method and apparatus for data communication
CN110825920A (en) Data processing method and device
CN116820354B (en) Data storage method, data storage device and data storage system
CN117675720B (en) Message transmission method and device, electronic equipment and storage medium
CN111259174B (en) Multimedia transmission method, device, electronic equipment and medium
CN113127222B (en) Data transmission method, device, equipment and medium

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