CN108243022B - Network service message transmission method, device, terminal and server - Google Patents

Network service message transmission method, device, terminal and server Download PDF

Info

Publication number
CN108243022B
CN108243022B CN201611204229.2A CN201611204229A CN108243022B CN 108243022 B CN108243022 B CN 108243022B CN 201611204229 A CN201611204229 A CN 201611204229A CN 108243022 B CN108243022 B CN 108243022B
Authority
CN
China
Prior art keywords
compression
preset
network service
message
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611204229.2A
Other languages
Chinese (zh)
Other versions
CN108243022A (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.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201611204229.2A priority Critical patent/CN108243022B/en
Publication of CN108243022A publication Critical patent/CN108243022A/en
Application granted granted Critical
Publication of CN108243022B publication Critical patent/CN108243022B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0273Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using web services for network management, e.g. simple object access protocol [SOAP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a network service message transmission method, a network service message transmission device, a terminal and a server, and relates to the technical field of communication. The network service message transmission method comprises the following steps: selecting a target compression strategy from preset compression strategies, wherein the target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency reaches a preset requirement under the current network bandwidth through the target compression strategy; generating a compressed network service request message according to the target compression strategy; and sending the network service request message to a target server. The scheme of the invention solves the problem that the time consumption of the whole service call is prolonged because the fixed compressed message is influenced by the unstable change of the network bandwidth in the transmission in the traditional network service message compression transmission mode.

Description

Network service message transmission method, device, terminal and server
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a terminal, and a server for transmitting a network service message.
Background
An SOA (service-oriented architecture) plays an important role in the fields of system integration, software multiplexing, and interaction of business applications as a general service architecture. And the network Web service is the core for realizing the architecture as the soul of the SOA. Web services enable access to heterogeneous, distributed applications by sending and receiving standardized Simple Object Access Protocol (SOAP) messages over a network. A SOAP message is essentially an extensible markup language XML document that contains standardized formatting tags and piggybacked data content. When the network bandwidth is sufficient, the calling time of the service is almost equal to the execution time of the service at the remote server, and the data transmission time can be ignored. But as network bandwidth decreases, the transmission time of service messages is becoming a greater and greater proportion. Under the condition of limited bandwidth, the influence of the redundancy of the SOAP message on network communication is obvious, and characters describing the structure in the message account for a large proportion. Especially when the message carries a large data load, the transmission of the data takes a lot of time, and even causes the message to be blocked so that the service execution fails.
At present, optimization of service call time under limited bandwidth is mainly realized by compressing SOAP messages, and researchers at home and abroad do much work aiming at the optimization. One of the most straightforward compression methods is to treat the SOAP message as a text, and compress and decompress the SOAP message at the sender and receiver using text compression techniques GZip or bzip2 to reduce the size of the message.
However, although this method can reduce the volume of the message to some extent and reduce the transmission time of the message data, with the unstable change of the network bandwidth, the transmission of the message compressed in a fixed manner is affected, and the time consumption of the whole service invocation is prolonged.
Disclosure of Invention
The invention aims to provide a network service message transmission method, a network service message transmission device, a terminal and a server, aiming at different network bandwidths and realizing the reduction of the time consumption of the whole service calling.
In order to achieve the above object, an embodiment of the present invention provides a network service message transmission method, applied to a terminal, including:
selecting a first target compression strategy from preset compression strategies, wherein the first target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency reaches a preset requirement under the current network bandwidth through the first target compression strategy;
generating a compressed network service request message according to the first target compression strategy;
and sending the network service request message to a target server.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the step of selecting a first target compression strategy from the preset compression strategies comprises:
predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and selecting a preset compression strategy with data transmission efficiency meeting preset requirements as a first target compression strategy.
The step of predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth comprises the following steps:
according to the formula
Figure GDA0002336418000000021
Obtaining the data transmission time T of the preset data quantity M without compression1
According to the formula
Figure GDA0002336418000000022
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service request message comprises a network service analysis request message and a network service calling request message;
generating a compressed network service request message according to the first target compression policy comprises:
when the terminal needs to initiate Web Service Description Language (WSDL) analysis, acquiring a WSDL address, compressing the WSDL address according to the first target compression strategy, and packaging the WSDL address into a web service analysis request message;
and when the terminal receives a network service analysis response message sent by a target server, acquiring basic parameters required by calling a service from a WSDL document in the network service analysis response message, compressing the assigned basic parameter information according to the first target compression strategy, and packaging the basic parameter information into a network service calling request message.
The step of acquiring basic parameters required for invoking the service from the WSDL document in the web service analysis response message comprises the following steps:
analyzing the WSDL document to obtain information content under a label corresponding to the basic parameter to obtain the basic parameter; wherein,
the types of the basic parameters comprise: WSDL address, initial value of input parameter, type of input parameter, interface name, type of return value and namespace.
Wherein the structure of the web service parsing request message and the web service invoking request message at least comprises: message type, compression identification and message body; the message body of the web service analysis request message is the WSDL address compressed according to the first target compression strategy, and the message body of the web service call request message is basic parameter information compressed according to the first target compression strategy.
Wherein, the network service message transmission method further comprises:
after receiving a network service analysis response message fed back by the target server according to the network service analysis request message, correspondingly decompressing based on a second target compression strategy of the target server to obtain a WSDL document;
after receiving a network service calling response message fed back by the target server according to the network service calling request message, determining a return type; if the return type is simple, correspondingly decompressing based on a second target compression strategy of the target server to obtain return result data; and if the return type is complex, performing data restoration after the second target compression strategy based on the target server is correspondingly decompressed to obtain return result data.
In order to achieve the above object, an embodiment of the present invention further provides a network service message transmission method, applied to a server, including:
selecting a second target compression strategy from preset compression strategies, wherein the second target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency reaches a preset requirement under the current network bandwidth through the second target compression strategy;
after receiving a network service request message sent by a terminal, generating a compressed network service response message according to the second target compression strategy;
and sending the network service response message to the terminal.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the step of selecting a second target compression strategy from the preset compression strategies comprises:
predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a second target compression strategy.
The step of predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth comprises the following steps:
according to the formula
Figure GDA0002336418000000041
Obtaining the data transmission time T of the preset data quantity M without compression1
According to the formula
Figure GDA0002336418000000042
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service response message comprises a network service analysis response message and a network service calling response message;
after receiving a network service request message sent by a terminal, generating a compressed network service response message according to the second target compression strategy, wherein the step comprises the following steps:
after receiving a web service analysis request message sent by a terminal, downloading a WSDL document based on a WSDL address in the web service analysis request message, compressing the WSDL document according to the second target compression strategy, and packaging the compressed WSDL document into a web service analysis response message;
and after receiving a network service calling request message sent by the terminal, acquiring effective information from service calling result data, compressing the effective information according to the second target compression strategy, and packaging the effective information into a network service calling response message.
The step of obtaining effective information from the service calling result data comprises the following steps:
extracting the label type and the label data in the service calling result data;
and carrying out statistical classification on the label data belonging to the same label type to obtain effective information, wherein the effective information comprises non-repeated label types.
Wherein the structure of the web service parsing response message at least comprises: message type, compression identification and message body; the structure of the network service invocation response message at least comprises the following steps: message type, compression identification, return type and message body;
and the message body of the network service analysis response message is the WSDL document processed according to the second target compression strategy, and the message body of the network service call response message is effective information processed according to the second target compression strategy.
Wherein, the network service message transmission method further comprises:
after receiving a network service analysis request message sent by the terminal, correspondingly decompressing based on a first target compression strategy of the terminal, and downloading a WSDL document according to a decompressed WSDL address;
and after receiving the network service calling request message sent by the terminal, correspondingly decompressing based on the first target compression strategy of the terminal, calling the network service according to the decompressed basic parameter information, and generating service calling result data.
In order to achieve the above object, an embodiment of the present invention further provides a network service message transmission apparatus, which is applied to a terminal, and includes:
the device comprises a first selection module, a second selection module and a third selection module, wherein the first selection module is used for selecting a first target compression strategy from preset compression strategies, the first target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency meets a preset requirement under the current network bandwidth through the first target compression strategy;
a first generation module, configured to generate a compressed network service request message according to the first target compression policy;
and the first sending module is used for sending the network service request message to a target server.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the first selection module comprises:
the first processing submodule is used for predicting the transmission time of data compressed by the data with the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and the first selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a target compression strategy.
Wherein the first processing sub-module comprises:
a first processing unit for processing the data according to a formula
Figure GDA0002336418000000061
Obtaining the data transmission time T of the preset data quantity M without compression1
A second processing unit for processing the data according toFormula (II)
Figure GDA0002336418000000062
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service request message comprises a network service analysis request message and a network service calling request message;
the first generation module comprises:
the third processing submodule is used for acquiring a WSDL address when the terminal needs to initiate WSDL analysis of the web service description language, compressing the WSDL address according to the first target compression strategy and packaging the WSDL address into a web service analysis request message;
and the fourth processing submodule is used for acquiring basic parameters required by calling the service from a WSDL document in the network service analysis response message when the terminal receives the network service analysis response message sent by the target server, compressing the assigned basic parameter information according to the first target compression strategy and packaging the basic parameter information into the network service calling request message.
Wherein the fourth processing submodule includes:
the analysis unit is used for analyzing the WSDL document to obtain information content under a label corresponding to the basic parameter to obtain the basic parameter; wherein,
the types of the basic parameters comprise: WSDL address, initial value of input parameter, type of input parameter, interface name, type of return value and namespace.
Wherein the structure of the web service parsing request message and the web service invoking request message at least comprises: message type, compression identification and message body; the message body of the web service analysis request message is the WSDL address compressed according to the first target compression strategy, and the message body of the web service call request message is basic parameter information compressed according to the first target compression strategy.
Wherein, the network service message transmission device further comprises:
the first processing module is used for correspondingly decompressing based on a second target compression strategy of the target server after receiving a network service analysis response message fed back by the target server according to the network service analysis request message to obtain a WSDL document;
the second processing module is used for determining a return type after receiving a network service calling response message fed back by the target server according to the network service calling request message; if the return type is simple, correspondingly decompressing based on a second target compression strategy of the target server to obtain return result data; and if the return type is complex, performing data restoration after the second target compression strategy based on the target server is correspondingly decompressed to obtain return result data.
In order to achieve the above object, an embodiment of the present invention further provides a terminal, including the network service message transmission apparatus applied to the terminal as described above.
In order to achieve the above object, an embodiment of the present invention further provides a network service message transmission apparatus, applied to a server, including:
the second selection module is used for selecting a second target compression strategy from preset compression strategies, wherein the second target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency meets the preset requirement under the current network bandwidth through the second target compression strategy;
the second generation module is used for generating a compressed network service response message according to the second target compression strategy after receiving the network service request message sent by the terminal;
and the second sending module is used for sending the network service response message to the terminal.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the second selection module comprises:
the second processing submodule is used for predicting the transmission time of the data of the preset data volume, which is compressed under the condition of no compression and a preset compression algorithm, based on the preset compression strategy and the current network bandwidth;
and the second selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a target compression strategy.
Wherein the second processing sub-module comprises:
a third processing unit for processing the data according to the formula
Figure GDA0002336418000000071
Obtaining the data transmission time T of the preset data quantity M without compression1
A fourth processing unit for processing according to the formula
Figure GDA0002336418000000072
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service response message comprises a network service analysis response message and a network service calling response message;
the second generation module comprises:
a fifth processing sub-module, configured to, after receiving a web service parsing request message sent by a terminal, download a WSDL document based on a WSDL address in the web service parsing request message, compress the WSDL document according to the second target compression policy, and package the WSDL document into a web service parsing response message;
and the sixth processing submodule is used for acquiring effective information from service calling result data after receiving a network service calling request message sent by the terminal, compressing the effective information according to the second target compression strategy and packaging the compressed effective information into a network service calling response message.
Wherein the sixth processing sub-module comprises:
the extracting unit is used for extracting the label type and the label data in the service calling result data;
and the classification unit is used for carrying out statistical classification on the label data belonging to the same label type to obtain effective information, wherein the effective information comprises non-repeated label types.
Wherein the structure of the web service parsing response message at least comprises: message type, compression identification and message body; the structure of the network service invocation response message at least comprises the following steps: message type, compression identification, return type and message body;
and the message body of the network service analysis response message is the WSDL document processed according to the second target compression strategy, and the message body of the network service call response message is effective information processed according to the second target compression strategy.
Wherein, the network service message transmission device further comprises:
the third processing module is used for correspondingly decompressing based on the first target compression strategy of the terminal after receiving the network service analysis request message sent by the terminal, and downloading the WSDL document according to the decompressed WSDL address;
and the fourth processing module is used for correspondingly decompressing based on the first target compression strategy of the terminal after receiving the network service calling request message sent by the terminal, calling the network service according to the decompressed basic parameter information and generating service calling result data.
In order to achieve the above object, an embodiment of the present invention further provides a server, including the network service message transmission apparatus applied to the server as described above.
The technical scheme of the invention has the following beneficial effects:
in the network service message transmission method of the embodiment of the invention, the terminal selects a preset compression strategy which accords with the preset corresponding relation with the current network bandwidth from preset compression strategies set in advance and can enable the data transmission efficiency to reach the preset requirement under the current network bandwidth as a first target compression strategy, then generates a compressed network service request message according to the first target compression strategy, and finally sends the network service request message to a target server. Therefore, the network service request message can be adaptively selected according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
Drawings
Fig. 1 is a flowchart illustrating a network service message transmission method according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a network service message transmission method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a network service message transmission method according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a network service message transmission method according to a second embodiment of the present invention;
FIG. 5 is a diagram illustrating a four-layer structure of a system applying the network service message transmission method according to the second embodiment;
FIG. 6 is a diagram illustrating a service invocation framework according to the present invention;
FIG. 7 is a diagram illustrating a network service message transmission apparatus according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of a network service message transmission apparatus according to a fifth embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
The invention provides a network service message transmission method, a device, a terminal and a server, aiming at the problem that the time consumption of the whole service call is prolonged because the fixed compressed message is influenced by the unstable change of the network bandwidth in the transmission in the existing network service message compression transmission mode, and the time consumption of the whole service call is reduced by selecting an adaptive compression strategy according to different network bandwidths.
As shown in fig. 1, a network service message transmission method according to a first embodiment of the present invention is applied to a terminal, and includes:
step 101, selecting a first target compression strategy from preset compression strategies, wherein the first target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the data transmission efficiency reaches a preset requirement under the current network bandwidth through the first target compression strategy;
102, generating a compressed network service request message according to the first target compression strategy;
step 103, sending the network service request message to a target server.
Through the above steps, the terminal to which the network service message transmission method according to the first embodiment of the present invention is applied selects, as a first target compression policy, a preset compression policy that conforms to a preset correspondence with a current network bandwidth and enables data transmission efficiency to meet a preset requirement under the current network bandwidth, then generates a compressed network service request message according to the first target compression policy, and finally sends the network service request message to a target server. Therefore, the network service request message can be adaptively selected according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
The data transmission efficiency refers to the time (compression, data transmission and decompression time) from the sending end to the receiving end of the original data with a unit data volume, and the preset requirement usually sets "the data transmission efficiency is maximum in all preset compression strategies", and of course, the preset requirement may also be a fixed value corresponding to the current network bandwidth, which is determined according to a test.
In this embodiment, the preset compression policy includes compression without compression and a preset compression algorithm; step 101 comprises:
predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and selecting a preset compression strategy with data transmission efficiency meeting preset requirements as a first target compression strategy.
Therefore, the preset compression strategy with the data transmission efficiency meeting the preset requirement can be selected as the first target compression strategy by predicting the data transmission time (compression, compressed data transmission and decompression time) of the data with the preset data volume under the compression without compression and the preset compression algorithm.
In the embodiment of the invention, in order to ensure that the service load data at the two ends of the terminal (client) and the server (service agent) are completely the same during operation, a lossless compression mode is often selected to compress the load data, so that the decompressed data is the same as the data before compression. However, while the data amount is reduced by using the compression algorithm for compression operation, the calculation load is increased when the terminal and the server operate, and the data transmission time T is calculated by the formula
Figure GDA0002336418000000111
Wherein,
Figure GDA0002336418000000112
and
Figure GDA0002336418000000113
the time for data compression and decompression respectively for the terminal,
Figure GDA0002336418000000114
and
Figure GDA0002336418000000115
for the time when the server is running for data compression and decompression operations,
Figure GDA0002336418000000116
being request messagesThe amount of data to be transmitted,
Figure GDA0002336418000000117
in order to respond to the amount of data of the message,
Figure GDA0002336418000000118
in order to request a compression rate for the message,
Figure GDA0002336418000000119
is the compression rate of the response message. Therefore, in order to reduce the total time of service invocation to the maximum extent, the selection of the compression strategy needs to be comprehensively weighted according to the factors of both data compression ratio and time consumption of compression and decompression.
Specifically, the step of predicting the data transmission time of the data of the preset data volume compressed under the non-compression and preset compression algorithms based on the preset compression strategy and the current network bandwidth includes:
according to the formula
Figure GDA00023364180000001110
Obtaining the data transmission time T of the preset data quantity M without compression1
According to the formula
Figure GDA00023364180000001111
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
Therefore, after the data with the preset data amount M is obtained through the formulas (2) and (3) of the steps, the data transmission time T in the network with the bandwidth B is obtained under the condition that the data is not compressed and the data is compressed by the preset compression algorithm1And T2In order to select the first target compression strategy afterwards.
It should be appreciated that the first target compression strategy proposed in this embodiment may be selectedFor the implementation of bandwidth Adaptive Compression Algorithm (ACA), the most reasonable compression mode is selected according to the network bandwidth. The preset compression strategy comprises compression without compression and a preset compression algorithm, and preferably, the preset compression algorithm is ZLib compression and Snappy compression. The Zlib is an open-source cross-platform lossless compression library, and the compression and decompression of data are realized through an LZ77 algorithm and a Huffman tree. The advantage of Zlib over other compression algorithms is that there is a very high compression rate for large files, with the disadvantages of slow and time consuming compression. Snappy is a compression library of Google open source and is a compression algorithm which is highly recommended and widely applied to its own business. It can provide high speed compression speed and reasonable compression rate, although not as good as Zlib in compression rate, but has sufficient advantage over Zlib in compression real-time. Compression ratio lambda of ZLib compressionzCompression speed
Figure GDA0002336418000000121
Decompression speed
Figure GDA0002336418000000122
Substituting into formula (3), obtaining the data transmission time T of ZLib compressionz(ii) a Compression ratio lambda for Snappy compressionsCompression speed
Figure GDA0002336418000000123
Decompression speed
Figure GDA0002336418000000124
Substituting into formula (3) to obtain Snappy compressed data transmission time TsAnd λz>λs>1。
After the data transmission time of the preset compression strategy is obtained, a first target compression strategy is selected according to whether the data transmission efficiency (the data transmission time of the preset data volume) reaches the preset requirement or not. E.g. selecting the least time consuming compression strategy among the preset compression strategies, i.e.
S0Argmin (t (S)), S ∈ { no compression, Snappy compression, Zlib compression } (4)
Wherein T (S) is data transmission time processed by different compression strategies, S0Is the selected optimal strategy.
Of course, in conjunction with equations (2) and (3), by comparing the data transmission efficiency of the three predetermined compression strategies, it is also possible to define the respective compression strategy selection basis over the bandwidth:
Figure GDA0002336418000000125
wherein, B1And B2The values of (A) are:
Figure GDA0002336418000000126
Figure GDA0002336418000000127
therefore, when the bandwidth is sufficient, the transmission pressure of the data is low, the data is preferably not compressed, and the time consumed by compression and decompression of the terminal and the server can be saved. For medium bandwidth, where the data transmission pressure is moderate, Snappy compression with medium compression rate but better compression rate is selected. For the case of low bandwidth, the transmission pressure of data is the maximum, and the primary purpose is to reduce the data volume, so the Zlib with the maximum compression ratio is adopted. The ACA ensures the optimal selection of compression strategies under different bandwidths, so that the total time required by data from a transmitting end to a receiving end is minimum, and the method is more scientific and effective compared with a single compression method.
However, although the purpose of shortening the time consumption of the whole service invocation can be achieved by selecting the adaptive compression strategy according to different network bandwidths, the network service request message sent by the terminal to the server is strictly organized according to a standard format under the existing SOA architecture, and the basic architecture of the message is a document in an XML format. Therefore, the web service invocation request message contains two parts of data, one part is formatted tag data describing the message architecture, such as SOAP message, which is not related to specific service: body and soap: an Envelope tag, and a parameter tag related to a specific service; the other part is the data payload, such as initial values of parameters in the request message. Therefore, on the basis of the above embodiment, in the embodiment of the present invention, the body of the network service request message is further simplified on the basis of enabling service invocation, unnecessary data for service invocation is filtered, the volume of the request message is reduced, and then the compression is performed according to the first target compression policy to generate the network service request message to be sent to the server.
More specifically, in the method for transmitting a network service message according to the first embodiment of the present invention, the network service request message includes a network service parsing request message and a network service invoking request message;
as shown in fig. 2, step 102 includes:
step 1021, when the terminal needs to initiate Web Service Description Language (WSDL) analysis, acquiring a WSDL address, compressing the WSDL address according to the first target compression strategy, and packaging the WSDL address into a web service analysis request message;
and 1022, when the terminal receives a web service parsing response message sent by a target server, acquiring basic parameters required for invoking a service from a WSDL document in the web service parsing response message, compressing the assigned basic parameter information according to the first target compression policy, and encapsulating the compressed basic parameter information into a web service invocation request message.
Here, in consideration of the difference in the contents of necessary information in the different types of network service request messages, the processing is differentiated according to two types of network service resolution request messages and network service invocation request messages. The terminal needs to initiate WSDL analysis to realize Web service calling, and then obtains a WSDL address, compresses the WSDL address according to a first target compression strategy, and packages the WSDL address into a network service analysis request message, so that the network service analysis request message is sent to a target server. When the terminal receives the web service analysis response message, the terminal can acquire basic parameters (parameters usrd (useful Services Request data)) required by calling the service from the WSDL document in the web service analysis response message, only assigns the basic parameters, finally compresses the assigned basic parameter information according to a first target compression strategy, encapsulates the basic parameter information into the web service calling Request message, and sends the web service calling Request message to the target server. Compared with the existing network service request message, the simplified network service request message has smaller volume, so that the aim of shortening the time consumption of the whole service call can be further fulfilled.
After the network service request message is sent to the target server, the network service response message fed back by the target server is received, and the network service response messages of different types are received corresponding to the network service request messages of different types. Certainly, in order to shorten the time consumption of the whole service invocation, the target server may also select the second target compression policy from the preset compression policies, and generate a compressed network service response message for feedback. The second target compression policy and the first target compression policy are adaptively selected according to respective current network bandwidths, and may be the same or different. Thus, the target server receives the web service analysis request message, downloads and obtains a WSDL document based on the WSDL address in the web service analysis request message, compresses the WSDL document according to a second target compression strategy, and generates a web service analysis response message to be fed back to the terminal; and after the target server receives the network service calling request message and carries out Web service calling based on the network service calling request message, the target server compresses effective information in service calling result data according to a second target compression strategy to generate a network service calling response message and feeds the network service calling response message back to the terminal. Considering that the type of the service call result data may be simple or complex, in order to reduce the volume of the transmission message, the simple service call result data may be directly compressed according to the second target compression policy as effective information to generate a response message for transmission, but for the complex service call result data, unnecessary information needs to be removed, and only the extracted effective information is compressed according to the second target compression policy to generate a response message for transmission.
Thus, on the basis of the above embodiment, the method of the first embodiment of the present invention further includes:
after receiving a network service analysis response message fed back by the target server according to the network service analysis request message, correspondingly decompressing based on a second target compression strategy of the target server to obtain a WSDL document;
after receiving a network service calling response message fed back by the target server according to the network service calling request message, determining a return type; if the return type is simple, correspondingly decompressing based on a second target compression strategy of the target server to obtain return result data; and if the return type is complex, performing data restoration after the second target compression strategy based on the target server is correspondingly decompressed to obtain return result data.
Therefore, the terminal carries out corresponding processing according to the received network service response messages of different types so as to complete the whole calling process. Of course, similar to the above steps, after receiving the network service request message, the server may also decompress the information in the network service request message correspondingly based on the first target compression policy of the terminal.
It should also be appreciated that for the SOAP service described in WSDL in the first embodiment of the present invention, the Web service can be invoked only by providing the required initial parameters to the application interface of Axis2, without the user assembling SOAP message by himself. Preferably, in step 1022, the step of obtaining basic parameters required for invoking the service from the WSDL document in the web service parsing response message includes:
analyzing the WSDL document to obtain information content under a label corresponding to the basic parameter to obtain the basic parameter; wherein,
the types of the basic parameters comprise: WSDL address, initial value of input parameter, type of input parameter, interface name, type of return value and namespace.
Based on the USRD type required by the Axis client to call the Web service: the WSDL address, the initial value of the input parameter, the type of the input parameter, the interface name, the type and the name space of the return value are analyzed, the information content under the label corresponding to the basic parameter is obtained by analyzing the WSDL document, the basic parameter is obtained, and the basic parameter information for calling the Web service is obtained after assignment.
In practical application, after acquiring a WSDL document returned by a server, a terminal needs to obtain corresponding original information of basic parameters in the WSDL document based on an information type WSDL address, an input parameter initial value, an input parameter type, an interface name, a type of a return value and a name space required by an Axis client to call a service, so as to facilitate subsequent assignment. Wherein, several key information except the WSDL address and the initial parameter value can be directly obtained from WSDL, which is an XML-based document and can use XML API of dom4j to analyze the information under the corresponding tag. The initial value of the parameter is set by the user or the output value of the previous service in the service combination flow is used. Since the content and structure of WSDL documents for each Web service are different, common information needs to be mined from different service description documents. At the beginning of each WSDL document, a set of namespace variables is defined, where targetNamespace is the namespace needed to invoke the service. The name information of all interface functions contained in the service is in the < WSDL: PortType > tag of the WSDL document, and the name of the interface function can be obtained according to the name attribute in the < WSDL: operation >. The node < wsdl: types > includes therein parameter information of the interface function and type information of the return value. All XML tags contained in < wsdl: types > are tags with prefixes, such as < xs: schema >, < xs: element >, and < xs: sequence >. In the IP address location service, the prefix name is xs. The prefix names in the WSDL of different services are different, so when the information of child nodes in < WSDL: types > is analyzed, the prefix name of the service needs to be acquired first. The prefix name required here is a suffix to the name of the namespace variable with attribute value http:// www.w3.org/2001/XMLSchema in < WSDL: definitions >, which is present and identical in all WSDLs, found by comparing WSDLs of a large number of services. In the present service, the prefix namespace name with the attribute value http:// www.w.3. org/2001/XMLSchema is xmlns: xs, and the suffix xs is the prefix of the tag within < wsdl: types >. The parameter information of the interface function is nested in the < xs: schema > tag, wherein the name attribute value of the < xs: schema > tag is in one < xs: element > of the interface name. And then, under the < xs: sequence > tag at the layer below the < xs: element >, one or more parallel xs: element tags are arranged, and the form parameter tags represent form parameter information of the function, and form parameter types are type attributes in the < xs: element > tag. The type of the return value is < xs: element > in which the content of the tag name attribute in < xs: schema > is "function name Response". The value of the type attribute of the < xs: element > tag in < xs: sequence > is the type of the return value, the name attribute is the name of the return value, and if so, the attribute is empty and the default value is return. Through the above operations, USRD information as in table 1 below was obtained.
TABLE 1
Figure GDA0002336418000000161
After the initial values of the parameters are filled in the USRD information, the terminal can call the Web service through the Axis2 client. Specifically, the element contents of the USRD are concatenated through pre-negotiated segmentation symbols, compressed, and then sent to the service agent runtime. After receiving the message during the operation of the service agent, the USRD is analyzed, the value of each element is taken out according to the segmentation symbol, and the value is filled into the Axis2 client to finish the calling of the service.
In the above, in order to reduce the amount of data transmitted in the network, the message structure of the simplified network service request message is changed compared with the existing request message. At this time, in the first embodiment of the present invention, when the proxy between the terminal and the server operates, data transmission needs to be organized and encapsulated according to a new transmission protocol. The message tasks between the terminal and the service agent are totally divided into four protocols, namely, WPP (WSDL space Protocol, WSDL parsing Protocol), WRP (WSDL Response Protocol, WSDL parsing Response Protocol), SIP (Services Invocation Protocol), and SRP (Services Response Protocol). WPP is a message structure of a network service resolution request message, WRP is a message structure of a network service resolution response message, SIP is a message structure of a network service invocation request message, and SRP is a message structure of a network service invocation response message.
In this specific embodiment, the structures of the network service parsing request message and the network service invoking request message at least include: message type, compression identification and message body; and the message body of the network service analysis request message is a WSDL address compressed according to the target compression strategy, and the message body of the network service call request message is basic parameter information compressed according to the target compression strategy.
Often, the web service parses the request message in order to obtain the complete WSDL document content for WSDL parsing. In the implementation of the invention, the server downloads the complete WSDL document content to the local through the HTTP protocol by sending the web service parsing request message to the server agent. Therefore, the message body of the web service parsing request message is the WSDL address compressed according to the target compression policy, as shown in the WPP message structure of table 2 below:
TABLE 2
Figure GDA0002336418000000171
In the WPP message structure, the first part of the message is a message type, the four protocols are respectively distinguished by unique integer values, and the message type of the WPP is 0x 01. The second part is compression flag, which includes, for example, 0x00 as no compression, 0x01 as Snappy compression, and 0x02 as Zlib compression, taking the above-mentioned preset compression policy as an example. The third part is a message body and is a WSDL address compressed by adopting the corresponding compression strategy of the second part.
After the service agent receives the request message sent by the terminal and determines the request message as the WPP request message according to the message type, the WSDL address can be extracted according to the WPP format (when the compression identifier indicates the adopted compression algorithm, decompression of the corresponding compression algorithm is also required). And then, downloading complete WSDL document content based on the WSDL address, and after compression, analyzing a response message through a network service of a WRP message structure and feeding back the response message to the terminal. The message body of the WRP message structure web service parsing response message is a WSDL document compressed by the second part corresponding to the compression policy, as shown in table 3 below:
TABLE 3
Figure GDA0002336418000000181
The WRP message structure has the same parts as the WPP message structure, but the WRP message type is 0x02, and the message body is a WSDL document compressed by using the compression policy corresponding to the second part.
After receiving the response message sent by the service agent and determining the message type as the WRP response message, the terminal can extract the WSDL document according to the WRP format (when the compression identifier indicates the adopted compression algorithm, decompression of the corresponding compression algorithm is also required). And then analyzing basic parameters required by calling Web service based on the WSDL document, assigning values, compressing, and feeding back to the service agent through a network service calling request message of an SIP message structure. The message body of the network service invocation request message of the SIP message structure is the USRD with initial parameter values compressed by the corresponding compression policy of the second part, as shown in table 4 below:
TABLE 4
Figure GDA0002336418000000182
Each part of the SIP message structure is also the same as the WPP message structure, however, the message type of the SIP is 0x03, and the message body is USRD with initial parameter values compressed by adopting the corresponding compression strategy of the second part, i.e. uncompressed USRD with initial parameter values or a compressed character set compressed by a preset compression algorithm.
When the service agent receives the network service call request message of the SIP message structure sent by the terminal during operation, the information is decompressed by a corresponding compression algorithm according to the compression identifier, and the USRD required by the call service is extracted. The Web service is then invoked by means passed to the Axis2 client. Once the call is completed, the service call result data is compressed and then the network service call response message according to the SRP message structure is fed back to the terminal.
But since the service invocation result data may be simple data or complex data (the repeated tag information and formatting information are the main reasons for redundancy of the message body). Therefore, in order to further shorten the time consumption of the whole service call, different service call result data are processed differently: and taking simple service calling result data as an operation result of the terminal to be sent, or taking data obtained by simplifying complex service calling result data (such as converting the complex service calling result data into a JSON format and then carrying out HPack compression) as the operation result of the terminal to be sent. Therefore, the network service invocation response message of the SRP message structure is added with a return type portion, as shown in table 5 below:
TABLE 5
Figure GDA0002336418000000191
In the SRP message structure, the first part is the message type, and the message type of the SRP is 0x 04. The second part is a compressed identifier, similar to the three message structures described above. The third part is a return type, 0x00 is a simple data type, and 0x01 is an XML complex data type. The fourth part is a message body and is an operation result compressed by adopting the corresponding compression strategy of the second part, namely, an operation result without compression or a compressed character set compressed by a preset compression algorithm.
After receiving the network service call response message of the SRP message structure, the terminal firstly decompresses the data compression algorithm to obtain the response message data in the decompressed message main body. Then, the message is restored according to the return type: for simple type return values, directly extracting; and the return value of the XML complex data type is converted into a JSON format in the server and then is compressed by HPack, and at the moment, the terminal needs to decompress by HPack first and then is restored into the XML type.
To sum up, in the terminal to which the network service message transmission method according to the first embodiment of the present invention is applied, a preset compression policy that conforms to a preset corresponding relationship with the current network bandwidth and enables data transmission efficiency to meet a preset requirement under the current network bandwidth is selected as a first target compression policy, and then a compressed network service request message is generated according to the first target compression policy, and finally, the network service request message is sent to a target server. Therefore, the appropriate compression strategy can be adaptively selected for the network service request message according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call. When the network service request message is generated, simplification is performed on the basis of realizing service calling, unnecessary data for service calling is filtered, the volume of the request message is reduced, and the time consumption of the whole service calling is further shortened. And because extra space consumption is not required to be increased, the method has good universality on functions and structures of the service.
As is well known, in Web service invocation, after a terminal sends a network service request message, a server needs to feed back a corresponding network service response message according to the network service request message, so that, in order to preferably achieve reduction of time consumption of the whole service invocation, data compression needs to be performed on a server side while data compression is performed on a terminal side, as shown in fig. 3, a second embodiment of the present invention further provides a network service message transmission method, which is applied to a server, and includes:
step 301, selecting a second target compression policy from preset compression policies, wherein the second target compression policy and the current network bandwidth conform to a preset corresponding relationship, and the data transmission efficiency reaches a preset requirement under the current network bandwidth through the second target compression policy;
step 302, after receiving a network service request message sent by a terminal, generating a compressed network service response message according to the second target compression strategy;
step 303, sending the network service response message to the terminal.
Through the step 301-. Therefore, the appropriate compression strategy can be adaptively selected to respond to the network service message according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
The data transmission efficiency refers to the time (compression, data transmission and decompression time) from the sending end to the receiving end of the original data with a unit data volume, and the preset requirement usually sets "the data transmission efficiency is maximum in all preset compression strategies", and of course, the preset requirement may also be a fixed value corresponding to the current network bandwidth, which is determined according to a test.
As in the first embodiment, the preset compression strategy includes no compression and compression of a preset compression algorithm;
step 301 comprises:
predicting the data transmission time of the data with the preset data volume compressed under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a second target compression strategy.
Similarly, by predicting the data transmission time (compression, compressed data transmission and decompression time) of the data with the preset data volume under the compression without compression and by the preset compression algorithm, the preset compression strategy with the data transmission efficiency meeting the preset requirement is selected as the second target compression strategy.
Specifically, the step of predicting the data transmission time of the data of the preset data volume compressed under the non-compression and preset compression algorithms based on the preset compression strategy and the current network bandwidth includes:
according to the formula
Figure GDA0002336418000000211
Obtaining the data transmission time T of the preset data quantity M without compression1
According to the formula
Figure GDA0002336418000000212
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
Since the second embodiment and the first embodiment of the present invention both adaptively select a suitable compression policy according to the current network bandwidth to complete the Web service invocation, the implementation manner of selecting the second target compression policy may be the same as that of selecting the first target compression policy, and is not described herein again.
In addition, similar to the first embodiment, although the purpose of shortening the time consumption of the whole service invocation can be achieved through data compression, in consideration of the existing SOA architecture, the network service response message fed back to the terminal by the server is the same as the network service request message, and there may be redundancy of the message body, and the repeated tag information and formatting information are the main reasons for the redundancy of the message body. Therefore, in the second embodiment, the main body of the network service response message is also reduced on the basis of realizing the service invocation, unnecessary data for the service invocation is filtered, the volume of the response message is reduced, and then the compression is performed according to the second target compression policy to generate the network service response message to be sent to the terminal.
Further specifically, in the method for transmitting a network service message according to the second embodiment of the present invention, the network service response message includes a network service parsing response message and a network service invoking response message;
as shown in fig. 4, step 302 includes:
step 3021, after receiving a web service parsing request message sent by a terminal, downloading a WSDL document based on a WSDL address in the web service parsing request message, compressing the WSDL document according to the second target compression policy, and encapsulating the WSDL document into a web service parsing response message;
step 3022, after receiving the network service invocation request message sent by the terminal, obtaining effective information from the service invocation result data, compressing the effective information according to the second target compression policy, and encapsulating the compressed effective information into a network service invocation response message.
Here, the response message is processed differently according to two types of the web service parsing response message and the web service invoking response message according to the content of the necessary information of the different types of web service response messages. Because the terminal sends the web service analysis request message carrying the WSDL address to the server to initiate the WSDL analysis to realize the service invocation, the server can download and obtain a WSDL document based on the WSDL address in the web service analysis request message after receiving the web service analysis request message, and package the document into the web service invocation response message sending terminal after locking according to the second target compression strategy, so that the terminal performs the WSDL analysis. The terminal sends a network service calling request message carrying basic parameter information required by calling the service to the server through WSDL analysis, and then the server can call the service based on the basic parameter information in the network service calling request message. Considering that the type of return of the service invocation result data may be simple or complex, in order to reduce the volume of the transmission message, it is necessary to obtain valid information from the service invocation result data and then compress the valid information. For simple service calling result data, the simple service calling result data can be directly compressed according to the second target compression strategy as effective information to generate response messages for sending, but for complex service calling result data, unnecessary information needs to be removed, and only the extracted effective information is compressed according to the second target compression strategy to generate response messages for sending.
Since the network service request message sent by the terminal is compressed by the first target compression policy selected by the method of the first embodiment, the method of the second embodiment of the present invention further includes:
after receiving a network service analysis request message sent by the terminal, correspondingly decompressing based on a first target compression strategy of the terminal, and downloading a WSDL document according to a decompressed WSDL address;
and after receiving the network service calling request message sent by the terminal, correspondingly decompressing based on the first target compression strategy of the terminal, calling the network service according to the decompressed basic parameter information, and generating service calling result data.
After receiving the network service request message, the server correspondingly decompresses based on the first target compression strategy to obtain a WSDL address or basic parameter information, thereby performing subsequent processing to complete the whole calling process.
In the method according to the second embodiment of the present invention, the types of the service invocation result data (return value of the service) are known to include a simple data type and a complex data type, and therefore, in order to obtain valid information in a complex, the step of obtaining valid information from the service invocation result data includes:
extracting the label type and the label data in the service calling result data;
and carrying out statistical classification on the label data belonging to the same label type to obtain effective information, wherein the effective information comprises non-repeated label types.
The effective information is obtained by extracting the label type and the label data in the service calling result data, classifying the label data according to the label type, and classifying the label data belonging to the same label type together. The effective information comprises the non-repeated label type, so that the repetition of the label type is avoided, and the volume of the message is reduced.
Specifically, the simple data type is a built-in data type of a programming language, such as a real number, an integer, a character, a boolean type, and the like. In the WSDL, variables are all built-in simple types of XML Schema, and these simple types correspond to types of programming languages, and in practical applications, when Axis2 service call result data is a service of a simple data type, according to the XML Schema type of a return value, a forced type conversion can be performed on the return value by using the corresponding programming language type to obtain a converted return value. The complex data types include: array type, structure type, and structure array type. Since the data set is large, there are many duplicate tags, and it is desirable to reduce the number of duplicate tags. Because the XML format and the JSON format data can be converted into each other, the XML format service response message is firstly converted into the JSON format data with simpler structure. Compared with the XML type, JSON omits half of repeated tags, the end tag of the XML is abandoned in the JSON, and the format is more compact. The JSON format replaces XML and brings great convenience to network transmission.
Taking a service for inquiring the weather of a city as an example, the type of service calling result data obtained by calling the service is a structure array, the weather information of three cities is included, and the weather information of each city includes a city number, a city name and weather information. As follows:
Figure GDA0002336418000000231
Figure GDA0002336418000000241
it can be seen that the formatted tags account for a great proportion of the XML formatted data. And the data converted into JSON format is as follows:
Figure GDA0002336418000000242
Figure GDA0002336418000000251
compared with the original XML format data, the JSON format data has the most direct change that the number of tags is reduced by half, and the end tags in the XML format data are also removed. However, in the JSON format data, the data structure in each object is the same, that is, the keys are the same, the key value is different, redundancy still exists in the same keys, and therefore the number of labels of the keys can be further reduced. The structure array can be regarded as a two-dimensional data table, the name of each key corresponds to the name of a field in the table, and the number of objects in the array corresponds to the number of rows recorded by the data table. Therefore, the JSON format data structure can be simplified according to the organization mode of the data table, namely the name of each key is obtained through the structure of one object and is used as the field name of the table. The value values of all objects in the JSON object array are then placed under the key's field in order. By separating the key and value of the object, the name of the key thus only needs to be recorded once. HPack can be used for JSON key value separation, JSON format data is extracted into a template and a numerical value by HPack, repeated key names are omitted, and the total capacity is reduced by changing the structure of the JSON data. Continuing with the above example, the resulting valid information is as follows:
Figure GDA0002336418000000252
since the key name in the original JSON format data becomes the field name of the two-dimensional table, it can be obviously seen that the data size after key value separation has an obvious effect of simplifying the original XML format data and JSON format data, which is only equivalent to less than one third of the original data. In addition, the processes of HPack compression of JSON format data and conversion of XML into JSON are reversible, so that the effective information can be reversely restored at the receiving end.
In addition, as in the first embodiment, in order to reduce the amount of data transmitted in the network, the message structure of the reduced network service response message is changed compared to the existing request message. Therefore, in the second embodiment of the present invention, when the proxy between the terminal and the server operates, the data transmission also needs to be organized and encapsulated according to the new transmission protocol. The message tasks between the terminal and the service agent are divided into four protocols in total, WPP, WRP, SIP and SRP. WPP is a message structure of a network service resolution request message, WRP is a message structure of a network service resolution response message, SIP is a message structure of a network service invocation request message, and SRP is a message structure of a network service invocation response message.
In this specific embodiment, the structure of the network service parsing response message at least includes: message type, compression identification and message body; the structure of the network service invocation response message at least comprises the following steps: message type, compression identification, return type and message body;
and the message body of the network service analysis response message is the WSDL document processed according to the second target compression strategy, and the message body of the network service call response message is effective information processed according to the second target compression strategy.
However, in the second embodiment of the present invention, the specific message structure and the interaction flow of the network service message between the terminal and the server are the same as those in the first embodiment, and are not described herein again.
In addition, the method of the second embodiment of the present invention can be implemented in one or more servers by using a Java language development service runtime system application. The service publishing user starts the service operation system while deploying the service, and processes the request message under the narrow-band condition. The service agent runtime system, as shown in fig. 5, includes four layers from top to bottom: interface layer, network layer, message layer and service layer. The interface layer is used as a main interface of the service agent runtime system, is developed and realized based on Java Swing, and is responsible for displaying the received request information and the analysis and calling results returned to the client. The network layer handles the TCP network connections between the service agent runtime and the clients, as well as transceiving network data streams. After the service agent runtime is started, the listening state is maintained. When a new request is received, the network layer develops a new thread to process the request and establishes a TCP short connection, and the connection is disconnected after a result is returned, so that the network resource is prevented from being occupied by long-term connection. The message layer is an adapter between the network layer and the service layer and is responsible for analyzing WPP and SIP request messages and encapsulating return values according to WRP and SRP formats. The message layer is also responsible for decompressing the request message and compressing the return data according to an adaptive compression algorithm. The service layer realizes the service analysis and service calling functions when the service agent runs. And the service analysis module extracts the USRD information of the service according to a message filtering algorithm, packages the USRD information into a WRP message through a message layer and returns the WRP message to the client. And the service calling module selects a proper service calling method according to the SIP message analyzed by the message layer, calls the requested service and obtains a service response result.
Taking the example that the client calls the IP address location service, the service agent runtime and the service are deployed on the host with the address of 192.168.1.110, and the runtime port is 8000. The user connects to SARS on host 192.168.1.114. The service agent runtime receives the client request and returns the resolution and invocation results of the IP address location service. The result of the resolution of the service, i.e., USRD, includes 1 interface GetLocationByIP. The USRD is divided among different elements and sub-elements in the elements through specific symbols, and the interface name and the interface parameter type in the analysis result are passed; "split, GetLocationByIP contains a parameter, the parameter type is a string type. And restoring the information of each interface of the service by the client according to the arrangement sequence and the segmentation symbol of the USRD. Services can be invoked by the service broker runtime only by providing initial values for the parameters. The client requests the GetLocationByIP function of the IP address location service from the service broker runtime. The GetLocationByIP interface inputs the parameter IP address with an initial value of "202.118.10.2". The service agent receives a service calling request message in an SIP format during operation, and the data format in Body is a service description document address; an interface name; initial values of the parameters; a namespace ". The service agent runtime extracts the required information for invoking the service, also according to the order and the segmentation notation of the message Body content element, completes the service invocation through the Axis2 client, and returns the encrypted string of the invocation result to the client.
To sum up, in the server to which the network service message transmission method according to the second embodiment of the present invention is applied, a preset compression policy that conforms to the preset corresponding relationship with the current network bandwidth is selected from preset compression policies that are set in advance, and a preset compression policy that enables data transmission efficiency to meet a preset requirement under the current network bandwidth is used as a second target compression policy, and then a compressed network service response message is generated according to the second target compression policy, and finally, the network service response message is sent to the terminal. Therefore, a proper compression strategy can be adaptively selected to respond to the network service message according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call. When the network service response message is generated, simplification is performed on the basis of realizing service calling, unnecessary data for service calling is filtered, the volume of the request message is reduced, and the time consumption of the whole service calling is further shortened. And because extra space consumption is not required to be increased, the method has good universality on functions and structures of the service.
With reference to the first and second embodiments, In the service invocation framework shown In fig. 6, the network service message transmission method used by the terminal and the server may adopt the main steps of an algorithm, such as Step1-Step, where the input of the algorithm is the request input In ═ { W, F, I }, where W is the WSDL address, F is the interface name, and I is the initial value of the parameter; the output is the response structure Out of the service.
Step1, downloading the WSDL document according to the input W by the server;
step2, performing self-adaptive compression on the WSDL document, packaging the WSDL document into a network service analysis response message M1 according to a WRP format, and sending the network service analysis response message M1 to the terminal;
step3, decompressing the M1 by the terminal, extracting the WSDL document, and acquiring the USRD necessary for calling the service based on the WSDL document;
step4, performing self-adaptive compression on the USRD data, packaging the USRD data into a network service call request message M2 according to the SIP, and sending the network service call request message M2 to the server;
step5, decompressing the M2 by the server, extracting the USRD calling service, and obtaining service calling result data;
step6, filtering the service call result data to obtain effective information;
step7, performing self-adaptive compression on the effective information, packaging the effective information into a network service call response message M3 according to the SRP, and sending the network service call response message M3 to the terminal;
step8, the terminal decompresses the M3 to obtain the valid information output Out.
As shown in fig. 7, a third embodiment of the present invention further provides a network service message transmission apparatus, which is applied to a terminal, and includes:
a first selecting module 701, configured to select a first target compression policy from preset compression policies, where the first target compression policy and a current network bandwidth conform to a preset correspondence, and data transmission efficiency meets a preset requirement under the current network bandwidth through the first target compression policy;
a first generating module 702, configured to generate a compressed network service request message according to the first target compression policy;
a first sending module 703, configured to send the network service request message to a target server.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the first selection module comprises:
the first processing submodule is used for predicting the transmission time of data compressed by the data with the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and the first selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a target compression strategy.
Wherein the first processing sub-module comprises:
a first processing unit for processing the data according to a formula
Figure GDA0002336418000000291
Obtaining the data transmission time T of the preset data quantity M without compression1
A second processing unit for processing the data according to the formula
Figure GDA0002336418000000292
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth and lambda is the compression of the preset algorithmRate, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service request message comprises a network service analysis request message and a network service calling request message;
the first generation module comprises:
the third processing submodule is used for acquiring a WSDL address when the terminal needs to initiate WSDL analysis of the web service description language, compressing the WSDL address according to the first target compression strategy and packaging the WSDL address into a web service analysis request message;
and the fourth processing submodule is used for acquiring basic parameters required by calling the service from a WSDL document in the network service analysis response message when the terminal receives the network service analysis response message sent by the target server, compressing the assigned basic parameter information according to the first target compression strategy and packaging the basic parameter information into the network service calling request message.
Wherein the fourth processing submodule includes:
the analysis unit is used for analyzing the WSDL document to obtain information content under a label corresponding to the basic parameter to obtain the basic parameter; wherein,
the types of the basic parameters comprise: WSDL address, initial value of input parameter, type of input parameter, interface name, type of return value and namespace.
Wherein the structure of the web service parsing request message and the web service invoking request message at least comprises: message type, compression identification and message body; the message body of the web service analysis request message is the WSDL address compressed according to the first target compression strategy, and the message body of the web service call request message is basic parameter information compressed according to the first target compression strategy.
Wherein, the network service message transmission device further comprises:
the first processing module is used for correspondingly decompressing based on a second target compression strategy of the target server after receiving a network service analysis response message fed back by the target server according to the network service analysis request message to obtain a WSDL document;
the second processing module is used for determining a return type after receiving a network service calling response message fed back by the target server according to the network service calling request message; if the return type is simple, correspondingly decompressing based on a second target compression strategy of the target server to obtain return result data; and if the return type is complex, performing data restoration after the second target compression strategy based on the target server is correspondingly decompressed to obtain return result data.
The network service message transmission device is applied to a terminal, the terminal selects a preset compression strategy which accords with the preset corresponding relation with the current network bandwidth from preset compression strategies set in advance and enables the data transmission efficiency to reach the preset requirement under the current network bandwidth as a first target compression strategy, then generates a compressed network service request message according to the first target compression strategy, and finally sends the network service request message to a target server. Therefore, the network service request message can be adaptively selected according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
It should be noted that the apparatus is an apparatus to which the network service message transmission method of the first embodiment is applied, and the implementation manner of the embodiment of the network service message transmission method of the first embodiment is applied to the apparatus, and the same technical effect can be achieved.
A fourth embodiment of the present invention provides a terminal including the network service message transmission apparatus as in the third embodiment.
The terminal selects a preset compression strategy which accords with the preset corresponding relation with the current network bandwidth from preset compression strategies set in advance, enables the data transmission efficiency to reach the preset requirement under the current network bandwidth to serve as a first target compression strategy, generates a compressed network service request message according to the first target compression strategy, and finally sends the network service request message to a target server. Therefore, the network service request message can be adaptively selected according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
It should be noted that the terminal is a terminal including the network service message transmission apparatus of the third embodiment, and the implementation manner of the embodiment of the network service message transmission apparatus of the third embodiment is applicable to the terminal, and the same technical effects can be achieved.
As shown in fig. 8, a fifth embodiment of the present invention provides a network service message transmission apparatus, which is applied to a server, and includes:
a second selecting module 801, configured to select a second target compression policy from preset compression policies, where the second target compression policy and a current network bandwidth conform to a preset corresponding relationship, and through the second target compression policy, under the current network bandwidth, data transmission efficiency meets a preset requirement;
a second generating module 802, configured to generate a compressed network service response message according to the second target compression policy after receiving a network service request message sent by a terminal;
a second sending module 803, configured to send the network service response message to the terminal.
Wherein the preset compression strategy comprises compression without compression and a preset compression algorithm;
the second selection module comprises:
the second processing submodule is used for predicting the transmission time of the data of the preset data volume, which is compressed under the condition of no compression and a preset compression algorithm, based on the preset compression strategy and the current network bandwidth;
and the second selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a target compression strategy.
Wherein the second processing sub-module comprises:
a third processing unit for performing a third processing operation,for according to a formula
Figure GDA0002336418000000311
Obtaining the data transmission time T of the preset data quantity M without compression1
A fourth processing unit for processing according to the formula
Figure GDA0002336418000000312
Obtaining the data transmission time T of the preset data volume M when the preset compression algorithm is compressed2(ii) a Wherein,
b is the current network bandwidth, lambda is the compression ratio of the preset algorithm, VcFor presetting the compression speed of the algorithm, VdThe decompression speed of the preset algorithm.
The network service response message comprises a network service analysis response message and a network service calling response message;
the second generation module comprises:
a fifth processing sub-module, configured to, after receiving a web service parsing request message sent by a terminal, download a WSDL document based on a WSDL address in the web service parsing request message, compress the WSDL document according to the second target compression policy, and package the WSDL document into a web service parsing response message;
and the sixth processing submodule is used for acquiring effective information from service calling result data after receiving a network service calling request message sent by the terminal, compressing the effective information according to the second target compression strategy and packaging the compressed effective information into a network service calling response message.
Wherein the sixth processing sub-module comprises:
the extracting unit is used for extracting the label type and the label data in the service calling result data;
and the classification unit is used for carrying out statistical classification on the label data belonging to the same label type to obtain effective information, wherein the effective information comprises non-repeated label types.
Wherein the structure of the web service parsing response message at least comprises: message type, compression identification and message body; the structure of the network service invocation response message at least comprises the following steps: message type, compression identification, return type and message body;
and the message body of the network service analysis response message is the WSDL document processed according to the second target compression strategy, and the message body of the network service call response message is effective information processed according to the second target compression strategy.
Wherein, the network service message transmission device further comprises:
the third processing module is used for correspondingly decompressing based on the first target compression strategy of the terminal after receiving the network service analysis request message sent by the terminal, and downloading the WSDL document according to the decompressed WSDL address;
and the fourth processing module is used for correspondingly decompressing based on the first target compression strategy of the terminal after receiving the network service calling request message sent by the terminal, calling the network service according to the decompressed basic parameter information and generating service calling result data.
In the network service message transmission apparatus of this embodiment, the server selects, from preset compression policies set in advance, a preset compression policy that corresponds to a preset correspondence with a current network bandwidth and enables data transmission efficiency to meet a preset requirement under the current network bandwidth as a second target compression policy, then generates a compressed network service response message according to the second target compression policy, and finally sends the network service response message to the terminal. Therefore, the appropriate compression strategy can be adaptively selected to respond to the network service message according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
It should be noted that the apparatus is an apparatus to which the network service message transmission method of the second embodiment is applied, and the implementation manner of the embodiment of the network service message transmission method of the second embodiment is applied to the apparatus, and the same technical effect can be achieved.
To achieve the above object, a sixth embodiment of the present invention further provides a server including the network service message transmission apparatus applied to the server as described above.
The server of the embodiment selects a preset compression policy which is in accordance with a preset corresponding relationship with the current network bandwidth from preset compression policies set in advance, and enables data transmission efficiency to meet a preset requirement under the current network bandwidth as a second target compression policy, then generates a compressed network service response message according to the second target compression policy, and finally sends the network service response message to the terminal. Therefore, the appropriate compression strategy can be adaptively selected to respond to the network service message according to the current network bandwidth, and the purpose of shortening the time consumption of the whole service call is realized on the basis of completing the Web service call.
The server is a server including the network service message transmission apparatus according to the fifth embodiment, and the implementation manner of the embodiment of the network service message transmission apparatus according to the fifth embodiment is applied to the server, and the same technical effects can be achieved.
It is further noted that the terminals described in this specification include, but are not limited to, smart phones, tablets, etc., and that many of the functional components described are referred to as modules in order to more particularly emphasize their implementation independence.
Many of the functional units described in this specification have been labeled as modules, in order to more particularly emphasize their implementation independence.
In embodiments of the present invention, modules may be implemented in software for execution by various types of processors. An identified module of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions which may, for instance, be constructed as an object, procedure, or function. Nevertheless, the executables of an identified module need not be physically located together, but may comprise disparate instructions stored in different bits which, when joined logically together, comprise the module and achieve the stated purpose for the module.
Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices. Likewise, operational data may be identified within the modules and may be embodied in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations including over different storage devices, and may exist, at least partially, merely as electronic signals on a system or network.
When a module can be implemented by software, considering the level of existing hardware technology, a module implemented by software may build a corresponding hardware circuit to implement a corresponding function, without considering cost, and the hardware circuit may include a conventional Very Large Scale Integration (VLSI) circuit or a gate array and an existing semiconductor such as a logic chip, a transistor, or other discrete components. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices or the like.
The exemplary embodiments described above are described with reference to the drawings, and many different forms and embodiments of the invention may be made without departing from the spirit and teaching of the invention, therefore, the invention is not to be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. In the drawings, the size and relative sizes of elements may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Unless otherwise indicated, a range of values, when stated, includes the upper and lower limits of the range and any subranges therebetween.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (14)

1. A network service message transmission method is applied to a terminal, and is characterized by comprising the following steps:
selecting a first target compression strategy from preset compression strategies, wherein the first target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the method comprises the following steps: predicting the data transmission time of the data of the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth, wherein the data transmission time is compressed according to a formula
Figure FDA0002336417990000011
Obtaining the data transmission time T of the preset data quantity M without compression1According to the formula
Figure FDA0002336417990000012
Lambda is more than 1, and the data transmission time T of the preset data volume M is obtained when the preset compression algorithm is compressed2B is the current network bandwidth, lambda is the compression ratio of the preset compression algorithm, VcFor presetting the compression speed of the compression algorithm, VdThe decompression speed of a preset compression algorithm is set; according to the first target compression strategy, under the current network bandwidth, the data transmission efficiency reaches a preset requirement;
selecting a preset compression strategy with data transmission efficiency meeting preset requirements as a first target compression strategy;
generating a compressed network service request message according to the first target compression strategy, wherein the network service request message comprises a network service analysis request message and a network service calling request message; the method comprises the following steps: when the terminal needs to initiate Web Service Description Language (WSDL) analysis, acquiring a WSDL address, compressing the WSDL address according to the first target compression strategy, and packaging the WSDL address into a web service analysis request message; when the terminal receives a network service analysis response message sent by a target server, basic parameters required by calling a service are obtained from a WSDL document in the network service analysis response message, and the assigned basic parameter information is compressed according to the first target compression strategy and packaged into a network service calling request message;
and sending the network service request message to a target server.
2. The method as claimed in claim 1, wherein the step of obtaining basic parameters required for invoking the service from the WSDL document in the web service parsing response message comprises:
analyzing the WSDL document to obtain information content under a label corresponding to the basic parameter to obtain the basic parameter; wherein the type of the basic parameter comprises: WSDL address, initial value of input parameter, type of input parameter, interface name, type of return value and namespace.
3. The method according to claim 2, wherein the structure of the web service parsing request message and the web service invoking request message at least comprises: message type, compression identification and message body; the message body of the web service analysis request message is the WSDL address compressed according to the first target compression strategy, and the message body of the web service call request message is basic parameter information compressed according to the first target compression strategy.
4. The method of claim 1, further comprising:
after receiving a network service analysis response message fed back by the target server according to the network service analysis request message, correspondingly decompressing based on a second target compression strategy of the target server to obtain a WSDL document;
after receiving a network service calling response message fed back by the target server according to the network service calling request message, determining a return type; if the return type is simple, correspondingly decompressing based on a second target compression strategy of the target server to obtain return result data; and if the return type is complex, performing data restoration after the second target compression strategy based on the target server is correspondingly decompressed to obtain return result data.
5. A network service message transmission method is applied to a server and is characterized by comprising the following steps:
selecting a second target compression strategy from preset compression strategies, wherein the second target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the method comprises the following steps: predicting the data transmission time of the data of the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth, wherein the data transmission time is compressed according to a formula
Figure FDA0002336417990000021
Obtaining the data transmission time T of the preset data quantity M without compression1(ii) a According to the formula
Figure FDA0002336417990000022
Lambda is more than 1, and the data transmission time T of the preset data volume M is obtained when the preset compression algorithm is compressed2B is the current network bandwidth, lambda is the compression ratio of the preset compression algorithm, VcFor presetting the compression speed of the compression algorithm, VdThe decompression speed of a preset compression algorithm is set; according to the second target compression strategy, under the current network bandwidth, the data transmission efficiency reaches the preset requirement;
selecting a preset compression strategy with data transmission efficiency meeting preset requirements as a second target compression strategy;
after receiving a network service request message sent by a terminal, generating a compressed network service response message according to the second target compression strategy, wherein the network service response message comprises a network service analysis response message and a network service calling response message; the method comprises the following steps: after receiving a web service analysis request message sent by a terminal, downloading a Web Service Description Language (WSDL) based on a WSDL address in the web service analysis request message to obtain a WSDL document, compressing the WSDL document according to the second target compression strategy, and packaging the WSDL document into a web service analysis response message; after receiving a network service calling request message sent by a terminal, obtaining effective information from service calling result data, compressing the effective information according to the second target compression strategy, and packaging the effective information into a network service calling response message;
and sending the network service response message to the terminal.
6. The method of claim 5, wherein the step of obtaining valid information from the service invocation result data comprises:
extracting the label type and the label data in the service calling result data;
and carrying out statistical classification on the label data belonging to the same label type to obtain effective information, wherein the effective information comprises non-repeated label types.
7. The method according to claim 6, wherein the structure of the web service parsing response message at least comprises: message type, compression identification and message body; the structure of the network service invocation response message at least comprises the following steps: message type, compression identification, return type and message body;
and the message body of the network service analysis response message is the WSDL document processed according to the second target compression strategy, and the message body of the network service call response message is effective information processed according to the second target compression strategy.
8. The method of claim 5, further comprising:
after receiving a network service analysis request message sent by the terminal, correspondingly decompressing based on a first target compression strategy of the terminal, and downloading a WSDL document according to a decompressed WSDL address;
and after receiving the network service calling request message sent by the terminal, correspondingly decompressing based on the first target compression strategy of the terminal, calling the network service according to the decompressed basic parameter information, and generating service calling result data.
9. A network service message transmission apparatus applied to a terminal, comprising:
the first selection module is used for selecting a first target compression strategy from preset compression strategies, and the first target compression strategy and the current network bandwidth accord with a preset corresponding relation, and the first selection module comprises: predicting the data transmission time of the data of the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth, wherein the data transmission time is compressed according to a formula
Figure FDA0002336417990000031
Obtaining the data transmission time T of the preset data quantity M without compression1According to the formula
Figure FDA0002336417990000041
Lambda is more than 1, and the data transmission time T of the preset data volume M is obtained when the preset compression algorithm is compressed2B is the current network bandwidth, lambda is the compression ratio of the preset compression algorithm, VcFor presetting the compression speed of the compression algorithm, VdThe decompression speed of a preset compression algorithm is set; according to the first target compression strategy, under the current network bandwidth, the data transmission efficiency reaches a preset requirement; selecting a preset compression strategy with data transmission efficiency meeting preset requirementsAs a first target compression strategy;
a first generation module, configured to generate a compressed network service request message according to the first target compression policy, where the network service request message includes a network service parsing request message and a network service invoking request message; when the terminal needs to initiate Web Service Description Language (WSDL) analysis, acquiring a WSDL address, compressing the WSDL address according to the first target compression strategy, and packaging the WSDL address into a web service analysis request message; when the terminal receives a network service analysis response message sent by a target server, basic parameters required by calling a service are obtained from a WSDL document in the network service analysis response message, and the assigned basic parameter information is compressed according to the first target compression strategy and packaged into a network service calling request message;
and the first sending module is used for sending the network service request message to a target server.
10. The network service message transmission device of claim 9, wherein the first selection module comprises:
the first processing submodule is used for predicting the transmission time of data compressed by the data with the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth;
and the first selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as a first target compression strategy.
11. A terminal, characterised by comprising a network service message transmission means according to claim 9 or claim 10.
12. A network service message transmission device applied to a server, comprising:
a second selection module, configured to select a second target compression policy from preset compression policies, where the second target compression policy and a current network bandwidth conform to a preset pairThe corresponding relation comprises: predicting the data transmission time of the data of the preset data volume under the condition of no compression and a preset compression algorithm based on the preset compression strategy and the current network bandwidth, wherein the data transmission time is compressed according to a formula
Figure FDA0002336417990000042
Obtaining the data transmission time T of the preset data quantity M without compression1According to the formula
Figure FDA0002336417990000051
Lambda is more than 1, and the data transmission time T of the preset data volume M is obtained when the preset compression algorithm is compressed2B is the current network bandwidth, lambda is the compression ratio of the preset compression algorithm, VcFor presetting the compression speed of the compression algorithm, VdThe decompression speed of a preset compression algorithm is set; according to the second target compression strategy, under the current network bandwidth, the data transmission efficiency reaches the preset requirement;
selecting a preset compression strategy with data transmission efficiency meeting preset requirements as a second target compression strategy;
a second generating module, configured to generate a compressed network service response message according to the second target compression policy after receiving a network service request message sent by a terminal, where the network service response message includes a network service parsing response message and a network service invoking response message; the method comprises the following steps: after receiving a web service analysis request message sent by a terminal, downloading a Web Service Description Language (WSDL) based on a WSDL address in the web service analysis request message to obtain a WSDL document, compressing the WSDL document according to the second target compression strategy, and packaging the WSDL document into a web service analysis response message; after receiving a network service calling request message sent by a terminal, obtaining effective information from service calling result data, compressing the effective information according to the second target compression strategy, and packaging the effective information into a network service calling response message;
and the second sending module is used for sending the network service response message to the terminal.
13. The network service message transmission device of claim 12, wherein the second selection module comprises:
the second processing submodule is used for predicting the transmission time of the data of the preset data volume, which is compressed under the condition of no compression and a preset compression algorithm, based on the preset compression strategy and the current network bandwidth;
and the second selection submodule is used for selecting a preset compression strategy with the data transmission efficiency meeting the preset requirement as the first target compression strategy.
14. A server, characterised by comprising a network service message transmission means according to claim 12 or claim 13.
CN201611204229.2A 2016-12-23 2016-12-23 Network service message transmission method, device, terminal and server Active CN108243022B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611204229.2A CN108243022B (en) 2016-12-23 2016-12-23 Network service message transmission method, device, terminal and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611204229.2A CN108243022B (en) 2016-12-23 2016-12-23 Network service message transmission method, device, terminal and server

Publications (2)

Publication Number Publication Date
CN108243022A CN108243022A (en) 2018-07-03
CN108243022B true CN108243022B (en) 2020-06-05

Family

ID=62703862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611204229.2A Active CN108243022B (en) 2016-12-23 2016-12-23 Network service message transmission method, device, terminal and server

Country Status (1)

Country Link
CN (1) CN108243022B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558442B (en) * 2018-11-19 2020-10-20 中国科学院信息工程研究所 Real-time data aggregation method and system
CN111600927B (en) * 2020-04-03 2022-12-20 浙江工业大学 Method for service adaptive calling under complex network environment
CN112422525B (en) * 2020-11-03 2022-04-01 珠海格力电器股份有限公司 Fault data transmission method, device, equipment and storage medium
CN113037603B (en) * 2021-03-12 2023-05-12 广州小鹏汽车科技有限公司 Remote control method and device and vehicle
CN113067674B (en) * 2021-03-17 2022-09-23 北京智慧星光信息技术有限公司 Transmission method, system, electronic device and storage medium of network text data
CN113542308B (en) * 2021-09-15 2022-01-07 广州锦行网络科技有限公司 Information processing method, system and storage medium, electronic device
CN115396525B (en) * 2022-08-26 2023-07-21 上海柯林布瑞信息技术有限公司 Data interaction method and device based on service template mapping
CN116054840B (en) * 2023-01-30 2023-11-17 北京中科江南信息技术股份有限公司 JSON character string data compression method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514587A (en) * 2003-05-20 2004-07-21 晨 叶 Video frequency network transmission technology of video compression mode and network band width self adaptive
CN102420843A (en) * 2011-06-24 2012-04-18 奇智软件(北京)有限公司 Compression and decompression method, device and system based on cloud compression link
CN105302494A (en) * 2015-11-19 2016-02-03 浪潮(北京)电子信息产业有限公司 Compression strategy selecting method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101789016A (en) * 2010-02-08 2010-07-28 浪潮(北京)电子信息产业有限公司 Method and device thereof for improving valid storage capacity of file system
CN102111437A (en) * 2010-12-30 2011-06-29 浪潮集团山东通用软件有限公司 Simple object access protocol (SOAP) extension-based WEB service transmission compression method
CN103813002A (en) * 2012-11-14 2014-05-21 广州三星通信技术研究有限公司 Device and method for sending pictures in terminals
CN104053019A (en) * 2013-03-12 2014-09-17 中兴通讯股份有限公司 Video playing and processing method and device based on virtual desktop

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1514587A (en) * 2003-05-20 2004-07-21 晨 叶 Video frequency network transmission technology of video compression mode and network band width self adaptive
CN102420843A (en) * 2011-06-24 2012-04-18 奇智软件(北京)有限公司 Compression and decompression method, device and system based on cloud compression link
CN105302494A (en) * 2015-11-19 2016-02-03 浪潮(北京)电子信息产业有限公司 Compression strategy selecting method and device

Also Published As

Publication number Publication date
CN108243022A (en) 2018-07-03

Similar Documents

Publication Publication Date Title
CN108243022B (en) Network service message transmission method, device, terminal and server
EP1609285B1 (en) System and method of compact messaging in network communications
EP3251322B1 (en) Improved client-driven push of resources by a server device
US9338258B2 (en) Methods and network devices for communicating data packets
KR101027299B1 (en) System and method for history driven optimization of web services communication
JP4363847B2 (en) Digital TV application protocol for interactive TV
Werner et al. Compressing SOAP messages by using differential encoding
EP1593204B1 (en) System and method for compression structured definition language
KR101110982B1 (en) Device method and system for multimedia content adaptation
US7765325B2 (en) Signaling compression/decompression with improved efficiency
CA3157076A1 (en) Partial downloads of compressed data
WO2009000119A1 (en) Data transmission system and transmission method thereof
WO2008042716A2 (en) Knowledge based encoding of data with multiplexing to facilitate compression
Apte et al. Wireless SOAP: optimizations for mobile wireless web services
AU2004316014B2 (en) Method and arrangement for state memory management
CN115643310B (en) Method, device and system for compressing data
CN101388905B (en) Simple object access protocol engine implementing method based on mobile device
CN106878054B (en) Service processing method and device
CN116781653A (en) Message processing method, device, electronic equipment, system and storage medium
Thomas-Kerr et al. Is that a fish in your ear? A universal metalanguage for multimedia
CN113596139B (en) Cluster communication system and method
US7447787B2 (en) Protocol executing system and protocol PDU common data structure converting method for processing protocol PDUS
Heinzl et al. A web service communication policy for describing non-standard application requirements
JP4976109B2 (en) SIP message compression / decompression module generation device, communication device, and SIP message compression / decompression method
Kleimola et al. Improving the efficiency of open sound control with compressed address strings

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant