CN109413154A - Conversion method of data format, device, computer equipment and storage medium - Google Patents
Conversion method of data format, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109413154A CN109413154A CN201811124285.4A CN201811124285A CN109413154A CN 109413154 A CN109413154 A CN 109413154A CN 201811124285 A CN201811124285 A CN 201811124285A CN 109413154 A CN109413154 A CN 109413154A
- Authority
- CN
- China
- Prior art keywords
- format
- data
- transmission data
- unit
- preset
- 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.)
- Withdrawn
Links
Classifications
-
- 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/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a kind of conversion method of data format, device, computer equipment and storage mediums, wherein the data transfer request includes the transmission data for sending server to the method includes detecting whether to generate data transfer request;If detecting generation data transfer request, the format of the transmission data is determined;Whether the format for judging the transmission data is preset format;If the format of the transmission data is not preset format, preset format conversion plug-in unit is called to format the transmission data.The present invention can flexible rapidly change data format, consequently facilitating the quick transmission and operation of data, save the waiting time of user network.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of conversion method of data format, device, computer equipments
And storage medium.
Background technique
When the interface of client and server at present on the market interacts, the lattice of the data of server interface are sent to
Formula is mostly character string, number, picture (gif, jpg etc.) etc..During data transmission, if data volume is excessive or institute
The network at place does not support the transmission of certain data formats, and needing that above-mentioned relevant data are parsed and are converted into allows to transmit
Default form, such as ASCII (American Standard Code for Information
Interchange, ASCII character) etc., and it is longer to carry out the time spent by the conversion of above-mentioned data format, while format conversion
Data volume afterwards is also bigger, therefore the time that data are transferred to server is longer, and the time that user is responded also is grown, and influences to use
The experience at family.
Summary of the invention
The embodiment of the present invention provides a kind of conversion method of data format, device, computer equipment and storage medium, Neng Gouling
Rapidly change data format living, consequently facilitating the quick transmission and operation of data, save the waiting time of user network.
In a first aspect, the embodiment of the invention provides a kind of conversion method of data format, this method comprises:
It detects whether to generate data transfer request, the data transfer request includes the transmission number for sending server to
According to;
If detecting generation data transfer request, the format of the transmission data is determined;
Whether the format for judging the transmission data is preset format;
If the format of the transmission data is not preset format, call preset format conversion plug-in unit to the transmission data
It formats.
Second aspect, the embodiment of the invention also provides a kind of data format converting device, which includes:
Detection unit, for detecting whether generating data transfer request, the data transfer request includes for sending to
The transmission data of server;
Determination unit, for determining the format of the transmission data;
Judging unit, for judging whether the format of the transmission data is preset format;
Converting unit calls preset format conversion plug-in unit if the format for the transmission data is not preset format
The transmission data are formatted.
The third aspect, the embodiment of the invention also provides a kind of computer equipments comprising memory and processor, it is described
Computer program is stored on memory, the processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the storage medium storage
There is computer program, the computer program includes program instruction, and described program instruction can be realized when being executed by a processor
State method.
The embodiment of the present invention generates data transfer request by detecting whether, the data transfer request includes for transmitting
To the transmission data of server;If detecting generation data transfer request, the format of the transmission data is determined;Judge the biography
Whether the format of transmission of data is preset format;If the format of the transmission data is not preset format, preset format is called to turn
Part is inserted to format the transmission data, can flexible rapidly change data format, consequently facilitating data is fast
Speed transmission and operation, greatly increase the time of interface network data interaction, quickly respond user's operation, save user network
The network waiting time.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description
Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field
For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of conversion method of data format provided in an embodiment of the present invention;
Fig. 1 a is a kind of application scenarios schematic diagram of conversion method of data format provided in an embodiment of the present invention;
Fig. 2 is a kind of sub-process schematic diagram of conversion method of data format provided in an embodiment of the present invention;
Fig. 3 is a kind of sub-process schematic diagram of conversion method of data format provided in an embodiment of the present invention;
Fig. 4 be another embodiment of the present invention provides a kind of conversion method of data format flow diagram;
Fig. 5 be another embodiment of the present invention provides a kind of conversion method of data format sub-process schematic diagram;
Fig. 6 is a kind of schematic block diagram of data format converting device provided in an embodiment of the present invention;
Fig. 7 is a kind of schematic block diagram of the determination unit of data format converting device provided in an embodiment of the present invention;
Fig. 8 is a kind of schematic block diagram of the converting unit of data format converting device provided in an embodiment of the present invention;
Fig. 9 be another embodiment of the present invention provides a kind of data format converting device schematic block diagram;
Figure 10 be another embodiment of the present invention provides a kind of data format converting device plug-in unit installation unit signal
Property block diagram;
Figure 11 is a kind of computer equipment structure composition schematic diagram provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
Fig. 1 and Fig. 1 a is please referred to, Fig. 1 is a kind of exemplary flow of conversion method of data format provided by the embodiments of the present application
Figure, Fig. 1 a is the schematic diagram of a scenario of conversion method of data format in the embodiment of the present application.The conversion method of data format can be applied
In terminal 10, which includes client, format conversion plug-in unit can be inserted on the client, thus according to preset lattice
Formula transformation rule formats the data for needing to be transferred to server 20, to realize the quick transmission of data.
Referring to Fig. 1, Fig. 1 is a kind of schematic flow diagram of conversion method of data format provided in an embodiment of the present invention.It should
Method may operate in smart phone (such as Android phone, IOS mobile phone), tablet computer, laptop and intelligence and set
In the terminals such as standby.As shown in Figure 1, the step of this method includes step S101~S104.
Step S101 detects whether that generation data transfer request, the data transfer request include for sending service to
The transmission data of device.
In the present embodiment, when being interacted between client and server, between the two can by be connected to the network come
Realize that corresponding data transmission is needed when initiating the dependent instruction of access request or response server with user orientation server
To the corresponding data of server transport, a data transfer request is then generated at this time, which includes needing to send to
To the data of server, i.e. transmission data.Therefore in order to transmission data can be rapidly transferred to server, need in client
Corresponding format conversion processing just is carried out to transmission data when end.So when need detect whether generation data transmission ask
It asks.
Step S102 determines the format of the transmission data if detecting generation data transfer request.
In the present embodiment, in order to ensure transmission data can be transmitted rapidly, data transmission is generated when detecting
Request is, it is thus necessary to determine that the format of the transmission data in the data transfer request.Wherein transmission data can be number, picture or
Person's file etc., format can be the formats such as binary system, picture, TXT, PDF or WORD.
Further, as shown in Fig. 2, the step S102 includes step S201~S202.
Step S201, extracts the attribute information of the transmission data, and the attribute information includes at least format information.
In the present embodiment, each transmission data are associated with the attribute information of itself, which may include this
It transmits the storage address of data, generate the essential informations such as time and format information.
Step S202 parses the format information to obtain the format of the transmission data.
In the present embodiment, by the format information of parsing transmission data, the lattice of the transmission data can be got
Formula, and as the basis of format conversion, clearly to transmit whether data need to format.
Step S103 judges whether the format of the transmission data is preset format.
In the present embodiment, the preset format is that preset client and server is handed over by network connection
The format of the data of transmission is supported when mutually.In order to determine that the format of transmission data can adapt to want in network transmission process
It asks, needs to judge whether the format of the transmission data is preset format.If the format of the transmission data is not preset format,
Then show that the transmission data are converted, and be specifically converted into which kind of format, needs according to the pre-set demand of user
Judged and is converted, specific visible step 104.If the format of the transmission data is preset format, then it represents that the transmission number
According to can rapidly be transmitted in network transmission process, i.e., do not need to convert transmission data at this time, and transmit number
According to directly server can be given to quickly through network transmission.
In one embodiment, during network data transmission, the data of binary format and Base64 coded format
The speed of transmission is fast, and performance is stablized, therefore the preset format can be binary format and Base64 coded format, certainly also
It can be other formats that can quickly transmit, such as TXT format, in embodiment provided by the present application and without limitation.
Step S104 calls preset format conversion plug-in unit to institute if the format of the transmission data is not preset format
Transmission data are stated to format.
In the present embodiment, if the format of the transmission data is not preset format, show transmission data at this time
Format does not meet the requirement of network transmission, needs to call with preset format conversion plug-in unit at this time to transmission data progress format
Conversion.Under normal circumstances, which is for carrying out Data Format Transform, and the plug-in unit can be applied
In different clients, there is universal applicability, to further increase the rate of data format conversion.And if described
Transmission data are preset format, but then directly transmit this and transmit data to server, while returning and detecting whether to generate number
It is requested according to transmission.
In one embodiment, which can be the HTML5 in client exploitation, and HTML5 is super
Text mark up language can assign the better meaning of webpage and structure, also provide unprecedented data and open with using access
Interface is put, and there is more effectively connection working efficiency.
For example, having developed HTML5 standard in wechat if client is wechat, the file in HTML5 standard can be called
It reads interface API (FileReader API) and carries out corresponding format conversion.The file, which reads interface API, can be used to
Some files read in memory, and read the data in file.
Further, as shown in figure 3, preset format conversion plug-in unit includes that file reads interface API, the file is read
Interface API is provided with corresponding configuration file, and the step S104 may include step S301~S304.
Step S301, the file for obtaining preset format conversion plug-in unit read the configuration file of interface API.
In the present embodiment, if the format of the transmission data is not preset format, it is thus necessary to determine that file reads interface API
Configuration file.The configuration file includes the configuration information that this document reads interface API, which may include multiple
Preset format transfer function.
For example, when preset format conversion plug-in unit is the text in the HTML5 standard that client is developed, in HTML5 standard
It may include that will transmit data to be converted to binary format data in the configuration file of part reading interface API
ToBinaryString () function and toDataURL () function that transmission data are converted to Base64 encoded data stream.
Specifically, toBinaryString () function can return to the character string of the binary representation of int variable, it is main
Process may include two steps:
A. it calculates for indicating two/eight/length of hexadecimal character array.Wherein, the meter of character array length
Calculate a high position continuous 0 's of the computer binary representation of int variable by numberOfLeadingZeros method at last
Quantity, and then obtain length of the non-zero position of highest to lowest order, that is, the digit for needing to indicate.For example integer 18 is in computer
In binary storage be 0000,0000,0000,0000,0000,0000,0001,0010, then the part for needing to indicate is just
It is 1,0010,28 of front are 0, do not have to indicate.
B. it is filled character array, obtain the character string that required system indicates and returned using formatUnsignedInt method
It returns.
In addition, the binary format of picture can be switched to base64 coded format by toDataURL () function.Wherein
Base64 is a kind of representation method that binary data is indicated based on 64 printable characters, specifically by binary data stream
Every one group of three characters is grouped (24bit), and after grouping, 24bit is divided into 4 6bit data, to add before every 6bit data
The 0 of upper 2 bit will obtain 4 8bit data (becoming 4byte), and the value of each byte is between the range of 0-63.
Then preset conversion table is pressed, these values are converted into corresponding printable character.
Step S302 parses the configuration file to obtain preset multiple format transfer functions, and each format converts letter
Number includes an identification information corresponding with its convertible Format Type.
In the present embodiment, each format transfer function can only read and convert matched data format, therefore
In order to ensure the validity and rate of conversion, each format transfer function includes a corresponding identification information, the identification information
For going and matching its corresponding transmission data.
In one embodiment, the identification information can be Format Type, and being also possible to others can ensure to be converted
The information that Data Matching is formatted to corresponding format transfer function, in the present embodiment and without limitation.
Step S303, the identification information that the determining attribute information with the transmission data matches.
In the present embodiment, the attribute information storage address of the transmission data, the generation bases such as time and Format Type
This information.So when can according to it is described transmission data attribute information be determined to the mark to match with the attribute information
Information is known, consequently facilitating calling includes the format transfer function of the identification information according to identification information.
Step S304 calls format transfer function corresponding with identified identification information to carry out to the transmission data
Format conversion.
In the present embodiment, it is determined that after format transfer function corresponding with identification information, the format conversion can be called
Function, to realize that the format to the transmission data is converted.
To sum up, the embodiment of the present invention can flexible rapidly change data format, consequently facilitating the quick transmission of data and
Operation, greatly increases the time of interface network data interaction, quickly responds user's operation, when saving user network waiting
Between.
Referring to Fig. 4, Fig. 4 be another embodiment of the present invention provides a kind of conversion method of data format exemplary flow
Figure.This method may operate in smart phone (such as Android phone, IOS mobile phone), tablet computer, laptop and
In the terminals such as smart machine.As shown in figure 4, the step of this method includes step S401a~S404.Wherein and in above-described embodiment
The similar step of step S101-S104 relevant explanation and be described in detail that details are not described herein, the following detailed description of being this
The step of increased in embodiment.
Step S401a installs corresponding format according to preset rules and converts if receiving format conversion plug-in unit mount request
Plug-in unit.
In the present embodiment, when user has submitted the mount request of format conversion plug-in unit, it can parse the mount request,
To install corresponding format conversion plug-in unit.
Further, as shown in figure 5, the step S401a may include step S501~S503.
Step S501, download formats convert the corresponding preset installation kit of plug-in unit.
Step S502 unpacks to obtain unpacked data the installation kit according to the type of the installation kit.
Step S503 installs the format according to the unpacked data and converts plug-in unit.
In the present embodiment, after the corresponding installation kit of download formats conversion plug-in unit, by the type for determining the installation kit
Unpacking processing is carried out to installation kit, and then the plug-in unit to be installed is installed, it can be achieved that format converts the fast of plug-in unit according to unpacked data
Speed installation, improves the using experience degree of user.
Step S401 detects whether that generation data transfer request, the data transfer request include for sending service to
The transmission data of device.
Step S402 determines the format of the transmission data if detecting generation data transfer request.
Step S403 judges whether the format of the transmission data is preset format.
Step S404 calls preset format conversion plug-in unit to institute if the format of the transmission data is not preset format
Transmission data are stated to format.
Those having ordinary skill in the art is understood that realize all or part of the process in above-described embodiment method, is that can lead to
Computer program is crossed to instruct relevant hardware and complete, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) etc..
Referring to Fig. 6, a kind of corresponding above-mentioned conversion method of data format, the embodiment of the present invention also propose a kind of data format
Conversion equipment, the device 100 include: detection unit 101, determination unit 102, judging unit 103 and converting unit 104.
The detection unit 101, for detecting whether generating data transfer request, the data transfer request includes being used for
Send the transmission data of server to.
In the present embodiment, when being interacted between client and server, between the two can by be connected to the network come
Realize that corresponding data transmission is needed when initiating the dependent instruction of access request or response server with user orientation server
To the corresponding data of server transport, a data transfer request is then generated at this time, which includes needing to send to
To the data of server, i.e. transmission data.Therefore in order to transmission data can be rapidly transferred to server, need in client
Corresponding format conversion processing just is carried out to transmission data when end.So when need detect whether generation data transmission ask
It asks.
The determination unit 102, for determining the format of the transmission data.
In the present embodiment, in order to ensure transmission data can be transmitted rapidly, data transmission is generated when detecting
Request is, it is thus necessary to determine that the format of the transmission data in the data transfer request.Wherein transmission data can be number, picture or
Person's file etc., format can be the formats such as binary system, picture, TXT, PDF or WORD.
Further, as shown in fig. 7, the determination unit 102 includes information extraction unit 201 and information resolution unit
202。
The information extraction unit 201, for extracting the attribute information of the transmission data, the attribute information is at least wrapped
Include format information.
In the present embodiment, each transmission data are associated with the attribute information of itself, which may include this
It transmits the storage address of data, generate the essential informations such as time and Format Type.
The information resolution unit 202 obtains the format of the transmission data for parsing the format information.
In the present embodiment, by the format information of parsing transmission data, the lattice of the transmission data can be got
Formula, and as the basis of format conversion, clearly to transmit whether data need to format.
The judging unit 103, for judging whether the format of the transmission data is preset format.
In the present embodiment, the preset format is that preset client and server is handed over by network connection
The format of the data of transmission is supported when mutually.In order to determine that the format of transmission data can adapt to want in network transmission process
It asks, needs to judge whether the format of the transmission data is preset format.If the format of the transmission data is not preset format,
Then show that the transmission data are converted, and be specifically converted into which kind of format, needs according to the pre-set demand of user
Judged and is converted, specific visible step 104.If the format of the transmission data is preset format, then it represents that the transmission number
According to can rapidly be transmitted in network transmission process, i.e., do not need to convert transmission data at this time, and transmit number
According to directly server can be given to quickly through network transmission.
In one embodiment, during network data transmission, the data of binary format and Base64 coded format
The speed of transmission is fast, and performance is stablized, therefore the preset format can be binary format and Base64 coded format, certainly also
It can be other formats that can quickly transmit, such as TXT format, in embodiment provided by the present application and without limitation.
The converting unit 104 calls preset format to turn if the format for the transmission data is not preset format
Part is inserted to format the transmission data.
In the present embodiment, if the format of the transmission data is not preset format, show transmission data at this time
Format does not meet the requirement of network transmission, needs to call with preset format conversion plug-in unit at this time to transmission data progress format
Conversion.Under normal circumstances, which is for carrying out Data Format Transform, and the plug-in unit can be applied
In different clients, there is universal applicability, to further increase the rate of data format conversion.And if described
Transmission data are preset format, but then directly transmit this and transmit data to server, while returning and detecting whether to generate number
It is requested according to transmission.
In one embodiment, which can be the HTML5 in client exploitation, and HTML5 is super
Text mark up language can assign the better meaning of webpage and structure, also provide unprecedented data and open with using access
Interface is put, and there is more effectively connection working efficiency.
For example, having developed HTML5 standard in wechat if client is wechat, the file in HTML5 standard can be called
It reads interface API (FileReader API) and carries out corresponding format conversion.The file, which reads interface API, can be used to
Some files read in memory, and read the data in file.
Further, as shown in figure 8, the preset format conversion plug-in unit includes that file reads interface API, the file
It reads interface API and is provided with corresponding configuration file, the converting unit 104 may include file obtaining unit 301, file solution
Analyse unit 302, information determination unit 303 and function calling cell 304.
The file obtaining unit 301, the file for obtaining preset format conversion plug-in unit read the configuration of interface API
File.
In the present embodiment, if the format of the transmission data is not preset format, it is thus necessary to determine that file reads interface API
Configuration file.The configuration file includes the configuration information that this document reads interface API, which may include multiple
Preset format transfer function.
For example, when preset format conversion plug-in unit is the text in the HTML5 standard that client is developed, in HTML5 standard
It may include that will transmit data to be converted to binary format data in the configuration file of part reading interface API
ToBinaryString () function and toDataURL () function that transmission data are converted to Base64 encoded data stream.
Specifically, toBinaryString () function can return to the character string of the binary representation of int variable, it is main
Process may include two steps:
A. it calculates for indicating two/eight/length of hexadecimal character array.Wherein, the meter of character array length
Calculate a high position continuous 0 's of the computer binary representation of int variable by numberOfLeadingZeros method at last
Quantity, and then obtain length of the non-zero position of highest to lowest order, that is, the digit for needing to indicate.For example integer 18 is in computer
In binary storage be 0000,0000,0000,0000,0000,0000,0001,0010, then the part for needing to indicate is just
It is 1,0010,28 of front are 0, do not have to indicate.
B. it is filled character array, obtain the character string that required system indicates and returned using formatUnsignedInt method
It returns.
In addition, the binary format of picture can be switched to base64 coded format by toDataURL () function.Wherein
Base64 is a kind of representation method that binary data is indicated based on 64 printable characters, specifically by binary data stream
Every one group of three characters is grouped (24bit), and after grouping, 24bit is divided into 4 6bit data, to add before every 6bit data
The 0 of upper 2 bit will obtain 4 8bit data (becoming 4byte), and the value of each byte is between the range of 0-63.
Then preset conversion table is pressed, these values are converted into corresponding printable character.
The document analysis unit 302 obtains preset multiple format transfer functions for parsing the configuration file,
Each format transfer function includes an identification information corresponding with its convertible Format Type.
In the present embodiment, each format transfer function can only read and convert matched data format, therefore
In order to ensure the validity and rate of conversion, each format transfer function includes a corresponding identification information, the identification information
For going and matching its corresponding transmission data.
In one embodiment, the identification information can be Format Type, and being also possible to others can ensure to be converted
The information that Data Matching is formatted to corresponding format transfer function, in the present embodiment and without limitation.
The information determination unit 303, the identification information to match for the determining attribute information with the transmission data.
In the present embodiment, the attribute information storage address of the transmission data, the generation bases such as time and Format Type
This information.So when can according to it is described transmission data attribute information be determined to the mark to match with the attribute information
Information is known, consequently facilitating calling includes the format transfer function of the identification information according to identification information.
The function calling cell 304, for calling format transfer function corresponding with identified identification information with right
The transmission data format.
In the present embodiment, it is determined that after format transfer function corresponding with identification information, the format conversion can be called
Function, to realize that the format to the transmission data is converted.
Referring to Fig. 9, a kind of corresponding above-mentioned conversion method of data format, another embodiment of the present invention also propose a kind of data
Format conversion apparatus, the device 400 include: plug-in unit installation unit 401a, detection unit 401, determination unit 402, judging unit
403 and converting unit 404.
The plug-in unit installation unit 401a, if being pacified for receiving format conversion plug-in unit mount request according to preset rules
Fill corresponding format conversion plug-in unit.
In the present embodiment, when user has submitted the mount request of format conversion plug-in unit, it can parse the mount request,
To install corresponding format conversion plug-in unit.
Further, as shown in Figure 10, the plug-in unit installation unit 401a may include download unit 501, unwrapper unit
502 and installation unit 503.
The download unit 501, for the corresponding preset installation kit of download formats conversion plug-in unit.
The unwrapper unit 502, for being unpacked the installation kit to be solved according to the type of the installation kit
Bag data.
The installation unit 503 converts plug-in unit for installing the format according to the unpacked data.
In the present embodiment, after the corresponding installation kit of download formats conversion plug-in unit, by the type for determining the installation kit
Unpacking processing is carried out to installation kit, and then the plug-in unit to be installed is installed, it can be achieved that format converts the fast of plug-in unit according to unpacked data
Speed installation, improves the using experience degree of user.
The detection unit 401, for detecting whether generating data transfer request, the data transfer request includes being used for
Send the transmission data of server to.
The determination unit 402, if determining the format of the transmission data for detecting generation data transfer request.
The judging unit 403, for judging whether the format of the transmission data is preset format.
The converting unit 404 calls preset format to turn if the format for the transmission data is not preset format
Part is inserted to format the transmission data.
It should be noted that it is apparent to those skilled in the art that, above-mentioned data format converting device
100 and each unit specific implementation process, can with reference to the corresponding description in preceding method embodiment, for convenience of description and
Succinctly, details are not described herein.
As seen from the above, in hardware realization, the above detection unit 101, determination unit 102, judging unit 103 and turn
Changing unit 104 etc. can be embedded in the form of hardware or independently of in the device of Data Format Transform, can also be in a software form
It is stored in the memory of data format converting device, executes the corresponding operation of above each unit so that processor calls.It should
Processor can be central processing unit (CPU), microprocessor, single-chip microcontroller etc..
Above-mentioned data format converting device can be implemented as a kind of form of computer program, and computer program can be such as
It is run in computer equipment shown in Figure 11.
Figure 11 is a kind of structure composition schematic diagram of computer equipment of the present invention.The equipment can be terminal, wherein terminal
Smart phone, tablet computer, laptop, desktop computer, personal digital assistant and wearable device etc. be can be with logical
The electronic equipment of telecommunication function.
Referring to Fig.1 1, which includes the processor 602 connected by system bus 601, memory, interior
Memory 604 and network interface 605, wherein memory may include non-volatile memory medium 603 and built-in storage 604.
The non-volatile memory medium 603 can storage program area 6031 and computer program 6032, the computer program
6032 include program instruction, which is performed, and processor 602 may make to execute a kind of conversion method of data format.
The processor 602 supports the operation of entire computer equipment 600 for providing calculating and control ability.
The built-in storage 604 provides environment for the operation of the computer program 6032 in non-volatile memory medium 603, should
When computer program 6032 is executed by processor 602, processor 602 may make to execute a kind of conversion method of data format.
The network interface 605 is used to carry out network communication with other equipment.It will be understood by those skilled in the art that in Figure 11
The structure shown, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme
The restriction of computer equipment 600 thereon, specific computer equipment 600 may include more more or fewer than as shown in the figure
Component perhaps combines certain components or with different component layouts.
Wherein, the processor 602 is for running computer program 6032 stored in memory, to realize following step
It is rapid: to detect whether to generate data transfer request, the data transfer request includes the transmission data for sending server to;If
It detects generation data transfer request, determines the format of the transmission data;Whether the format for judging the transmission data is pre-
If format;If the format of the transmission data is not preset format, call preset format conversion plug-in unit to the transmission data
It formats.
In one embodiment, processor 602, which is also realized, realizes following steps: asking if receiving format conversion plug-in unit installation
It asks, corresponding format is installed according to preset rules and converts plug-in unit.
In one embodiment, processor 602 is described according to the corresponding format conversion plug-in unit step of preset rules installation in realization
When rapid, be implemented as follows step: download formats convert the corresponding preset installation kit of plug-in unit;According to the type of the installation kit
The installation kit is unpacked to obtain unpacked data;The format is installed according to the unpacked data and converts plug-in unit.
In one embodiment, processor 602 is when realizing the format step of the determination transmission data, specific implementation
Following steps: extracting the attribute information of the transmission data, and the attribute information includes at least format information;Parse the format
Information is to obtain the format for transmitting data.
In one embodiment, the preset format conversion plug-in unit includes that file reads interface API, and the file reading connects
Mouth API is provided with corresponding configuration file, and processor 602 is realizing the preset format conversion plug-in unit of the calling to the transmission
After data format step, be implemented as follows step: the file reading for obtaining preset format conversion plug-in unit connects
The configuration file of mouth API;The configuration file is parsed to obtain preset multiple format transfer functions, each format transfer function
It include an identification information corresponding with its convertible Format Type;The determining attribute information with the transmission data matches
Identification information;Format transfer function corresponding with identified identification information is called to turn to carry out format to the transmission data
It changes.
It should be appreciated that in the embodiment of the present application, processor 602 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or
Person's processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process,
It is that relevant hardware can be instructed to complete by computer program.The computer program includes program instruction, computer journey
Sequence can be stored in a storage medium, which is computer readable storage medium.The program instruction is by the department of computer science
At least one processor in system executes, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium.This is deposited
Storage media is stored with computer program, and wherein computer program includes program instruction.The program instruction makes when being executed by processor
Processor executes following steps: detecting whether to generate data transfer request, the data transfer request includes for sending clothes to
The transmission data of business device;If detecting generation data transfer request, the format of the transmission data is determined;Judge the transmission number
According to format whether be preset format;If the format of the transmission data is not preset format, preset format conversion plug is called
Part formats the transmission data.
In one embodiment, if the processor, which also executes the following steps:, receives format conversion plug-in unit mount request, root
Corresponding format is installed according to preset rules and converts plug-in unit.
In one embodiment, the processor is realized described according to preset rules installation phase in the instruction of execution described program
When the format conversion plug-in unit step answered, be implemented as follows step: download formats convert the corresponding preset installation kit of plug-in unit;Root
The installation kit is unpacked to obtain unpacked data according to the type of the installation kit;According to unpacked data installation
Format converts plug-in unit.
In one embodiment, the processor realizes the determination transmission data executing described program instruction
When format step, it is implemented as follows step: extracting the attribute information of the transmission data, the attribute information includes at least
Format information;The format information is parsed to obtain the format of the transmission data.
In one embodiment, the preset format conversion plug-in unit includes that file reads interface API, and the file reading connects
Mouth API is provided with corresponding configuration file, and the processor realizes the preset lattice of calling executing described program instruction
When formula conversion plug-in unit formats step to the transmission data, following steps are also realized: obtaining preset format conversion
The file of plug-in unit reads the configuration file of interface API;The configuration file is parsed to obtain preset multiple format transfer functions,
Each format transfer function includes an identification information corresponding with its convertible Format Type;The determining and transmission data
The identification information that matches of attribute information;Call format transfer function corresponding with identified identification information to the biography
Transmission of data formats.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk
Or the various computer readable storage mediums that can store program code such as CD.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware
With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This
A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially
Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not
It is considered as beyond the scope of this invention.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only
Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied
Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair
Unit in bright embodiment device can be combined, divided and deleted according to actual needs.In addition, in each implementation of the present invention
Each functional unit in example can integrate in one processing unit, is also possible to each unit and physically exists alone, can also be with
It is that two or more units are integrated in one unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product,
It can store in one storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing skill
The all or part of part or the technical solution that art contributes can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, terminal or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace
It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right
It is required that protection scope subject to.
Claims (10)
1. a kind of conversion method of data format, which is characterized in that the described method includes:
It detects whether to generate data transfer request, the data transfer request includes the transmission data for sending server to;
If detecting generation data transfer request, the format of the transmission data is determined;
Whether the format for judging the transmission data is preset format;
If the format of the transmission data is not preset format, preset format conversion plug-in unit is called to carry out the transmission data
Format conversion.
2. the method as described in claim 1, which is characterized in that it is described detect whether generate data transfer request before, comprising:
If receiving format conversion plug-in unit mount request, corresponding format is installed according to preset rules and converts plug-in unit.
3. method according to claim 2, which is characterized in that described to install corresponding format conversion plug according to preset rules
Part, comprising:
Download formats convert the corresponding preset installation kit of plug-in unit;
The installation kit is unpacked to obtain unpacked data according to the type of the installation kit;
The format is installed according to the unpacked data and converts plug-in unit.
4. the method as described in claim 1, which is characterized in that the format of the determination transmission data, comprising:
The attribute information of the transmission data is extracted, the attribute information includes at least format information;
The format information is parsed to obtain the format of the transmission data.
5. the method as described in claim 1, which is characterized in that the preset format conversion plug-in unit includes that file reads interface
API, the file reads interface API and is provided with corresponding configuration file, described to call preset format conversion plug-in unit to described
Transmission data format, comprising:
The file for obtaining preset format conversion plug-in unit reads the configuration file of interface API;
The configuration file is parsed to obtain preset multiple format transfer functions, each format transfer function includes one and its
The convertible corresponding identification information of Format Type;
The identification information that the determining attribute information with the transmission data matches;
Call format transfer function corresponding with identified identification information to format to the transmission data.
6. a kind of data format converting device, which is characterized in that described device includes:
Detection unit, for detecting whether generating data transfer request, the data transfer request includes for sending service to
The transmission data of device;
Determination unit, for determining the format of the transmission data;
Judging unit, for judging whether the format of the transmission data is preset format;
Converting unit calls preset format conversion plug-in unit to institute if the format for the transmission data is not preset format
Transmission data are stated to format.
7. device as claimed in claim 6, which is characterized in that the determination unit, comprising:
Information extraction unit, for extracting the attribute information of the transmission data, the attribute information includes at least format information;
Information resolution unit obtains the format of the transmission data for parsing the format information.
8. device as claimed in claim 6, which is characterized in that the preset format conversion plug-in unit includes that file reads interface
API, the file read interface API and are provided with corresponding configuration file, described device further include:
File obtaining unit obtains preset format conversion plug-in unit if the format for the transmission data is not preset format
File read interface API configuration file;
Document analysis unit, preset multiple format transfer functions are obtained for parsing the configuration file, and each format turns
Exchange the letters number includes an identification information corresponding with its convertible Format Type;
Information determination unit, the identification information to match for the determining attribute information with the transmission data;
Function calling cell, for calling format transfer function corresponding with identified identification information to the transmission data
It formats.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory and processor, on the memory
It is stored with computer program, the processor is realized as described in any one of claim 1-5 when executing the computer program
Method.
10. a kind of computer readable storage medium, which is characterized in that the storage medium is stored with computer program, the meter
Calculation machine program makes the processor execute the life insurance side of reporting a case to the security authorities according to any one of claims 1 to 5 when being executed by processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811124285.4A CN109413154A (en) | 2018-09-26 | 2018-09-26 | Conversion method of data format, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811124285.4A CN109413154A (en) | 2018-09-26 | 2018-09-26 | Conversion method of data format, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109413154A true CN109413154A (en) | 2019-03-01 |
Family
ID=65466223
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811124285.4A Withdrawn CN109413154A (en) | 2018-09-26 | 2018-09-26 | Conversion method of data format, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109413154A (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110069755A (en) * | 2019-03-21 | 2019-07-30 | 平安普惠企业管理有限公司 | Method, apparatus, computer equipment and the storage medium that data are sent |
CN110222282A (en) * | 2019-04-17 | 2019-09-10 | 深圳壹账通智能科技有限公司 | Data processing method, device, server and storage medium |
CN110287041A (en) * | 2019-06-28 | 2019-09-27 | 苏州亿歌网络科技有限公司 | A kind of business datum sending method, device, equipment and storage medium |
CN110515894A (en) * | 2019-08-02 | 2019-11-29 | 济南浪潮数据技术有限公司 | A kind of conversion method of data format, device, equipment and readable storage medium storing program for executing |
CN110995843A (en) * | 2019-12-06 | 2020-04-10 | 北京明略软件系统有限公司 | Data transmission method and device, electronic equipment and readable storage medium |
CN111079101A (en) * | 2019-12-20 | 2020-04-28 | 支付宝(杭州)信息技术有限公司 | Method and device for obtaining evidence of infringement based on block chain, electronic equipment and storage medium |
CN111212097A (en) * | 2020-04-21 | 2020-05-29 | 炬星科技(深圳)有限公司 | Method, device and storage medium for robot to access server |
CN111241172A (en) * | 2019-12-26 | 2020-06-05 | 北京航天测控技术有限公司 | Data storage method, device, terminal and computer readable medium |
CN111368512A (en) * | 2020-03-04 | 2020-07-03 | 北京软通智慧城市科技有限公司 | Service data conversion method, device, equipment and storage medium |
CN111782713A (en) * | 2019-09-24 | 2020-10-16 | 北京京东尚科信息技术有限公司 | Method and apparatus for converting data |
CN111831713A (en) * | 2019-04-18 | 2020-10-27 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
CN113094176A (en) * | 2021-04-16 | 2021-07-09 | 南京艾莫尔人工智能研究院有限公司 | Hybrid cloud management method and device |
CN115495082A (en) * | 2022-11-21 | 2022-12-20 | 北京天元特通科技有限公司 | TLV format data automatic conversion method and related equipment |
-
2018
- 2018-09-26 CN CN201811124285.4A patent/CN109413154A/en not_active Withdrawn
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110069755A (en) * | 2019-03-21 | 2019-07-30 | 平安普惠企业管理有限公司 | Method, apparatus, computer equipment and the storage medium that data are sent |
CN110222282A (en) * | 2019-04-17 | 2019-09-10 | 深圳壹账通智能科技有限公司 | Data processing method, device, server and storage medium |
CN111831713A (en) * | 2019-04-18 | 2020-10-27 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
CN110287041B (en) * | 2019-06-28 | 2020-06-05 | 苏州亿歌网络科技有限公司 | Service data sending method, device, equipment and storage medium |
CN110287041A (en) * | 2019-06-28 | 2019-09-27 | 苏州亿歌网络科技有限公司 | A kind of business datum sending method, device, equipment and storage medium |
CN110515894A (en) * | 2019-08-02 | 2019-11-29 | 济南浪潮数据技术有限公司 | A kind of conversion method of data format, device, equipment and readable storage medium storing program for executing |
CN110515894B (en) * | 2019-08-02 | 2023-07-21 | 济南浪潮数据技术有限公司 | Data format conversion method, device, equipment and readable storage medium |
CN111782713A (en) * | 2019-09-24 | 2020-10-16 | 北京京东尚科信息技术有限公司 | Method and apparatus for converting data |
CN110995843A (en) * | 2019-12-06 | 2020-04-10 | 北京明略软件系统有限公司 | Data transmission method and device, electronic equipment and readable storage medium |
CN111079101A (en) * | 2019-12-20 | 2020-04-28 | 支付宝(杭州)信息技术有限公司 | Method and device for obtaining evidence of infringement based on block chain, electronic equipment and storage medium |
CN111241172A (en) * | 2019-12-26 | 2020-06-05 | 北京航天测控技术有限公司 | Data storage method, device, terminal and computer readable medium |
CN111241172B (en) * | 2019-12-26 | 2023-05-26 | 北京航天测控技术有限公司 | Data storage method, device, terminal and computer readable medium |
CN111368512A (en) * | 2020-03-04 | 2020-07-03 | 北京软通智慧城市科技有限公司 | Service data conversion method, device, equipment and storage medium |
CN111368512B (en) * | 2020-03-04 | 2023-08-22 | 北京软通智慧科技有限公司 | Service data conversion method, device, equipment and storage medium |
CN111212097A (en) * | 2020-04-21 | 2020-05-29 | 炬星科技(深圳)有限公司 | Method, device and storage medium for robot to access server |
CN113094176A (en) * | 2021-04-16 | 2021-07-09 | 南京艾莫尔人工智能研究院有限公司 | Hybrid cloud management method and device |
CN115495082A (en) * | 2022-11-21 | 2022-12-20 | 北京天元特通科技有限公司 | TLV format data automatic conversion method and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109413154A (en) | Conversion method of data format, device, computer equipment and storage medium | |
CN110912803B (en) | IM message transmission method and terminal | |
CN106657149B (en) | Communication protocol conversion method and device | |
JP5753946B2 (en) | Method and system for downloading font files | |
CN109756536A (en) | A kind of method, apparatus and system of data transmission | |
US8584146B1 (en) | Communications driver management | |
CN105376225A (en) | Software-as-a-service method and device | |
CN110838071A (en) | Policy data processing method and device and server | |
CN109617647A (en) | Message forwarding method, device, computer equipment and computer readable storage medium | |
US11212658B2 (en) | Method for providing near filed communication device information for user and system therefor | |
CN110351715A (en) | AT command processing method, terminal adapter and computer readable storage medium | |
CN109255246A (en) | Interface parameters encryption method, device, computer equipment and storage medium | |
CN115242896A (en) | Dynamic message analysis method and device, electronic equipment and computer readable storage medium | |
CN104978325B (en) | A kind of web page processing method, device and user terminal | |
US20110153695A1 (en) | Method for making usb storage of file system and remote connection, and system thereof | |
CN113162977B (en) | Information processing method and device, equipment and storage medium | |
CN107465538B (en) | Internet of things terminal migration method and gateway | |
CN111770558A (en) | Slice access method, terminal and network equipment | |
CN111324645A (en) | Data processing method and device for block chain | |
CN108600255A (en) | Mock service management method, device, computer equipment and storage medium | |
CN114244912B (en) | Data transmission method, device, computer equipment and storage medium | |
CN113608889A (en) | Message data processing method, device, equipment and storage medium | |
CN108259500A (en) | A kind of RPC means of communication, system and device | |
CN108234216B (en) | Method and device for downloading data message | |
EP1528467A2 (en) | Method and system for delivery of data objects to components in a distributed system, using multiple data type representations |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190301 |
|
WW01 | Invention patent application withdrawn after publication |