CN103532959A - Cross-platform network communication method - Google Patents

Cross-platform network communication method Download PDF

Info

Publication number
CN103532959A
CN103532959A CN201310493110.1A CN201310493110A CN103532959A CN 103532959 A CN103532959 A CN 103532959A CN 201310493110 A CN201310493110 A CN 201310493110A CN 103532959 A CN103532959 A CN 103532959A
Authority
CN
China
Prior art keywords
platform
message
network
network communication
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310493110.1A
Other languages
Chinese (zh)
Inventor
于龙
朱涛
赵西法
郝林
李元策
孙杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JINAN ZHENGHE TECHNOLOGY Co Ltd
Original Assignee
JINAN ZHENGHE TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JINAN ZHENGHE TECHNOLOGY Co Ltd filed Critical JINAN ZHENGHE TECHNOLOGY Co Ltd
Priority to CN201310493110.1A priority Critical patent/CN103532959A/en
Publication of CN103532959A publication Critical patent/CN103532959A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a cross-platform network communication method. The method comprises the following processes of (1), forming transmission channels among different platforms by building network connection among the different platforms; (2), encoding messages by a sending platform, i.e. (2.1) storing a command name to be sent and data contained in a command in the form of a key-value pair A1, (2.2) converting the values of types of data contained in the A1 into character strings, and (2.3) converting the stored key-value pair into a fixed message format; (3) transmitting a message to a receiving platform through a network by the sending platform according to a network byte order; (4) analyzing the received message through the converting rule the same as a message encoding rule by the receiving platform, and reducing into the command name and command content. The problem on the real-time property of cross-platform network communication and the problem caused by different character encoding of different platforms are solved.

Description

A kind of Network Communication between differ Flats method
Technical field
The present invention relates to communication technical field, specifically a kind of Network Communication between differ Flats method.
Background technology
Along with the development of network technology and the rise of intelligent mobile phone platform, Network Communication between differ Flats technology is more and more applied in the middle of exploitation at present.In different platform, the programming language of use, the data type classification of support, data type lengths, syllable sequence, character code are not identical, cause data in different platforms, to be interpreted as different implications, cannot direct communication.
The main WebService technology that adopts realizes Network Communication between differ Flats at present, and the main target of WebService is cross-platform interoperability manipulation.In order to reach this target, WebService is completely based on XML, XSD(XMLSchema) etc. be independent of platform, be independent of the standard of software vendor, the interface defining by WebService obtains WSDL description document, each platform obtains WebService interface message according to this WSDL description document, has realized cross-platform far call.
But, adopt WebService technology to realize Network Communication between differ Flats and but have following shortcoming:
One, at network service layer, WebService utilization http protocol carries out network service, therefore use the interactivity of the network application of WebService to be subject to the machine-processed restriction that HTTP protocol " is asked-response ", Shortcomings in mutual real-time.
Two, on data protocol, WebService is used SOAP(Simple Object Access Protocol), soap protocol is a kind of light weight, the agreement based on XML, yet, XML is as a kind of extend markup language, its form is complicated, and the file with its form is comparatively huge, and this makes the shared bandwidth of transfer of data larger.
Summary of the invention
For above-mentioned deficiency, the invention provides a kind of Network Communication between differ Flats method of communicating by letter between different platform that facilitates.
The present invention solves the technical scheme that its technical problem takes: a kind of Network Communication between differ Flats method, it is characterized in that, and comprise following process:
1) network of setting up between different platform connects
By the network of setting up between different platform, be connected to form the transmission channel between different platform, for sending, receive message and the interactive command of different platform;
2) send platform and carry out message coding
2.1) data that the command name that will send and order comprised are stored with the form of key-value pair A1, and wherein, the implication of data representation is key assignments, and data are value;
2.2) by the value of the different types of data comprising in A1, be converted to character string;
2.3) key-value pair of storage is converted to fixing message format;
3) send platform message is sent to receiving platform according to network bytes order by network;
4) receiving platform carries out message parse
Receiving platform adopts the transformation rule identical with message coding to carry out message parse to the information receiving, and restores command name and command context.
In said method, between described different platform, adopt SOCKET (socket) interface of standard ICP/IP protocol to carry out transmission, the reception of message and interactive command.
In said method, described character string adopts UTF-8 as the coding standard of character string.
In said method, the process that described receiving platform carries out message parse comprises the following steps:
4.1) fixing message format is converted to key-value pair A1;
4.2), by the character string comprising in A1, be converted to the value of different types of data.
In said method, described data type comprises Boolean, Char, Double, Float, Int, Short and Long.
In said method, described data type comprises numeric type, Boolean type and character types.
The invention has the beneficial effects as follows:
The present invention adopts SOCKET (socket) interface of standard ICP/IP protocol to carry out data communication, can use TCP or UDP as host-host protocol, has real-time and amphicheirality, thereby solved the real time problems of Network Communication between differ Flats in transmission.
The present invention is by being string representation by the data type conversion of different platform, and the unified UTF-8 that uses is as the string encoding of standard, overcome the problem such as length, syllable sequence of the various data types of different platform, language, and the last message unification sending is converted to UTF-8 coding, has solved the problem that different platform character code difference is brought.
Accompanying drawing explanation
Fig. 1 is method flow diagram of the present invention;
Fig. 2 is the method flow diagram that transmission platform of the present invention carries out message coding.
Embodiment
As depicted in figs. 1 and 2, a kind of Network Communication between differ Flats method of the present invention, it comprises following process:
1) network of setting up between different platform connects
By the network of setting up between different platform, be connected to form the transmission channel between different platform, for sending, receive message and the interactive command of different platform.
2) send platform and carry out message coding
2.1) data that the command name that will send and order comprised are stored with the form of key-value pair A1, and wherein, the implication of data representation is key assignments, and data are value; Key assignments unification represents by character string, and the key assignments of command name can approximately be decided to be Cmd, but is not limited to this, and the content example of storage is as follows:
Key assignments Value Implication
Cmd Register User's registration
UserName ABC User name
Age 18 Age
Gender Man Sex
2.2) by the value of the different types of data comprising in A1, be converted to character string; Described data type comprises Boolean, Char, Double, Float, Int, Short, Long, is mainly divided into numeric type, Boolean type and character types three classes, and the transformation rule of three kinds of data types is as follows:
Numeric type According to literal, be converted to character string type
Boolean type Really be converted to character string " 1 ", vacation is converted to character string " 0 "
Character types Without conversion
2.3) key-value pair of storage is converted to fixing message format; To the character string type in the result after conversion, adopt UTF-8 to change character code, fixing message format is as follows:
Message-length <key assignments=value> <key assignments=value> <key assignments=value> …… <key assignments=value>
above-mentioned lifted storage content example transformation result is as follows:
Message character string length <Cmd=Register> <UserName=ABC> <Age=18> <Gender=“1”>
3) send platform message is sent to receiving platform according to network bytes order by network.
4) receiving platform carries out message parse
Receiving platform adopts the transformation rule identical with message coding to carry out message parse to the information receiving, and restores command name and command context, and it specifically comprises the following steps:
4.1) fixing message format is converted to key-value pair A1;
4.2), by the character string comprising in A1, be converted to the value of different types of data.
In said method, between described different platform, adopt SOCKET (socket) interface of standard ICP/IP protocol to carry out transmission, the reception of message and interactive command.
In said method, described character string adopts UTF-8 as the coding standard of character string.
The present invention is approximately decided to be fixing command format by the interacting message between different platform, the specific implementation of bottom communication adopts SOCKET (socket) interface of standard ICP/IP protocol to carry out data communication, thereby has solved the real time problems of Network Communication between differ Flats; And by being string representation by the data type conversion of different platform, and the unified UTF-8 that uses is as the string encoding of standard, the problems such as length, syllable sequence of the various data types of different platform, language have been overcome; The command format of a kind of by using "<data name=data value>", but not adopt XML as command code form, the extra data transfer overhead of having avoided XML to bring.
The above is the preferred embodiment of the present invention, for those skilled in the art, under the premise without departing from the principles of the invention, can also make some improvements and modifications, and these improvements and modifications are also regarded as protection scope of the present invention.

Claims (6)

1. a Network Communication between differ Flats method, is characterized in that, comprises following process:
1) network of setting up between different platform connects
By the network of setting up between different platform, be connected to form the transmission channel between different platform, for sending, receive message and the interactive command of different platform;
2) send platform and carry out message coding
2.1) data that the command name that will send and order comprised are stored with the form of key-value pair A1, and wherein, the implication of data representation is key assignments, and data are value;
2.2) by the value of the different types of data comprising in A1, be converted to character string;
2.3) key-value pair of storage is converted to fixing message format;
3) send platform message is sent to receiving platform according to network bytes order by network;
4) receiving platform carries out message parse
Receiving platform adopts the transformation rule identical with message coding to carry out message parse to the information receiving, and restores command name and command context.
2. a kind of Network Communication between differ Flats method according to claim 1, is characterized in that, adopts SOCKET (socket) interface of standard ICP/IP protocol to carry out transmission, the reception of message and interactive command between described different platform.
3. a kind of Network Communication between differ Flats method according to claim 1, is characterized in that, described character string adopts UTF-8 as the coding standard of character string.
4. a kind of Network Communication between differ Flats method according to claim 1, is characterized in that, the process that described receiving platform carries out message parse comprises the following steps:
4.1) fixing message format is converted to key-value pair A1;
4.2), by the character string comprising in A1, be converted to the value of different types of data.
5. according to a kind of Network Communication between differ Flats method described in any one right in claim 1 to 4, it is characterized in that, described data type comprises Boolean, Char, Double, Float, Int, Short and Long.
6. according to a kind of Network Communication between differ Flats method described in any one right in claim 1 to 4, it is characterized in that, described data type comprises numeric type, Boolean type and character types.
CN201310493110.1A 2013-10-21 2013-10-21 Cross-platform network communication method Pending CN103532959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310493110.1A CN103532959A (en) 2013-10-21 2013-10-21 Cross-platform network communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310493110.1A CN103532959A (en) 2013-10-21 2013-10-21 Cross-platform network communication method

Publications (1)

Publication Number Publication Date
CN103532959A true CN103532959A (en) 2014-01-22

Family

ID=49934638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310493110.1A Pending CN103532959A (en) 2013-10-21 2013-10-21 Cross-platform network communication method

Country Status (1)

Country Link
CN (1) CN103532959A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104501848A (en) * 2014-12-04 2015-04-08 国家电网公司 Data accessing method and system of substation equipment
CN104519134A (en) * 2014-12-25 2015-04-15 漳州顶竹通讯技术有限公司 Cross-platform file read-write system and method
CN109583880A (en) * 2018-12-05 2019-04-05 深圳市爱贝信息技术有限公司 Cross-platform communication means and device and method of payment and device
CN110049360A (en) * 2018-01-16 2019-07-23 中兴通讯股份有限公司 Cross-platform contents controlling method, device, terminal, server and storage medium
CN112738170A (en) * 2020-12-22 2021-04-30 北京讯腾智慧科技股份有限公司 Cross-platform network communication method and system based on ROS
CN113835528A (en) * 2021-09-30 2021-12-24 深圳康佳电子科技有限公司 Multi-platform interaction method and device of wearable device, intelligent terminal and storage medium
CN115827283A (en) * 2023-02-09 2023-03-21 中国证券登记结算有限责任公司 Cross-platform information transmission method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010047441A1 (en) * 2000-02-23 2001-11-29 Mark Robertson Communications system conduit for transferring data
CN1549163A (en) * 2003-05-15 2004-11-24 深圳市中兴通讯股份有限公司南京分公 Across-platform data base researching method
CN1838665A (en) * 2005-03-24 2006-09-27 华为技术有限公司 Adapting method between different byte sequence styles in network communication
CN1968288A (en) * 2006-09-22 2007-05-23 上海微电子装备有限公司 Data communication system and method for distributed system
CN101662378A (en) * 2009-09-07 2010-03-03 孙刚 Cross-platform unified communication system and implementation method thereof
CN101739254A (en) * 2009-12-31 2010-06-16 山东中创软件商用中间件股份有限公司 Method and device for realizing multiplexing of multi-platform communication assemblies
CN102571939A (en) * 2011-12-26 2012-07-11 广州市玄武无线科技有限公司 Cross-platform communication method and system
US20120233301A1 (en) * 2011-03-08 2012-09-13 Samsung Electronics Co., Ltd. Method and apparatus for synchronizing information between platforms in a portable terminal based on a multi-software platform
CN103177028A (en) * 2011-12-23 2013-06-26 腾讯科技(深圳)有限公司 Method and system for information interaction
CN103345487A (en) * 2013-06-24 2013-10-09 北京奇虎科技有限公司 Method and system of verifying data consistency between multiple platforms

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010047441A1 (en) * 2000-02-23 2001-11-29 Mark Robertson Communications system conduit for transferring data
CN1549163A (en) * 2003-05-15 2004-11-24 深圳市中兴通讯股份有限公司南京分公 Across-platform data base researching method
CN1838665A (en) * 2005-03-24 2006-09-27 华为技术有限公司 Adapting method between different byte sequence styles in network communication
CN1968288A (en) * 2006-09-22 2007-05-23 上海微电子装备有限公司 Data communication system and method for distributed system
CN101662378A (en) * 2009-09-07 2010-03-03 孙刚 Cross-platform unified communication system and implementation method thereof
CN101739254A (en) * 2009-12-31 2010-06-16 山东中创软件商用中间件股份有限公司 Method and device for realizing multiplexing of multi-platform communication assemblies
US20120233301A1 (en) * 2011-03-08 2012-09-13 Samsung Electronics Co., Ltd. Method and apparatus for synchronizing information between platforms in a portable terminal based on a multi-software platform
CN103177028A (en) * 2011-12-23 2013-06-26 腾讯科技(深圳)有限公司 Method and system for information interaction
CN102571939A (en) * 2011-12-26 2012-07-11 广州市玄武无线科技有限公司 Cross-platform communication method and system
CN103345487A (en) * 2013-06-24 2013-10-09 北京奇虎科技有限公司 Method and system of verifying data consistency between multiple platforms

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
兰鲁光等: "以太网现场总线的跨平台网络通信", 《微计算机信息》 *
戴冲: "DNB电源实时监控系统跨平台网络通讯", 《微计算机信息》 *
陈飞云等: "HT-7U极向场电源控制系统跨平台网络通信", 《计算机应用与软件》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104501848A (en) * 2014-12-04 2015-04-08 国家电网公司 Data accessing method and system of substation equipment
CN104519134A (en) * 2014-12-25 2015-04-15 漳州顶竹通讯技术有限公司 Cross-platform file read-write system and method
CN104519134B (en) * 2014-12-25 2018-06-19 漳州顶竹通讯技术有限公司 A kind of cross-platform file read-write system and method
CN110049360A (en) * 2018-01-16 2019-07-23 中兴通讯股份有限公司 Cross-platform contents controlling method, device, terminal, server and storage medium
CN110049360B (en) * 2018-01-16 2022-03-04 中兴通讯股份有限公司 Cross-platform content control method, device, terminal, server and storage medium
CN109583880A (en) * 2018-12-05 2019-04-05 深圳市爱贝信息技术有限公司 Cross-platform communication means and device and method of payment and device
CN112738170A (en) * 2020-12-22 2021-04-30 北京讯腾智慧科技股份有限公司 Cross-platform network communication method and system based on ROS
CN113835528A (en) * 2021-09-30 2021-12-24 深圳康佳电子科技有限公司 Multi-platform interaction method and device of wearable device, intelligent terminal and storage medium
CN115827283A (en) * 2023-02-09 2023-03-21 中国证券登记结算有限责任公司 Cross-platform information transmission method and system

Similar Documents

Publication Publication Date Title
CN103532959A (en) Cross-platform network communication method
US10313410B2 (en) Systems and methods using binary dynamic rest messages
US9560170B2 (en) System and method of abstracting communication protocol using self-describing messages
US9462085B2 (en) Chunk-based communication of binary dynamic rest messages
CN105763619B (en) The method and device that client and server-side are communicated
CN104363285B (en) A kind of network communication program generation method and device
CN102571939A (en) Cross-platform communication method and system
CN104486396A (en) Cross-platform network data transmission method
CN103179133A (en) Communication method between client side and server based on entity class
CN1783882A (en) Flexibly transferring typed application data
CN102541926B (en) Data exchange processing method, equipment and system
CN104272774B (en) System and method for handling encoded data stream
CN107222461A (en) Communication processing method and device
CN105024923B (en) The method and device that message category based on XMPP extension message is realized
CN101442524A (en) Method for data communication with national electric network marketing system server
CN105515947B (en) A kind of method, server and the system of the heterogeneous terminals message intercommunication based on XMPP
DE50210901D1 (en) BROWSIBLE COMMUNICATION SYSTEM AND CLIENT AND SERVER FOR SUCH A COMMUNICATION SYSTEM
CN102438048A (en) Method and system for calling remote service from Internet
CN102843345B (en) Remote communication method and computer program product thereof
CN104717032A (en) Coding and decoding method suitable for AFDX network data transparent transmission
CN102073693A (en) XML-based data communication method and system
CN103167001A (en) Network data transmission method based on extensive makeup language (XML)
CN106790201A (en) A kind of method and apparatus for transmitting data
CN100589358C (en) Metod and system for processing messages, and message sending end and message receiving end
CN103561105A (en) Image transmitting method, sending end and receiving end

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140122