CN107370731A - The method and device to be communicated between different application is realized based on natural language - Google Patents
The method and device to be communicated between different application is realized based on natural language Download PDFInfo
- Publication number
- CN107370731A CN107370731A CN201710575070.3A CN201710575070A CN107370731A CN 107370731 A CN107370731 A CN 107370731A CN 201710575070 A CN201710575070 A CN 201710575070A CN 107370731 A CN107370731 A CN 107370731A
- Authority
- CN
- China
- Prior art keywords
- application
- natural language
- message
- response message
- request message
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Information Transfer Between Computers (AREA)
Abstract
In the embodiment of the present invention, proposition is a kind of to realize the method to be communicated between different application based on natural language:Second application receives the request message that the first application is sent, and request message is used to ask the target information related to the communication protocol that the second application can be supported;Response message is sent to the first application, the target information related at least one communication protocol that the second application can be supported is carried in response message;Wherein, request message and/or response message are sent based on natural language.In this scenario, the target information related to communication protocol is obtained using natural language, because the versatility of natural language is high, even if the first application does not prestore the target information related to the second supported communication protocol of application, can also by natural language come obtain with, so as to realize with the second application communication, therefore the defects of the agreement that can solve not prestore related application in the prior art can not just be communicated with such application, expand the scope of application scenarios.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of realize what is communicated between different application based on natural language
Method and device.
Background technology
With the development of science and technology, the species of application program is also more and more, needs can be run under many circumstances by not
The problem of carrying out data transmission between same application.Data transmission method between application common at present mainly includes following several
Kind:
One kind is:By a virtual container, data transmission interface is established in the application different from two respectively, then first should
Data in are passed in virtual container by corresponding first data transmission interface, virtual container again by with the second application pair
The second data transmission interface answered passes to above-mentioned data in the second application.Although the program can realize two different applications
Between data transfer, but the program needs to pre-establish the data transmission interface of virtual container, if do not pre-establish, or
Person does not know application and the interface between virtual container, then can not realize the data transfer between two different applications;
Another kind is:Two different to apply before being communicated, and the first application is first initiated to shake hands, and this is shaken hands including the
The unique identifier of one application (main application) and the first random number for marking and/or proving respond request, the second application can
The unique identifier is checked with the list using the first application being proved, with the application of checking first.If tested
Card, then the second application are responded using first random number and the second random number, wherein, the second random number can mark
And/or prove the request of data sent by the first application.But if two different applications do not know this in advance in the program
The relevant information of interaction flow, then it is also what can not be carried out data transmission between two applications;
Another is:When carrying out data transmission between two different applications, by the data transmission format of the first application
The data transmission format of the second application is converted into, so as to realize the data transfer between two different applications, but this side
The first application needs to be known a priori by the data transmission format of the second application in case, otherwise, still can not carry out data therebetween
Transmission.
In summary, the method for communication transmission between existing different application, which depends on, will obtain some relevant informations in advance
On the basis of could realize, otherwise can not realize the communication between different application.
The content of the invention
In view of the above problems, it is proposed that the present invention, overcome above mentioned problem to provide one kind or solve at least in part
The method and device to be communicated between a kind of different application of above mentioned problem, for solving present in prior art if do not had in advance
Have and obtain some relevant informations, then can not realize the defects of communicating between different application.
According to the first aspect of the present invention, there is provided a kind of that the side to be communicated between different application is realized based on natural language
Method, including:
Second application receives the request message that the first application is sent, and the request message is used to ask and the described second application
The target information for the communication protocol correlation that can be supported;
Response message is sent to the described first application, being carried in the response message can support with the described second application
The related target information of at least one communication protocol;
Wherein, the request message and/or the response message are sent based on natural language.
In one embodiment, the method according to the above-mentioned embodiment of the present invention, first application and institute
State the second application and be respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In some embodiments, the method according to any of the above-described embodiment of the present invention, the request message
It is middle to carry instruction protocol-identifier;
Second application sends response message to the described first application, including:
Second application returns to response message according to the instruction protocol-identifier to the described first application.
In some embodiments, the method according to any of the above-described embodiment of the present invention, the target information
Including protocol-identifier and/or protocol definition.
In some embodiments, the method according to any of the above-described embodiment of the present invention, the protocol definition
Information defines at least one of information, the format information of message and signaling process information including message coffret.
In some embodiments, the method according to any of the above-described embodiment of the present invention, the lattice of the message
Formula information includes digital encoding format;
Wherein, the digital encoding format includes the field, length, value model for the data that the described second application can receive
Enclose, at least one of data type.
In some embodiments, the method according to any of the above-described embodiment of the present invention, protocol-identifier can
Characterized with characterization information;
Wherein, the characterization information includes the mark ID of the described second application, the type of second application, described second
The version number of application and to the described second related internet protocol address of application, at least one of associative key.
In some embodiments, the method according to any of the above-described embodiment of the present invention, second application
After sending response message to the described first application, methods described also includes:
If at least one agreement and described first that second application is supported is using supported at least one association
View mismatches, and second application continues to send response message to the described first application.
In some embodiments, the method according to any of the above-described embodiment of the present invention, the natural language
For voice and/or text.
According to the second aspect of the present invention, there is provided a kind of that the dress to be communicated between different application is realized based on natural language
Put, including:
Receiving unit in second application, the request message sent for receiving the first application, the request message are used for
Ask the target information related to the communication protocol that the described second application can be supported;
Transmitting element in second application, for sending response message to the described first application, taken in the response message
The band target information related at least one communication protocol that the described second application can be supported;
Wherein, the request message and/or the response message are sent based on natural language.
In one embodiment, the device according to the above-mentioned embodiment of the present invention, first application and institute
State the second application and be respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In some embodiments, the device according to any of the above-described embodiment of the present invention, the request message
It is middle to carry instruction protocol-identifier;
Transmitting element in second application sends response message to the described first application, including:
Transmitting element in second application returns to response to the described first application according to the instruction protocol-identifier and disappeared
Breath.
In some embodiments, the device according to any of the above-described embodiment of the present invention, the target information
Including protocol-identifier and/or protocol definition.
In some embodiments, the device according to any of the above-described embodiment of the present invention, the protocol definition
Information defines at least one of information, the format information of message and signaling process information including message coffret.
In some embodiments, the device according to any of the above-described embodiment of the present invention, the lattice of the message
Formula information includes digital encoding format;
Wherein, the digital encoding format includes the field, length, value model for the data that the described second application can receive
Enclose, at least one of data type.
In some embodiments, the device according to any of the above-described embodiment of the present invention, protocol-identifier can
Characterized with characterization information;
Wherein, the characterization information includes the mark ID of the described second application, the type of second application, described second
The version number of application and to the described second related internet protocol address of application, at least one of associative key.
In some embodiments, the device according to any of the above-described embodiment of the present invention, second application
In transmitting element apply supported at least one in described second at least one agreement for being supported of application and described first
When agreement mismatches, continue to send response message to the described first application.
In some embodiments, the device according to any of the above-described embodiment of the present invention, the natural language
For voice and/or text.
According to the third aspect of the present invention, a kind of electronic equipment is also provided, including:
Memory and one or more processors;
Wherein, the memory is connected with one or more of processor communications, and being stored with the memory can quilt
The instruction of one or more of computing devices, the instruction is by one or more of computing devices, so that described one
Individual or multiple processors can realize method as described above.
In this scenario, the target information related to communication protocol is obtained using natural language, due to natural language
Versatility is high, therefore, believes even if the first application does not prestore to second using the related target of supported communication protocol
Breath, the target information related to the second supported communication protocol of application can also be obtained by natural language, subsequently can be with
Using obtained target information come with the second application communication, therefore, can solve not prestore in the prior art it is related should
The defects of agreement can not just be communicated with such application, expand the scope of application scenarios.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 be propose according to an embodiment of the invention a kind of stream to communicate between different application is realized based on natural language
Cheng Tu;
It is another that Fig. 2A is that being realized based on natural language of proposing according to an embodiment of the invention is communicated between different application
Kind flow chart;
It is another that Fig. 2 B are that being realized based on natural language of proposing according to an embodiment of the invention is communicated between different application
Kind flow chart;
Fig. 3 be propose according to an embodiment of the invention the device to be communicated between different application is realized based on natural language
Schematic diagram;
Fig. 4 be propose according to an embodiment of the invention the device to be communicated between different application is realized based on natural language
Another schematic diagram.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
First the technical term that may relate in the application is briefly described below.
Communication protocol, is a kind of agreement for being different from natural language form and being communicated, including disappearing of defining of communicating pair
Cease form (including message encoding format, such as 00001- represent closing television), signaling process, message channel definition (such as TCP
(Transmission Control Protocol, transmission control protocol) port numbers etc.), but these contents are all to set in advance
Fixed.Among the application, communication protocol can also include the form definition of the message of interaction between applying, between
The flow of interacting message, also including these message in physical layer, the data format of transport layer and interaction flow.
Interface message is equal to communication protocol sometimes, can be replaced, but both are still distinguishing, for example,
Interface message can also include hardware electric interfaces, and this is non negotiable part, and communication protocol then more embodies negotiable property,
Therefore, typically hardware electric interfaces information is not included in communication protocol.Wherein, interface message includes interface type, interface is determined
Justice and interface specification book etc..
Interface type (ether interface, USB (Universal Serial Bus, USB) interface etc.), typically
Defined including hardware electric interfaces, and based on the message definition on the hardware interface, signaling process, equipment behavior etc..For
Interface set in advance, typically supported by corresponding communication protocol, such as Ethernet interface, there is corresponding Ethernet protocol.
The definition of interface:Including hardware interface and protocol interface, including above-mentioned message definition, signaling process, equipment behavior
Deng.Message definition can include the digital encoding format of message.
Interface specification book (can also be called protocol specification book):Including contents such as message definition, signaling process, equipment behaviors,
It can be presented with arbitrary forms such as natural language form, form, charts.
Signaling process refers to the message sequence (procedure) that both sides exchange.
Digital encoding format refers to the mode for representing information digitalization, belongs to the content that can arrange in agreement.Than
Such as, " the opening control instruction " of a TV can be represented with 4bit binary system, such as b0001, and this 4bit
Binary data b0001 by the way of certain message sink coding or channel coding are encoded by can just be called digital coding
Form, including compression.
The communication between application involved in the embodiment of the present invention is simply introduced below.
Communication between the application of Android phone:
Message is transmitted using handler
Everybody can be imagined as handler one sub-line journey of main thread (UI threads), and it can give main thread (UI lines
Journey) data are sent so as to update the UI and logic of main thread (UI threads), handler is a sub-line journey so its time-consuming behaviour
Work will not block main thread, as you know if somewhere blocking main thread in code more than 5 in Android exploitation
If second, system can prompt ANR (system prompt positive closing), so we can contemplate one son of unlatching on time-consuming operation
Thread avoids ANR.Handler can send message to main thread, and cooperation is arranged in the form of queue and waits main thread renewal UI
Logic, etc..
Such as, message is transmitted using handler to update the UI display contents of main thread, often spending one second after click button passes through
Handler sends the time of information updating UI thread displays, until the renewal of display time to 10 and then terminates this thread.
The communication between client and server in practical application is simply introduced below.
Each application has a UPD (User Datagram Protocol, UDP) ends in server
Slogan or TCP (Transmission Control Protocol, transmission control protocol) port numbers, the IP address one of server
As be changeless, client is known that IP address and UPD/TCP port numbers in advance.Such as wechat server end, it is micro-
Letter application is assigned with an IP address, such as 20.22.119.10, TCP port number 10000.Client will need to be sent to clothes
Be engaged in device message according to TCP message form, be sent to IP address be 20.22.119.10 server TCP port 10000,
There is an application persistently to intercept the data for being sent to the port in server, and transmit data to wechat application.So, it is established that
Initial communication between client and wechat server end.
Fig. 1 is schematically shown to be realized between different application according to one kind of embodiment of the present invention based on natural language
The method 10 of communication, including:
Step 100:First application obtains at least one communication protocols that can be supported with the second application based on natural language
Discuss related target information;
Step 110:All or part of information of first application in the target information should to described second
With transmission message.
In the embodiment of the present invention described natural language actually refer to be for recipient non-preset content nature
Language, rather than the natural language form of immobilized substance.Wherein, the natural language of non-default content mean recipient need into
Row semantic analysis;And the natural language of preset content, recipient directly carry out string matching.For example, non-default interior
In the case of the natural language of appearance, " good heat today ", either " today, temperature was good high " or " fast solarization today is in the dust ", although interior
Hold different, but identical when implication is substantial, can with any expression way.In another example in non-default content
In the case of natural language, " Current Temperatures " and " present temperature ", although expression-form is different, semanteme is identical, is adopted
Also can with any one statement.
In the embodiment of the present invention, the expression way of natural language has a variety of, for example, it may be speech form, or also may be used
To be textual form (such as by IP (Internet Protocol, procotol) Web broadcast), speech form and textual form
Can be by the way of ultrasonic wave.Wherein, the text that text is specifically as follows picture character or Quick Response Code form shows
Word, speech form can be music, of course, it is also possible to there is other forms, be not specifically limited herein.
Certainly, the first application can also define specification by FTP download protocols.
In the embodiment of the present invention, alternatively, first application and the described second application are respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In the embodiment of the present invention, alternatively, the first application obtains what can be supported with the second application based on natural language
The related target information of at least one communication protocol, including:
It is described first application based on natural language to second application send request message, the request message be used for ask with
The target information for the communication protocol correlation that second application can be supported;
First application receives the response message that second application returns, and carries in the response message and described the
The target information at least one communication protocol correlation that two applications can be supported.
That is natural language is used when the first application sends request message to the second application, still, second should
It is not specifically limited with the form that response message is returned to the first application, the form of natural language can be used, or can also
The agreement that first application is specified, for example, carrying instruction protocol-identifier in the request message;
Now, alternatively, first application receives the response message that second application returns, including:
First application receives the response message that second application returns according to the instruction protocol-identifier.
Certainly, the second application returns to response message to the first application can also use other forms, not do specific limit herein
It is fixed.
Previously described is that the first application sends message to the second application and uses natural language, but the second application is to first
It is not specifically limited using the form for sending message, in the embodiment of the present invention or the second application is sent to the first application
Message uses natural language, but the form that the first application sends message to the second application is not specifically limited.
Therefore, the first application obtains at least one communication protocol phase that can be supported with the second application based on natural language
The target information of pass, including:
First application sends request message to the second application, and the request message is used to ask and the described second application
The target information for the communication protocol correlation that can be supported;
First application receives the response message that second application is returned based on natural language, in the response message
Carry the target information related at least one communication protocol that the described second application can be supported.
In the embodiment of the present invention, request message can be for directly request and communication protocol relevant information message, than
Such as:First application is sent in the form of natural language for inquiring the message with communication protocol relevant information to the second application, and second
Replied and communication protocol relevant information using then to the first application.
Or request message can also be the message for indirect or implicit request and communication protocol relevant information, as long as
The application of triggering second includes the message of target information to first using return, such as:First application is in the form of natural language
Username and password (implicit mode) is sent to the second application, the second application is replied related to communication protocol then to the first application
Information (implicit response).
Previously described is the direct mode of request message, or implicit, indirect mode, and similarly, response also may be used
To be response or implicit, the indirect response directly against the clear and definite information request of the first application.Herein no longer
It is described in detail.
In the embodiment of the present invention, the mechanism for sending broadcast and receiving broadcast can be used, to realize in android system
Two complete irrespective applications between communication, such as have sent a broadcast using A, receive and then perform using B
Associative operation, it can so realize mutual communication.
In the embodiment of the present invention, the first application obtains at least one that can be supported with the second application based on natural language
During the target information of communication protocol correlation, it is alternatively possible in the following way:
First application obtains the target information that second application is sent based on broadcast message.
Alternatively, the broadcast message to broadcast the message between application.
The broadcast between same device interior different application is simply introduced by taking android as an example below.
Android broadcast is divided into two aspects:Broadcast transmission person and broadcast recipients, it is generally the case that
BroadcastReceiver refers to broadcast recipients' (radio receiver).Broadcast the communication party as Android inter-modules
Formula, the scene that can be used comprise at least following several:
1. the message communicating in the same component inside same application (between single or multiple threads);
2. the message communicating (individual process) between the different components inside same application;
3. same application has the message communicating between the different components of multiple processes;
4. message communicating between the component between different application;
The 5.Android systems message communicating between application under specific circumstances.
Take a fancy to from realization principle, the broadcast in Android has used Observer Pattern, message based publish/subscribe thing
Part model.Specific implementation flow main points are summarized as follows roughly:
1. broadcast recipients (BroadcastReceiver) are by Binder mechanism to AMS (Activity
ManagerService) registered;
2. broadcast transmission person is sent to AMS by Binder mechanism and broadcast the message;
3.AMS searches the broadcast recipients for meeting corresponding conditionses (IntentFilter/Permission etc.), and broadcast is disappeared
Breath is sent in the corresponding Message Rotation Queue of the broadcast recipients' (being generally Activity) found;
4. message loop, which performs, takes this broadcast message, onReceive () method in broadcast recipients is adjusted back.
For the type of different broadcast messages, and the logon mode of different broadcast recipients, meeting in specific implementation
There is trickle difference, but overall procedure is substantially as above.From this, broadcast transmission person and broadcast recipients are belonging respectively to Observer
News release and subscription both ends, AMS in formula belong to middle processing center.
Which between the application of striding equipment, run if it is not known that purpose is applied in equipment, source application can use
Web broadcast mode related transmitting information.Such as purpose IP (Internet Protocol, internet protocol by broadcast message
View) address is set as broadcast address 255.255.255.255, then and it is wide that the miscellaneous equipment on network can receive this
Broadcast message.
In the embodiment of the present invention, first is a variety of using applying the mode for sending request message to have to second, it is alternatively possible to
In the following way:
First application receives the command information that user sends;
First application obtains the semantic analysis result of the command information;
First application determines request message corresponding with the semantic analysis result, and the request message is sent
To the described second application.
Wherein, when first application obtains the semantic analysis result of the command information, command information can be carried out
Semantic analysis, obtain semantic analysis result;It is of course also possible to after to carry out semantic analysis by cloud device or server,
Semantic analysis result is returned into the first application again, is not specifically limited herein.
Previously described is the semantic analysis result that the first application obtains command information, certainly, to obtain other and be based on certainly
The method class of semantic analysis result of the method for the semantic analysis result of the message of right linguistic form with obtaining the command information
Seemingly, no longer it is described in detail herein.
Because the mode that the first application sends request message to the second application can be using natural language, can not also adopt
With natural language, therefore, above-mentioned specific implementation can both be applicable the first application and sent using natural language to the second application
The mode of request message, the first application can also be applied by the way of other modes send request message to the second application,
This is not specifically limited.
Aforesaid way can specifically use following form to realize:
First application receives the command information that user sends, and the command information is converted into format data;
The format data is normalized to obtain the semantic analysis result of the command information;
And request message corresponding with the semantic analysis result is determined, and the request message is sent to described second
Using.
In the embodiment of the present invention, the request message that the first application is sent is based on natural language, and second using return
Response message can also be based on natural language, be not specifically limited herein.
For example, the first application and the second application are the social software of two stand-alone developments, they synchronous buddy list,
But do not know the digital transmission form of other side mutually, now, the first application can inquire the second application in the form of natural language,
Such as " your buddy list data be how to carry out it is digitally coded", the second application receives disappearing for this natural language form
Breath, and after semantic parsing, the digital encoding scheme of oneself is transmitted to the first application in a manner of natural language, such as " row
Table is transmitted with binary-coded form, comes to the length of five bytes (40bit), and wherein first character section represents surname
Family name, below three byte representation names (if name only accounts for a byte, behind 16bit represented with full null sequence),
Last byte representative is other.", then, the second application can be by binary sequence list corresponding to each byte with text
Form be sent to the first application.First application carries out semantic parsing after receiving, and obtains the digital encoding format of the second application, double
Square can directly carries out efficient data transfer with unified digital encoding scheme.Such as by the Zhang San's in the first application
The information transfer of boy student can then send a string of binary sequences into the second application.
In the embodiment of the present invention, alternatively, the target information includes protocol-identifier and/or protocol definition information, certainly,
Other information can also be included, be not specifically limited herein.
In the embodiment of the present invention, alternatively, the protocol definition information includes message coffret and defines information, message
At least one of format information and signaling process information, it is, of course, also possible to including other information, it is not specifically limited herein.
Data transmission interface include physical layer electrical characteristic definition (such as transmission voltage swing, signal power size, bus type, when
Clock frequency etc.), physical layer data reads sequential (such as reading and writing data sequential, dutycycle regulation etc.), transport layer protocol (for example is believed
Road coding, transfer check mechanism, retransmission mechanism etc.), network layer transport protocol (such as IP address, UDP (User Datagram
Protocol, UDP) or TCP port number etc.).
Signaling process is described by taking the signaling process for obtaining friend information as an example below:
Step 1:First application sends list_req message;
When needing to obtain buddy list, the first application sends list_req message;
Step 2:After second application receives list_req message, list_data is sent.
If second applies and do not receive list_data in the range of 1s, the first application resends list_req message.
It is above-mentioned simply to be illustrated by taking the signaling process for obtaining friend information as an example, but it is not limited to this.
In the embodiment of the present invention, alternatively, the format information of the message includes digital encoding format;
Wherein, the digital encoding format includes field (filed), the length for the data that the described second application can receive
(length), at least one of span (range), data type (type).Wherein, the format information of message can be with
Including compressed format.
Digital encoding format can be the form of form, the example as shown in table 1,2.
The digital encoding format of table 1
Field | Type | Length | Span | Side information |
Buddy list data (list_data) | Character string type | 40 bits | - 40 to 60 | Carried in a manner of IP/UDP (port=10001) |
The digital encoding format of table 2
Field | Type | Length | Span | Side information |
Buddy list asks (list_req) | Integer | 1 bit | 0,1 | Carried in a manner of IP/UDP (port=10001) |
In the span item of table 2,0 represents no longer to need buddy list data;1 represents to need to receive buddy list number
According to.
Wherein, alternatively, form can be graphic form, or can also be the document of rich text form, not do herein
It is specific to limit.
In the embodiment of the present invention, alternatively, the protocol-identifier can be characterized with characterization information;
Wherein, the characterization information includes the mark ID (Identification, mark) of the described second application, described the
The types of two applications, second application version number (such as mi6) and to the described second related Internet protocol IP of application
At least one of location, associative key (such as " DLNA ").
Now, all or part of information of first application in the target information is sent out to the described second application
Message is sent, including:
Agreement of first application according to corresponding to the characterization information determines the characterization information;
Message is sent to the described second application using the agreement of determination.
Example is carried out to the ID of the second application below:
As application has a process or multiple ID in an operating system, in another example, Android applications have one it is unique
Using ID.
Wherein, the related IP address of the second application, can refer to server where the second application operation IP address, the
The IP address of computer where the IP address of website where two application operations or the second application operation, wherein, IP address can
To be the station address (such as www.mqpat.com) embodied in the form of domain name.
In the embodiment of the present invention, alternatively, first application determines the characterization information institute according to the characterization information
Corresponding agreement, including:
First application passes through protocol information corresponding to the acquisition of the 3rd equipment;
Wherein, the 3rd equipment is at least one in Internet Server, search engine, natural language interactive engine
Kind.
For example, first its own device id fed back using obtaining by server in a manner of natural language, the first application
Using the ID as keyword, download to obtain the protocol definition of the second application support by internet search engine.In a word, agreement is obtained
The mode of definition is unlimited.A code segment is write in the first application, as spatial term module, when itself and the second application
When being communicated, then the first application firstly generate on inquire on second application interface define with data transmission format from
The relevant information of right language (such as voice or text), and send;, can on the information of its interface type/data transmission format
To be to inquire the type of the second application, software and hardware version number, production firm etc. or to direct access inquiry interface definition/say
Bright book, is not specifically limited herein.
In actual applications, the digital encoding format that can be supported and the first application institute energy that the second application is fed back
The possible disunity of digital encoding format enough supported, now, can hold consultation therebetween, therefore, in the embodiment of the present invention,
Alternatively, all or part of information of first application in the target information disappears to described second using transmission
Breath, including:
First application judges that described second is supported using at least one agreement and first application supported
At least one agreement whether match;
If first application judges that at least one agreement and described first that second application is supported applies institute
At least one agreement of support matches, and is directly disappeared using agreement corresponding to the target information to described second using transmission
Breath;
Otherwise, first application is returned to be obtained based on natural language and led to second using at least one that can be supported
The step of believing protocol-dependent target information.
For example, the first application and the second application are the social software of two stand-alone developments, they synchronous buddy list,
But do not know the digital transmission form of other side mutually, now, the first application can inquire the second application in the form of natural language,
Such as " your buddy list data be how to carry out it is digitally coded", the second application receives disappearing for this natural language form
Breath, and after semantic parsing, the digital encoding scheme of oneself is transmitted to the first application in a manner of natural language, first should
With after the digital transmission form for receiving the second application, sent in the form of binary-coded to the second application to high-speed
Friendly list information, the name for finding some people are five words, it is also necessary to increase the length of a word to transmit its name, then can
To be sent to the second application, "-transmission name can increase the length of a word", the second application receives the message and detected certainly
Find after body data format definition to change, then sending to the first application " can be with!”.Then first application one word of increase
Length (8bit) be used for transmitting name, if not having, complete zero is encoded to, so as to which the two has just consulted a kind of new digital coding
Mode, communicated using the digital encoding scheme for consulting to obtain.
It should be noted that if the first application returns at least one communication protocols that obtains and can be supported with the second application
After the step of discussing related target information, if first application judges the supported at least one association of second application
If at least one agreement that first application is supported of negotiating peace does not match that, it can be further continued for obtaining, untill matching,
It is not specifically limited herein.
In the embodiment of the present invention, second applies after request message is received, and possibly can not understand that the first application is sent
Request message, now, communications can be repeated in the first application and the second application, can parse first up to the second application
Using the request message of transmission, therefore, in the embodiment of the present invention, after the first application sends request message to the second application, connect
Before receiving the response message, methods described also includes:
If second application can not understand the request message, first application continues to carry out ditch with the second application
It is logical, until second application can parse the request message.Wherein, in specific implementation process, such as lower section can be used
Formula:
If second application can not understand the request message, first application continues to send to the described second application
Request message, until the described second application is it will be appreciated that the request message.
Previously described is the request message that the second application can not understand the first application, it is of course also possible to should in the presence of first
The response message sent with that can not understand the second application, now, the first application can also link up repeatedly with the second application, until the
One application can parse response message, and therefore, in the embodiment of the present invention, first application receives second application and returned
Response message after, to described second application send message before, further, methods described also includes:
If first application can not understand the response message, first application continues to carry out with the described second application
Link up, until the first application can parse the response message that the second application is sent.In specific implementation process, it can use such as
Under type:
If first application can not understand the response message, first application continues to the second application hair
The response message sent, until the described first application is it will be appreciated that the response message.
In the embodiment of the present invention, when the natural language is text, the first application is obtained based on natural language should with second
During with the related target information of at least one communication protocol that can be supported, it is alternatively possible in the following way:
First application is obtained with least one of Quick Response Code, image, symbol word marking shape based on image collection module
The target information of formula program.Such as, the first application obtains obtains a URL (Uniform by two-dimensional code scanning
Resource Locator, URL) address, it can download to what is interacted with the second application by the address
The information related at least one communication protocol.
Image collection module can be camera, or can also be image code scanner.Preferably, first application
The target information of the program in the form of at least one of Quick Response Code, image, symbol word marking is obtained based on image collection module
Apply and be in the first equipment in the first application, the second application is under the scene of the second equipment.In same equipment different application it
Between interaction the mode such as queue can be transmitted by message between shared drive, program and realize.
When the natural language is voice, first application based on natural language obtain with second application can support to
During a kind of target information of few communication protocol correlation, it is alternatively possible in the following way:
First application obtains the target information based on ultrasonic wave.Preferably, this mode is applied in the first application
Under the first equipment, the second scene of the application in the second equipment.
In this scenario, the target information related to communication protocol is obtained using natural language, due to natural language
Versatility is high, therefore, believes even if the first application does not prestore to second using the related target of supported communication protocol
Breath, the target information related to the second supported communication protocol of application can also be obtained by natural language, subsequently can be with
Using obtained target information come with the second application communication, therefore, can solve not prestore in the prior art it is related should
The defects of agreement can not just be communicated with such application, expand the scope of application scenarios.
Further, due to digital encoding format transmission specified in agreement after target information is obtained, can be used to disappear
Breath, and use the efficiency of digital encoding format transmission data higher, therefore, the method that the embodiment of the present invention proposes can also improve
Efficiency of transmission.
Refering to shown in Fig. 2A, in the embodiment of the present invention, it is also proposed that one kind is realized logical between different application based on natural language
The method of letter, including:
Method 20A:Step 200A:Second application receives the request message that the first application is sent based on natural language, described
Request message is used to ask the target information related to the communication protocol that the described second application can be supported;Step 210A:To
First application sends response message, and at least one that can be supported with the described second application is carried in the response message
The related target information of communication protocol;Or
Method 20B:Step 200B:Second application receives the request message that the first application is sent, the request message
The target information related for the communication protocol asked to the described second application can be supported;Step 210B:Based on nature language
Say to the described first application and send response message, being carried in the response message can support at least with the described second application
A kind of related target information of communication protocol.
In the embodiment of the present invention described natural language actually refer to be for recipient non-preset content nature
Language, rather than the natural language form of immobilized substance.Wherein, the natural language of non-default content mean recipient need into
Row semantic analysis;And the natural language of preset content, recipient directly carry out string matching.For example, non-default interior
In the case of the natural language of appearance, " good heat today ", either " today, temperature was good high " or " fast solarization today is in the dust ", although interior
Hold different, but identical when implication is substantial, can with any expression way.In another example in non-default content
In the case of natural language, " Current Temperatures " and " present temperature ", although expression-form is different, semanteme is identical, is adopted
Also can with any one statement.
In the embodiment of the present invention, the expression way of natural language has a variety of, for example, it may be speech form, or also may be used
To be textual form (such as being broadcasted by IP network), speech form and textual form can be by the way of ultrasonic waves.Wherein,
The word that text is specifically as follows picture character or Quick Response Code form shows, speech form can be music, certainly, also
There may be other forms, be not specifically limited herein.
It should be noted that second applies after the request message that the first application is sent based on natural language is received, need
The semantic analysis result of request message is obtained, wherein, can be to request message when obtaining the semantic analysis result of request message
Semantic analysis is carried out, obtains semantic analysis result;Or, or semantic analysis is carried out by high in the clouds application or server
Afterwards, then by semantic analysis result the second application is returned to, it is, of course, also possible to there are other modes, be not specifically limited herein.
Previously described is the semantic analysis result that the second application obtains request message, certainly, to obtain other and be based on certainly
The method class of semantic analysis result of the method for the semantic analysis result of the message of right linguistic form with obtaining the request message
Seemingly, no longer it is described in detail herein.
In the embodiment of the present invention, first application and the described second application are respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In the embodiment of the present invention, instruction protocol-identifier alternatively, in the request message is carried;
Second application sends response message to the described first application, including:
Second application returns to response message according to the instruction protocol-identifier to the described first application.
In the embodiment of the present invention, alternatively, the target information includes protocol-identifier and/or protocol definition.
In the embodiment of the present invention, alternatively, the protocol definition information includes message coffret and defines information, message
At least one of format information and signaling process information.
Data transmission interface include physical layer electrical characteristic definition (such as transmission voltage swing, signal power size, bus
Type, clock frequency etc.), physical layer data read sequential (such as reading and writing data sequential, dutycycle regulation etc.), transport layer protocol
(such as channel coding, transfer check mechanism, retransmission mechanism etc.), network layer transport protocol (such as IP address, UDP or TCP port
Number etc.).
Signaling process is described by taking the signaling process for obtaining friend information as an example below:
Step 1:First application sends list_req message;
When needing to obtain buddy list, the first application sends list_req message;
Step 2:After second application receives list_req message, list_data is sent.
If second applies and do not receive list_data in the range of 1s, the first application resends list_req message.
It is above-mentioned simply to be illustrated by taking the signaling process for obtaining friend information as an example, but it is not limited to this.
In the embodiment of the present invention, alternatively, the format information of the message includes digital encoding format;
Wherein, the digital encoding format includes the field, length, value model for the data that the described second application can receive
Enclose, at least one of data type.Wherein, the format information of message can also include compressed format.
Digital encoding format can be the form of form, the example as shown in table 1,2.Wherein, alternatively, form can be
Graphic form, or can also be the document of rich text form, it is not specifically limited herein.
In the embodiment of the present invention, alternatively, protocol-identifier can be characterized with characterization information;
Wherein, the characterization information includes the mark ID of the described second application, the type of second application, described second
The version number of application and to the described second related internet protocol address of application, at least one of associative key.
In actual applications, the digital encoding format that can be supported and the first application institute energy that the second application is fed back
The possible disunity of digital encoding format enough supported, now, can hold consultation therebetween, therefore, in the embodiment of the present invention,
Alternatively, after second application sends response message to the described first application, methods described also includes:
If at least one agreement and described first that second application is supported is using supported at least one association
View mismatches, and second application continues to send response message to the described first application.
In the embodiment of the present invention, second applies after request message is received, and possibly can not understand that the first application is sent
Request message, now, communications can be repeated in the first application and the second application, can parse first up to the second application
Using the request message of transmission, therefore, in the embodiment of the present invention, if second application can not understand the request message, institute
The second application is stated to continue to be linked up with the described first application.
Previously described is the request message that the second application can not understand the first application, it is of course also possible to should in the presence of first
The response message sent with that can not understand the second application, now, the first application can also link up repeatedly with the second application, until the
One application can parse response message, therefore, in the embodiment of the present invention, if first application can not understand that the response disappears
Breath, second application continue to be linked up with the described first application.
In this scenario, the target information related to communication protocol is obtained using natural language, due to natural language
Versatility is high, therefore, believes even if the first application does not prestore to second using the related target of supported communication protocol
Breath, the target information related to the second supported communication protocol of application can also be obtained by natural language, subsequently can be with
Using obtained target information come with the second application communication, therefore, can solve not prestore in the prior art it is related should
The defects of agreement can not just be communicated with such application, expand the scope of application scenarios.
Further, due to digital encoding format transmission specified in agreement after target information is obtained, can be used to disappear
Breath, and use the efficiency of digital encoding format transmission data higher, therefore, the method that the embodiment of the present invention proposes can also improve
Efficiency of transmission.
As shown in fig.3, the embodiment of the present invention also proposes a kind of to realize what is communicated between different application based on natural language
Device 30, including:
First application in acquiring unit 300, for based on natural language obtain with second application can support to
A kind of related target information of few communication protocol;
Transmitting element 310 in first application, for all or part of information in the target information
Message is sent to the described second application.
In the embodiment of the present invention described natural language actually refer to be for recipient non-preset content nature
Language, rather than the natural language form of immobilized substance.Wherein, the natural language of non-default content mean recipient need into
Row semantic analysis;And the natural language of preset content, recipient directly carry out string matching.For example, non-default interior
In the case of the natural language of appearance, " good heat today ", either " today, temperature was good high " or " fast solarization today is in the dust ", although interior
Hold different, but identical when implication is substantial, can with any expression way.In another example in non-default content
In the case of natural language, " Current Temperatures " and " present temperature ", although expression-form is different, semanteme is identical, is adopted
Also can with any one statement.
In the embodiment of the present invention, the expression way of natural language has a variety of, for example, it may be speech form, or also may be used
To be textual form (such as being broadcasted by IP network), speech form and textual form can be by the way of ultrasonic waves.Wherein,
The word that text is specifically as follows picture character or Quick Response Code form shows, speech form can be music, certainly, also
There may be other forms, be not specifically limited herein.
Certainly, the first application can also define specification by FTP download protocols.
In the embodiment of the present invention, alternatively, first application and the described second application are respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In the embodiment of the present invention, alternatively, the transmitting element 310 is additionally operable to, and is sent out based on natural language to the second application
Request message is sent, the request message is used to ask the target related to the communication protocol that the described second application can be supported to be believed
Breath;
Acquiring unit 300 in first application is obtained based on natural language and can supported at least with the second application
A kind of related target information of communication protocol, including:
The response message that second application returns is received, being carried in the response message can with the described second application
The target information at least one communication protocol correlation supported.
That is natural language is used when the first application sends request message to the second application, still, second should
It is not specifically limited with the form that response message is returned to the first application, the form of natural language can be used, or can also
The agreement that first application is specified, for example, carrying instruction protocol-identifier in the request message;
The acquiring unit 300 receives the response message that second application returns, including:
Receive the response message that second application returns according to the instruction protocol-identifier.
Certainly, the second application returns to response message to the first application can also use other forms, not do specific limit herein
It is fixed.
Previously described is that the first application sends message to the second application and uses natural language, but the second application is to first
It is not specifically limited using the form for sending message, in the embodiment of the present invention or the second application is sent to the first application
Message uses natural language, but the form that the first application sends message to the second application is not specifically limited.
Therefore, the transmitting element 310 is additionally operable to, and sends request message to the second application, the request message is used for please
Seek the target information related to the communication protocol that the described second application can be supported;
Acquiring unit 300 in first application is obtained based on natural language and can supported at least with the second application
A kind of related target information of communication protocol, including:
The response message that second application is returned based on natural language is received, is carried in the response message and described the
The target information at least one communication protocol correlation that two applications can be supported.
In the embodiment of the present invention, request message can be for directly request and communication protocol relevant information message, than
Such as:First application is sent in the form of natural language for inquiring the message with communication protocol relevant information to the second application, and second
Replied and communication protocol relevant information using then to the first application.
Or request message can also be the message for indirect or implicit request and communication protocol relevant information, as long as
The application of triggering second includes the message of target information to first using return, such as:First application is in the form of natural language
Username and password (implicit mode) is sent to the second application, the second application is replied related to communication protocol then to the first application
Information (implicit response).
Previously described is the direct mode of request message, or implicit, indirect mode, and similarly, response also may be used
To be response or implicit, the indirect response directly against the clear and definite information request of the first application.Herein no longer
It is described in detail.
In the embodiment of the present invention, the mechanism for sending broadcast and receiving broadcast can be used, to realize in android system
Two complete irrespective applications between communication, such as have sent a broadcast using A, receive and then perform using B
Associative operation, it can so realize mutual communication.
In the embodiment of the present invention, the acquiring unit 300 in first application is obtained by the first application based on natural language
The target information related at least one communication protocol that the second application can be supported is taken, including:
The target information that second application is sent is obtained based on broadcast message.
In the embodiment of the present invention, described device also includes receiving unit 320 and processing unit 330, wherein:
The receiving unit 320, for receiving the command information of user's transmission;
The processing unit 330, for obtaining the semantic analysis result of the command information;
The transmitting element 310 sends request message to the second application, including:
It is determined that request message corresponding with the semantic analysis result, and the request message is sent to described second and answered
With.
Wherein, when first application obtains the semantic analysis result of the command information, command information can be carried out
Semantic analysis, obtain semantic analysis result;It is of course also possible to after to carry out semantic analysis by cloud device or server,
Semantic analysis result is returned into the first application again, is not specifically limited herein.
Previously described is the semantic analysis result that the first application obtains command information, certainly, to obtain other and be based on certainly
The method class of semantic analysis result of the method for the semantic analysis result of the message of right linguistic form with obtaining the command information
Seemingly, no longer it is described in detail herein.
Because the mode that the first application sends request message to the second application can be using natural language, can not also adopt
With natural language, therefore, above-mentioned specific implementation can both be applicable the first application and sent using natural language to the second application
The mode of request message, the first application can also be applied by the way of other modes send request message to the second application,
This is not specifically limited.
Aforesaid way can specifically use following form to realize:
First application receives the command information that user sends, and the command information is converted into format data;
The format data is normalized to obtain the semantic analysis result of the command information;
And request message corresponding with the semantic analysis result is determined, and the request message is sent to described second
Using.
In the embodiment of the present invention, the request message that the first application is sent is based on natural language, and second using return
Response message can also be based on natural language, be not specifically limited herein.
For example, the first application and the second application are the social software of two stand-alone developments, they synchronous buddy list,
But do not know the digital transmission form of other side mutually, now, the first application can inquire the second application in the form of natural language,
Such as " your buddy list data be how to carry out it is digitally coded", the second application receives disappearing for this natural language form
Breath, and after semantic parsing, the digital encoding scheme of oneself is transmitted to the first application in a manner of natural language, such as " row
Table is transmitted with binary-coded form, comes to the length of five bytes (40bit), and wherein first character section represents surname
Family name, below three byte representation names (if name only accounts for a byte, behind 16bit represented with full null sequence),
Last byte representative is other.", then, the second application can be by binary sequence list corresponding to each byte with text
Form be sent to the first application.First application carries out semantic parsing after receiving, and obtains the digital encoding format of the second application, double
Square can directly carries out efficient data transfer with unified digital encoding scheme.Such as by the Zhang San's in the first application
The information transfer of boy student can then send a string of binary sequences into the second application.
In the embodiment of the present invention, alternatively, the target information includes protocol-identifier and/or protocol definition information.
In the embodiment of the present invention, alternatively, the protocol definition information includes message coffret and defines information, message
At least one of format information and signaling process information.It is, of course, also possible to including other information, it is not specifically limited herein.
Data transmission interface include physical layer electrical characteristic definition (such as transmission voltage swing, signal power size, bus type, when
Clock frequency etc.), physical layer data reads sequential (such as reading and writing data sequential, dutycycle regulation etc.), transport layer protocol (for example is believed
Road coding, transfer check mechanism, retransmission mechanism etc.), network layer transport protocol (such as IP address, UDP or TCP port number etc.).
Signaling process is described by taking the signaling process for obtaining friend information as an example below:
Step 1:First application sends list_req message;
When needing to obtain buddy list, the first application sends list_req message;
Step 2:After second application receives list_req message, list_data is sent.
If second applies and do not receive list_data in the range of 1s, the first application resends list_req message.
It is above-mentioned simply to be illustrated by taking the signaling process for obtaining friend information as an example, but it is not limited to this.
In the embodiment of the present invention, alternatively, the format information of the message includes digital encoding format;
Wherein, the digital encoding format includes the field, length, value model for the data that the described second application can receive
Enclose, at least one of data type.The format information of message can also include compressed format.
Digital encoding format can be the form of form, the example as shown in table 1,2.Wherein, alternatively, form can be
Graphic form, or can also be the document of rich text form, it is not specifically limited herein.
In the embodiment of the present invention, alternatively the protocol-identifier can be characterized with characterization information;
Wherein, the characterization information includes the mark ID of the described second application, the type of second application, described second
The version number of application and to the described second related internet protocol address of application, at least one of associative key.
Wherein, the related IP address of the second application, can refer to server where the second application operation IP address, the
The IP address of computer where the IP address of website where two application operations or the second application operation, wherein, IP address can
To be the station address (such as www.mqpat.com) embodied in the form of domain name.
In the embodiment of the present invention, alternatively, the transmitting element 310 in first application is according in the target information
All or part of information sends message to the described second application, including:
Agreement according to corresponding to the characterization information determines the characterization information;
Message is sent to the described second application using the agreement of determination.
In the embodiment of the present invention, alternatively, the transmitting element 310 determines the characterization information according to the characterization information
Corresponding agreement, including:
Pass through protocol information corresponding to the 3rd application acquisition;
Wherein, the 3rd application is at least one in Internet Server, search engine, natural language interactive engine
Kind.
For example, first its own device id fed back using obtaining by server in a manner of natural language, the first application
Using the ID as keyword, download to obtain the protocol definition of the second application support by internet search engine.In a word, agreement is obtained
The mode of definition is unlimited.A code segment is write in the first application, as spatial term module, when itself and the second application
When being communicated, then the first application firstly generate on inquire on second application interface define with data transmission format from
The relevant information of right language (such as voice or text), and send;, can on the information of its interface type/data transmission format
To be to inquire the type of the second application, software and hardware version number, production firm etc. or to direct access inquiry interface definition/say
Bright book, is not specifically limited herein.
In actual applications, the digital encoding format that can be supported and the first application institute energy that the second application is fed back
The possible disunity of digital encoding format enough supported, now, can hold consultation therebetween, therefore, in the embodiment of the present invention,
Alternatively, all or part of information of the transmitting element 310 in the target information in first application is to described
Second application sends message, including:
Judge that at least one agreement and described first that second application is supported is assisted using supported at least one
Whether view matches;
If it is determined that at least one agreement and described first that second application is supported is using at least one supported
Kind agreement matches, and directly sends message to the described second application using agreement corresponding to the target information;
Otherwise, return related based at least one communication protocol that natural language obtains to the second application can be supported
The step of target information.
For example, the first application and the second application are the social software of two stand-alone developments, they synchronous buddy list,
But do not know the digital transmission form of other side mutually, now, the first application can inquire the second application in the form of natural language,
Such as " your buddy list data be how to carry out it is digitally coded", the second application receives disappearing for this natural language form
Breath, and after semantic parsing, the digital encoding scheme of oneself is transmitted to the first application in a manner of natural language, first should
With after the digital transmission form for receiving the second application, sent in the form of binary-coded to the second application to high-speed
Friendly list information, the name for finding some people are five words, it is also necessary to increase the length of a word to transmit its name, then can
To be sent to the second application, "-transmission name can increase the length of a word", the second application receives the message and detected certainly
Find after body data format definition to change, then sending to the first application " can be with!”.Then first application one word of increase
Length (8bit) be used for transmitting name, if not having, complete zero is encoded to, so as to which the two has just consulted a kind of new digital coding
Mode, communicated using the digital encoding scheme for consulting to obtain.
It should be noted that if the first application returns at least one communication protocols that obtains and can be supported with the second application
After the step of discussing related target information, if first application judges the supported at least one association of second application
If at least one agreement that first application is supported of negotiating peace does not match that, it can be further continued for obtaining, untill matching,
It is not specifically limited herein.
In the embodiment of the present invention, second applies after request message is received, and possibly can not understand that the first application is sent
Request message, now, communications can be repeated in the first application and the second application, can parse first up to the second application
Using the request message of transmission, therefore, in the embodiment of the present invention, after the first application sends request message to the second application, connect
Before receiving the response message, methods described also includes:
If second application can not understand the request message, first application continues to carry out ditch with the second application
It is logical, until second application can parse the request message.Wherein, in specific implementation process, such as lower section can be used
Formula:
If second application can not understand the request message, first application continues to send to the described second application
Request message, until the described second application is it will be appreciated that the request message.
Previously described is the request message that the second application can not understand the first application, it is of course also possible to should in the presence of first
The response message sent with that can not understand the second application, now, the first application can also link up repeatedly with the second application, until the
One application can parse response message, and therefore, in the embodiment of the present invention, first application receives second application and returned
Response message after, to described second application send message before, further, methods described also includes:
If first application can not understand the response message, first application continues to carry out with the described second application
Link up, until the first application can parse the response message that the second application is sent.In specific implementation process, it can use such as
Under type:
If first application can not understand the response message, first application continues to the second application hair
The response message sent, until the described first application is it will be appreciated that the response message.
In the embodiment of the present invention, alternatively, when the natural language is text, the acquiring unit in first application
300 based on the natural language acquisition target information related at least one communication protocol that the second application can be supported, including:
Obtained based on image collection module in the form of at least one of Quick Response Code, image, symbol word marking described in program
Target information.Such as, the first application obtains obtains a URL address by two-dimensional code scanning, can be downloaded to by the address and
The information related at least one communication protocol that second application interacts.
Image collection module can be camera, or can also be image code scanner.Preferably, first application
The target information of the program in the form of at least one of Quick Response Code, image, symbol word marking is obtained based on image collection module
Apply and be in the first equipment in the first application, the second application is under the scene of the second equipment.In same equipment different application it
Between interaction the mode such as queue can be transmitted by message between shared drive, program and realize.
In the embodiment of the present invention, when the natural language is voice, the acquiring unit 300 in first application is based on certainly
The right language acquisition target information related at least one communication protocol that the second application can be supported, including:
The target information is obtained based on ultrasonic wave.Preferably, this mode is applied is in the first equipment in the first application,
Under second scene of the application in the second equipment.
In this scenario, the target information related to communication protocol is obtained using natural language, due to natural language
Versatility is high, therefore, believes even if the first application does not prestore to second using the related target of supported communication protocol
Breath, the target information related to the second supported communication protocol of application can also be obtained by natural language, subsequently can be with
Using obtained target information come with the second application communication, therefore, can solve not prestore in the prior art it is related should
The defects of agreement can not just be communicated with such application, expand the scope of application scenarios.
Further, due to digital encoding format transmission specified in agreement after target information is obtained, can be used to disappear
Breath, and use the efficiency of digital encoding format transmission data higher, therefore, the method that the embodiment of the present invention proposes can also improve
Efficiency of transmission.
As shown in fig.4, in the embodiment of the present invention, it is also proposed that it is a kind of based on natural language realize different application between communicate
Device 40, including:
Receiving unit 400 in second application, the request message sent for receiving the first application based on natural language, institute
State request message be used for ask to the described second target information that to apply the communication protocol that can support related;In second application
Transmitting element 410, for sending response message to the described first application, carry in the response message and the described second application
The target information at least one communication protocol correlation that can be supported;Or
Receiving unit 400 in second application, the request that the first application transmission is received for the described second application disappear
Breath, the request message are used to ask the target information related to the communication protocol that the described second application can be supported;It is described
Transmitting element 410 in second application, for sending response message to the described first application based on natural language, the response disappears
The target information related at least one communication protocol that the described second application can be supported is carried in breath.
In the embodiment of the present invention described natural language actually refer to be for recipient non-preset content nature
Language, rather than the natural language form of immobilized substance.Wherein, the natural language of non-default content mean recipient need into
Row semantic analysis;And the natural language of preset content, recipient directly carry out string matching.For example, non-default interior
In the case of the natural language of appearance, " good heat today ", either " today, temperature was good high " or " fast solarization today is in the dust ", although interior
Hold different, but identical when implication is substantial, can with any expression way.In another example in non-default content
In the case of natural language, " Current Temperatures " and " present temperature ", although expression-form is different, semanteme is identical, is adopted
Also can with any one statement.
In the embodiment of the present invention, the expression way of natural language has a variety of, for example, it may be speech form, or also may be used
To be textual form (such as being broadcasted by IP network), speech form and textual form can be by the way of ultrasonic waves.Wherein,
The word that text is specifically as follows picture character or Quick Response Code form shows, speech form can be music, certainly, also
There may be other forms, be not specifically limited herein.
It should be noted that second applies after the request message that the first application is sent based on natural language is received, need
The semantic analysis result of request message is obtained, wherein, can be to request message when obtaining the semantic analysis result of request message
Semantic analysis is carried out, obtains semantic analysis result;Or, or semantic analysis is carried out by high in the clouds application or server
Afterwards, then by semantic analysis result the second application is returned to, it is, of course, also possible to there are other modes, be not specifically limited herein.
Previously described is the semantic analysis result that the second application obtains request message, certainly, to obtain other and be based on certainly
The method class of semantic analysis result of the method for the semantic analysis result of the message of right linguistic form with obtaining the request message
Seemingly, no longer it is described in detail herein.
In the embodiment of the present invention, alternatively, first application and the described second application are respectively positioned on the first equipment;Or
First application is located at the first equipment, and second application is located at the second equipment.
In the embodiment of the present invention, instruction protocol-identifier alternatively, in the request message is carried;
Transmitting element 410 in second application sends response message to the described first application, including:
Transmitting element 410 in second application returns to response according to the instruction protocol-identifier to the described first application
Message.
In the embodiment of the present invention, alternatively, the target information includes protocol-identifier and/or protocol definition.
In the embodiment of the present invention, alternatively, the protocol definition information includes message coffret and defines information, message
At least one of format information and signaling process information.
In the embodiment of the present invention, the format information of the message includes digital encoding format;
Wherein, the digital encoding format includes the field, length, value model for the data that the described second application can receive
Enclose, at least one of data type.Wherein, the format information of message can also include compressed format.
Digital encoding format can be the form of form, the example as shown in table 1,2.Wherein, alternatively, form can be
Graphic form, or can also be the document of rich text form, it is not specifically limited herein.
In the embodiment of the present invention, alternatively, protocol-identifier can be characterized with characterization information;
Wherein, the characterization information includes the mark ID of the described second application, the type of second application, described second
The version number of application and to the described second related internet protocol address of application, at least one of associative key.
In actual applications, the digital encoding format that can be supported and the first application institute energy that the second application is fed back
The possible disunity of digital encoding format enough supported, now, can hold consultation therebetween, therefore, in the embodiment of the present invention,
Alternatively, the transmitting element 410 in second application is in described second at least one agreement for being supported of application and described the
When at least one agreement that one application is supported mismatches, continue to send response message to the described first application.
In the embodiment of the present invention, second applies after request message is received, and possibly can not understand that the first application is sent
Request message, now, communications can be repeated in the first application and the second application, can parse first up to the second application
Using the request message of transmission, therefore, in the embodiment of the present invention, if second application can not understand the request message, institute
The second application is stated to continue to be linked up with the described first application.
Previously described is the request message that the second application can not understand the first application, it is of course also possible to should in the presence of first
The response message sent with that can not understand the second application, now, the first application can also link up repeatedly with the second application, until the
One application can parse response message, therefore, in the embodiment of the present invention, if first application can not understand that the response disappears
Breath, second application continue to be linked up with the described first application.
In this scenario, the target information related to communication protocol is obtained using natural language, due to natural language
Versatility is high, therefore, believes even if the first application does not prestore to second using the related target of supported communication protocol
Breath, the target information related to the second supported communication protocol of application can also be obtained by natural language, subsequently can be with
Using obtained target information come with the second application communication, therefore, can solve not prestore in the prior art it is related should
The defects of agreement can not just be communicated with such application, expand the scope of application scenarios.
Further, due to digital encoding format transmission specified in agreement after target information is obtained, can be used to disappear
Breath, and use the efficiency of digital encoding format transmission data higher, therefore, the method that the embodiment of the present invention proposes can also improve
Efficiency of transmission.
Method and apparatus are not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of device
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the device in embodiment
Change and they are arranged in one or more devices different from the embodiment.Can be some modules in embodiment
A module or unit or component are combined into, and multiple submodule or subelement or sub-component can be divided into addition.
In addition at least some in such feature and/or process or module exclude each other, any combinations pair can be used
All features and so disclosed any method disclosed in this specification (including adjoint claim, summary and accompanying drawing)
Or all processes or unit of equipment are combined.Unless expressly stated otherwise, this specification (including adjoint right will
Ask, make a summary and accompanying drawing) disclosed in each feature can be replaced by providing identical, equivalent or similar purpose alternative features.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any
Mode it can use in any combination.
Each device embodiment of the present invention can be realized with hardware, or to be run on one or more processor
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice
Microprocessor or digital signal processor (DSP) realize some or all moulds in device according to embodiments of the present invention
The some or all functions of block.The present invention is also implemented as the part or complete for performing method as described herein
The program of device (for example, computer program and computer program product) in portion.Such program for realizing the present invention can store
On a computer-readable medium, or can the form with one or more signal.Such signal can be from internet
Download and obtain on website, either provide on carrier signal or provided in the form of any other.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
Claims (10)
1. a kind of realize the method to be communicated between different application based on natural language, it is characterised in that including:
Second application receives the request message that the first application is sent, and the request message is used to ask and the described second application institute energy
The target information for the communication protocol correlation enough supported;
Send response message to the described first application, carry in the response message with the described second application can support to
A kind of related target information of few communication protocol;
Wherein, the request message and/or the response message are sent based on natural language.
2. the method as described in claim 1, it is characterised in that instruction protocol-identifier is carried in the request message;
Second application sends response message to the described first application, including:
Second application returns to response message according to the instruction protocol-identifier to the described first application.
3. the method as described in claim 1, it is characterised in that the target information includes protocol-identifier and/or protocol definition.
4. the method as described in claim 1, it is characterised in that second application sends response message to the described first application
Afterwards, methods described also includes:
If at least one agreement that at least one agreement and first application that second application is supported are supported is not
Matching, second application continue to send response message to the described first application.
5. the method as described in claim 1, it is characterised in that the natural language is voice and/or text.
6. the device to be communicated between different application is realized based on natural language a kind of, including:
Receiving unit in second application, the request message sent for receiving the first application, the request message are used to ask
The target information related to the communication protocol that the described second application can be supported;
Transmitting element in second application, for sending response message to the described first application, carry in the response message with
The target information at least one communication protocol correlation that second application can be supported;
Wherein, the request message and/or the response message are sent based on natural language.
7. the device as described in right wants 6, it is characterised in that instruction protocol-identifier is carried in the request message;
Transmitting element in second application sends response message to the described first application, including:
Transmitting element in second application returns to response message according to the instruction protocol-identifier to the described first application.
8. device as claimed in claim 6, it is characterised in that the target information includes protocol-identifier and/or protocol definition.
9. device as claimed in claim 6, it is characterised in that the transmitting element in second application is in the described second application
When at least one agreement that at least one agreement and first application supported are supported mismatches, continue to described first
Using transmission response message.
10. a kind of electronic equipment, including:
Memory and one or more processors;
Wherein, the memory is connected with one or more of processor communications, and being stored with the memory can be described
The instruction that one or more processors perform, the instruction by one or more of computing devices so that it is one or
Multiple processors can realize the method as any one of claim 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710575070.3A CN107370731B (en) | 2017-07-14 | 2017-07-14 | Method and device for realizing communication between different applications based on natural language |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710575070.3A CN107370731B (en) | 2017-07-14 | 2017-07-14 | Method and device for realizing communication between different applications based on natural language |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107370731A true CN107370731A (en) | 2017-11-21 |
CN107370731B CN107370731B (en) | 2020-09-04 |
Family
ID=60308382
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710575070.3A Active CN107370731B (en) | 2017-07-14 | 2017-07-14 | Method and device for realizing communication between different applications based on natural language |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107370731B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111541662A (en) * | 2020-04-15 | 2020-08-14 | 赞同科技股份有限公司 | Communication method, device, system and equipment based on binary communication protocol |
CN116132385A (en) * | 2022-08-18 | 2023-05-16 | 马上消费金融股份有限公司 | Data forwarding method, device, computer equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101287043A (en) * | 2007-04-12 | 2008-10-15 | 国际商业机器公司 | Method and apparatus for providing expressive user interaction with a multimodal application |
US20140282983A1 (en) * | 2012-07-02 | 2014-09-18 | Sk Planet Co., Ltd. | Single certificate service system and operational method thereof |
CN104113529A (en) * | 2014-06-23 | 2014-10-22 | 胡栋 | Natural language understanding-based method and system for fusion of internet of things and social network fusion |
CN105376398A (en) * | 2015-09-30 | 2016-03-02 | 联想(北京)有限公司 | An information processing method and an electronic apparatus |
CN106375535A (en) * | 2015-07-20 | 2017-02-01 | 中兴通讯股份有限公司 | Contact information synchronization method and apparatus |
CN106921660A (en) * | 2017-02-28 | 2017-07-04 | 国网福建省电力有限公司 | A kind of method for supporting random communication protocol shared channel resources |
-
2017
- 2017-07-14 CN CN201710575070.3A patent/CN107370731B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101287043A (en) * | 2007-04-12 | 2008-10-15 | 国际商业机器公司 | Method and apparatus for providing expressive user interaction with a multimodal application |
US20140282983A1 (en) * | 2012-07-02 | 2014-09-18 | Sk Planet Co., Ltd. | Single certificate service system and operational method thereof |
CN104113529A (en) * | 2014-06-23 | 2014-10-22 | 胡栋 | Natural language understanding-based method and system for fusion of internet of things and social network fusion |
CN106375535A (en) * | 2015-07-20 | 2017-02-01 | 中兴通讯股份有限公司 | Contact information synchronization method and apparatus |
CN105376398A (en) * | 2015-09-30 | 2016-03-02 | 联想(北京)有限公司 | An information processing method and an electronic apparatus |
CN106921660A (en) * | 2017-02-28 | 2017-07-04 | 国网福建省电力有限公司 | A kind of method for supporting random communication protocol shared channel resources |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111541662A (en) * | 2020-04-15 | 2020-08-14 | 赞同科技股份有限公司 | Communication method, device, system and equipment based on binary communication protocol |
CN116132385A (en) * | 2022-08-18 | 2023-05-16 | 马上消费金融股份有限公司 | Data forwarding method, device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107370731B (en) | 2020-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107612909B (en) | Information interaction method, device and equipment about Internet of things equipment | |
US10257142B2 (en) | Message delivery in a message system | |
US11108761B2 (en) | Method, apparatus and system for remote control of intelligent device | |
KR101999039B1 (en) | Device triggering | |
CN105812315B (en) | Multiple terminals method for message transmission and device based on user's login account | |
CN111026982A (en) | Intelligent contract processing method, computer equipment and storage medium | |
WO2017174026A1 (en) | Client connection method and system | |
CN108156210A (en) | The acquisition methods and device of target resource | |
CN103139761B (en) | The method and communication terminal of a kind of information real-time show | |
KR20110071453A (en) | Zigbee gateway and method for identifying message of the same | |
CN103532984A (en) | Data transmission method, device and system of websocket protocol | |
CN104348848B (en) | Manage method, terminal device and the server of picture | |
CN109495492A (en) | Communication system for intelligent water utilities industry | |
CN110268687A (en) | Use the data processing of defined data definition | |
CN107370731A (en) | The method and device to be communicated between different application is realized based on natural language | |
CN104410649A (en) | Cross-screen synchronous logging method based on identity code | |
CN108880923A (en) | The method and apparatus that policer operation applied to application server is requested | |
CN107395583A (en) | The method and device to be communicated between different application is realized based on natural language | |
CN112929257A (en) | Multi-scenario message sending method, device, server and storage medium | |
CN105306577A (en) | Data sharing system and method between handheld devices based on APP | |
CN109005250B (en) | Method and device for accessing server | |
CN116437377A (en) | Communication method, system, electronic device and medium for device control communication protocol | |
CN105263127B (en) | SMS communication method and apparatus | |
US10263892B2 (en) | Compression method and system for user friendly address in mesh networking | |
CN107395584B (en) | Method and equipment for realizing communication between equipment based on natural language |
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 |