CN102571939A - Cross-platform communication method and system - Google Patents

Cross-platform communication method and system Download PDF

Info

Publication number
CN102571939A
CN102571939A CN2011104434650A CN201110443465A CN102571939A CN 102571939 A CN102571939 A CN 102571939A CN 2011104434650 A CN2011104434650 A CN 2011104434650A CN 201110443465 A CN201110443465 A CN 201110443465A CN 102571939 A CN102571939 A CN 102571939A
Authority
CN
China
Prior art keywords
platform
bytes
cross
binary stream
client
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
CN2011104434650A
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.)
Guangzhou Xuanwu Wireless Technology Co Ltd
Original Assignee
Guangzhou Xuanwu Wireless 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 Guangzhou Xuanwu Wireless Technology Co Ltd filed Critical Guangzhou Xuanwu Wireless Technology Co Ltd
Priority to CN2011104434650A priority Critical patent/CN102571939A/en
Publication of CN102571939A publication Critical patent/CN102571939A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a cross-platform communication method and a cross-platform communication system. The communication system runs on clients of different platforms, and is used for unifying conversion standards between objects of the different platforms and a binary stream. The communication system comprises an object resolution module, wherein the object resolution module is used for conversion between the objects of the different platforms and the binary stream. The communication method comprises the following steps that: a first platform performs object serialization to convert a constructed object into the binary stream according to the conversion standard; the binary stream is transmitted to a second platform through a network; and the second platform performs object deserialization to convert the received binary stream into an object usable for the second platform according to the conversion standard. The problem of difference between the different platforms is solved, the objects can be conveniently transmitted and recovered, and communication between the different platforms is facilitated.

Description

A kind of cross-platform communication means and system
Technical field
The present invention relates to network communication field, particularly a kind of cross-platform communication means and system.
Background technology
Present communications platform is varied, and network service all is to transmit with the mode of binary stream.Different platforms communicates, and need convert object to binary stream.And in the different platforms, it is inconsistent that object converts the standard of binary stream to.The communication standard of different platforms inside is different, can't directly communicate.An object of for example constructing among the Java can't directly let C# use.When cross-platform communication, different platform needs the Unified coding form.
Summary of the invention
The shortcoming that the objective of the invention is to overcome prior art provides a kind of cross-platform communication means with not enough, through unified transfer standard, makes things convenient for the communication between the different platform.
Another object of the present invention is to, a kind of cross-platform communication system is provided.
In order to achieve the above object, the present invention adopts following technical scheme to realize:
A kind of cross-platform communication means carries out unifiedly to the object of different platform and the transfer standard between the binary stream, said communication means may further comprise the steps:
First platform carry out object sequenceization, converts the object of structure to binary stream by transfer standard;
Binary stream passes through Network Transmission to second platform;
Second platform carries out the object unserializing, converts the binary stream that receives to object that second platform can use by transfer standard.
Preferably, object includes at least two each and every one attribute: unique identification-UUID, and other attribute-character type when this object needs cross-platform transmission, need convert binary stream earlier to, and concrete steps are following:
Use fixing length to deposit coded format, convert binary system to;
Convert unique identification to binary system, be appended to the coded format back;
Convert other attribute to binary system, be appended to the unique identification back;
Preferably, said transfer standard is the length of frequently-used data type in internal memory of definition object properties.
Preferably, said frequently-used data type comprises Boolean, Char, Double, Float, Int, Long, Short and UUID.
Preferably, the length of said frequently-used data type in internal memory is defined as: Boolean is that 1 byte, Char are that 2 bytes, Double are that 8 bytes, Float are that 4 bytes, Int are that 4 bytes, Long are that 8 bytes, Short are that 2 bytes, UUID are 16 bytes.
In order to reach above-mentioned another purpose, the present invention adopts following technical scheme:
A kind of cross-platform communication system; Comprise the object parsing module of changing between object that at least one is used for different platform and the binary stream; Said object explanation module is arranged on that communication system operates on the client of different platform on the client of each platform, is used for the object of different platform and the transfer standard between the binary stream are unified.
Preferably, said client comprises Android client, Iphone client, Windows Mobile client, Symbian client or Web client.
Preferably, said transfer standard is the length of frequently-used data type in internal memory of definition object properties.
Preferably, said frequently-used data type comprises Boolean, Char, Double, Float, Int, Long, Short and UUID.
Preferably, the length of said frequently-used data type in internal memory is defined as: Boolean is that 1 byte, Char are that 2 bytes, Double are that 8 bytes, Float are that 4 bytes, Int are that 4 bytes, Long are that 8 bytes, Short are that 2 bytes, UUID are 16 bytes.In order to reach above-mentioned another purpose, the present invention adopts following technical scheme:
The present invention has following advantage and effect with respect to prior art:
1, the invention solves otherness between the different platform, made things convenient for the transmission and the reduction of object, thereby made things convenient for the communication between the different platform.
Description of drawings
Fig. 1 is the flow chart of the cross-platform communication means of the present invention;
Fig. 2 is applied topology figure of the present invention;
Fig. 3 is the sketch map of the embodiment of the invention 1.
Embodiment
Below in conjunction with embodiment and accompanying drawing the present invention is described in further detail, but execution mode of the present invention is not limited thereto.
Embodiment
The flow chart of cross-platform communication means as shown in Figure 1, first platform and second platform are provided with cross-platform communication system, and said communication system includes the object parsing module.The object of first platform structure carry out object sequenceization through the object parsing module, converts binary stream to and passes through Network Transmission to second platform.The object parsing module of second platform carries out unserializing, converts the binary stream that receives to object that second platform can use.
Said object includes three attribute: unique identification-UUID, name-character type, sex-character type.When this object needs cross-platform transmission, need convert binary stream earlier to, step is following:
Use fixing length to deposit coded format, represent with 10001, convert binary system to like UTF-8;
Convert unique identification to binary system, be appended to the coded format back;
Convert name to binary system, be appended to the unique identification back;
Convert sex to binary system, be appended to the name back.
Object converts to behind the binary system as shown in the table:
4 bytes 16 bytes 4 bytes 4 bytes
Coded format Unique identification Name Sex
Receiving platform adopts identical transformation rule, just reduciblely goes out object.Above-mentioned object also can be provided with different attributes according to the situation of reality, and unique identification is to exist, and except that unique identification, other attribute all is character type datas.
The present invention is applied to the topological as shown in Figure 2 of portable terminal.The client of different platform (Android, Iphone, Windows Mobile, Symbian, Web) all is provided with the object parsing module, and gateway server also is provided with the object parsing module.Different platforms is used different computer languages, and inner communication standard is also different.The object parsing module becomes binary stream with the object of platform structure with unified standard handovers; Binary stream transmits through network; The object parsing module of receiving platform converts the binary stream that receives to object that platform can use; Thereby solved the otherness between the different platform, made things convenient for cross-platform communication.
The A platform adopts Java language, and the B platform adopts C# language, if object of the Java of A platform structure need let the C# of B platform use, changes through the object parsing module.Because each object all is made up of the attribute of fundamental type, so the present invention defines the length of data type in internal memory commonly used, the definition standard is as shown in the table:
Data type Definition length
Boolean 1 byte
Char 2 bytes
Double 8 bytes
?Float 4 bytes
?Int 4 bytes
?Long 8 bytes
?Short 2 bytes
?UUID 16 bytes
All use this definition standard between two platforms, then can realize the cross-platform transmission of object.
The attribute and the corresponding data types of A platform structure object " client a " are as shown in the table:
Name Zhang San ?String
Sex The man ?String
The address Guangzhou ?String
Age
40 ?Int
Party member whether Be ?Boolean
The consumption amount of money 400000000.24 ?Double
Binary stream structure after changing through the object parsing module of A platform is as shown in Figure 3.
After the object parsing module of B platform receives binary stream, take out one by one, convert the object that C# can use to according to memory block.
The foregoing description is a preferred implementation of the present invention; But execution mode of the present invention is not restricted to the described embodiments; Other any do not deviate from change, the modification done under spirit of the present invention and the principle, substitutes, combination, simplify; All should be the substitute mode of equivalence, be included within protection scope of the present invention.

Claims (10)

1. a cross-platform communication means is characterized in that, the object of different platform and the transfer standard between the binary stream is carried out unified, and said communication means may further comprise the steps:
First platform carry out object sequenceization, converts the object of structure to binary stream by transfer standard;
Binary stream passes through Network Transmission to second platform;
Second platform carries out the object unserializing, converts the binary stream that receives to object that second platform can use by transfer standard.
2. cross-platform communication means according to claim 1 is characterized in that, object includes at least two each and every one attribute: unique identification-UUID; Other attribute-character type; When this object needs cross-platform transmission, need convert binary stream earlier to, concrete steps are following:
Use fixing length to deposit coded format, convert binary system to;
Convert unique identification to binary system, be appended to the coded format back;
Convert other attribute to binary system, be appended to the unique identification back.
3. cross-platform communication means according to claim 1 is characterized in that, said transfer standard is the length of frequently-used data type in internal memory of definition object properties.
4. cross-platform communication means according to claim 3 is characterized in that, said frequently-used data type comprises Boolean, Char, Double, Float, Int, Long, Short and UUID.
5. cross-platform communication means according to claim 4, it is characterized in that the length of said frequently-used data type in internal memory is defined as: Boolean is that 1 byte, Char are that 2 bytes, Double are that 8 bytes, Float are that 4 bytes, Int are that 4 bytes, Long are that 8 bytes, Short are that 2 bytes, UUID are 16 bytes.
6. cross-platform communication system that realizes each said cross-platform communication means among the claim 1-5; It is characterized in that; Comprise the object parsing module of changing between object that at least one is used for different platform and the binary stream; Said object explanation module is arranged on that communication system operates on the client of different platform on the client of each platform, is used for the object of different platform and the transfer standard between the binary stream are unified.
7. cross-platform communication means according to claim 6 is characterized in that, said client comprises Android client, Iphone client, Windows Mobile client, Symbian client or Web client.
8. cross-platform communication system according to claim 6 is characterized in that, said transfer standard is the length of frequently-used data type in internal memory of definition object properties.
9. cross-platform communication system according to claim 8 is characterized in that, said frequently-used data type comprises Boolean, Char, Double, Float, Int, Long, Short and UUID.
10. cross-platform communication system according to claim 9; It is characterized in that the length of said frequently-used data type in internal memory is defined as: Boolean is that 1 byte, Char are that 2 bytes, Double are that 8 bytes, Float are that 4 bytes, Int are that 4 bytes, Long are that 8 bytes, Short are that 2 bytes, UUID are 16 bytes.
CN2011104434650A 2011-12-26 2011-12-26 Cross-platform communication method and system Pending CN102571939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104434650A CN102571939A (en) 2011-12-26 2011-12-26 Cross-platform communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104434650A CN102571939A (en) 2011-12-26 2011-12-26 Cross-platform communication method and system

Publications (1)

Publication Number Publication Date
CN102571939A true CN102571939A (en) 2012-07-11

Family

ID=46416399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104434650A Pending CN102571939A (en) 2011-12-26 2011-12-26 Cross-platform communication method and system

Country Status (1)

Country Link
CN (1) CN102571939A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103219004A (en) * 2013-04-28 2013-07-24 北京推博信息技术有限公司 Text transmission method, device and system
CN103532959A (en) * 2013-10-21 2014-01-22 济南政和科技有限公司 Cross-platform network communication method
CN104486396A (en) * 2014-12-10 2015-04-01 中国电信集团系统集成有限责任公司 Cross-platform network data transmission method
CN105681333A (en) * 2016-02-24 2016-06-15 携程计算机技术(上海)有限公司 Binary-system-based network data transmission method and system
CN106648817A (en) * 2016-12-09 2017-05-10 北京酷我科技有限公司 Cross-platform data object transmission method
CN107493266A (en) * 2017-07-26 2017-12-19 广州广电运通金融电子股份有限公司 Communication system, the method and device of built-in self-help terminal
CN108540477A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 The method and relevant device of data communication
CN109308224A (en) * 2017-07-27 2019-02-05 阿里巴巴集团控股有限公司 The method, apparatus and system of cross-platform data communication, cross-platform data processing
CN109981676A (en) * 2019-04-08 2019-07-05 陈鹏 One kind being based on the customized Internet of Things information interacting method of binary system analysis protocol
CN114519026A (en) * 2022-02-17 2022-05-20 深圳集智数字科技有限公司 Serial port communication method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477836A (en) * 2002-08-19 2004-02-25 万达信息股份有限公司 Data format of data exchange in network data transmission
CN1682186A (en) * 2001-09-05 2005-10-12 斯文·约翰·贝林 Technology independent information management
CN102063511A (en) * 2011-01-21 2011-05-18 深圳市汉普电子技术开发有限公司 Data synchronism system and method
CN102073663A (en) * 2009-11-24 2011-05-25 北大方正集团有限公司 Method and device for rapidly processing XML (Extensible Markup Language) compressed data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1682186A (en) * 2001-09-05 2005-10-12 斯文·约翰·贝林 Technology independent information management
CN1477836A (en) * 2002-08-19 2004-02-25 万达信息股份有限公司 Data format of data exchange in network data transmission
CN102073663A (en) * 2009-11-24 2011-05-25 北大方正集团有限公司 Method and device for rapidly processing XML (Extensible Markup Language) compressed data
CN102063511A (en) * 2011-01-21 2011-05-18 深圳市汉普电子技术开发有限公司 Data synchronism system and method

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103219004A (en) * 2013-04-28 2013-07-24 北京推博信息技术有限公司 Text transmission method, device and system
CN103532959A (en) * 2013-10-21 2014-01-22 济南政和科技有限公司 Cross-platform network communication method
CN104486396A (en) * 2014-12-10 2015-04-01 中国电信集团系统集成有限责任公司 Cross-platform network data transmission method
CN104486396B (en) * 2014-12-10 2017-12-26 中国电信集团系统集成有限责任公司 A kind of transmission method of cross-platform network data
CN105681333A (en) * 2016-02-24 2016-06-15 携程计算机技术(上海)有限公司 Binary-system-based network data transmission method and system
CN106648817A (en) * 2016-12-09 2017-05-10 北京酷我科技有限公司 Cross-platform data object transmission method
CN107493266A (en) * 2017-07-26 2017-12-19 广州广电运通金融电子股份有限公司 Communication system, the method and device of built-in self-help terminal
CN109308224A (en) * 2017-07-27 2019-02-05 阿里巴巴集团控股有限公司 The method, apparatus and system of cross-platform data communication, cross-platform data processing
CN108540477A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 The method and relevant device of data communication
CN109981676A (en) * 2019-04-08 2019-07-05 陈鹏 One kind being based on the customized Internet of Things information interacting method of binary system analysis protocol
CN114519026A (en) * 2022-02-17 2022-05-20 深圳集智数字科技有限公司 Serial port communication method and device

Similar Documents

Publication Publication Date Title
CN102571939A (en) Cross-platform communication method and system
CN103037314B (en) The method of pocket transmission news on the mobile terminal in autonomous network
CN102713904A (en) Method and apparatus for utilizing a scalable data structure
CN104125208A (en) Data transmission method and data transmission device
CN105429858A (en) Real-time message transmission method among multiple robots
CN103442042A (en) Incremental data synchronization method and system
CN102724324A (en) Information pushing and integrating device and information pushing and integrating method
CN103780285A (en) Method for broadcasting data through Bluetooth and Bluetooth devices
CN103532959A (en) Cross-platform network communication method
CN103379140A (en) Log processing rule synchronization method and relative device and system
CN105868364B (en) Byte stream-based structured data representation method
CN102946648A (en) Intelligent terminal system of wireless gateway and automatic control method of intelligent terminal system
CN104486396A (en) Cross-platform network data transmission method
CN105681333A (en) Binary-system-based network data transmission method and system
CN107454456B (en) Management control method and system for floating layer elements
CN105635337A (en) Method for binding iOS device, iOS device and auxiliary device
KR20120063387A (en) Device and method for generating sms message
CN204031463U (en) A kind of intelligent watch communication system
CN102843345B (en) Remote communication method and computer program product thereof
CN106982165A (en) Data compression method and its system
CN104486296A (en) Identity recognition device and identity recognition method
CN102521360B (en) Raster data transmission method and system
WO2022087795A1 (en) Resource mapping method and apparatus, device, and storage medium
CN102098663A (en) Method for realizing remote management of smartcard based on SCWS (SmartCard Web Server), smartcard and system
CN102073693A (en) XML-based data communication method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C53 Correction of patent of invention or patent application
CB03 Change of inventor or designer information

Inventor after: Li Hairong

Inventor after: Huang Fangjie

Inventor before: Li Hairong

Inventor before: Huang Fangjie

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: Tianhe District Guangzhou city Guangdong province 510620 Sports Road No. 103, a Victoria Square, B building 32 unit 01 room

Applicant after: GUANGZHOU XUANWU WIRELESS TECHNOLOGY CO., LTD.

Address before: 510620 EF, building 2, building A, No. 107, Sports West Road, Guangzhou, Guangdong, Tianhe District

Applicant before: Guangzhou XuanWu Technology Co.,Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: GUANGZHOU XUANWU WIRELESS TECHNOLOGY LTD. TO: GUANGZHOU XUANWU WIRELESS TECHNOLOGY CO., LTD.

WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120711