CN114138245A - Data processing method and device based on pipeline communication - Google Patents

Data processing method and device based on pipeline communication Download PDF

Info

Publication number
CN114138245A
CN114138245A CN202111487422.2A CN202111487422A CN114138245A CN 114138245 A CN114138245 A CN 114138245A CN 202111487422 A CN202111487422 A CN 202111487422A CN 114138245 A CN114138245 A CN 114138245A
Authority
CN
China
Prior art keywords
subprocess
pipeline
file
parameter
call request
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
CN202111487422.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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111487422.2A priority Critical patent/CN114138245A/en
Publication of CN114138245A publication Critical patent/CN114138245A/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
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Abstract

The present disclosure provides a data processing method based on pipeline communication, which can be applied to the technical field of computers. The method comprises the following steps: a parent process starting a subprocess, wherein the subprocess is used for realizing C + + library function calling; a parent process creates a first pipeline file and a second pipeline file; the parent process sends the received call request parameters to the child process through the first pipeline file; and the child process sends a return parameter to the parent process through the second pipeline file, wherein the return parameter is obtained by processing the child process according to the call request parameter. The present disclosure also provides a data processing apparatus, a device, a storage medium, and a program product based on pipe communication.

Description

Data processing method and device based on pipeline communication
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an interprocess communication technology, and more particularly, to a data processing method, apparatus, device, medium, and program product based on pipeline communication.
Background
In the daily application development process, different program languages are selected from the aspects of convenience, stability and efficiency of development. For example, the java framework has high maturity, is relatively stable, has small development difficulty and can be used for service encapsulation development; c + + has high efficiency and can be used for bottom-layer algorithm development. Therefore, there are often scenes where Java applications call C + + libraries through JNI (Java Native Interface, JNI), for example, package external service codes through Java, call C + + code deep learning model bottom layer, and the like. In the practical application process, due to the problem of the C + + self exception handling mechanism, the C + + code exception running caused by some exception input data can occur, so that the whole java service is crashed and unavailable.
In order to solve the problem that JVM (Java virtual machine) is crashed due to the fact that C + + abnormity does not occur when java application calls a C + + library function, the current common method is that the C + + library is independently packaged into a service, and java realizes the access of the C + + library function through a network protocol, so that the realization is not influenced mutually.
However, the method of encapsulating C + + into a service separately has a relatively high development cost, one more service increases the operation and maintenance cost, and monitoring the state of the C + + service and the crash and pull-up in real time also requires other schemes for support, which is generally complex.
Disclosure of Invention
In view of the above, the present disclosure provides a data processing method, apparatus, device, medium, and program product based on pipe communication.
According to a first aspect of the present disclosure, there is provided a pipeline-based data processing method, comprising: a parent process starting a subprocess, wherein the subprocess is used for realizing C + + library function calling;
a parent process creates a first pipeline file and a second pipeline file;
the parent process sends the received call request parameters to the child process through the first pipeline file; and
the child process sends a return parameter to the parent process through the second pipe file,
and the return parameters are obtained by processing the subprocess according to the call request parameters.
According to an embodiment of the present disclosure, further comprising:
monitoring the running state of the subprocess;
and when the running state of the subprocess is determined to be abnormal, restarting the subprocess.
According to an embodiment of the present disclosure, the determining that the running state of the sub-process is abnormal includes:
and when the parent process performs writing operation on the first pipeline file and/or performs reading operation on the second pipeline file, and an abnormal error is reported, determining that the running state of the child process is abnormal.
According to an embodiment of the present disclosure, the sending, by the parent process, the received call request parameter to the child process through the first pipeline file includes:
receiving a call request parameter;
writing the calling request parameter into the first pipeline file;
and the subprocess reads the first pipeline file to obtain the call request parameter.
According to an embodiment of the present disclosure, the sending, by the child process, the return parameter to the parent process through the second pipeline file includes:
the subprocess determines a return parameter according to the call request parameter;
writing the return parameter into the second pipeline file;
and the parent process reads the second pipeline file to obtain the return parameter.
According to an embodiment of the present disclosure, the determining, by the sub-process, a return parameter according to the call request parameter includes:
reading the calling request parameter of the first pipeline file by the subprocess;
and the subprocess completes the C + + library function call according to the call request parameter to obtain a return parameter.
A second aspect of the present disclosure provides a data processing apparatus based on pipe communication, including: the starting module is used for starting a subprocess, and the subprocess is used for realizing C + + library function calling;
the creating module is used for creating a first pipeline file and a second pipeline file; and
the first sending module is used for sending the received call request parameters to the subprocess through the first pipeline file; and
and the second sending module is used for sending a return parameter to the parent process through the second pipeline file, wherein the return parameter is obtained by processing the child process according to the call request parameter.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described data processing method based on pipe communication.
The fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to perform the above-mentioned data processing method based on pipe communication.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-mentioned data processing method based on pipe communication.
According to the method provided by the embodiment of the disclosure, a JNI interface is called through Java codes in a parent-child process mode, one child process is started to realize C + + library function calling, parent-child processes interact through pipelines, the state real-time monitoring and abnormal pull-up of the child processes are realized, and the problem that JVM crash service is unavailable due to the fact that Java application calls C + + library abnormity is solved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of a data processing method based on pipe communication according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow chart of a data processing method based on pipe communication according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a parent-child process communication method according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a flow diagram of a method for a parent process to monitor a child process, in accordance with an embodiment of the present disclosure;
FIG. 5 is a block diagram schematically illustrating a data processing apparatus based on pipe communication according to an embodiment of the present disclosure; and
fig. 6 schematically shows a block diagram of an electronic device adapted to implement a data processing method based on pipe communication according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The terms appearing in the embodiments of the present disclosure are explained first:
JNI: JNI (Java Native Interface, JNI) can ensure that codes can be conveniently transplanted on different platforms by writing programs through a Java Native Interface. The JNI standard is part of the Java platform, which allows Java code to interact with code written in other languages.
JVM: an abbreviation of Java Virtual Machine (JVM), a specification for computing devices, is a fictitious computer implemented by emulating various computer functions on a real computer. After the Java language virtual machine is introduced, the Java language does not need to be recompiled when running on different platforms. The Java language masks information related to a specific platform using a Java virtual machine, so that a Java language compiler can be executed on a variety of platforms without modification by only generating object codes (bytecodes) to be executed on the Java virtual machine.
Pipeline communication: pipeline Communication (Communication Pipeline) is a process in which a sending process sends large amounts of data into a Pipeline in the form of a character stream, and a receiving process can receive data from the Pipeline, both of which communicate using the Pipeline. Due to the uniqueness of current operating systems, each system has its own communication protocol, resulting in difficulties in communication between different systems. The named pipe has unique advantages as a communication method, which is mainly characterized in that the named pipe does not depend on a certain protocol completely, but is applicable to any protocol.
In the daily application development process, different program languages are selected from the aspects of convenience, stability and efficiency of development. For example, the java framework has high maturity, is relatively stable, has small development difficulty and can be used for service encapsulation development; c + + has high efficiency and can be used for bottom-layer algorithm development. Therefore, scenes that java applications call the C + + library through JNI often exist, for example, packaging of external service codes is achieved through java, bottom layer calling of a C + + code deep learning model is achieved, and the like. In the practical application process, due to the problem of the C + + self exception handling mechanism, the C + + code exception running caused by some exception input data can occur, so that the whole java service is crashed and unavailable.
In one example, in order to realize that the problem of JVM crash caused by C + + exception does not occur when a Java application calls a C + + library function, the current common practice is to independently encapsulate the C + + library into a service, and Java realizes the access of the C + + library function through a network protocol, so that the realization is not influenced by each other. The method of separately encapsulating C + + into a service has a relatively high development cost, one more service increases the operation and maintenance cost, and monitoring the state of the C + + service and pulling up in real time also requires other schemes for support, which is generally complex.
The embodiment of the disclosure provides a data processing method based on pipeline communication, which comprises the following steps:
a parent process starting a subprocess, wherein the subprocess is used for realizing C + + library function calling; a parent process creates a first pipeline file and a second pipeline file; the parent process sends the received call request parameters to the child process through the first pipeline file; and the child process sends a return parameter to the parent process through the second pipeline file, wherein the return parameter is obtained by processing the child process according to the call request parameter.
Fig. 1 schematically illustrates an application scenario of a data processing method based on pipe communication according to an embodiment of the present disclosure. It should be noted that the application scenario shown in fig. 1 is only an example of an application scenario that may be used in the embodiments of the present disclosure to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.
Fig. 1 schematically illustrates an application scenario of a data processing method based on pipe communication according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may include a scenario in which a Java application calls a C + + library function. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various client applications installed thereon, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back the return parameters (e.g., web pages, information, or data obtained or generated according to the user request parameters) to the terminal device.
It should be noted that the data processing method based on pipe communication provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the data processing apparatus based on pipe communication provided by the embodiments of the present disclosure may be generally disposed in the server 105. The data processing method based on pipe communication provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the data processing apparatus based on pipe communication provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The data processing method based on pipe communication according to the disclosed embodiment will be described in detail below with reference to fig. 2 to 4 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flow chart of a data processing method based on pipe communication according to an embodiment of the present disclosure.
As shown in fig. 2, the data processing method based on pipe communication of the embodiment includes operations S210 to S240, and the data processing method may be performed by a server or a computing device.
In operation S210, the parent process starts a subprocess, and the child process is used to implement a C + + library function call.
In one example, a program developed by Java serves as a parent process, and when the parent process starts initialization, the parent process starts a C + + program subprocess by calling a JNI interface, and the subprocess can realize the calling of C + + library functions. Compared with the mode of independently encapsulating C + + into service in the prior art, the method realizes C + + library function calling through the promoter process, and the parent process only provides data forwarding and state monitoring functions, so that the development cost is reduced, and the usability and stability of the service can be improved.
In operation S220, the parent process creates a first pipe file and a second pipe file.
In one example, a parent process interacts with a child process through a pipeline file, the parent process creates a first pipeline file and a second pipeline file, the pipeline files are files which are established on a memory and can be accessed by the two processes at the same time, in the first pipeline file, the parent process can only perform data writing operation, and the child process can only perform data reading operation, so that the parent process sends request data for receiving external calls to the child process in a form of writing the first pipeline file; in the second pipeline file, the parent process can only perform data reading operation, and the child process can only perform data writing operation, and is used for the child process to return a result, wherein the return result is a processing result obtained by the child process calling the C + + library function according to the received request data, and the return result is written into the second pipeline file, so that the transmission of the data processing result can be completed. The pipeline file belongs to a half-duplex communication mode, namely, both communication parties can send information, but both communication parties cannot send information at the same time and cannot receive information at the same time.
In operation S230, the parent process transmits the received call request parameter to the child process through the first pipe file.
Fig. 3 schematically shows a flowchart of a parent-child process communication method according to an embodiment of the present disclosure. As shown in fig. 3, the parent process transmitting data to the child process through the first pipe file includes operations S231 to S233.
Operation S230 includes operations S231 through S233.
Receiving a call request parameter in operation S231; in operation S232, writing the call request parameter into the first pipeline file; in operation S233, the sub-process reads the first pipe file get call request parameter.
In one example, a parent process receives an external call request parameter, where the call request parameter is data required for performing logic operation on a corresponding service, such as image data required by an image processing service, audio data required by a voice recognition service, and the like, and writes the received external call request parameter into a first pipeline file.
In operation S240, the child process sends a return parameter to the parent process through the second pipeline file, where the return parameter is obtained by the child process according to the processing of the call request parameter.
As shown in fig. 3, the child process transmitting data to the parent process through the second pipe file includes operations S241 to S243. Operation S240 includes operations S241 to S243.
In operation S241, the sub-process determines a return parameter according to the call request parameter.
According to the embodiment of the disclosure, a subprocess reads a call request parameter of a first pipeline file; and the subprocess completes the C + + library function call according to the call request parameter to obtain a return parameter.
Reading a call request parameter of the first pipeline file by the subprocess, calling a C + + library function according to the call request parameter to complete logic operation processing, and obtaining a return parameter, wherein the return parameter is obtained by logic processing after the subprocess calls the C + + library function, for example, a face recognition algorithm in C + + is called to recognize according to received picture data, and a recognition result is returned; for example, the text data may be obtained by calling an audio recognition algorithm based on the received audio data.
In operation S242, the return parameter is written to the second pipe file. In operation S243, the parent process reads the second pipe file to obtain the return parameter.
In one example, similar to operation S230, the parent process continuously reads the data in the second pipeline file, and after the child process writes the return parameter into the second pipeline file, the parent process may read the return parameter and return the return parameter to the external requester. Thereby completing the Java service.
According to the method and the device for achieving isolation of the parent process and the child process, the child process is created through the parent process, the parent process and the child process carry out communication and data interaction through the pipeline, the child process achieves calling of the C + + library function, parent and child process isolation is achieved through the method, the situation that service is unavailable due to crash of the parent process caused by crash of the child process is avoided, and the problem that JVM crashes caused by calling of C + + codes through JNI is solved.
FIG. 4 schematically illustrates a flow diagram of a method for a parent process to monitor a child process, according to an embodiment of the disclosure. The data processing method based on pipeline communication provided by the embodiment of the present disclosure further includes the parent process monitoring the running state of the child process in real time to implement abnormal pulling-up of the child process, and specifically includes operation S310 to operation S320.
In operation S310, the operation state of the sub-process is monitored. In operation S320, when it is determined that the running state of the sub-process is abnormal, the sub-process is restarted.
According to the embodiment of the disclosure, the determining the running state of the child process includes determining that the running state of the child process is abnormal when the parent process performs a write operation on the first pipeline file and/or performs a read operation on the second pipeline file and an exception error is reported.
In one example, when a parent process performs data writing operation on a first pipeline file, if the first pipeline file fails to be written due to error report, determining that the current state of a child process is abnormal, and at the moment, restarting a new C + + child process by the parent process to avoid unavailable service due to crash of the child process; similarly, in the normal running state of the child process, the parent process reads the return parameters in the second pipeline file through a communication blocking mode, when the child process state is abnormal, the parent process can generate error reporting information when reading the second pipeline file, the fact that the current child process is abnormal and rushing is determined, and the parent process can restart a new C + + child process, so that the purposes of abnormal monitoring and restart recovery are achieved, an additional monitoring system and a crash pull-up recovery system do not need to be developed, and development cost is reduced.
By the method provided by the embodiment of the disclosure, the parent process monitors the abnormal state of the child process through the pipeline file, and when the child process is abnormally rushed, the child process can be restarted in time, so that the reliability of providing service to the outside is improved.
Based on the data processing method based on the pipeline communication, the disclosure also provides a data processing device based on the pipeline communication. The apparatus will be described in detail below with reference to fig. 5.
Fig. 5 schematically shows a block diagram of a data processing apparatus based on pipe communication according to an embodiment of the present disclosure.
As shown in fig. 5, the data processing apparatus 500 based on pipe communication of this embodiment includes a start module 510, a creation module 520, a first transmission module 530, and a second transmission module 540.
The starting module 510 is used for starting a subprocess, and the subprocess is used for realizing function call of the C + + library. In an embodiment, the starting module 510 may be configured to perform the operation S210 described above, which is not described herein again.
The creation module 520 is used to create a first pipeline file and a second pipeline file. In an embodiment, the creating module 520 may be configured to perform the operation S220 described above, which is not described herein again.
The first sending module 530 is configured to send the received call request parameter to the sub-process through the first pipeline file. In an embodiment, the first sending module 530 may be configured to perform the operation S230 described above, which is not described herein again.
The second sending module 540 is configured to send the return parameter to the parent process through the second pipeline file, where the return parameter is obtained by processing the child process according to the call request parameter. In an embodiment, the second sending module 540 may be configured to perform the operation S240 described above, and is not described herein again.
According to an embodiment of the present disclosure, any plurality of the starting module 510, the creating module 520, the first sending module 530, and the second sending module 540 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the starting module 510, the creating module 520, the first sending module 530 and the second sending module 540 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware and firmware, or in a suitable combination of any of them. Alternatively, at least one of the starting module 510, the creating module 520, the first sending module 530 and the second sending module 540 may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement a data processing method based on pipe communication according to an embodiment of the present disclosure.
As shown in fig. 6, an electronic apparatus 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. Processor 901 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 901 may also include on-board memory for caching purposes. The processor 901 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 900 may also include input/output (I/O) interface 905, input/output (I/O) interface 905 also connected to bus 904, according to an embodiment of the present disclosure. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: 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), 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 disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 902 and/or the RAM 903 described above and/or one or more memories other than the ROM 902 and the RAM 903.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the data processing method based on the pipeline communication provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 901. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, and downloaded and installed through the communication section 909 and/or installed from the removable medium 911. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program, when executed by the processor 901, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A data processing method based on pipeline communication is characterized by comprising the following steps:
a parent process starting a subprocess, wherein the subprocess is used for realizing C + + library function calling;
a parent process creates a first pipeline file and a second pipeline file;
the parent process sends the received call request parameters to the child process through the first pipeline file; and
the child process sends a return parameter to the parent process through the second pipe file,
and the return parameters are obtained by processing the subprocess according to the call request parameters.
2. The method of claim 1, further comprising:
monitoring the running state of the subprocess;
and when the running state of the subprocess is determined to be abnormal, restarting the subprocess.
3. The method of claim 2, wherein the determining that the running state of the sub-process is abnormal comprises:
and when the parent process performs writing operation on the first pipeline file and/or performs reading operation on the second pipeline file, and an abnormal error is reported, determining that the running state of the child process is abnormal.
4. The method of claim 1, wherein the parent process sending the received call request parameters to the child process via the first pipe file comprises:
receiving a call request parameter;
writing the calling request parameter into the first pipeline file;
and the subprocess reads the first pipeline file to obtain the call request parameter.
5. The method of claim 1, wherein sending, by the child process, the return parameters to the parent process via the second conduit file comprises:
the subprocess determines a return parameter according to the call request parameter;
writing the return parameter into the second pipeline file;
and the parent process reads the second pipeline file to obtain the return parameter.
6. The method of claim 5, wherein the sub-process determining a return parameter from the call request parameter comprises:
reading the calling request parameter of the first pipeline file by the subprocess;
and the subprocess completes the C + + library function call according to the call request parameter to obtain a return parameter.
7. A data processing apparatus based on pipe communication, comprising:
the starting module is used for starting a subprocess, and the subprocess is used for realizing C + + library function calling;
the creating module is used for creating a first pipeline file and a second pipeline file;
the first sending module is used for sending the received call request parameters to the subprocess through the first pipeline file; and
and the second sending module is used for sending a return parameter to the parent process through the second pipeline file, wherein the return parameter is obtained by processing the child process according to the call request parameter.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 6.
CN202111487422.2A 2021-12-07 2021-12-07 Data processing method and device based on pipeline communication Pending CN114138245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111487422.2A CN114138245A (en) 2021-12-07 2021-12-07 Data processing method and device based on pipeline communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111487422.2A CN114138245A (en) 2021-12-07 2021-12-07 Data processing method and device based on pipeline communication

Publications (1)

Publication Number Publication Date
CN114138245A true CN114138245A (en) 2022-03-04

Family

ID=80384960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111487422.2A Pending CN114138245A (en) 2021-12-07 2021-12-07 Data processing method and device based on pipeline communication

Country Status (1)

Country Link
CN (1) CN114138245A (en)

Similar Documents

Publication Publication Date Title
CN109032706B (en) Intelligent contract execution method, device, equipment and storage medium
CN111090536B (en) Method, device, medium and electronic equipment for acquiring memory leakage information
EP2307977B1 (en) System and method for dynamic partitioning of applications in client-server environments
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
US9417938B2 (en) Remote procedure call chains
US20140372985A1 (en) API Rules Verification Platform
US11561889B2 (en) Orchestration for automated performance testing
CN113312037A (en) Data processing method, device and equipment applied to microservice and storage medium
US11151020B1 (en) Method and system for managing deployment of software application components in a continuous development pipeline
CN112395098B (en) Application program interface calling method and device, storage medium and electronic equipment
US20130139185A1 (en) Intercepting and tracing interface routine transactions
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN114138245A (en) Data processing method and device based on pipeline communication
CN114035864A (en) Interface processing method, interface processing device, electronic device, and storage medium
CN114327404A (en) File processing method and device, electronic equipment and computer readable medium
CN114116263A (en) System, method, apparatus, and medium for multi-page tag communication in a browser
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN112506781A (en) Test monitoring method, test monitoring device, electronic device, storage medium, and program product
CN112068814A (en) Method, device, system and medium for generating executable file
CN110647405A (en) System message processing method, electronic device, and computer-readable storage medium
US11689630B2 (en) Request processing method and apparatus, electronic device, and computer storage medium
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN113127051B (en) Application resource packaging process monitoring method, device, equipment and medium
CN114237624A (en) Go language-based error processing method, device, equipment, medium and product

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