CN104519134B - A kind of cross-platform file read-write system and method - Google Patents

A kind of cross-platform file read-write system and method Download PDF

Info

Publication number
CN104519134B
CN104519134B CN201410816140.6A CN201410816140A CN104519134B CN 104519134 B CN104519134 B CN 104519134B CN 201410816140 A CN201410816140 A CN 201410816140A CN 104519134 B CN104519134 B CN 104519134B
Authority
CN
China
Prior art keywords
file
platform
equipment
read
write
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.)
Expired - Fee Related
Application number
CN201410816140.6A
Other languages
Chinese (zh)
Other versions
CN104519134A (en
Inventor
顾明毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhangzhou Dingzhu Communication Technologies Co Ltd
Original Assignee
Zhangzhou Dingzhu Communication Technologies 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 Zhangzhou Dingzhu Communication Technologies Co Ltd filed Critical Zhangzhou Dingzhu Communication Technologies Co Ltd
Priority to CN201410816140.6A priority Critical patent/CN104519134B/en
Publication of CN104519134A publication Critical patent/CN104519134A/en
Application granted granted Critical
Publication of CN104519134B publication Critical patent/CN104519134B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of cross-platform file read-write system and methods, and suitable for the file read-write between the equipment of different architectural framework platforms, system includes file read-write proxy module;The file read-write proxy module stores documentary record information for establishing and importing and export configuration template in the configuration template;Wherein, when file stores, the file data that the equipment of the first platform generates is converted into network bytes sequential mode according to the configuration template and preserved into the equipment of the second platform by the file read-write proxy module;When file is read, the file data being stored in the equipment of the second platform with network bytes sequential mode is converted into the machine byte sequential mode according to the configuration template and is handled for the documentor of the equipment of the second platform by the file read-write proxy module.The present invention realizes the consistency treatment of the file between the various equipment of different architectural framework platforms so that file can correctly be written and read operation on different platforms.

Description

A kind of cross-platform file read-write system and method
Technical field
The present invention relates to moving communicating field more particularly to a kind of cross-platform file read-write system and methods.
Background technology
With the needs that the development of science and technology and people link up, computing device type is more and more, file between equipment Exchanging and sharing also becomes frequent.From common PC machine, notebook to tablet, smart mobile phone, it is filled in daily life various The computing device of various kinds.Mainly to have Intel Architecture platform, ARM architecture platforms to also have a small amount of from processor classification for these equipment PowerPC and MPIS architecture platforms.
The equipment of different architectural framework platforms, processor essentially consist in syllable sequence for the difference of data manipulation.Byte Sequence (byte order), i.e. Endianess, be processor when handling multibyte data, preserved in register and memory The sequence of byte.Syllable sequence is divided into big small end, wherein, big end byte (big-endian) is according to " low address storage is high-order The principle processing multibyte data of data ";Small end byte (little-endian) is according to " low address storage low data " Principle processing multibyte data.Our common most of processors all use little-endian, such as Intel;Few portion Divide using big-endian, such as PowerPC;And MIPS and arm processor can be usually silent by being configured using different syllable sequences Recognize using little-endian(ARM stores floating number using big-endian always).
Such as 32 integer 0x01020304, it is stored as follows in little-endian:
Address A 0x01
Address A+1 0x02
Address A+2 0x03
Address A+3 0x04
It is stored as follows in big-endian:
Address A 0x04
Address A+1 0x03
Address A+2 0x02
Address A+3 0x01
For same numerical value, if big small end is different, the value of acquirement is just different.The equipment of different architectural framework platforms it Between need read and write same file, due to syllable sequence the problem of can lead to the inconsistent of the parsing to file content, cause There is mistake in file process on distinct device.
Accordingly, it is desirable to provide a kind of realization method of cross-platform file read-write, can solve the text between various equipment The consistency treatment problem of part can cause file can correctly be written and read operation on different platforms.
Invention content
The object of the present invention is to provide a kind of cross-platform file read-write system and methods, solve the prior art various The consistency treatment problem of file between equipment can cause file can correctly be written and read behaviour on different platforms Make.
To achieve these goals, the present invention provides a kind of cross-platform file read-write system, suitable for different system framves File read-write between the equipment of structure platform, system include file read-write proxy module;The file read-write proxy module is used for It establishes and imports and export configuration template, documentary record information is stored in the configuration template;Wherein, file stores When, the file read-write proxy module converts networking according to the file data that the configuration template generates the equipment of the first platform Network byte sequential mode is preserved into the equipment of the second platform;When file is read, the file read-write proxy module is matched according to It puts masterplate and the file data being stored in the equipment of the second platform with network bytes sequential mode is converted into the machine byte sequential mode It is handled for the documentor of the equipment of the second platform.
To achieve these goals, cross-platform file read-write system of the present invention is used the present invention also provides a kind of The method for carrying out cross-platform file storage, includes the following steps:(1)Receive the file storage request of the equipment of the second platform;(2) Startup file read-write proxy module imports configuration template, wherein, the record information of file data is stored in the configuration template; (3)The file data that the equipment of first platform generates is converted into network by file read-write proxy module according to the configuration template Byte sequential mode;(4)File read-write proxy module is by the document data saving of network bytes sequential mode to the equipment of the second platform In.
To achieve these goals, cross-platform file read-write system of the present invention is used the present invention also provides a kind of The method for carrying out cross-platform file reading, which is characterized in that include the following steps:(1)The equipment of second platform receives file and looks into Ask request;(2)Startup file read-write proxy module imports configuration template, wherein, it is stored with file data in the configuration template Record information;(3)File read-write proxy module reads the target text of the equipment of the second platform according to the file query requests Part records;(4)File read-write proxy module will be stored in the second platform according to the configuration template with network bytes sequential mode File data in equipment is converted into documentor processing of the machine byte sequential mode for the equipment of the second platform.
It is an advantage of the current invention that by setting file read-write proxy module, each of different architectural framework platforms is realized The consistency treatment of file between kind equipment so that file can correctly be written and read operation on different platforms, keep away Exempt from the file process in different platform equipment to be caused mistake occur due to the problem of syllable sequence.
Description of the drawings
Fig. 1, the Organization Chart of cross-platform one specific embodiment of file read-write system of the present invention;
Fig. 2, a specific embodiment flow chart of cross-platform file memory method of the present invention;
Fig. 3, a specific embodiment flow chart of cross-platform file reading of the present invention.
Specific embodiment
The specific embodiment of cross-platform file read-write system and method provided by the invention is done in detail below in conjunction with the accompanying drawings It describes in detail bright.
The specific embodiment of cross-platform file read-write system of the present invention is provided with reference to attached drawing first.
With reference to figure 1, the Organization Chart of cross-platform file read-write system described in present embodiment, the cross-platform file is read System is write suitable for different architectural framework platforms(For example, the first platform 11 and the second platform 19)Equipment between file read It writes, the system comprises file read-write proxy module 12, the file read-write proxy module 12 is used to establish and import and lead Go out configuration template 121, documentary record information is stored in the configuration template 121.
When file stores, the file read-write proxy module 12 is according to the configuration template 121 by the first platform 11 The file data of equipment generation is converted into network bytes sequential mode and preserves into the equipment of the second platform 19.When file is read, The file read-write proxy module 12 will be stored in the second platform 19 according to the configuration template 121 with network bytes sequential mode File data in equipment is converted into documentor processing of the machine byte sequential mode for the equipment of the second platform 19.When The equipment of two platforms 19 need obtain the first platform 11 equipment generation file data when, no matter the equipment master of the first platform 11 What machine syllable sequence is, file read-write proxy module 12 is all converted into network bytes sequence, transmission(Such as pass through network)And It preserves into the equipment of the second platform 19;And file read-write proxy module 12 is independently of documentor, the second platform 19 Before the data that the documentor of equipment is received in processing from network, no matter what network bytes sequence is, starts text first Part reads and writes proxy module 12 by network bytes ordinal number according to host byte sequence is converted to, so as to which documentor is without considering across flat The syllable sequence difference problem of platform.
As preferred embodiment, file of the present invention is written and read operation in a binary fashion, the file Data are the data with form repeatability stored with recording mode, so that the file read-write proxy module 12 is matched The configuration format for putting masterplate 121 is simple, and required memory space is smaller.For example, store in a binary fashion with a fixed frequency The data of acquisition, the data format acquired are fixed, and only numerical value is different, that is, its data has form repeatability.
The record information of the file includes the value type of storage and the word length of each numerical value;So as to file read-write Proxy module 12 can convert the machine syllable sequence initial data handled with data structure form according to the configuration template 121 The machine syllable sequence of relevant device is converted into corresponding network bytes sequence and by network bytes sequence.Implement as optional Mode, the file read-write proxy module 12 is further used for changing the configuration template 121, so as to according to new file Data source modifies to the original stencil in configuration template 121, that is, re-establishes and import configuration template 121, to adapt to The conversion process of source of new data.
With the first platform 11 for Intel platforms, the second platform 19 is the comparison invention system work for PowerPC platforms It further illustrates, when defining procotol, formulates network bytes sequence and use big-endian.
The machine syllable sequence generated in the equipment of Intel platforms be little-endian, file read-write proxy module 12 Network bytes sequence is converted into according to the configuration template 121, by network transmission and is preserved to the equipment of PowerPC platforms In.That is, the short types data conversion on the device Host of Intel platforms into the short offset numbers arranged by network bytes sequence According to the long types data conversion on the device Host of Intel platforms into the long type data arranged by network bytes sequence.
For the equipment of PowerPC platforms when file is read, the file read-write proxy module 12 is according to the configuration template The network bytes sequence of preservation is converted into the machine syllable sequence, i.e. big-endian by 121, for the file of the equipment of PowerPC platforms Routine processes.I.e. the short types data conversion on network into the device Host syllable sequence arrangement by PowerPC platforms Short type data, the long types data conversion on network into the long of the device Host syllable sequence arrangement by PowerPC platforms Type data.
Next it is provided with reference to attached drawing and cross-platform file reading is carried out using cross-platform file read-write system of the present invention The specific embodiment for the method write.
With reference to figure 2, the flow chart of the method for cross-platform file storage, use are of the present invention described in present embodiment Cross-platform file read-write system, include the following steps:S21:Receive the file storage request of the equipment of the second platform;S22:It opens Dynamic file read-write proxy module imports configuration template;S23:File read-write proxy module is flat by first according to the configuration template The file data of the equipment generation of platform is converted into network bytes sequential mode;S24:File read-write proxy module is by network bytes sequence side In the document data saving of formula to the equipment of the second platform.Next it elaborates to step shown in Fig. 2.
S21:Receive the file storage request of the equipment of the second platform.
For example, cross-platform file read-write system receives the file storage request of the equipment of PowerPC platforms.It is of the present invention File can be to be written and read operation in a binary fashion, and the data of the file are to have form weight with what recording mode stored The data of renaturation, so that the configuration format of the configuration template 121 of the file read-write proxy module 12 is simple, required storage Space is smaller.For example, the data acquired with a fixed frequency stored in a binary fashion, the data format acquired are fixed, Only numerical value is different, that is, its data has form repeatability.
S22:Startup file read-write proxy module imports configuration template.
Wherein, the record information of file data is stored in the configuration template 121.The record information of the file includes The word length of the value type of storage and each numerical value.So as to which file read-write proxy module 12 can according to the configuration template 121 The machine handled with data structure form syllable sequence initial data is converted into corresponding network bytes sequence.
S23:According to the configuration template, the file data that the equipment of the first platform is generated turns file read-write proxy module Change network bytes sequential mode into.
File read-write proxy module 12 is according to the configuration template 121, the machine word that will be generated in the equipment of Intel platforms The file data that section sequence is little-endian is converted into network bytes sequential mode, such as big-endian.That is, Intel is put down Short types data conversion on the device Host of platform is into the short offset data arranged by network bytes sequence, Intel platforms Device Host on long types data conversion into the long type data arranged by network bytes sequence.
S24:File read-write proxy module will be in the equipment of the document data saving of network bytes sequential mode to the second platform.
As optional embodiment, the method further includes startup file read-write proxy module 12 is changed and is led Enter the configuration template 121, so as to be repaiied according to new file data source to the original stencil in configuration template 121 Change, that is, re-establish and import configuration template 121, to adapt to the conversion process of source of new data.
With reference to figure 3, the flow chart of the method for cross-platform file reading, use are of the present invention described in present embodiment Cross-platform file read-write system, include the following steps:S31:The equipment of second platform receives file query requests;S32:Start File read-write proxy module imports configuration template;S33:File read-write proxy module reads second according to the file query requests The file destination record of the equipment of platform;S34:File read-write proxy module, will be with network bytes sequence according to the configuration template The file data that mode is stored in the equipment of the second platform is converted into text of the machine byte sequential mode for the equipment of the second platform Part routine processes.Next it elaborates to step shown in Fig. 3.
S31:The equipment of second platform receives file query requests.
For example, the equipment of PowerPC platforms receives file query requests in cross-platform file read-write system.Institute of the present invention It can be to be written and read operation in a binary fashion to state file, and the data of the file are to have form with what recording mode stored The data of repeatability, so that the configuration format of the configuration template 121 of the file read-write proxy module 12 is simple, it is required to deposit It is smaller to store up space.For example, the data acquired with a fixed frequency stored in a binary fashion, the data format acquired are consolidated Fixed, only numerical value is different, that is, its data has form repeatability.
S32:Startup file read-write proxy module imports configuration template.
Wherein, the record information of file data is stored in the configuration template 121.The record information of the file includes The word length of the value type of storage and each numerical value.So as to which file read-write proxy module 12 can according to the configuration template 121 Network bytes sequence is converted into corresponding the machine syllable sequence.
S33:File read-write proxy module reads the file destination of the equipment of the second platform according to the file query requests Record.
The file query requests carry inquiry target, and file read-write proxy module 12 is according to the file query requests The file record in the equipment of PowerPC platforms is inquired, so as to read respective objects file record.
S34:File read-write proxy module will be stored in the second platform according to the configuration template with network bytes sequential mode Equipment in file data be converted into the machine byte sequential mode for the second platform equipment documentor processing.
File read-write proxy module 12 is according to the configuration template 121, the network that will be stored in the equipment of PowerPC platforms Syllable sequence, such as big-endian are converted into the machine syllable sequence, i.e. big-endian, for the file of the equipment of PowerPC platforms Routine processes.That is, short types data conversion on the device Host of Intel platforms into being arranged by network bytes sequence Short offset data, the long types data conversion on the device Host of Intel platforms into the long arranged by network bytes sequence Type data.
For the equipment of PowerPC platforms when file is read, the file read-write proxy module 12 is according to the configuration template The network bytes sequence of preservation is converted into the machine syllable sequence, i.e. big-endian by 121, for the file of the equipment of PowerPC platforms Routine processes.That is, the short types data conversion on network into the device Host syllable sequence arrangement by PowerPC platforms Short type data, the long types data conversion on network by PowerPC platforms device Host syllable sequence arrangement Long type data.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art Member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should be regarded as Protection scope of the present invention.

Claims (7)

1. a kind of cross-platform file read-write system, special suitable for the file read-write between the equipment of different architectural framework platforms Sign is, including file read-write proxy module;
The file read-write proxy module is stored with text for establishing and importing and export configuration template in the configuration template The record information of part;
Wherein, when file stores, the file read-write proxy module generates the equipment of the first platform according to the configuration template File data be converted into network bytes sequential mode and preserve into the equipment of the second platform;When file is read, the file read-write Proxy module turns the file data being stored in network bytes sequential mode in the equipment of the second platform according to the configuration template Turn to documentor processing of the machine byte sequential mode for the equipment of the second platform;
Wherein, the file is written and read operation in a binary fashion, and the data of the file are the tool stored with recording mode There are the data of form repeatability;
The file read-write proxy module is further used for changing the configuration template.
2. cross-platform file read-write system according to claim 1, which is characterized in that the record information of the file includes The word length of the value type of storage and each numerical value.
3. a kind of method for carrying out cross-platform file storage using cross-platform file read-write system described in claim 1, special Sign is, includes the following steps:
(1) the file storage request of the equipment of the second platform is received;
(2) startup file read-write proxy module imports configuration template, wherein, the note of file data is stored in the configuration template Record information;
(3) file data that the equipment of the first platform generates is converted by file read-write proxy module according to the configuration template Network bytes sequential mode;
(4) file read-write proxy module will be in the equipment of the document data saving of network bytes sequential mode to the second platform.
4. according to the method described in claim 3, it is characterized in that, the step (2) further comprises:Startup file reads and writes generation Module is managed, changes and imports configuration template.
5. according to the method described in claim 3, it is characterized in that, the record information of the file includes the numerical value class of storage The word length of type and each numerical value.
6. a kind of method for carrying out cross-platform file reading using cross-platform file read-write system described in claim 1, special Sign is, includes the following steps:
The equipment of (1) second platform receives file query requests;
(2) startup file read-write proxy module imports configuration template, wherein, the note of file data is stored in the configuration template Record information;
(3) file read-write proxy module reads the file destination record of the equipment of the second platform according to the file query requests;
(4) file read-write proxy module will be stored in setting for the second platform according to the configuration template with network bytes sequential mode File data in standby is converted into documentor processing of the machine byte sequential mode for the equipment of the second platform.
7. according to the method described in claim 6, it is characterized in that, which is characterized in that the record information of the file include deposit The word length of the value type of storage and each numerical value.
CN201410816140.6A 2014-12-25 2014-12-25 A kind of cross-platform file read-write system and method Expired - Fee Related CN104519134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410816140.6A CN104519134B (en) 2014-12-25 2014-12-25 A kind of cross-platform file read-write system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410816140.6A CN104519134B (en) 2014-12-25 2014-12-25 A kind of cross-platform file read-write system and method

Publications (2)

Publication Number Publication Date
CN104519134A CN104519134A (en) 2015-04-15
CN104519134B true CN104519134B (en) 2018-06-19

Family

ID=52793837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410816140.6A Expired - Fee Related CN104519134B (en) 2014-12-25 2014-12-25 A kind of cross-platform file read-write system and method

Country Status (1)

Country Link
CN (1) CN104519134B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030177283A1 (en) * 2002-03-18 2003-09-18 Hamilton Thomas E. Application program interface
CN102497230A (en) * 2011-12-19 2012-06-13 太仓市同维电子有限公司 General-purpose processing method adopted by ONT for multi-vendor non-standard management entity
CN103338134A (en) * 2013-07-01 2013-10-02 盛科网络(苏州)有限公司 Distributed network switch debugging system
CN103532959A (en) * 2013-10-21 2014-01-22 济南政和科技有限公司 Cross-platform network communication method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030177283A1 (en) * 2002-03-18 2003-09-18 Hamilton Thomas E. Application program interface
CN102497230A (en) * 2011-12-19 2012-06-13 太仓市同维电子有限公司 General-purpose processing method adopted by ONT for multi-vendor non-standard management entity
CN103338134A (en) * 2013-07-01 2013-10-02 盛科网络(苏州)有限公司 Distributed network switch debugging system
CN103532959A (en) * 2013-10-21 2014-01-22 济南政和科技有限公司 Cross-platform network communication method

Also Published As

Publication number Publication date
CN104519134A (en) 2015-04-15

Similar Documents

Publication Publication Date Title
CN104899304A (en) Named entity identification method and device
CN107357929A (en) File reading, mobile terminal and readable storage medium storing program for executing
CN103020207B (en) Browser label page grouping management method and device
CN101256561A (en) Method, apparatus and system for storing and accessing database data
CN101515929A (en) Message format conversion method, network device and agent device
CN105830022A (en) File access method and apparatus
WO2023131218A1 (en) Graph data storage
CN107919943A (en) Coding, coding/decoding method and the device of binary data
CN106815733A (en) Data processing method, device and system and printer
CN103176852A (en) Method and device for inter-progress communication
CN103177233A (en) Record inquiry system based on RFID (Radio Frequency Identification Devices) technology
CN106598885A (en) Configurable multiport general data bridging system and working method thereof
CN104519134B (en) A kind of cross-platform file read-write system and method
CN102316428A (en) Method for communication between mobile application client and intelligent card and device
CN108319882A (en) A kind of c bookmart page number recording method and system
CN105653687A (en) Medium recognition method
CN102855115A (en) Method and system for displaying character label based on splicing wall
CN105191419B (en) It enables the device to find to service via network controller or group owner
CN107358566A (en) library management system based on RFID
CN207663457U (en) Power information recording device with OCR and speech identifying function
CN105574591A (en) Machine room information management system and method
CN101772207A (en) Method for mobile terminal equipment to identify file
CN206312230U (en) A kind of artificial intelligence accounting system
EP1566759A3 (en) Device for acquiring, consulting and processing of data, in particular medical
CN109284340A (en) The storage and search method of relational data in resource-constrained smart object

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180619

Termination date: 20211225

CF01 Termination of patent right due to non-payment of annual fee