CN109040210A - Communication means, terminal device and storage medium between a kind of application - Google Patents

Communication means, terminal device and storage medium between a kind of application Download PDF

Info

Publication number
CN109040210A
CN109040210A CN201810814438.1A CN201810814438A CN109040210A CN 109040210 A CN109040210 A CN 109040210A CN 201810814438 A CN201810814438 A CN 201810814438A CN 109040210 A CN109040210 A CN 109040210A
Authority
CN
China
Prior art keywords
client
application
communication
request
communication packet
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.)
Granted
Application number
CN201810814438.1A
Other languages
Chinese (zh)
Other versions
CN109040210B (en
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.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen 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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201810814438.1A priority Critical patent/CN109040210B/en
Publication of CN109040210A publication Critical patent/CN109040210A/en
Priority to PCT/CN2019/095087 priority patent/WO2020019972A1/en
Application granted granted Critical
Publication of CN109040210B publication Critical patent/CN109040210B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application is suitable for field of communication technology, provide the communication means between a kind of application, terminal device and computer readable storage medium, the described method includes: the first application establishes connection with server-side based on the interface that the first client provides, second application establishes connection with server-side based on the interface that the second client provides, in this way, communication connection is just established between first application and the second application, then the first application sends the first communication packet to the second application by the communication connection, second application can return to the second communication packet to the first application by the communication connection, after the communication connection of the first application and the second application terminates, the communication connection between the first application and the second application is disconnected by release request, and, the data applied are converted to the information for meeting communication protocol since the interface that client provides has , so, by the application to apply between the communication means development cycle is short, stability is good.

Description

Communication means, terminal device and storage medium between a kind of application
Technical field
The application belongs to communication means, terminal device and calculating between field of communication technology more particularly to a kind of application Machine readable storage medium storing program for executing.
Background technique
Linux system is mainly based upon linux kernel and the total system and software environment that run.Current many terminals Equipment is all based on Linux system.Current Linux system supports multitask, i.e., multiple applications that can run simultaneously.
However, when needing to communicate between application, it is necessary to which the developer of each application respectively completes to develop, thus The workload that will increase developer causes the development cycle long, and the communication implementation between application is many kinds of, stablizes Property is poor.
Summary of the invention
In view of this, communication means, terminal device and computer that the embodiment of the present application provides between a kind of application can Storage medium is read, to solve the problems, such as that the communication development cycle between applying at present is long and stability is poor.
The first aspect of the embodiment of the present application provides the communication means between a kind of application, comprising:
The registration request that the first corresponding first client of application is sent is received, and is described the based on the registration request One application setting unique identification;
The handshake request of the first client transmission is received, and objective using corresponding second to second based on the handshake request Family end sends the connection request for meeting communication protocol, and second application is the application registered in the server-side;
The first communication packet of the first client transmission is received, and first communication packet is transmitted to second visitor Family end;
The second communication packet of the second client return is received, and second communication packet is returned into first visitor Family end;
The release request of the first client transmission is received, and is released based on release request to second client transmission Put notice.
The second aspect of the embodiment of the present application provides a kind of terminal device, comprising:
Registration module, the registration request sent for receiving the first corresponding first client of application, and it is based on the note Volume request is the first application setting unique identification;
Handshake module is answered for receiving the handshake request of the first client transmission, and based on the handshake request to second The connection request for meeting communication protocol is sent with corresponding second client, second application is registered in the server-side Application;
First communication module is reported for receiving the first communication packet of the first client transmission, and by first communication Text is transmitted to second client;
Second communication module is reported for receiving the second communication packet of the second client return, and by second communication Text returns to first client;
Release module is requested for receiving the release request of the first client transmission, and based on the release to described the Two clients send release notice.
The third aspect of the embodiment of the present application provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program The step of realizing the method that the embodiment of the present application first aspect provides.
The fourth aspect of the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes the embodiment of the present application when being executed by one or more processors On the one hand the step of the method provided.
5th aspect of the embodiment of the present application provides a kind of computer program product, and the computer program product includes Computer program, the computer program realize that the embodiment of the present application first aspect provides when being executed by one or more processors The method the step of.
Communication mode between application provided by the embodiments of the present application first receives the registration of application with the angle of server-side, To save unique identification, communication mode, messaging parameter of application etc., when the first application needs to be communicated with the second application When, firstly, the first application establishes connection with server-side based on the interface that the first corresponding first client of application provides, second is answered Connection is established with the interface and server-side provided based on the second corresponding second client of application, in this way, the first application and second Communication connection is just established between, then the first application sends the first communication report to the second application by the communication connection Text, the second application can return to the second communication packet to the first application by the communication connection, in the first application and the second application Communication connection terminate after, the communication connection between the first application and the second application is disconnected by release request, also, the One application second application between be not direct communication but by first application and second application respectively where client into Row communication, so that the communication stability between the first application and the second application is preferable, and without developer specially to respective Using exploitation is re-started, the development cycle of application is shortened.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of frame diagram of system provided by the embodiments of the present application;
Fig. 2 is the implementation process schematic diagram of the communication means between a kind of application provided by the embodiments of the present application;
Fig. 3 is the timing diagram communicated between a kind of application provided by the embodiments of the present application;
Fig. 4 is a kind of schematic block diagram of terminal device provided by the embodiments of the present application;
Fig. 5 is the schematic block diagram of another terminal device provided by the embodiments of the present application.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step, Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solution described herein, the system architecture in the application is described first, as shown in Figure 1, Fig. 1 For system architecture provided by the embodiments of the present application, it is located at same terminal device (example using A and application B by can be seen that in figure Such as, POS machine) in, it is located in different terminal devices (such as being located at POS machine and cash register) using A and using C, this Shen Please the communication between the application in embodiment can be using the communication between A and application B, be also possible to using A and apply C it Between communication, i.e., in the embodiment of the present application application between communication does not limit application whether in same terminal device.Figure The data flow that middle dotted line indicates is the intent data stream for wanting to realize, the data flow that the realization in figure indicates actually occurs Actual data stream.It is communicated respectively by the interface that corresponding client provides with server-side using A, using B, using C.
The following is a description of specific embodiments, it should be noted that the embodiment of the present application is from server-side side It is illustrated, in order to describe the when program process communicated between clear application, also from application or corresponding client can be applied Side be illustrated.
Fig. 2 is the implementation process schematic diagram of the communication means between a kind of application provided by the embodiments of the present application, as schemed institute Show that this method may comprise steps of:
Step S201 is received the registration request that the first corresponding first client of application is sent, and is asked based on the registration It asks as the first application setting unique identification.
In the embodiment of the present application, the registration request is initialization of first client according to first application The information for meeting communication protocol that information conversion obtains.
In order to become apparent from the step illustrated in the embodiment of the present application, can as shown in connection with fig. 3 application between communicate when Sequence figure is aided in illustrating,
By taking Fig. 3 as an example, Communications service is the service that server-side provides, and the first application passes through corresponding first visitor of the first application The interface and server-side that family end provides, which are established, to be communicated to connect, and the second application is provided by the second corresponding second client of application Interface and server-side, which are established, to be communicated to connect.Either the first client or the second client, which all have, to be converted into using data Meet the function of the information of specific communication protocol.
When being communicated between the first application and the second application, guarantees the first application first and the second application is In the application that the server-side registered, we describe the process of registration by taking the first application as an example, firstly, the first application is sent just There are the data by the first application to be converted into for the interface that beginningization information gives the first client to provide, the interface that the first client provides Meet the function of the information of specific communication protocol, it is possible to convert the initialization information of the first application to registration and ask Ask, registration request is sent to server-side by the first client, server-side after the registration request for receiving the transmission of the first client, It needs to be the corresponding first application setting unique identification of first client based on the registration request, and can also think first Client returns to registration reply.
The registration request includes: the communication mode and messaging parameter of client;Server-side will save application in this way Communication mode and messaging parameter can also include: communication handle, session id, state (idle, busy, abnormal) in practical application Etc. information.
Step S202 receives the handshake request that the first client is sent, and is based on the handshake request to the second application pair The second client answered sends the connection request for meeting communication protocol, and second application is answered for what is registered in the server-side With.
In the embodiment of the present application, the handshake request is that first client is built according to what first application was sent The information for meeting communication protocol that chain information conversion obtains, the connection request are used to indicate second client according to Connection request sends link setup notice to second application.Registered is led to using in need with other registered applications When letter, link setup information can be sent to corresponding client, by taking the first application as an example, the first application is sent to the first client Link setup information, the first client convert the link setup information to the handshake request for meeting communication protocol, and the second client is by institute It states handshake request and sends server-side, it should be noted that server-side is contained in handshake request and wanted after terminating to handshake request The application of connection, the embodiment of the present application first have to confirm the handshake request that first client is sent by taking the second application as an example In second application whether be idle state;If second application is idle state, establishes and be based on first client With the thread of the second client, and corresponding first application of first client and second client are realized based on the thread Hold the communication between corresponding second application.Server-side according to current thread to the second client send connection request, second Client end converts the connection request for meeting communication protocol to the link setup notice that the second application can identify, certainly, the Two clients can return to server-side connection reply after receiving connection request, and server-side is receiving the transmission of the second client The first client can be returned to after connection reply to shake hands response.
Step S203 receives the first communication packet that the first client is sent, and first communication packet is transmitted to Second client.
In the embodiment of the present application, first communication packet is that first client is sent according to first application The information for meeting communication protocol that obtains of the first data conversion, first communication packet is used to indicate the second client for institute It states the first communication packet and is converted into after the first data and first data are sent to the second application, the first application can will be sent out The first data for giving the second application are sent to the first client, and the first client, which converts the first data to, meets communication protocol The first communication packet, the first communication packet is then sent to server-side, what needs to be explained here is that, server-side receives After one communication packet, the validity of first communication packet can be parsed and verified;If first communication packet is effective, First communication packet is transmitted to second client.Second client also needs to convert the second communication packet to Then first data are sent to the second application again by the first data that two applications can identify.
Due to first application and second application there may be inside same terminal device, it is also possible to exist from it is different Terminal device, so, it is also necessary to before server-side receives the first communication packet that the first client is sent, need based on described the The communication mode and messaging parameter of one client start the communication mode that first client is supported, then again based on described the The communication mode that one client is supported receives the first communication packet that the first client is sent;Server-side is communicated by described first Message is transmitted to before second client, it is also necessary to communication mode and messaging parameter starting based on second client The communication mode that second client is supported, the communication mode then supported again based on second client is by described first Communication packet is transmitted to second client.
In addition, when first application and second application are located at same terminal device, first client and institute The communication modes of server-side are stated as local socket mode, the communication modes of second client and the server-side are local Socket mode;
When first application and second application are not located at same terminal device, first client and described the The communication modes of at least one client and the server-side are not local socket mode in two clients.It is not local Socket mode includes: serial ports, USB, network etc..
Step S204 receives the second communication packet that the second client returns, and second communication packet is returned to First client.
In the embodiment of the present application, second communication packet is that second client is returned according to second application The information for meeting communication protocol that obtains of the second data conversion, second communication packet is used to indicate the first client for institute It states the second communication packet and is converted into after the second data and second data are sent to the first application, second applies and receiving After one data, the second data can be returned to the second client, the second client can incite somebody to action after receiving the second data Second data are converted into the second communication packet for meeting communication protocol, and the second communication packet is sent to server-side, server-side After receiving the second communication packet, the second communication packet is returned into the first client, the first client is by the second communication packet The second data that the first application can identify are converted into, and the second data are sent to the first application.
It needs to illustrate to it is logical also to can parse and verify described second after server-side receives the second communication packet Interrogate the validity of message;If second communication packet is effective, second communication packet is just transmitted to first client End.
Step S205 is received the release request that the first client is sent, and is requested based on the release to second visitor Family end sends release notice.
In the embodiment of the present application, the release request is first client according to the disconnected of the first application transmission The information for meeting communication protocol that chain information conversion obtains, the release notice is used to indicate the second client, and the release is logical Know after being converted into chain rupture notice, chain rupture notice is sent to second application, the first application and the are illustrated only in Fig. 3 The communication process of a communication packet between two applications, indeed it is possible to repeatedly, it is whole in the first application and the second application When only communicating, the first application can send chain rupture information to the first client, and the first client converts the first chain rupture information to Meet the release request of communication protocol, and release request is sent to server-side, server-side is according to release request first to the second visitor Family end sends release notice, and release is notified that being converted into the chain rupture for meeting communication protocol notifies by the second client, and chain rupture is led to Know and is sent to the second application.
As the another embodiment of the application, server-side receive information that the first client or the second client are sent it Afterwards, further includes:
Response message is returned to corresponding first client of the message or the second client, the response message is used to indicate The message arrived;
The message that first client is sent includes: registration request, handshake request, the first communication packet, release request;
The message that second client is sent includes: the second communication packet.
In the embodiment of the present application, as seen in Figure 3, the data communication that server-side and the first client carry out, Corresponding response message can be returned to, similarly, the data communication that server-side and the second client carry out also can be returned and be answered accordingly Answer information.
As the another embodiment of the application, before receiving the release request that the first client is sent, if receiving third The handshake request sent using corresponding third client, further includes:
Confirm whether the 4th application in the handshake request of the third client transmission is idle state, and the third is answered With the application with the 4th application to be registered in the server-side;
If the 4th application is idle state, the thread based on the third client and the 4th client is established, And it realizes that the corresponding third of the third client is applied based on the thread and applies it with the 4th client the corresponding 4th Between communication.
In the embodiment of the present application, an application can only once be communicated with another application, cannot be simultaneously and more A application is communicated, however, server-side can be realized simultaneously the communication between multiple groups application, for example, realizing that first answers simultaneously With the communication between communication, third application and the 4th application between the second application.In this way, the first application and second applies it Between can occupy first thread, third apply and the 4th application before can occupy the second thread, i.e. the embodiment of the present application is supported Mostly concurrent communication process.
Illustrate the embodiment of the present application in order to clearer, enumerates section communication agreement
1 serial data of table exchanges communication structure
2 network data exchange communication structure of table
Table 3 is the meaning of table 1 or the symbol in table 2
4 profile parameters of table (when communication mode is arranged, can be arranged) according to configuration file
5 registration request of table
The response message of 6 registration request of table
Domain name Variable name It is required that Remarks
Order cmd M 0x01
Answer code rspCode M
7 handshake request of table
Domain name Variable name It is required that Remarks
Order cmd M 0x02
Application ID appID M
Target application ID targetAppID M Communication object application ID
Check value checksum C
The response message of 8 handshake request of table
Domain name Variable name It is required that Remarks
Order cmd M 0x02
Session id sessionID M
Answer code rspCode M
Check value checksum C
Table 9 sends communication packet:
Table 10 sends the corresponding response message of communication packet
Domain name Variable name It is required that Remarks
Order cmd M 0x03
Session id sessionID M
Answer code rspCode M
Check value checksum C
Table 11 receives communication packet
Table 12 receives the corresponding response message of communication packet
Domain name Variable name It is required that Remarks
Application ID appID M
Order cmd M 0x06 remarks: response
Answer code rspCode M
Check value checksum C
The release request of table 13
Corresponding response message is requested in the release of table 14
Domain name Variable name It is required that Remarks
Order cmd M 0x04
Session id sessionID M
Answer code rspCode M
Check value checksum C
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Fig. 4 is that the schematic block diagram for the terminal device that one embodiment of the application provides only is shown and this Shen for ease of description It please the relevant part of embodiment.
The terminal device 4 can be the software being built in the terminal devices such as mobile phone, tablet computer, notebook, computer The unit of unit, hardware cell or soft or hard combination, can also be used as independent pendant be integrated into the mobile phone, tablet computer, In the terminal devices such as notebook, computer.
The terminal device 4 includes:
Registration module 41, the registration request sent for receiving the first corresponding first client of application, and based on described Registration request is the corresponding first application setting unique identification of first client;
Handshake module 42 for receiving the handshake request of the first client transmission, and is based on the handshake request to second The connection request for meeting communication protocol is sent using corresponding second client, second application is in server-side registration The application crossed;
First communication module 43 for receiving the first communication packet of the first client transmission, and described first is communicated Message is transmitted to second client;
Second communication module 44 for receiving the second communication packet of the second client return, and described second is communicated Message returns to first client;
Release module 45 for receiving the release request of the first client transmission, and is requested based on the release to described Second client sends release notice.
Optionally, the registration request is that first client is obtained according to the initialization information conversion of first application The information for meeting communication protocol obtained;
The handshake request is that first client is obtained according to the link setup information conversion that first application is sent Meet the information of communication protocol, the connection request is used to indicate second client according to the connection request to described Two applications send link setup notice;
First communication packet is that first client is obtained according to the first data conversion that first application is sent The information for meeting communication protocol obtained, first communication packet are used to indicate the second client and turn first communication packet It turns to and first data is sent to the second application after the first data;
Second communication packet is that second client is obtained according to the second data conversion that second application returns The information for meeting communication protocol obtained, second communication packet are used to indicate the first client and turn second communication packet It turns to and second data is sent to the first application after the second data;
The release request is that first client is obtained according to the chain rupture information conversion that first application is sent Meet the information of communication protocol, the release notice is used to indicate the second client and converts chain rupture notice for release notice Afterwards, chain rupture notice is sent to second application.
Optionally, the registration request includes: the communication mode and messaging parameter of client;
Correspondingly, the first communication module 43 is also used to:
Communication mode and messaging parameter based on first client start the communication party that first client is supported Formula, and the communication mode supported based on first client receives the first communication packet that the first client is sent;
Communication mode and messaging parameter based on second client start the communication party that second client is supported Formula, and first communication packet is transmitted to by second client based on the communication mode that second client is supported.
Optionally, the first communication module 43 is also used to:
Before first communication packet is transmitted to second client, the first communication report is parsed and verified The validity of text;
If first communication packet is effective, first communication packet is transmitted to second client.
Optionally, the handshake module 42 is also used to:
Confirm whether the second application in the handshake request of the first client transmission is idle state;
If second application is idle state, the thread based on described the first client and the second client is established, And realize that corresponding first application of first client applies it with second client corresponding second based on the thread Between communication.
Optionally, the terminal device 4 further include:
Third communication module, for receive the first client send release request before, if receiving third application The handshake request that corresponding third client is sent confirms that the 4th application in the handshake request of the third client transmission is No is idle state, and the third is applied and the 4th application is the application registered in the server-side;
If the 4th application is idle state, the thread based on the third client and the 4th client is established, And it realizes that the corresponding third of the third client is applied based on the thread and applies it with the 4th client the corresponding 4th Between communication.
Optionally, it is described first application and it is described second application be located at same terminal device when, first client with The communication modes of the server-side are local socket mode, and the communication modes of second client and the server-side are Ground socket mode;
When first application and second application are not located at same terminal device, first client and described the The communication modes of at least one client and the server-side are not local socket mode in two clients.
Optionally, the terminal device 4 further include:
Responder module, for after receiving the information that the first client or the second client are sent, to the message pair The first client answered or the second client return to response message, and the response message is used to indicate the message and arrived;
The message that first client is sent includes: registration request, handshake request, the first communication packet, release request;
The message that second client is sent includes: the second communication packet.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of the terminal device is divided into different functional unit or module, to complete All or part of function described above.Each functional unit in embodiment, module can integrate in one processing unit, It is also possible to each unit to physically exist alone, can also be integrated in one unit with two or more units, above-mentioned collection At unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function Unit, module specific name be also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above-mentioned dress The specific work process for setting middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Fig. 5 is the schematic block diagram for the terminal device that the another embodiment of the application provides.As shown in figure 5, the end of the embodiment End equipment 5 includes: one or more processors 50, memory 51 and is stored in the memory 51 and can be in the processing The computer program 52 run on device 50.The processor 50 realizes above-mentioned each camera when executing the computer program 52 Step in control method embodiment, such as step S201 to S205 shown in Fig. 2.Alternatively, the processor 50 execute it is described The function of each module/unit in above-mentioned terminal device embodiment, such as module 41 to 45 shown in Fig. 4 are realized when computer program 52 Function.
Illustratively, the computer program 52 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 51, and are executed by the processor 50, to complete the application.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 52 in the terminal device 5 is described.For example, the computer program 52 can be divided It is cut into registration module, handshake module, first communication module, second communication module, release module.
Registration module, the registration request sent for receiving the first corresponding first client of application, and it is based on the note Volume request is the corresponding first application setting unique identification of first client;
Handshake module is answered for receiving the handshake request of the first client transmission, and based on the handshake request to second The connection request for meeting communication protocol is sent with corresponding second client, second application is registered in the server-side Application;
First communication module is reported for receiving the first communication packet of the first client transmission, and by first communication Text is transmitted to second client;
Second communication module is reported for receiving the second communication packet of the second client return, and by second communication Text returns to first client;
Release module is requested for receiving the release request of the first client transmission, and based on the release to described the Two clients send release notice.
Other modules can refer to the description in embodiment shown in Fig. 4, and details are not described herein.
The terminal device includes but are not limited to processor 50, memory 51.It will be understood by those skilled in the art that figure 5 be only an example of terminal device 5, does not constitute the restriction to terminal device 5, may include more more or less than illustrating Component, perhaps combine certain components or different components, for example, the terminal device can also include input equipment, it is defeated Equipment, network access equipment, bus etc. out.
The processor 50 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 51 can be the internal storage unit of the terminal device 5, such as the hard disk or interior of terminal device 5 It deposits.The memory 51 is also possible to the External memory equipment of the terminal device 5, such as be equipped on the terminal device 5 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 51 can also both include the storage inside list of the terminal device 5 Member also includes External memory equipment.The memory 51 is for storing needed for the computer program and the terminal device Other programs and data.The memory 51 can be also used for temporarily storing the data that has exported or will export.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed Scope of the present application.
In embodiment provided herein, it should be understood that disclosed terminal device and method can pass through it Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the module or list Member division, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown The mutual coupling or direct-coupling or communication connection shown or discussed can be through some interfaces, between device or unit Coupling or communication connection are connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the application realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and Telecommunication signal.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (10)

1. the communication means between a kind of application, which is characterized in that be applied to server-side, the communication means includes:
The registration request that the first corresponding first client of application is sent is received, and is answered based on the registration request for described first With setting unique identification;
The handshake request of the first client transmission is received, and corresponding second client is applied to second based on the handshake request The connection request for meeting communication protocol is sent, second application is the application registered in the server-side;
The first communication packet of the first client transmission is received, and first communication packet is transmitted to second client End;
The second communication packet of the second client return is received, and second communication packet is returned into first client End;
The release request of the first client transmission is received, and logical to second client transmission release based on release request Know.
2. the communication means between application as described in claim 1, which is characterized in that the registration request is first visitor The information for meeting communication protocol that family end is obtained according to the initialization information conversion of first application;
The handshake request is that first client meets according to what the link setup information conversion that first application is sent obtained The information of communication protocol, the connection request are used to indicate second client and are answered according to the connection request to described second It is notified with link setup is sent;
First communication packet is that first client is obtained according to the first data conversion that first application is sent Meet the information of communication protocol, first communication packet is used to indicate the second client and converts first communication packet to First data are sent to the second application after first data;
Second communication packet is that second client is obtained according to the second data conversion that second application returns Meet the information of communication protocol, second communication packet is used to indicate the first client and converts second communication packet to Second data are sent to the first application after second data;
The release request is that first client meets according to what the chain rupture information conversion that first application is sent obtained The information of communication protocol, the release notice are used to indicate the second client and notify the release after being converted into chain rupture notice, Chain rupture notice is sent to second application.
3. the communication means between application as described in claim 1, which is characterized in that the registration request includes: client Communication mode and messaging parameter;
Correspondingly, first communication packet for receiving the transmission of the first client includes:
Communication mode and messaging parameter based on first client start the communication mode that first client is supported, and The first communication packet based on communication mode reception the first client transmission that first client is supported;
It is described first communication packet is transmitted to second client to include:
Communication mode and messaging parameter based on second client start the communication mode that second client is supported, and First communication packet is transmitted to second client by the communication mode supported based on second client.
4. the communication means between application as described in claim 1, which is characterized in that forwarded by first communication packet Before second client, further includes:
Parse and verify the validity of first communication packet;
If first communication packet is effective, first communication packet is transmitted to second client.
5. the communication means between application as described in claim 1, which is characterized in that receiving holding for the first client transmission After hand request, further includes:
Confirm whether the second application in the handshake request of the first client transmission is idle state;
If second application is idle state, the thread based on described the first client and the second client, and base are established It is realized between corresponding first application of first client and corresponding second application of second client in the thread Communication.
6. the communication means between application as claimed in claim 5, which is characterized in that receiving releasing for the first client transmission Before putting request, if receiving the handshake request that third applies corresponding third client to send, further includes:
Confirm whether the 4th application in handshake request that the third client is sent is idle state, the third apply and 4th application is the application registered in the server-side;
If the 4th application is idle state, the thread based on the third client and the 4th client, and base are established It is realized between the corresponding third application of the third client and corresponding 4th application of the 4th client in the thread Communication.
7. the communication means between application as described in claim 1, which is characterized in that first application and described second is answered When with being located at same terminal device, the communication modes of first client and the server-side are local socket mode, institute The communication modes for stating the second client and the server-side are local socket mode;
When first application and second application are not located at same terminal device, first client and second visitor The communication modes of at least one client and the server-side are not local socket mode in the end of family.
8. a kind of terminal device characterized by comprising
Registration module, the registration request sent for receiving the first corresponding first client of application, and asked based on the registration It asks as the first application setting unique identification;
Handshake module for receiving the handshake request of the first client transmission, and is based on the handshake request to the second application pair The second client answered sends the connection request for meeting communication protocol, and second application is answered for what is registered in the server-side With;
First communication module turns for receiving the first communication packet of the first client transmission, and by first communication packet Issue second client;
Second communication module for receiving the second communication packet of the second client return, and second communication packet is returned Back to first client;
Release module, for receiving the release request of the first client transmission, and it is objective to described second based on release request Family end sends release notice.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 7 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence realizes the step such as any one of claim 1 to 7 the method when the computer program is executed by one or more processors Suddenly.
CN201810814438.1A 2018-07-23 2018-07-23 Communication method between applications, terminal equipment and storage medium Active CN109040210B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810814438.1A CN109040210B (en) 2018-07-23 2018-07-23 Communication method between applications, terminal equipment and storage medium
PCT/CN2019/095087 WO2020019972A1 (en) 2018-07-23 2019-07-08 Communication method between applications, terminal device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810814438.1A CN109040210B (en) 2018-07-23 2018-07-23 Communication method between applications, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109040210A true CN109040210A (en) 2018-12-18
CN109040210B CN109040210B (en) 2020-11-24

Family

ID=64645177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810814438.1A Active CN109040210B (en) 2018-07-23 2018-07-23 Communication method between applications, terminal equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109040210B (en)
WO (1) WO2020019972A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019972A1 (en) * 2018-07-23 2020-01-30 百富计算机技术(深圳)有限公司 Communication method between applications, terminal device, and storage medium
CN110766392A (en) * 2019-10-17 2020-02-07 中国银联股份有限公司 Transaction processing method and device
CN112954068A (en) * 2021-03-09 2021-06-11 西安奥卡云数据科技有限公司 RDMA (remote direct memory Access) -based data transmission method and device
CN115348309A (en) * 2022-06-17 2022-11-15 上海数慧系统技术有限公司 Communication management method and device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580987B (en) * 2020-04-21 2024-08-06 深圳市优必选科技股份有限公司 Remote procedure call method, device, storage medium and terminal equipment
CN112702434B (en) * 2020-12-25 2023-03-24 中国农业银行股份有限公司 Communication method and system
CN113301122B (en) * 2021-04-30 2023-08-18 珠海横乐医学科技有限公司 Medical robot distributed system real-time communication method and device and electronic equipment
CN113986501B (en) * 2021-10-28 2024-09-03 西安热工研究院有限公司 Real-time database API (application program interface) interrupt-free calling method, system, storage medium and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516933A (en) * 2014-09-22 2016-04-20 中兴通讯股份有限公司 Message processing method, message processing device, mobile terminal and server
CN106657273A (en) * 2016-11-18 2017-05-10 深圳思路名扬通讯技术股份有限公司 Information interaction method
CN107169904A (en) * 2017-03-31 2017-09-15 西藏喜年通讯科技有限公司 Method, mobile device and the device of the information interaction of different application platforms
CN107332912A (en) * 2017-07-03 2017-11-07 广州视源电子科技股份有限公司 Service discovery method, device, system, storage medium and computer equipment
CN206878866U (en) * 2017-03-29 2018-01-12 重庆大学 The residents ' health card for possessing isomery instruction transfer capability accesses gateway device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120066318A1 (en) * 2010-09-09 2012-03-15 I O Interconnect, Ltd. Data transmission method
CN102651746A (en) * 2012-05-18 2012-08-29 珠海德百祺科技有限公司 Point-to-point information transmission method, system and device
CN109040210B (en) * 2018-07-23 2020-11-24 百富计算机技术(深圳)有限公司 Communication method between applications, terminal equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516933A (en) * 2014-09-22 2016-04-20 中兴通讯股份有限公司 Message processing method, message processing device, mobile terminal and server
CN106657273A (en) * 2016-11-18 2017-05-10 深圳思路名扬通讯技术股份有限公司 Information interaction method
CN206878866U (en) * 2017-03-29 2018-01-12 重庆大学 The residents ' health card for possessing isomery instruction transfer capability accesses gateway device
CN107169904A (en) * 2017-03-31 2017-09-15 西藏喜年通讯科技有限公司 Method, mobile device and the device of the information interaction of different application platforms
CN107332912A (en) * 2017-07-03 2017-11-07 广州视源电子科技股份有限公司 Service discovery method, device, system, storage medium and computer equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019972A1 (en) * 2018-07-23 2020-01-30 百富计算机技术(深圳)有限公司 Communication method between applications, terminal device, and storage medium
CN110766392A (en) * 2019-10-17 2020-02-07 中国银联股份有限公司 Transaction processing method and device
CN112954068A (en) * 2021-03-09 2021-06-11 西安奥卡云数据科技有限公司 RDMA (remote direct memory Access) -based data transmission method and device
CN115348309A (en) * 2022-06-17 2022-11-15 上海数慧系统技术有限公司 Communication management method and device
CN115348309B (en) * 2022-06-17 2024-03-22 上海数慧系统技术有限公司 Communication management method and device

Also Published As

Publication number Publication date
WO2020019972A1 (en) 2020-01-30
CN109040210B (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN109040210A (en) Communication means, terminal device and storage medium between a kind of application
CN108365961B (en) The response method and server that interface call method and terminal device, interface call
CN105101370B (en) Data connection method and device and WIFI module
CN105956000B (en) A kind of data interactive method and client
CN107133109B (en) Method and device for communication between modules and computing equipment
CN107968848B (en) A kind of method, terminal device and storage medium obtaining IP address
CN109544439A (en) A kind of coding/decoding method based on multi-core processor, terminal device and storage medium
CN110245029A (en) A kind of data processing method, device, storage medium and server
CN109445954A (en) A kind of execution method, terminal device and the storage medium of timed task
CN110519151A (en) Controllable good friend's adding method, device, terminal device and storage medium
CN111064588B (en) Message processing method, system, device and storage medium
CN110505609A (en) A kind of bluetooth exchange method, bluetooth interactive device and terminal device
CN108830581A (en) Anti-fake method of payment, user terminal, service unit and sale terminal
CN109862083A (en) A kind of Activiation method of internet of things equipment, device and equipment
CN103902496B (en) USB KEY protocol conversion devices and method
CN106302432B (en) A kind of communication device and control method based on car networking
CN108830596A (en) The acquisition device and terminal device of a kind of acquisition methods of information, information
CN110572476B (en) Remote control method, device and equipment
Petruţ et al. The IoT connectivity challenges
CN114125024B (en) Audio transmission method, electronic device and readable storage medium
CN109936500A (en) A kind of data interactive method, data interaction device and electronic equipment
CN204596022U (en) A kind of public bicycle signal transmitting apparatus
CN103607324A (en) Data processing method, Java information client and server for Java information service
CN105871917A (en) Transmission control protocol TCP connection scheduling method and device
CN102970245B (en) Data transmission method and system

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
GR01 Patent grant
GR01 Patent grant