WO2017157023A1 - Method and system for transmitting soap message - Google Patents

Method and system for transmitting soap message Download PDF

Info

Publication number
WO2017157023A1
WO2017157023A1 PCT/CN2016/103950 CN2016103950W WO2017157023A1 WO 2017157023 A1 WO2017157023 A1 WO 2017157023A1 CN 2016103950 W CN2016103950 W CN 2016103950W WO 2017157023 A1 WO2017157023 A1 WO 2017157023A1
Authority
WO
WIPO (PCT)
Prior art keywords
router
index
dictionary
soap message
server
Prior art date
Application number
PCT/CN2016/103950
Other languages
French (fr)
Chinese (zh)
Inventor
成祎
Original Assignee
上海斐讯数据通信技术有限公司
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 上海斐讯数据通信技术有限公司 filed Critical 上海斐讯数据通信技术有限公司
Publication of WO2017157023A1 publication Critical patent/WO2017157023A1/en

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]

Definitions

  • the present invention relates to the field of network communications, and in particular, to a SOAP message transmission method and system.
  • Wireless networks are indispensable in our lives.
  • WLAN wireless local area network
  • APs wireless access points
  • Many configuration options of these "thin” APs cannot be configured through the local webpage, but are sent from the server to the router through the packet, and then the router parses and finally takes effect.
  • the server and the router's Simple Object Access Protocol directly use plain text for transmission, which occupies a large amount of bandwidth.
  • SOAP Simple Object Access Protocol
  • the user's demand for network bandwidth is increasing, and the router is a terminal product if the SOAP packet is used. Taking up a lot of bandwidth and traffic will affect the user experience.
  • the object of the present invention is to provide a SOAP message transmission method and system, which can save bandwidth and traffic occupied by SOAP packets and improve user experience.
  • a SOAP message transmission method includes: Step S10: A router receives a SOAP message sent by a server, where the SOAP message includes an envelope element, a header element, and a body element, the envelope element, the header element, and the body element Each of the at least one key value pair is included; the step S20 router parses the SOAP message; and the step S50: the router retrieves whether the SOAP message is all an index stored in the first dynamic dictionary and/or static dictionary in the router. If yes, step S60 is performed; in step S60, the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content.
  • the step S20 and the step S50 further include: step S30 routing Retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router, if not, executing step S40; and step S40: the router retrieving whether the SOAP message exists in the router Determining the index in the first dynamic dictionary and/or the static dictionary, if yes, executing step S50; if not, executing step S80; step S80, according to the content indicated by the encoding information in the SOAP message, Perform the operation.
  • step S30 further includes: step S30, the router retrieving whether the SOAP message has an index of a second dynamic dictionary stored in the router, and if yes, performing step S31; and step S31, the router parses the SOAP
  • the index of the second dynamic dictionary existing in the message is obtained by the index represented by the index of the second dynamic dictionary; wherein the content represented by the index of the second dynamic dictionary includes an index of the static dictionary, and / Or, an index of the first dynamic dictionary.
  • the step S50 further includes: if no, performing step S70; the step S70, the router reorganizing the index and the content represented by the coding information in the SOAP message, and performing an operation according to the recombined content;
  • the S90 server determines whether the combination of the index and the encoding information, the single encoding information constitutes at least one key value pair, and if yes, executing step S110; the step S110, the server respectively separates each key value of the composition Updating to a new index of the first dynamic dictionary stored in the server and feeding back the new index to the router; in step S120, the router updates the new index of the feedback to the first dynamic dictionary stored in the router.
  • the method further includes: the step S100: the server determines whether the encoded information constitutes at least one key value pair, and if yes, performs step S110; the step S110: the server updates each key value pair of the composition separately Forming a new index of the first dynamic dictionary stored in the server, and feeding back each new index to a router; step S120, the router updates each new index of the feedback to be stored in the router The first dynamic dictionary.
  • the method further includes: step S61, the server determines whether the envelope element, the header element and the body element are respectively composed of a plurality of the indexes, and if yes, executing step S62; step S62 The server is updated by a plurality of said index groups The envelope element, the header element, the body element are newly indexed into a second dynamic dictionary stored in the server, and each updated new index is fed back to the router; step S63 router update station Deriving a new index of feedback to the second dynamic dictionary stored in the router.
  • the method further includes: step S01, the server retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server, and if yes, executing step S02, if If yes, the step S03 is performed; wherein the dictionary includes: the static dictionary, the first dynamic dictionary and the second dynamic dictionary; and the server uses the index to replace the index in the SOAP message by using the index
  • the content of the representation constitutes a new SOAP message; in step S03, the server sends the SOAP message to the router.
  • the present invention further provides a SOAP message transmission system, comprising: a router and a server; the router includes: a receiving module, receiving a SOAP message sent by the server; and a parsing module, electrically connecting with the receiving module, parsing the SOAP report And parsing an index of the second dynamic dictionary existing in the SOAP message to obtain content represented by an index of the second dynamic dictionary; the first retrieval module is electrically connected to the parsing module, and searching for Whether the SOAP message is all an index stored in the first dynamic dictionary and/or static dictionary in the router; and retrieving whether the SOAP message has the first dynamic dictionary stored in the router And/or an index in the static dictionary; and retrieving whether the SOAP message has an index of a second dynamic dictionary stored in the router; the first storage module is electrically connected to the first retrieval module, Storing the dictionary, the dictionary including a first dynamic dictionary, the second dynamic dictionary, and the static dictionary; an execution module, the first retrieval module, the a storage module is electrically connected, and when the SOAP
  • the server further includes: a second storage module, the dictionary is stored, the dictionary includes a first dynamic dictionary, the second dynamic dictionary, and the static dictionary; and the determining module determines the sent SOAP message Whether the combination of the index and the encoding information constitutes at least one key value pair; and determining whether the individual encoding information constitutes at least one key value pair; and determining the envelope element, the header element, and Whether the body element is composed of a plurality of the indexes; the second update module is electrically connected to the determining module and the second storage module, and when the combination of the index and the encoding information constitutes a key value pair, and / or, when the individual encoding information is combined to form a key value pair, each key value pair of the composition is respectively updated to a new index of the first dynamic dictionary stored in the server; and, respectively, updated by The envelope element, the header element, and the body element of the index are newly indexed into a second dynamic dictionary stored in the server; feedback mode Electrically connecting with the second update module
  • the server further includes: a second retrieval module electrically connected to the second storage module, and retrieving whether the SOAP message to be sent exists may be replaced by an index stored in a dictionary of the server And a replacement module, electrically connected to the second retrieval module and the second storage module, and replacing the content represented by the index in the SOAP message with the index to form a new SOAP message; and sending a module, And the second retrieval module, the The replacement module is electrically connected to the determining module, and sends the SOAP message to the router.
  • the encoded information of the representative is reorganized to form a complete uncompressed message, and the operation is performed according to the meaning of the message.
  • the originally transmitted plain text SOAP message is replaced by the corresponding index, and the transmitted content is greatly reduced, and does not occupy a large amount of bandwidth.
  • the router determines that there is no index of the second dynamic dictionary, the first dynamic dictionary, and the static dictionary in the received SOAP message, indicating that the SOAP message cannot be replaced by the index in the dictionary, and is composed of plain text, that is, They are all composed of encoded information. Without compression, the router can directly perform operations based on the content represented by the encoded information.
  • the index of the second dynamic dictionary exists in the SOAP message, the index of the second dynamic dictionary is first parsed, and becomes the index in the first dynamic dictionary and/or static dictionary represented by the latter. Further judgments are provided to provide the basis.
  • a SOAP message When a SOAP message is composed of a mixture of partial index and coded information, it will be reorganized according to the content and coded information represented by the index part to form a complete message, and then the operation is performed according to the complete message.
  • the part of the index compresses the size of the message, saving a portion of the bandwidth and increasing the transfer speed.
  • the encoded information is judged, and the encoded information capable of forming the key-value pair is updated into a corresponding new index into the first dynamic dictionary.
  • the index When it is convenient to send the same content again, it can be replaced by the index;
  • the SOAP message is composed of the mixed information and the index, after the operation is performed, it is determined whether the encoded information and the index can form a key-value pair, and , judging purely encoded information is Can it be composed of key-value pairs, if possible, each key-value pair of the composition is updated into a new index into the first dynamic dictionary, and when the same content is sent again, the index can be replaced by this index, and SOAP is compressed.
  • the size of the message is used to save bandwidth.
  • a complete SOAP message is divided into three parts, an envelope element (Envelope), a header element (Header), and a body element (Body). Each element also contains a different number of key-value pairs.
  • the SOAP messages are all composed of indexes, that is, the key-value pairs in each element are replaced by indexes, and a new index is formed to the second dynamic dictionary for the index combination in each element, that is, each new index represents a certain The index combination of the elements.
  • the content of the same element is sent next time, it can be directly replaced by the index in the second dynamic dictionary, which is smaller than the message replaced by the index in the first dynamic dictionary and/or the static dictionary, which greatly improves the number of messages.
  • the compression ratio reduces the occupation of the network.
  • the server Before sending the message, the server will first retrieve whether the content of the message can be replaced by the index in the dictionary. If possible, replace it with an index, compress the size of the message, and save bandwidth.
  • the SOAP message transmission method and system of the present invention greatly compresses the size of the SOAP message through the agreed dictionary between the router and the server, reduces the network occupation rate, and improves the user experience.
  • FIG. 1 is a flow chart of an embodiment of a SOAP message transmission method according to the present invention.
  • FIG. 2 is a flow chart of another embodiment of a SOAP message transmission method according to the present invention.
  • FIG. 3 is a schematic structural diagram of an embodiment of a SOAP message transmission system according to the present invention.
  • FIG. 4 is a schematic structural diagram of another embodiment of a SOAP message transmission system according to the present invention.
  • a SOAP message transmission method includes: Step S10: A router receives a SOAP message sent by a server, where the SOAP message includes an envelope element, a header element, and a body element, and an envelope The element, the header element and the body element each include at least one key value pair; the step S20 router parses the SOAP message; and the step S50 the router retrieves whether the SOAP message is all the index in the first dynamic dictionary and/or the static dictionary stored in the router. If yes, step S60 is performed; in step S60, the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content.
  • the static dictionary and the dynamic dictionary constitute a dictionary
  • the dynamic dictionary includes a first dynamic dictionary and a second dynamic dictionary.
  • a complete SOAP message is divided into three parts, namely the envelope element (ENV, Envelope), the header element (Header) and the body element (Body).
  • ENV envelope element
  • Header header element
  • Body body element
  • the static dictionary consists of two parts: 1) for a completely fixed key-value pair, it can be straight Use an index representation; 2) For key-fixed key-value pairs, you can use a fixed key to represent it.
  • the key-value pairs are in the dictionary. You only need to use one byte to represent the entire key-value pair, as shown in Table 3 below. The leftmost one is fixed to 1, indicating that the key-value pair is in the dictionary, and the last 7 digits. Stores the index of the key-value pair in the dictionary. E.g:
  • Huffman coding uses a variable length coding table to encode a source symbol (such as a letter in a file).
  • the variable length coding table is obtained by evaluating the probability of occurrence of the source symbol. Encoding, if the probability of occurrence is low, the longer encoding is used, which reduces the average length and expected value of the encoded string, thus achieving the lossless compression number. According to the purpose.
  • Huffman coding is used here to enable previously frequent messages to be transmitted with shorter coded information, so that the size of the message transmitted between the server and the router is better compressed.
  • the first position of the first byte is 0, indicating that the value is not in the dictionary.
  • the following Index is the index of the key in the dictionary, and the second byte is used to indicate the length of the value. Value. It should be noted here that since the Huffman coding is used for the variable length coding, the length of the value needs to be in bits, one byte, that is, 8 bits.
  • the key in the above encoded information belongs to the index in the dictionary, and the value is not, then after the first transmission of the SOAP message, the above key value pair can be added to the first dynamic dictionary, see Table 5 below.
  • the next time you send this code you can directly use the index in the first dynamic dictionary instead, 1000 0111------- (indicating that the key-value pair is in the dictionary, the index value is 7), compared to the first
  • the need for 7 bytes of content, this time only requires 1 byte; compared to the case of not using compression, the degree of compression is much better.
  • Both the router and the server store the same dictionary.
  • the two parties can analyze the contents of the index without any problem, and reorganize according to the contents of the indexes, so as to obtain a complete plain text SOAP message. Then proceed according to the content of this message.
  • static dictionaries exist for fixed content. Therefore, the content of static dictionaries is agreed between the server and all routers, that is, the server and all routers are stored in static.
  • the content of the state dictionary is the same; the dynamic dictionary is generated according to the content of the interaction between the server and the router. Because the content of the interaction between the server and each router is different, the content of the dynamic dictionary is also different, that is, the dynamic dictionary is a server and some A common convention between specific routers.
  • the step S20 and the step S50 further comprise: step S30: the router retrieves whether the SOAP message has an index of the second dynamic dictionary stored in the router, and if not, performs step S40; and the step S40 searches whether the SOAP message is retrieved by the router. There is an index of the first dynamic dictionary and/or the static dictionary stored in the router. If yes, step S50 is performed. If not, step S80 is performed; and step S80 performs an operation according to the content indicated by the encoded information in the SOAP message. .
  • step S30 further includes: the router retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router, and if yes, performing step S31; and step S31, the router parsing the index of the second dynamic dictionary existing in the SOAP message And obtaining the content represented by the index of the second dynamic dictionary; wherein the content represented by the index of the second dynamic dictionary includes an index of the static dictionary, and/or an index of the first dynamic dictionary.
  • the second dynamic dictionary is a secondary compression performed when most of the messages become part of the dictionary.
  • the SOAP message is:
  • Such a byte to represent the original hundreds of bytes of content greatly improving the compression ratio and reducing the occupation of the network. Therefore, after receiving the SOAP message, it first retrieves whether there is an index of the second dynamic dictionary, and if so, the index of the second dynamic dictionary is solved. Analyze it into an index of the first dynamic dictionary and/or static dictionary, and then perform subsequent judgment and retrieval.
  • the operation may be performed directly according to the content indicated by the encoded information in the SOAP message.
  • the step S50 further includes: the router retrieving whether the SOAP message is all the index of the first dynamic dictionary and/or the static dictionary stored in the router, if not, executing step S70; the step S70 reorganizing the index and the The content represented by the encoded information in the SOAP message is performed, and the operation is performed according to the recombined content; in step S90, the server determines whether the combination of the index and the encoded information, the individual encoded information constitutes at least one key value pair, and if so, the performing step S110; Step S110: The server updates each of the composed key-value pairs to a new index of the first dynamic dictionary stored in the server, and feeds the new index to the router; and in step S120, the router updates the feedback new index to the router.
  • the first dynamic dictionary is a new index of the first dynamic dictionary stored in the server, and feeds the new index to the router.
  • the method further includes: step S100: the server determines whether the encoded information constitutes at least one key value pair, and if yes, performs step S110; and the step S110 updates each of the composed key value pairs to the first stored in the server.
  • step S100 the server determines whether the encoded information constitutes at least one key value pair, and if yes, performs step S110; and the step S110 updates each of the composed key value pairs to the first stored in the server.
  • a new index of a dynamic dictionary and each new index is fed back to the router; in step S120 the router updates each new index of feedback to the first dynamic dictionary stored in the router.
  • the SOAP message is composed of a mixture of index and coded information
  • the content of the index can be re-formed into a complete plain text SOAP message, and then the router performs the operation according to the complete message.
  • the server will judge the SOAP message.
  • the server will determine whether the individual coded information can form a key-value pair, and the code. Whether the combination of information and index can form a key-value pair (as in the previous case, the key is in the dictionary, and the value is not). If a key-value pair can be formed, a new index will be generated for the key-value pair.
  • the method further includes: step S61: the server determines whether the envelope element, the header element, and the body element are respectively composed of multiple indexes, and if yes, executing step S62; and step S62, respectively, updating the envelope element composed of multiple indexes.
  • the header element and the body element are newly indexed into the second dynamic dictionary stored in the server, and the updated new indexes are fed back to the router; in step S63, the router updates the feedback new index to the second dynamic dictionary stored in the router.
  • the SOAP packets can be compressed twice.
  • the envelope element, the header element, and the body element are all composed of indexes
  • a corresponding new index may be generated for each element, and an index set representing each element is stored in the second dynamic dictionary, next time.
  • the index in the second dynamic dictionary is directly sent, and when received, parsing is performed to obtain an index of the static dictionary and/or the first dynamic dictionary, and then combined to obtain a complete message content, and then according to the content
  • the content performs the operation.
  • the compression ratio is greatly improved, and the occupation of network bandwidth is reduced.
  • a corresponding new index can be generated and stored in the second dynamic dictionary, and not all of the elements are completely combined by the index.
  • the key value pair composed of the encoded information (or the encoded information is indexed) may be updated into the first dynamic dictionary, and the remaining index set is updated to the new index storage. To the second dynamic dictionary.
  • the method further includes: step S01: the server retrieves the SOAP message to be sent, whether there is content that can be replaced by the index stored in the dictionary of the server, and if so, step S02 is performed, and if not, step S03 is performed;
  • the dictionary includes: a static dictionary, a first dynamic dictionary, and a second dynamic dictionary; in step S02, the server replaces the content represented by the index in the SOAP message with an index to form a new SOAP message; and the server sends a SOAP message to the router in step S03.
  • a SOAP message transmission method includes: Step S01: The server retrieves whether a SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server. If yes, go to step S02, if no, go to step S03; wherein, the dictionary includes: a static dictionary, a first dynamic dictionary and a second dynamic dictionary; in step S02, the server replaces the content represented by the index in the SOAP message with an index to form a new The SOAP message is sent to the router in step S03; the router receives the SOAP message sent by the server in step S10, the SOAP message includes an envelope element, a header element, and a body element, and the envelope element, the header element, and the body element each include at least a key value pair; the step S20 router parses the SOAP message; the step S30: the router retrieves the SOAP message whether there is an index of the second dynamic dictionary stored in the router, and if yes, executes step S31;
  • step S40 the router retrieves whether the SOAP message has the first dynamic stored in the router The index of the dictionary and/or the static dictionary, if yes, step S50 is performed, and if not, step S80 is performed; step S50, the router retrieves whether the SOAP message is all index of the first dynamic dictionary and/or static dictionary stored in the router.
  • step S60 the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content
  • step S61 the server determines whether the envelope element, the header element and the main element are respectively Each of the indexes is composed of a plurality of indexes, and if yes, step S62 is performed; in step S62, the server updates the envelope element, the header element, and the body element composed of the plurality of indexes into a new index to be stored in the second dynamic dictionary of the server, and updates the update.
  • step S63 the router updates the new index of the feedback to the store
  • the second dynamic dictionary step S70 of the router reassembles the index and the content represented by the encoded information in the SOAP message, and performs an operation according to the recombined content; in step S90, the server determines the combination of the index and the encoded information, respectively.
  • step S110 the router performs an operation according to the content indicated by the encoded information in the SOAP message; and the step S100 determines by the server Whether the encoded information constitutes at least one key-value pair, and if yes, executing step S110; the step S110, the server updates each of the composed key-value pairs to a new index of the first dynamic dictionary stored in the server, and feeds back the new index to Router; step S120: The router updates the new index of the feedback to the first dynamic dictionary stored in the router.
  • the transmission of the SOAP packet is bidirectional.
  • the router retrieves the index in the dictionary to replace the content of the SOAP message. If it is, it will be replaced and sent to the server.
  • the server will retrieve its own dictionary based on the parsed message and parse the content of the SOAP message. The message content performs the operation.
  • updating the dynamic dictionary it is judged by the server. If it needs to be updated, the server will feed back the content that needs to be updated to the router, let the router update, and the server will also store the content that needs to be updated into its own dictionary.
  • the dynamic dictionary when the communication is more frequent and longer, the dynamic dictionary will become larger and larger, and the compression effect will be better and better, but the content of the dictionary will occupy a part of the memory of the server and the router, essentially It is to exchange memory space for network space. Therefore, it is impossible to let the dynamic dictionary occupy the storage space indefinitely, so the dynamic dictionary must set the aging time or the space size limit, so that the occupied memory does not affect the performance of the server and the router.
  • a SOAP message transmission system includes: a router 10 and a server 20; the router 10 includes: a receiving module 11 that receives a SOAP message sent by the server; and a parsing module 12, Electrically connecting with the receiving module 11 to parse the SOAP message; and parsing the index of the second dynamic dictionary existing in the SOAP message to obtain the content represented by the index of the second dynamic dictionary; the first retrieval module 13 and the parsing module 12 Connecting, retrieving whether the SOAP message is all an index in the first dynamic dictionary and/or static dictionary stored in the router; and retrieving whether the SOAP message exists in the first dynamic dictionary and/or the static dictionary stored in the router Indexing; and retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router; the first storage module 14 is electrically connected to the first retrieval module 13, storing the dictionary, the dictionary including the first dynamic dictionary, and the second The dynamic dictionary and the static dictionary; the execution module 15 is electrically connected to the first retrieval
  • the server 20 further includes: a second storage module 23, storing a dictionary, the dictionary includes a first dynamic dictionary, a second dynamic dictionary, and a static dictionary; and the determining module 21 determines whether the combination of the index and the encoded information in the sent SOAP message is Forming at least one key-value pair; and determining whether the individual encoding information constitutes at least one key-value pair; and determining whether the envelope element, the header element, and the body element are respectively composed of a plurality of indexes; the second updating module 22, and the determining module 21.
  • the second storage module 23 is electrically connected.
  • each key-value pair composed is separately updated to be stored in a new index of the first dynamic dictionary in the server; and respectively updating the envelope element, the header element, and the body element composed of the plurality of indexes into a new index stored in the second dynamic dictionary of the server;
  • the feedback module 24, and the second The update module 22 is electrically connected, and feeds a new index corresponding to each key value pair to the router; and, by combining multiple indexes The new index corresponding to the encapsulation element, the header element, and the main element is fed back to the router;
  • the receiving module 11 of the router 10 is further configured to receive a new index corresponding to each key-value pair composed by the server; and receive multiple feedbacks from the server
  • the index element consists of an envelope element, a header element, and a new index corresponding to the body element.
  • the router 10 further includes: a first update module 16, electrically connected to the receiving module 11 and the first storage module 14, and updates each key-value pair of the feedback component. Corresponding new index to the first dynamic dictionary stored in the router; updating the envelope element, the header element, and the new index corresponding to the body element of the plurality of indexes fed back to the second dynamic dictionary stored in the router.
  • the dictionary is stored in the memory of the router 10 and the server 20. Therefore, the first storage module 14 can be the memory of the router 10, and the second storage module 23 can be the memory of the server 20.
  • the router 10 After receiving and parsing the SOAP message, the router 10 searches for whether it is stored. In the index, if it exists, the content represented by the index is obtained in its own dictionary, and the content is reorganized to obtain the complete message content, and the operation is performed according to the content represented by the SOAP message.
  • the server 20 further includes: a second retrieval module 25, electrically connected to the second storage module 23, and retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server; the replacement module 26, The second retrieval module 25 and the second storage module 23 are electrically connected to each other, and the content represented by the index in the SOAP message is replaced by an index to form a new SOAP message; the sending module 27, the second retrieval module 25, the replacement module 26, and the judgment Module 21 is electrically connected and sends a SOAP message to the router.
  • a second retrieval module 25 electrically connected to the second storage module 23, and retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server
  • the replacement module 26 The second retrieval module 25 and the second storage module 23 are electrically connected to each other, and the content represented by the index in the SOAP message is replaced by an index to form a new SOAP message
  • the sending module 27, the second retrieval module 25, the replacement module 26, and the judgment Module 21
  • the reason why the server determines whether the content of the dynamic dictionary (the first dynamic dictionary and the second dynamic dictionary) can be updated in the sent SOAP message is because the dynamic dictionary is an agreement between the server and a certain router, and one server will Corresponding to many routers, therefore, the index requires the server to be managed in an integrated manner without error.
  • a SOAP message transmission system includes: a router 10 and a server 20; the router 10 includes: a receiving module 11 that receives a SOAP message sent by the server; and a receiving server a new index corresponding to each key-value pair of the feedback; and an envelope element, a header element, and a new index corresponding to the body element composed of a plurality of indexes fed back by the server; the parsing module 12 is electrically connected to the receiving module 11 and parsed a SOAP message; and parsing an index of the second dynamic dictionary existing in the SOAP message to obtain an index represented by the index of the second dynamic dictionary; the first retrieval module 13 is electrically connected to the parsing module 12 to retrieve whether the SOAP message is all Is an index in a first dynamic dictionary and/or a static dictionary stored in the router; and retrieving whether the SOAP message has an index stored in a first dynamic dictionary and/or a static dictionary in the router; and, retrieving the SOAP report
  • the execution module 15 is electrically connected to the first retrieval module 13 and the first storage module 14, and the SOAP message is all stored in the first dynamic of the router.
  • the SOAP message is all stored in the first dynamic of the router.
  • indexing in a dictionary and/or static dictionary reorganizing the content represented by the index and performing operations according to the reorganized content
  • SOAP message Not all of the indexes stored in the first dynamic dictionary and/or the static dictionary in the router reorganizing the index and the content represented by the encoded information in the SOAP message, and performing operations according to the reorganized content
  • the SOAP message does not have an index stored in the first dynamic dictionary and/or the static dictionary in the router, the operation is performed according to the content indicated by the encoded information in the SOAP message; the first update module 16, and the receiving module 11.
  • the first storage module 14 is electrically connected, and the new index corresponding to each key value pair of the feedback feedback is updated to the first dynamic dictionary stored in the router; the envelope element, the header element, and the subject composed of multiple indexes of the updated feedback are updated. a new index corresponding to the element to the second dynamic dictionary stored in the router; the server 20 further includes: a second storage module 23, storing a dictionary, the dictionary including a first dynamic dictionary, a second dynamic dictionary, and a static dictionary; the determining module 21, determining Whether the combination of the index and the encoded information in the sent SOAP message constitutes at least one key value pair; and, determining whether the individual encoded information is composed to a key value pair; and, respectively, determining whether the envelope element, the header element, and the body element are composed of a plurality of indexes; the second update module 22 is electrically connected to the determination module 21 and the second storage module 23, when the combination of the index and the encoded information Forming a key-value pair, and/or, when the individual encoding information
  • the index is fed back to the router; and the new index corresponding to the envelope element, the header element, and the main element of the plurality of indexes is fed back to the router; the second retrieval module 25 is electrically connected to the second storage module 23, and retrieves the SOAP report to be sent. Whether there is content that can be replaced by an index stored in a dictionary of the server; a replacement module 26, and a second retrieval module 25, a second storage module
  • the block 23 is electrically connected, and replaces the content indicated by the index in the SOAP message with the index to form a new SOAP message;
  • the sending module 27 is electrically connected to the second search module 25, the replacement module 26, and the determining module 21, and sends the SOAP message to router.
  • the SOAP packet is transmitted in both directions.
  • the process of the server 20 transmitting the packet to the router 10 is shown.
  • the process is consistent with the foregoing process.
  • Lead, if any, will look up the contents of the existing index representation in its own dictionary, recompose to get the meaning of SOAP representation, and then perform related operations.
  • updating the content of the dynamic dictionary is determined by the server 20. If the update is needed, the server 20 updates the content that needs to be updated to the router 10 after updating in its own dictionary, so that it also updates the same content. It is convenient for subsequent parsing results without error when transmitting compressed SOAP packets.

Abstract

Disclosed in the present invention are a method and a system for transmitting a SOAP message, the method comprising: step S10, a router receiving a SOAP message sent by a server, the SOAP message comprising an envelope element, a header element and a body element, the envelop element, the header element and the body element each comprising at least one key-value pair; step S20, the router parsing the SOAP message; step S50, the router determining, by retrieving, whether the SOAP message is wholly composed of indexes stored in a first dynamic dictionary and/or a static dictionary in the router; if so, executing step S60; step S60, the router reorganizing the content represented by the indexes, and performing the operation according to the reorganized content. The invention substantially reduces, by means of the dictionaries agreed by the router and the server, the SOAP message size, reducing the network occupancy by the SOAP message, improving the user experience.

Description

一种SOAP报文传输方法及系统SOAP message transmission method and system 技术领域Technical field
本发明涉及网络通信领域,尤其涉及一种SOAP报文传输方法及系统。The present invention relates to the field of network communications, and in particular, to a SOAP message transmission method and system.
背景技术Background technique
无线网络是我们生活中不可或缺的东西,在无线局域网(WLAN,Wireless Local Area Networks)产品中,会存在大量的无线接入点(AP,Access Point),也可以称为“瘦”AP。这些“瘦”AP的很多配置选项不能通过本地网页进行配置,而是需要通过报文从服务器下发到路由器上,然后路由器进行解析,并最终生效。Wireless networks are indispensable in our lives. In wireless local area network (WLAN) products, there are a large number of wireless access points (APs), which can also be called "thin" APs. Many configuration options of these "thin" APs cannot be configured through the local webpage, but are sent from the server to the router through the packet, and then the router parses and finally takes effect.
目前服务器和路由器的交互报文(SOAP,Simple Object Access Protocol)直接使用纯文本进行传输,会占用大量的带宽;用户对于网络带宽的需求日益增长,而路由器作为一款终端产品,如果SOAP报文占用了大量的带宽和流量,就会影响到用户体验。At present, the server and the router's Simple Object Access Protocol (SOAP) directly use plain text for transmission, which occupies a large amount of bandwidth. The user's demand for network bandwidth is increasing, and the router is a terminal product if the SOAP packet is used. Taking up a lot of bandwidth and traffic will affect the user experience.
发明内容Summary of the invention
本发明的目的是提供一种SOAP报文传输方法及系统,节省SOAP报文占用的带宽和流量,提高用户体验。The object of the present invention is to provide a SOAP message transmission method and system, which can save bandwidth and traffic occupied by SOAP packets and improve user experience.
本发明提供的技术方案如下:The technical solution provided by the present invention is as follows:
一种SOAP报文传输方法,包括:步骤S10路由器接收服务器发送的SOAP报文,所述SOAP报文包括信封元素、报头元素和主体元素,所述信封元素、所述报头元素和所述主体元素各包括至少一个键值对;步骤S20路由器解析所述SOAP报文;步骤S50路由器检索所述SOAP报文是否全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引,若是,则执行步骤S60;步骤S60路由器重组所述索引表示的内容,并根据重组后的内容执行操作。A SOAP message transmission method includes: Step S10: A router receives a SOAP message sent by a server, where the SOAP message includes an envelope element, a header element, and a body element, the envelope element, the header element, and the body element Each of the at least one key value pair is included; the step S20 router parses the SOAP message; and the step S50: the router retrieves whether the SOAP message is all an index stored in the first dynamic dictionary and/or static dictionary in the router. If yes, step S60 is performed; in step S60, the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content.
进一步优选地,所述步骤S20和步骤S50之间还包括:步骤S30路由 器检索所述SOAP报文是否存在存储在所述路由器中的第二动态字典的索引,若否,则执行步骤S40;步骤S40路由器检索所述SOAP报文是否存在存储在所述路由器中的所述第一动态字典和/或所述静态字典中的索引,若是,则执行步骤S50,若否,则执行步骤S80;步骤S80路由器根据所述SOAP报文中的所述编码信息表示的内容,执行操作。Further preferably, the step S20 and the step S50 further include: step S30 routing Retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router, if not, executing step S40; and step S40: the router retrieving whether the SOAP message exists in the router Determining the index in the first dynamic dictionary and/or the static dictionary, if yes, executing step S50; if not, executing step S80; step S80, according to the content indicated by the encoding information in the SOAP message, Perform the operation.
进一步优选地,所述步骤S30还包括:步骤S30路由器检索所述SOAP报文是否存在存储在所述路由器中的第二动态字典的索引,若是,则执行步骤S31;步骤S31路由器解析所述SOAP报文中存在的所述第二动态字典的索引,得到所述第二动态字典的索引表示的内容;其中,所述第二动态字典的索引表示的内容包括所述静态字典的索引,和/或,所述第一动态字典的索引。Further preferably, the step S30 further includes: step S30, the router retrieving whether the SOAP message has an index of a second dynamic dictionary stored in the router, and if yes, performing step S31; and step S31, the router parses the SOAP The index of the second dynamic dictionary existing in the message is obtained by the index represented by the index of the second dynamic dictionary; wherein the content represented by the index of the second dynamic dictionary includes an index of the static dictionary, and / Or, an index of the first dynamic dictionary.
进一步优选地,所述步骤S50还包括:若否,则执行步骤S70;步骤S70路由器重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;步骤S90服务器分别判断所述索引和所述编码信息的组合、单独的所述编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S110服务器将所述组成的每个键值对分别更新成存储在所述服务器中的第一动态字典的新索引,并将所述新索引反馈给路由器;步骤S120路由器更新所述反馈的新索引至存储在路由器中的所述第一动态字典。Further preferably, the step S50 further includes: if no, performing step S70; the step S70, the router reorganizing the index and the content represented by the coding information in the SOAP message, and performing an operation according to the recombined content; The S90 server determines whether the combination of the index and the encoding information, the single encoding information constitutes at least one key value pair, and if yes, executing step S110; the step S110, the server respectively separates each key value of the composition Updating to a new index of the first dynamic dictionary stored in the server and feeding back the new index to the router; in step S120, the router updates the new index of the feedback to the first dynamic dictionary stored in the router.
进一步优选地,所述步骤S80之后还包括:步骤S100服务器判断所述编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S110服务器将所述组成的每个键值对分别更新成存储在所述服务器中的所述第一动态字典的新索引,并将每个所述新索引反馈给路由器;步骤S120路由器更新每个所述反馈的新索引至存储在所述路由器中的第一动态字典。Further preferably, after the step S80, the method further includes: the step S100: the server determines whether the encoded information constitutes at least one key value pair, and if yes, performs step S110; the step S110: the server updates each key value pair of the composition separately Forming a new index of the first dynamic dictionary stored in the server, and feeding back each new index to a router; step S120, the router updates each new index of the feedback to be stored in the router The first dynamic dictionary.
进一步优选地,所述步骤S60之后还包括:步骤S61服务器分别判断所述信封元素、所述报头元素和所述主体元素是否分别由多个所述索引组成,若是,则执行步骤S62;步骤S62服务器分别更新由多个所述索引组 成的所述信封元素、所述报头元素、所述主体元素成新索引至存储在所述服务器的第二动态字典中,并把更新的各个所述新索引反馈给路由器;步骤S63路由器更新所述反馈的新索引至存储在所述路由器的所述第二动态字典。Further preferably, after the step S60, the method further includes: step S61, the server determines whether the envelope element, the header element and the body element are respectively composed of a plurality of the indexes, and if yes, executing step S62; step S62 The server is updated by a plurality of said index groups The envelope element, the header element, the body element are newly indexed into a second dynamic dictionary stored in the server, and each updated new index is fed back to the router; step S63 router update station Deriving a new index of feedback to the second dynamic dictionary stored in the router.
进一步优选地,所述步骤S10之前还包括:步骤S01服务器检索需要发送的所述SOAP报文是否存在可以由存储在所述服务器的字典中的索引替换的内容,若是,则执行步骤S02,若否,则执行步骤S03;其中,所述字典包括:所述静态字典、所述第一动态字典和所述第二动态字典;步骤S02服务器利用所述索引替换所述SOAP报文中所述索引表示的内容,组成新的SOAP报文;步骤S03服务器发送所述SOAP报文至所述路由器。Further preferably, before step S10, the method further includes: step S01, the server retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server, and if yes, executing step S02, if If yes, the step S03 is performed; wherein the dictionary includes: the static dictionary, the first dynamic dictionary and the second dynamic dictionary; and the server uses the index to replace the index in the SOAP message by using the index The content of the representation constitutes a new SOAP message; in step S03, the server sends the SOAP message to the router.
本发明还提供一种SOAP报文传输系统,包括:路由器和服务器;所述路由器包括:接收模块,接收服务器发送的SOAP报文;解析模块,与所述接收模块电连接,解析所述SOAP报文;以及,解析所述SOAP报文中存在的所述第二动态字典的索引,得到所述第二动态字典的索引表示的内容;第一检索模块,与所述解析模块电连接,检索所述SOAP报文是否全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引;以及,检索所述SOAP报文是否存在存储在所述路由器中的所述第一动态字典和/或所述静态字典中的索引;以及,检索所述SOAP报文是否存在存储在所述路由器中的第二动态字典的索引;第一存储模块,与所述第一检索模块电连接,存储所述字典,所述字典包括第一动态字典、所述第二动态字典和所述静态字典;执行模块,与所述第一检索模块、所述第一存储模块电连接,当所述SOAP报文全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引时,重组所述索引表示的内容,并根据重组后的内容执行操作;以及,当所述SOAP报文不全部是存储在所述路由器中的第一动态字典和/或静态字典的索引时,重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;以及,当所述SOAP报文不存在存储在所述路由器中的所述第一动态字典和/或所述 静态字典的索引时,根据所述SOAP报文中的所述编码信息表示的内容,执行操作。The present invention further provides a SOAP message transmission system, comprising: a router and a server; the router includes: a receiving module, receiving a SOAP message sent by the server; and a parsing module, electrically connecting with the receiving module, parsing the SOAP report And parsing an index of the second dynamic dictionary existing in the SOAP message to obtain content represented by an index of the second dynamic dictionary; the first retrieval module is electrically connected to the parsing module, and searching for Whether the SOAP message is all an index stored in the first dynamic dictionary and/or static dictionary in the router; and retrieving whether the SOAP message has the first dynamic dictionary stored in the router And/or an index in the static dictionary; and retrieving whether the SOAP message has an index of a second dynamic dictionary stored in the router; the first storage module is electrically connected to the first retrieval module, Storing the dictionary, the dictionary including a first dynamic dictionary, the second dynamic dictionary, and the static dictionary; an execution module, the first retrieval module, the a storage module is electrically connected, and when the SOAP message is all indexes stored in the first dynamic dictionary and/or the static dictionary in the router, recombining the content represented by the index, and performing according to the reorganized content And recombining the index and the content represented by the encoded information in the SOAP message when the SOAP messages are not all indexes of the first dynamic dictionary and/or the static dictionary stored in the router; And performing operations according to the reorganized content; and, when the SOAP message does not exist, the first dynamic dictionary and/or the stored in the router When the index of the static dictionary is indexed, an operation is performed according to the content indicated by the encoded information in the SOAP message.
进一步优选地,所述服务器还包括:第二存储模块,存储所述字典,所述字典包括第一动态字典、所述第二动态字典和所述静态字典;判断模块,判断发送的SOAP报文中所述索引和所述编码信息的组合是否组成至少一个键值对;以及,判断单独的所述编码信息是否组成至少一个键值对;以及,分别判断所述信封元素、所述报头元素和所述主体元素是否由多个所述索引组成;第二更新模块,与所述判断模块、所述第二存储模块电连接,当所述索引和所述编码信息的组合组成键值对,和/或,单独的所述编码信息组合组成键值对时,将所述组成的每个键值对分别更新成存储在所述服务器中的第一动态字典的新索引;以及,分别更新由多个所述索引组成的所述信封元素、所述报头元素、所述主体元素成新索引至存储在所述服务器的第二动态字典中;反馈模块,与所述第二更新模块电连接,将所述组成的每个键值对对应的所述新索引反馈给路由器;以及,将多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引反馈给路由器;所述路由器的所述接收模块,进一步用于接收服务器反馈的所述组成的每个键值对对应的所述新索引;以及,接收服务器反馈的多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引;所述路由器还包括:第一更新模块,与所述接收模块、所述第一存储模块电连接,更新反馈的所述组成的每个键值对对应的所述新索引至存储在所述路由器中的第一动态字典;更新反馈的多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引至存储在所述路由器中的第二动态字典。Further preferably, the server further includes: a second storage module, the dictionary is stored, the dictionary includes a first dynamic dictionary, the second dynamic dictionary, and the static dictionary; and the determining module determines the sent SOAP message Whether the combination of the index and the encoding information constitutes at least one key value pair; and determining whether the individual encoding information constitutes at least one key value pair; and determining the envelope element, the header element, and Whether the body element is composed of a plurality of the indexes; the second update module is electrically connected to the determining module and the second storage module, and when the combination of the index and the encoding information constitutes a key value pair, and / or, when the individual encoding information is combined to form a key value pair, each key value pair of the composition is respectively updated to a new index of the first dynamic dictionary stored in the server; and, respectively, updated by The envelope element, the header element, and the body element of the index are newly indexed into a second dynamic dictionary stored in the server; feedback mode Electrically connecting with the second update module, feeding back the new index corresponding to each key value pair of the composition to a router; and, the envelope element, the header element composed of a plurality of the indexes The new index corresponding to the body element is fed back to the router; the receiving module of the router is further configured to receive the new index corresponding to each key-value pair of the component fed back by the server; and receive The envelope element, the header element, and the new index corresponding to the body element that are sent by the server, and the router further includes: a first update module, and the receiving module, the The first storage module is electrically connected, and the new index corresponding to each key value pair of the feedback is updated to the first dynamic dictionary stored in the router; The envelope element, the header element, the new index corresponding to the body element, to a second dynamic dictionary stored in the router.
进一步优选地,所述服务器还包括:第二检索模块,与所述第二存储模块电连接,检索需要发送的所述SOAP报文是否存在可以由存储在所述服务器的字典中的索引替换的内容;替换模块,与所述第二检索模块、所述第二存储模块电连接,利用所述索引替换所述SOAP报文中所述索引表示的内容,组成新的SOAP报文;发送模块,与所述第二检索模块、所述 替换模块、所述判断模块电连接,发送所述SOAP报文至所述路由器。Further preferably, the server further includes: a second retrieval module electrically connected to the second storage module, and retrieving whether the SOAP message to be sent exists may be replaced by an index stored in a dictionary of the server And a replacement module, electrically connected to the second retrieval module and the second storage module, and replacing the content represented by the index in the SOAP message with the index to form a new SOAP message; and sending a module, And the second retrieval module, the The replacement module is electrically connected to the determining module, and sends the SOAP message to the router.
与现有技术相比,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
1、把固定的交互内容压缩成静态字典分别存储在服务器和路由器中,形成服务器和所有的路由器的共同约定;把需要动态设置的内容压缩成动态字典,形成服务器和某个特定的路由器之间的约定;静态字典和第一动态字典一般每个索引代表一个键值对,这样在发送报文时可以用索引代替原先的纯文本进行传输,节省量的带宽。当要路由器接收到SOAP报文时,在解析后,会判断SOAP报文的组成,若SOAP报文全部是由第一动态字典和/或静态字典中的索引组成,则在字典中查找这些索引代表的编码信息进行重组,形成完整的未压缩的报文,根据此报文的意思进行操作。原本传输的纯文本SOAP报文被相应的索引代替,传输的内容大大减少,不会占用大量的带宽。1. Compress the fixed interactive content into a static dictionary, which is stored in the server and the router respectively, forming a common agreement between the server and all the routers; compressing the content that needs to be dynamically set into a dynamic dictionary, forming a relationship between the server and a specific router The convention; the static dictionary and the first dynamic dictionary generally each index represents a key-value pair, so that when the message is sent, the index can be used instead of the original plain text for transmission, saving bandwidth. When the router receives the SOAP packet, it will determine the composition of the SOAP packet after parsing. If the SOAP packet is composed of the index in the first dynamic dictionary and/or the static dictionary, the index is searched in the dictionary. The encoded information of the representative is reorganized to form a complete uncompressed message, and the operation is performed according to the meaning of the message. The originally transmitted plain text SOAP message is replaced by the corresponding index, and the transmitted content is greatly reduced, and does not occupy a large amount of bandwidth.
2、路由器判断接收的SOAP报文中不存在第二动态字典、第一动态字典和静态字典的索引,表示这份SOAP报文不能被字典中的索引替换,是以纯文本的形式组成的,即都是由编码信息组成,没有经过压缩,路由器可以直接根据编码信息表示的内容执行操作。2. The router determines that there is no index of the second dynamic dictionary, the first dynamic dictionary, and the static dictionary in the received SOAP message, indicating that the SOAP message cannot be replaced by the index in the dictionary, and is composed of plain text, that is, They are all composed of encoded information. Without compression, the router can directly perform operations based on the content represented by the encoded information.
3、当检索到SOAP报文中存在第二动态字典的索引时,会先对第二动态字典的索引进行解析,变成其代表的第一动态字典和/或静态字典中的索引,为后面进行的进一步判断提供基础。3. When the index of the second dynamic dictionary exists in the SOAP message, the index of the second dynamic dictionary is first parsed, and becomes the index in the first dynamic dictionary and/or static dictionary represented by the latter. Further judgments are provided to provide the basis.
4、当SOAP报文是由部分索引和编码信息混合组成时,会根据索引的部分表示的内容和编码信息进行重组,形成完整的报文,再根据这份完整的报文执行操作。索引的部分会压缩报文的大小,从而节省一部分带宽,提高传输速度。4. When a SOAP message is composed of a mixture of partial index and coded information, it will be reorganized according to the content and coded information represented by the index part to form a complete message, and then the operation is performed according to the complete message. The part of the index compresses the size of the message, saving a portion of the bandwidth and increasing the transfer speed.
5、当SOAP报文全部由编码信息组成时,在执行完操作后,会对这些编码信息进行判断,把能够组成键值对的编码信息更新成对应的新的索引至第一动态字典中,便于后续再次发送相同的内容时,可以由此索引替换;当SOAP报文是由编码信息和索引混合组成时,在执行完操作后,会分别判断编码信息和索引是否能够组成键值对,以及,判断纯编码信息是 否能够组成键值对,如果可以的话,就把组成的每个键值对分别更新成新的索引到第一动态字典中,后续再次发送相同的内容时,可以由此索引替换,压缩了SOAP报文的大小,达到节省带宽的目的。5. When all the SOAP messages are composed of the encoded information, after performing the operation, the encoded information is judged, and the encoded information capable of forming the key-value pair is updated into a corresponding new index into the first dynamic dictionary. When it is convenient to send the same content again, it can be replaced by the index; when the SOAP message is composed of the mixed information and the index, after the operation is performed, it is determined whether the encoded information and the index can form a key-value pair, and , judging purely encoded information is Can it be composed of key-value pairs, if possible, each key-value pair of the composition is updated into a new index into the first dynamic dictionary, and when the same content is sent again, the index can be replaced by this index, and SOAP is compressed. The size of the message is used to save bandwidth.
6、一个完整的SOAP报文分为3个部分,分别是信封元素(Envelope)、报头元素(Header)和主体元素(Body),每个元素也包含不同数量的键值对。当SOAP报文全部由索引组成时,即每个元素中的键值对都由索引代替,会对每个元素中的索引组合形成新索引至第二动态字典,即每个新索引表示某个元素的索引组合。当下次发送相同的某个元素的内容时,可以被第二动态字典中的索引直接替换时,比用第一动态字典和/或静态字典中的索引替换的报文更小,极大地提高了压缩比率,降低了对网络的占用。6. A complete SOAP message is divided into three parts, an envelope element (Envelope), a header element (Header), and a body element (Body). Each element also contains a different number of key-value pairs. When the SOAP messages are all composed of indexes, that is, the key-value pairs in each element are replaced by indexes, and a new index is formed to the second dynamic dictionary for the index combination in each element, that is, each new index represents a certain The index combination of the elements. When the content of the same element is sent next time, it can be directly replaced by the index in the second dynamic dictionary, which is smaller than the message replaced by the index in the first dynamic dictionary and/or the static dictionary, which greatly improves the number of messages. The compression ratio reduces the occupation of the network.
7、服务器在发送报文前,会先检索下报文内容是否可以被字典中的索引替换,如果可以的话就用索引替换,压缩报文大小,节省带宽。7. Before sending the message, the server will first retrieve whether the content of the message can be replaced by the index in the dictionary. If possible, replace it with an index, compress the size of the message, and save bandwidth.
本发明的一种SOAP报文传输方法及系统,通过路由器和服务器之间约定的字典,大幅压缩SOAP报文的大小,降低其对网络的占有率,提高用户体验。The SOAP message transmission method and system of the present invention greatly compresses the size of the SOAP message through the agreed dictionary between the router and the server, reduces the network occupation rate, and improves the user experience.
附图说明DRAWINGS
下面将以明确易懂的方式,结合附图说明优选实施方式,对一种SOAP报文传输方法及系统的上述特性、技术特征、优点及其实现方式予以进一步说明。The above described features, technical features, advantages and implementations of a SOAP message transmission method and system will be further described below in a clear and understandable manner with reference to the accompanying drawings.
图1是本发明SOAP报文传输方法一个实施例的流程图;1 is a flow chart of an embodiment of a SOAP message transmission method according to the present invention;
图2是本发明SOAP报文传输方法另一个实施例的流程图;2 is a flow chart of another embodiment of a SOAP message transmission method according to the present invention;
图3是本发明SOAP报文传输系统一个实施例的结构示意图;3 is a schematic structural diagram of an embodiment of a SOAP message transmission system according to the present invention;
图4是本发明SOAP报文传输系统另一个实施例的结构示意图。4 is a schematic structural diagram of another embodiment of a SOAP message transmission system according to the present invention.
附图标号说明:Description of the reference numerals:
10.路由器,11.接收模块,12.解析模块,13.第一检索模块,14.第一存储模块,15.执行模块,16.第一更新模块,20.服务器,21.判断模块,22. 第二更新模块,23.第二存储模块,24.反馈模块,25.第二检索模块,26.替换模块,27.发送模块。10. router, 11. receiving module, 12. parsing module, 13. first retrieval module, 14. first storage module, 15. execution module, 16. first update module, 20. server, 21. judgment module, 22 . Second update module, 23. second storage module, 24. feedback module, 25. second retrieval module, 26. replacement module, 27. transmission module.
具体实施方式detailed description
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对照附图说明本发明的具体实施方式。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图,并获得其他的实施方式。In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the specific embodiments of the present invention will be described below with reference to the accompanying drawings. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings according to the drawings without obtaining creative labor, and obtain Other embodiments.
为使图面简洁,各图中只示意性地表示出了与本发明相关的部分,它们并不代表其作为产品的实际结构。另外,以使图面简洁便于理解,在有些图中具有相同结构或功能的部件,仅示意性地绘示了其中的一个,或仅标出了其中的一个。在本文中,“一个”不仅表示“仅此一个”,也可以表示“多于一个”的情形。In order to simplify the drawings, only the parts related to the present invention are schematically shown in the drawings, and they do not represent the actual structure of the product. In addition, in order to make the drawings simple and easy to understand, components having the same structure or function in some of the figures are only schematically illustrated, or only one of them is marked. In the present context, "a" means not only "only one" but also "more than one".
在本发明的一个实施例中,如图1所示,一种SOAP报文传输方法,包括:步骤S10路由器接收服务器发送的SOAP报文,SOAP报文包括信封元素、报头元素和主体元素,信封元素、报头元素和主体元素各包括至少一个键值对;步骤S20路由器解析SOAP报文;步骤S50路由器检索SOAP报文是否全部是存储在路由器中的第一动态字典和/或静态字典中的索引,若是,则执行步骤S60;步骤S60路由器重组所述索引表示的内容,并根据重组后的内容执行操作。In an embodiment of the present invention, as shown in FIG. 1, a SOAP message transmission method includes: Step S10: A router receives a SOAP message sent by a server, where the SOAP message includes an envelope element, a header element, and a body element, and an envelope The element, the header element and the body element each include at least one key value pair; the step S20 router parses the SOAP message; and the step S50 the router retrieves whether the SOAP message is all the index in the first dynamic dictionary and/or the static dictionary stored in the router. If yes, step S60 is performed; in step S60, the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content.
具体的,静态字典和动态字典组成了字典,而动态字典包括第一动态字典和第二动态字典。Specifically, the static dictionary and the dynamic dictionary constitute a dictionary, and the dynamic dictionary includes a first dynamic dictionary and a second dynamic dictionary.
一个完整的SOAP报文分为三个部分,分别是信封元素(ENV,Envelope),报头元素(Header)和主体元素(Body),如下是ENV部分的例子:A complete SOAP message is divided into three parts, namely the envelope element (ENV, Envelope), the header element (Header) and the body element (Body). The following is an example of the ENV part:
Figure PCTCN2016103950-appb-000001
Figure PCTCN2016103950-appb-000001
Figure PCTCN2016103950-appb-000002
Figure PCTCN2016103950-appb-000002
这里主要描述了使用环境,编码方式,编码方案等,这些都是最为常用的,而且一般不会变化,因此可以为这些固定的键值对建立静态字典,参见下述表一。在SOAP报文的Header和Body部分,大部分的键值对的键一般是不变的,但是值是变化的,如下面SOAP报文的Header部分:This mainly describes the use environment, coding method, coding scheme, etc. These are the most commonly used, and generally do not change, so you can create a static dictionary for these fixed key-value pairs, see Table 1 below. In the Header and Body sections of a SOAP message, most of the key-value pairs are generally invariant, but the values are changed, as in the Header section of the SOAP message below:
<SOAP-ENV:Header><SOAP-ENV:Header>
<cwmp:ID SOAP-ENV:mustUnderstand="1">24758</cwmp:ID><cwmp:ID SOAP-ENV:mustUnderstand="1">24758</cwmp:ID>
</SOAP-ENV:Header></SOAP-ENV:Header>
这部分主要标示了报文的ID,虽然ID的内容会变,但是除了“24758”的部分,其他部分一般不会发生变化,因此,静态字典也可以进一步扩展,参见下列表二。This part mainly marks the ID of the message. Although the content of the ID will change, except for the part of "24758", other parts generally do not change. Therefore, the static dictionary can be further extended, see Table 2 below.
表一Table I
Figure PCTCN2016103950-appb-000003
Figure PCTCN2016103950-appb-000003
表二Table II
Figure PCTCN2016103950-appb-000004
Figure PCTCN2016103950-appb-000004
综上,静态字典有两部分组成:1)对于完全固定的键值对,可以直 接使用一个索引表示;2)对于键固定的键值对,可以将固定的键用一个索引表示。In summary, the static dictionary consists of two parts: 1) for a completely fixed key-value pair, it can be straight Use an index representation; 2) For key-fixed key-value pairs, you can use a fixed key to represent it.
最简单的情况是键值对都在字典中,只需要使用一个字节就可以表示整个键值对,如下表三所示,最左边固定为1,表示键值对在字典当中,后7位存放键值对在字典中的索引。例如:In the simplest case, the key-value pairs are in the dictionary. You only need to use one byte to represent the entire key-value pair, as shown in Table 3 below. The leftmost one is fixed to 1, indicating that the key-value pair is in the dictionary, and the last 7 digits. Stores the index of the key-value pair in the dictionary. E.g:
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"Xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"Xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"Xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"Xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-0"Xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
这么一堆键值对,根据之前定义的字典,可以表示如下:Such a bunch of key-value pairs, according to the previously defined dictionary, can be expressed as follows:
1000 0001-------(表示键值对在字典中,索引值为1)1000 0001------- (indicating that the key-value pair is in the dictionary, the index value is 1)
1000 0010-------(表示键值对在字典中,索引值为2)1000 0010------- (indicating that the key-value pair is in the dictionary, the index value is 2)
1000 0011-------(表示键值对在字典中,索引值为3)1000 0011------- (indicating that the key-value pair is in the dictionary, the index value is 3)
1000 0100-------(表示键值对在字典中,索引值为4)1000 0100------- (indicating that the key-value pair is in the dictionary, the index value is 4)
1000 0101-------(表示键值对在字典中,索引值为5)1000 0101------- (indicating that the key-value pair is in the dictionary, the index value is 5)
通过实际对比,可以看到原来需要几十上百个字节表示的内容,现在仅需要5个字节即可,在传输过程中大幅度压缩了SOAP报文,减少了带宽占用。Through actual comparison, it can be seen that the content that needs to be represented by tens of hundreds of bytes is now only required to be 5 bytes, and the SOAP message is greatly compressed during the transmission process, thereby reducing the bandwidth occupation.
表三Table 3
Figure PCTCN2016103950-appb-000005
Figure PCTCN2016103950-appb-000005
当键在字典中,而值不在时,需要使用静态哈夫曼编码来对值进行编码,可以使用之前大量的交互报文来训练哈夫曼树,使之最符合交互报文的实际情况,达到最大程度压缩报文大小。When the key is in the dictionary, and the value is not, you need to use static Huffman coding to encode the value. You can use a large number of interactive messages to train the Huffman tree to make it fit the actual situation of the interactive message. The maximum compressed message size is reached.
哈夫曼编码使用变长编码表对源符号(如文件中的一个字母)进行编码,其中变长编码表是通过一种评估来源符号出现概率的方法得到的,出现概率高的字母使用较短的编码,反之出现概率低的则使用较长的编码,这便使编码之后的字符串的平均长度、期望值降低,从而达到无损压缩数 据的目的。哈夫曼编码应用在这里,使之前经常出现的报文以较短的编码信息进行传输,让服务器和路由器之间传输的报文大小被较优地进行压缩。Huffman coding uses a variable length coding table to encode a source symbol (such as a letter in a file). The variable length coding table is obtained by evaluating the probability of occurrence of the source symbol. Encoding, if the probability of occurrence is low, the longer encoding is used, which reduces the average length and expected value of the encoded string, thus achieving the lossless compression number. According to the purpose. Huffman coding is used here to enable previously frequent messages to be transmitted with shorter coded information, so that the size of the message transmitted between the server and the router is better compressed.
具体应用请参见下述表四,首字节的第一位置为0,表示值不在字典中,后面的Index为键在字典中的索引,第二个字节用来表示值的长度,再之后接值。在这里需要注意的是,因为使用了哈夫曼编码进行了不定长编码,所以值的长度需要以比特为单位,一个字节,即8个比特。For specific applications, please refer to Table 4 below. The first position of the first byte is 0, indicating that the value is not in the dictionary. The following Index is the index of the key in the dictionary, and the second byte is used to indicate the length of the value. Value. It should be noted here that since the Huffman coding is used for the variable length coding, the length of the value needs to be in bits, one byte, that is, 8 bits.
表四Table 4
Figure PCTCN2016103950-appb-000006
Figure PCTCN2016103950-appb-000006
比如:such as:
<cwmp:ID SOAP-ENV:mustUnderstand="1">24758</cwmp:ID><cwmp:ID SOAP-ENV:mustUnderstand="1">24758</cwmp:ID>
上述编码信息中的键是属于字典中的索引,而值不是,那么在第一次传输SOAP报文之后,可以把上述的键值对加入至第一动态字典中,参见下表五。下次再发送这条编码时,可以直接用第一动态字典中的索引代替,1000 0111-------(表示键值对在字典中,索引值为7),相比于第一次需要7个字节表示的内容,这次仅仅需要1个字节;而相较于不使用压缩的情况,压缩程度更是好了很多少倍。The key in the above encoded information belongs to the index in the dictionary, and the value is not, then after the first transmission of the SOAP message, the above key value pair can be added to the first dynamic dictionary, see Table 5 below. The next time you send this code, you can directly use the index in the first dynamic dictionary instead, 1000 0111------- (indicating that the key-value pair is in the dictionary, the index value is 7), compared to the first The need for 7 bytes of content, this time only requires 1 byte; compared to the case of not using compression, the degree of compression is much better.
表五Table 5
Figure PCTCN2016103950-appb-000007
Figure PCTCN2016103950-appb-000007
路由器和服务器中都存储了相同的字典,在SOAP报文传输时,双方可以无障碍地解析出索引表示的内容,根据这些索引表示的内容进行重组,从而得到完整的纯文本的SOAP报文,然后根据此报文的内容进行操作。一般来说,静态字典是针对固定的内容存在的,因此,静态字典的内容是服务器和所有路由器共同约定的,即服务器和所有路由器中存储在静 态字典的内容是相同的;而动态字典是根据服务器和路由器交互的内容而生成的,因服务器和每个路由器交互的内容不同,因此动态字典的内容也不同,即动态字典是服务器和某个特定的路由器之间的共同约定。Both the router and the server store the same dictionary. When the SOAP message is transmitted, the two parties can analyze the contents of the index without any problem, and reorganize according to the contents of the indexes, so as to obtain a complete plain text SOAP message. Then proceed according to the content of this message. In general, static dictionaries exist for fixed content. Therefore, the content of static dictionaries is agreed between the server and all routers, that is, the server and all routers are stored in static. The content of the state dictionary is the same; the dynamic dictionary is generated according to the content of the interaction between the server and the router. Because the content of the interaction between the server and each router is different, the content of the dynamic dictionary is also different, that is, the dynamic dictionary is a server and some A common convention between specific routers.
优选地,步骤S20和步骤S50之间还包括:步骤S30路由器检索SOAP报文是否存在存储在路由器中的第二动态字典的索引,若否,则执行步骤S40;步骤S40路由器检索SOAP报文是否存在存储在路由器中的第一动态字典和/或静态字典的索引,若是,则执行步骤S50,若否,则执行步骤S80;步骤S80路由器根据SOAP报文中的编码信息表示的内容,执行操作。Preferably, the step S20 and the step S50 further comprise: step S30: the router retrieves whether the SOAP message has an index of the second dynamic dictionary stored in the router, and if not, performs step S40; and the step S40 searches whether the SOAP message is retrieved by the router. There is an index of the first dynamic dictionary and/or the static dictionary stored in the router. If yes, step S50 is performed. If not, step S80 is performed; and step S80 performs an operation according to the content indicated by the encoded information in the SOAP message. .
优选地,步骤S30还包括:路由器检索SOAP报文是否存在存储在路由器中的第二动态字典的索引,若是,则执行步骤S31;步骤S31路由器解析SOAP报文中存在的第二动态字典的索引,得到第二动态字典的索引表示的内容;其中,第二动态字典的索引表示的内容包括静态字典的索引,和/或,第一动态字典的索引。Preferably, step S30 further includes: the router retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router, and if yes, performing step S31; and step S31, the router parsing the index of the second dynamic dictionary existing in the SOAP message And obtaining the content represented by the index of the second dynamic dictionary; wherein the content represented by the index of the second dynamic dictionary includes an index of the static dictionary, and/or an index of the first dynamic dictionary.
具体的,第二动态字典是当大部分报文都成为字典中的一部分后进行的二次压缩,例如,SOAP报文为:Specifically, the second dynamic dictionary is a secondary compression performed when most of the messages become part of the dictionary. For example, the SOAP message is:
1000 0001-------(表示键值对在字典中,索引值为1)1000 0001------- (indicating that the key-value pair is in the dictionary, the index value is 1)
1000 0010-------(表示键值对在字典中,索引值为2)1000 0010------- (indicating that the key-value pair is in the dictionary, the index value is 2)
1000 0011-------(表示键值对在字典中,索引值为3)1000 0011------- (indicating that the key-value pair is in the dictionary, the index value is 3)
1000 0100-------(表示键值对在字典中,索引值为4)1000 0100------- (indicating that the key-value pair is in the dictionary, the index value is 4)
1000 0101-------(表示键值对在字典中,索引值为5)1000 0101------- (indicating that the key-value pair is in the dictionary, the index value is 5)
虽然使用了5个字节的内容代替了数百个字节,但是这部分还是有优化的空间,这5个字节还可以生成第二动态字典,生成新的动态字典索引“8”来表示这5个字节的集合:Although 5 bytes of content are used instead of hundreds of bytes, there is room for optimization in this part. These 5 bytes can also generate a second dynamic dictionary, generating a new dynamic dictionary index "8" to represent This collection of 5 bytes:
1000 1000--------(表示键值对在字典中,索引值为8)1000 1000-------- (indicating that the key-value pair is in the dictionary, the index value is 8)
这样一个字节来表示原先长达数百字节的内容,极大地提高了压缩比,降低了对网络的占用。因此,在收到SOAP报文后,会先检索是否存在第二动态字典的索引,如果存在的话,会把第二动态字典的索引进行解 析,使其变成第一动态字典和/或静态字典的索引,然后再进行后续的判断、检索。Such a byte to represent the original hundreds of bytes of content, greatly improving the compression ratio and reducing the occupation of the network. Therefore, after receiving the SOAP message, it first retrieves whether there is an index of the second dynamic dictionary, and if so, the index of the second dynamic dictionary is solved. Analyze it into an index of the first dynamic dictionary and/or static dictionary, and then perform subsequent judgment and retrieval.
即使不停地更新字典,也有可能存在传输的SOAP报文无法用索引代替的情况,这种情况下,就直接依照此SOAP报文中的编码信息表示的内容执行操作即可。Even if the dictionary is constantly updated, there may be cases where the transmitted SOAP message cannot be replaced by an index. In this case, the operation may be performed directly according to the content indicated by the encoded information in the SOAP message.
优选地,步骤S50还包括:路由器检索SOAP报文是否全部是存储在路由器中的第一动态字典和/或静态字典的索引,若否,则执行步骤S70;步骤S70路由器重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;步骤S90服务器分别判断索引和编码信息的组合、单独的编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S110服务器将组成的每个键值对分别更新成存储在服务器中的第一动态字典的新索引,并将新索引反馈给路由器;步骤S120路由器更新反馈的新索引至存储在路由器中的第一动态字典。Preferably, the step S50 further includes: the router retrieving whether the SOAP message is all the index of the first dynamic dictionary and/or the static dictionary stored in the router, if not, executing step S70; the step S70 reorganizing the index and the The content represented by the encoded information in the SOAP message is performed, and the operation is performed according to the recombined content; in step S90, the server determines whether the combination of the index and the encoded information, the individual encoded information constitutes at least one key value pair, and if so, the performing step S110; Step S110: The server updates each of the composed key-value pairs to a new index of the first dynamic dictionary stored in the server, and feeds the new index to the router; and in step S120, the router updates the feedback new index to the router. The first dynamic dictionary.
优选地,步骤S80之后还包括:步骤S100服务器判断编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S110服务器将组成的每个键值对分别更新成存储在服务器中的第一动态字典的新索引,并将每个新索引反馈给路由器;步骤S120路由器更新每个反馈的新索引至存储在路由器中的第一动态字典。Preferably, after step S80, the method further includes: step S100: the server determines whether the encoded information constitutes at least one key value pair, and if yes, performs step S110; and the step S110 updates each of the composed key value pairs to the first stored in the server. A new index of a dynamic dictionary and each new index is fed back to the router; in step S120 the router updates each new index of feedback to the first dynamic dictionary stored in the router.
具体的,若SOAP报文是由索引和编码信息混合组成时,可以在得到索引表示的内容后和编码进行重组成完整的纯文本SOAP报文,然后路由器再根据这份完整的报文执行操作。在执行完操作后,服务器会对此次SOAP报文进行判断,当SOAP报文是由索引和编码信息组合而成时,服务器会分别判断单独的编码信息是否可以组成键值对,以及,编码信息和索引的组合是否可以组成键值对(像前面所讲的,键在字典中,而值不在的情况),如果可以组成键值对的话,会为这个键值对生成新的索引,分别更新至服务器和路由器的第一动态字典中,便于后续的使用;而当SOAP报文仅仅是由编码信息组成时,服务器只需要判断这些编码信息是否可以组成键值对,如果可以的话,也会为这些键值对分别生成对应的新的索引, 更新至服务器和路由器的第一动态字典。下次再发送这些报文时,可以直接用这些索引代替,更好地压缩SOAP报文的大小。Specifically, if the SOAP message is composed of a mixture of index and coded information, the content of the index can be re-formed into a complete plain text SOAP message, and then the router performs the operation according to the complete message. . After performing the operation, the server will judge the SOAP message. When the SOAP message is composed of the index and the coded information, the server will determine whether the individual coded information can form a key-value pair, and the code. Whether the combination of information and index can form a key-value pair (as in the previous case, the key is in the dictionary, and the value is not). If a key-value pair can be formed, a new index will be generated for the key-value pair. Update to the first dynamic dictionary of the server and router for subsequent use; when the SOAP message is composed only of the encoded information, the server only needs to determine whether the encoded information can form a key-value pair, if possible, Generate corresponding new indexes for these key-value pairs, Update to the first dynamic dictionary of servers and routers. The next time you send these messages, you can use these indexes instead to better compress the size of the SOAP message.
优选地,步骤S60之后还包括:步骤S61服务器分别判断信封元素、报头元素和主体元素是否分别由多个索引组成,若是,则执行步骤S62;步骤S62服务器分别更新由多个索引组成的信封元素、报头元素、主体元素成新索引至存储在服务器的第二动态字典中,并把更新的各个新索引反馈给路由器;步骤S63路由器更新反馈的新索引至存储在路由器的第二动态字典。Preferably, after step S60, the method further includes: step S61: the server determines whether the envelope element, the header element, and the body element are respectively composed of multiple indexes, and if yes, executing step S62; and step S62, respectively, updating the envelope element composed of multiple indexes. The header element and the body element are newly indexed into the second dynamic dictionary stored in the server, and the updated new indexes are fed back to the router; in step S63, the router updates the feedback new index to the second dynamic dictionary stored in the router.
具体的,进行多次通信之后,大部分的SOAP报文都会成为字典中的一部分,在这种情况下,可以对SOAP报文进行二次压缩。在本实施例中,当信封元素、报头元素和主体元素都由索引组成时,可以分别对各元素生成对应的新的索引,代表各元素的索引集合,存储至第二动态字典中,下次发送这些内容时,直接发送第二动态字典中的索引,当接收到时,进行解析,得到静态字典和/或第一动态字典的索引,再进行组合,得到完整的报文内容,再根据此内容执行操作。极大地提高了压缩比率,降低了对网络带宽的占用。Specifically, after multiple communications, most of the SOAP packets become part of the dictionary. In this case, the SOAP packets can be compressed twice. In this embodiment, when the envelope element, the header element, and the body element are all composed of indexes, a corresponding new index may be generated for each element, and an index set representing each element is stored in the second dynamic dictionary, next time. When the content is sent, the index in the second dynamic dictionary is directly sent, and when received, parsing is performed to obtain an index of the static dictionary and/or the first dynamic dictionary, and then combined to obtain a complete message content, and then according to the content The content performs the operation. The compression ratio is greatly improved, and the occupation of network bandwidth is reduced.
在其它实施例中,只要各元素的某一个元素存在索引组合时,即可生成对应的新索引,存储至第二动态字典中,并不局限于全部元素都完全由索引组合而成。且当某个元素由索引集合、编码信息共同组成时,可以把编码信息(或,编码信息加索引)组成的键值对更新成第一动态字典,把剩下的索引集合更新成新索引存储至第二动态字典中。In other embodiments, as long as an element of each element has an index combination, a corresponding new index can be generated and stored in the second dynamic dictionary, and not all of the elements are completely combined by the index. And when an element is composed of an index set and coding information, the key value pair composed of the encoded information (or the encoded information is indexed) may be updated into the first dynamic dictionary, and the remaining index set is updated to the new index storage. To the second dynamic dictionary.
优先地,步骤S10之前还包括:步骤S01服务器检索需要发送的SOAP报文是否存在可以由存储在服务器的字典中的索引替换的内容,若是,则执行步骤S02,若否,则执行步骤S03;其中,字典包括:静态字典、第一动态字典和第二动态字典;步骤S02服务器利用索引替换SOAP报文中索引表示的内容,组成新的SOAP报文;步骤S03服务器发送SOAP报文至路由器。Preferably, before step S10, the method further includes: step S01: the server retrieves the SOAP message to be sent, whether there is content that can be replaced by the index stored in the dictionary of the server, and if so, step S02 is performed, and if not, step S03 is performed; The dictionary includes: a static dictionary, a first dynamic dictionary, and a second dynamic dictionary; in step S02, the server replaces the content represented by the index in the SOAP message with an index to form a new SOAP message; and the server sends a SOAP message to the router in step S03.
具体的,在发送SOAP报文前,都会在自己的字典中进行检索,查看 是否可以有相应的索引替换内容,以达到压缩SOAP报文大小的目的。Specifically, before sending a SOAP message, it will be retrieved in its own dictionary. Whether the content can be replaced with a corresponding index to achieve the purpose of compressing the size of the SOAP message.
在本发明的另一个实施例中,参见图2,一种SOAP报文传输方法,包括:步骤S01服务器检索需要发送的SOAP报文是否存在可以由存储在服务器的字典中的索引替换的内容,若是,则执行步骤S02,若否,则执行步骤S03;其中,字典包括:静态字典、第一动态字典和第二动态字典;步骤S02服务器利用索引替换SOAP报文中索引表示的内容,组成新的SOAP报文;步骤S03服务器发送SOAP报文至路由器;步骤S10路由器接收服务器发送的SOAP报文,SOAP报文包括信封元素、报头元素和主体元素,信封元素、报头元素和主体元素各包括至少一个键值对;步骤S20路由器解析SOAP报文;步骤S30路由器检索SOAP报文是否存在存储在路由器中的第二动态字典的索引,若是,则执行步骤S31,若否,则执行步骤S40;步骤S31路由器解析SOAP报文中存在的第二动态字典的索引,得到第二动态字典的索引表示的内容;其中,第二动态字典的索引表示的内容包括静态字典的索引,和/或,第一动态字典的索引;步骤S40路由器检索SOAP报文是否存在存储在路由器中的第一动态字典和/或静态字典的索引,若是,则执行步骤S50,若否,则执行步骤S80;步骤S50路由器检索SOAP报文是否全部是存储在路由器中的第一动态字典和/或静态字典的索引,若是,则执行步骤S60,若否,则执行步骤S70;步骤S60路由器重组所述索引表示的内容,并根据重组后的内容执行操作;步骤S61服务器分别判断信封元素、报头元素和主体元素是否分别由多个索引组成,若是,则执行步骤S62;步骤S62服务器分别更新由多个索引组成的信封元素、报头元素、主体元素成新索引至存储在服务器的第二动态字典中,并把更新的各个新索引反馈给路由器;步骤S63路由器更新反馈的新索引至存储在路由器的第二动态字典步骤S70路由器重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;步骤S90服务器分别判断索引和编码信息的组合、单独的编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S80路由器根据SOAP报文中的编码信息表示的内容,执行操作;步骤S100服务器判断 编码信息是否组成至少一个键值对,若是,则执行步骤S110;步骤S110服务器将组成的每个键值对分别更新成存储在服务器中的第一动态字典的新索引,并将新索引反馈给路由器;步骤S120路由器更新反馈的新索引至存储在路由器中的第一动态字典。In another embodiment of the present invention, referring to FIG. 2, a SOAP message transmission method includes: Step S01: The server retrieves whether a SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server. If yes, go to step S02, if no, go to step S03; wherein, the dictionary includes: a static dictionary, a first dynamic dictionary and a second dynamic dictionary; in step S02, the server replaces the content represented by the index in the SOAP message with an index to form a new The SOAP message is sent to the router in step S03; the router receives the SOAP message sent by the server in step S10, the SOAP message includes an envelope element, a header element, and a body element, and the envelope element, the header element, and the body element each include at least a key value pair; the step S20 router parses the SOAP message; the step S30: the router retrieves the SOAP message whether there is an index of the second dynamic dictionary stored in the router, and if yes, executes step S31; if not, proceeds to step S40; The S31 router parses the index of the second dynamic dictionary existing in the SOAP packet, and obtains the second dynamic dictionary. The content represented by the index; wherein the content of the index represented by the second dynamic dictionary includes an index of the static dictionary, and/or an index of the first dynamic dictionary; and step S40: the router retrieves whether the SOAP message has the first dynamic stored in the router The index of the dictionary and/or the static dictionary, if yes, step S50 is performed, and if not, step S80 is performed; step S50, the router retrieves whether the SOAP message is all index of the first dynamic dictionary and/or static dictionary stored in the router. If yes, go to step S60, if no, go to step S70; step S60, the router reorganizes the content indicated by the index, and performs an operation according to the reorganized content; step S61, the server determines whether the envelope element, the header element and the main element are respectively Each of the indexes is composed of a plurality of indexes, and if yes, step S62 is performed; in step S62, the server updates the envelope element, the header element, and the body element composed of the plurality of indexes into a new index to be stored in the second dynamic dictionary of the server, and updates the update. Each new index is fed back to the router; in step S63 the router updates the new index of the feedback to the store The second dynamic dictionary step S70 of the router reassembles the index and the content represented by the encoded information in the SOAP message, and performs an operation according to the recombined content; in step S90, the server determines the combination of the index and the encoded information, respectively. Whether the encoded information constitutes at least one key value pair, and if so, executing step S110; step S80: the router performs an operation according to the content indicated by the encoded information in the SOAP message; and the step S100 determines by the server Whether the encoded information constitutes at least one key-value pair, and if yes, executing step S110; the step S110, the server updates each of the composed key-value pairs to a new index of the first dynamic dictionary stored in the server, and feeds back the new index to Router; step S120: The router updates the new index of the feedback to the first dynamic dictionary stored in the router.
具体的,SOAP报文的传输是双向的,在本实施例中,只说明了服务器发送SOAP报文到路由器时,两者执行的方式,路由器发送SOAP报文到服务器时的执行方式相同。路由器会检索字典中是否存在索引可以替换SOAP报文的内容,如果有,会替换后发送给服务器,服务器会根据解析后的报文检索自己的字典,解析SOAP报文的内容,根据解析后的报文内容执行操作。在更新动态字典时,都是由服务器进行判断,如果需要更新,服务器会把需要更新的内容反馈给路由器,让路由器更新,同时服务器也会把需要更新的内容存储到自己的字典中。Specifically, the transmission of the SOAP packet is bidirectional. In this embodiment, only the manner in which the server sends the SOAP packet to the router is performed, and the manner in which the router sends the SOAP packet to the server is the same. The router retrieves the index in the dictionary to replace the content of the SOAP message. If it is, it will be replaced and sent to the server. The server will retrieve its own dictionary based on the parsed message and parse the content of the SOAP message. The message content performs the operation. When updating the dynamic dictionary, it is judged by the server. If it needs to be updated, the server will feed back the content that needs to be updated to the router, let the router update, and the server will also store the content that needs to be updated into its own dictionary.
需要注意的是,当通信的越频繁、时间越长,动态字典就会越来越大,而压缩的效果会越来越好,但是字典的内容会占用服务器和路由器的一部分内存,从本质上讲就是用内存空间换取网络空间。因此,不可能无限放任动态字典占用存储空间,所以动态字典必须设置老化时间或者空间大小限制,使占用的内存不会影响到服务器和路由器的工作性能。It should be noted that when the communication is more frequent and longer, the dynamic dictionary will become larger and larger, and the compression effect will be better and better, but the content of the dictionary will occupy a part of the memory of the server and the router, essentially It is to exchange memory space for network space. Therefore, it is impossible to let the dynamic dictionary occupy the storage space indefinitely, so the dynamic dictionary must set the aging time or the space size limit, so that the occupied memory does not affect the performance of the server and the router.
在本发明的另一个实施例中,参见图3,一种SOAP报文传输系统,包括:路由器10和服务器20;路由器10包括:接收模块11,接收服务器发送的SOAP报文;解析模块12,与接收模块11电连接,解析SOAP报文;以及,解析SOAP报文中存在的第二动态字典的索引,得到第二动态字典的索引表示的内容;第一检索模块13,与解析模块12电连接,检索SOAP报文是否全部是存储在路由器中的第一动态字典和/或静态字典中的索引;以及,检索SOAP报文是否存在存储在路由器中的第一动态字典和/或静态字典中的索引;以及,检索SOAP报文是否存在存储在路由器中的第二动态字典的索引;第一存储模块14,与第一检索模块13电连接,存储字典,字典包括第一动态字典、第二动态字典和静态字典;执行模块15,与第一检索模块13、第一存储模块14电连接,当SOAP报文全 部是存储在路由器中的第一动态字典和/或静态字典中的索引时,重组所述索引表示的内容,并根据重组后的内容执行操作;以及,当SOAP报文不全部是存储在路由器中的第一动态字典和/或静态字典的索引时,重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;以及,当SOAP报文不存在存储在路由器中的第一动态字典和/或静态字典的索引时,根据SOAP报文中的编码信息表示的内容,执行操作。In another embodiment of the present invention, referring to FIG. 3, a SOAP message transmission system includes: a router 10 and a server 20; the router 10 includes: a receiving module 11 that receives a SOAP message sent by the server; and a parsing module 12, Electrically connecting with the receiving module 11 to parse the SOAP message; and parsing the index of the second dynamic dictionary existing in the SOAP message to obtain the content represented by the index of the second dynamic dictionary; the first retrieval module 13 and the parsing module 12 Connecting, retrieving whether the SOAP message is all an index in the first dynamic dictionary and/or static dictionary stored in the router; and retrieving whether the SOAP message exists in the first dynamic dictionary and/or the static dictionary stored in the router Indexing; and retrieving whether the SOAP message has an index of the second dynamic dictionary stored in the router; the first storage module 14 is electrically connected to the first retrieval module 13, storing the dictionary, the dictionary including the first dynamic dictionary, and the second The dynamic dictionary and the static dictionary; the execution module 15 is electrically connected to the first retrieval module 13 and the first storage module 14, when the SOAP message is full When the first dynamic dictionary and/or the index in the static dictionary are stored in the router, the content represented by the index is reorganized, and the operation is performed according to the reorganized content; and when the SOAP message is not all stored in the router Recombining the index and the content represented by the encoded information in the SOAP message, and performing operations according to the recombined content; and when the SOAP message does not exist, when indexing the first dynamic dictionary and/or the static dictionary When the index of the first dynamic dictionary and/or the static dictionary stored in the router is stored, the operation is performed based on the content indicated by the encoded information in the SOAP message.
优选地,服务器20还包括:第二存储模块23,存储字典,字典包括第一动态字典、第二动态字典和静态字典;判断模块21,判断发送的SOAP报文中索引和编码信息的组合是否组成至少一个键值对;以及,判断单独的编码信息是否组成至少一个键值对;以及,分别判断信封元素、报头元素和主体元素是否由多个索引组成;第二更新模块22,与判断模块21、第二存储模块23电连接,当索引和编码信息的组合组成键值对,和/或,单独的编码信息组合组成键值对时,将组成的每个键值对分别更新成存储在服务器中的第一动态字典的新索引;以及,分别更新由多个索引组成的信封元素、报头元素、主体元素成新索引至存储在服务器的第二动态字典中;反馈模块24,与第二更新模块22电连接,将组成的每个键值对对应的新索引反馈给路由器;以及,将多个索引组成的信封元素、报头元素、主体元素对应的新索引反馈给路由器;路由器10的接收模块11,进一步用于接收服务器反馈的组成的每个键值对对应的新索引;以及,接收服务器反馈的多个索引组成的信封元素、报头元素、主体元素对应的新索引;路由器10还包括:第一更新模块16,与接收模块11、第一存储模块14电连接,更新反馈的组成的每个键值对对应的新索引至存储在路由器中的第一动态字典;更新反馈的多个索引组成的信封元素、报头元素、主体元素对应的新索引至存储在路由器中的第二动态字典。Preferably, the server 20 further includes: a second storage module 23, storing a dictionary, the dictionary includes a first dynamic dictionary, a second dynamic dictionary, and a static dictionary; and the determining module 21 determines whether the combination of the index and the encoded information in the sent SOAP message is Forming at least one key-value pair; and determining whether the individual encoding information constitutes at least one key-value pair; and determining whether the envelope element, the header element, and the body element are respectively composed of a plurality of indexes; the second updating module 22, and the determining module 21. The second storage module 23 is electrically connected. When the combination of index and encoding information constitutes a key-value pair, and/or, the individual encoding information is combined to form a key-value pair, each key-value pair composed is separately updated to be stored in a new index of the first dynamic dictionary in the server; and respectively updating the envelope element, the header element, and the body element composed of the plurality of indexes into a new index stored in the second dynamic dictionary of the server; the feedback module 24, and the second The update module 22 is electrically connected, and feeds a new index corresponding to each key value pair to the router; and, by combining multiple indexes The new index corresponding to the encapsulation element, the header element, and the main element is fed back to the router; the receiving module 11 of the router 10 is further configured to receive a new index corresponding to each key-value pair composed by the server; and receive multiple feedbacks from the server The index element consists of an envelope element, a header element, and a new index corresponding to the body element. The router 10 further includes: a first update module 16, electrically connected to the receiving module 11 and the first storage module 14, and updates each key-value pair of the feedback component. Corresponding new index to the first dynamic dictionary stored in the router; updating the envelope element, the header element, and the new index corresponding to the body element of the plurality of indexes fed back to the second dynamic dictionary stored in the router.
具体的,字典是存储在路由器10和服务器20的内存中的,因此,第一存储模块14可以为路由器10的内存,而第二存储模块23可以为服务器20的内存。路由器10在接收、解析SOAP报文后,会检索其中是否存 在索引,如果存在的话,会在自身的字典中得出此索引表示的内容,对这些内容进行重组后得到完整的报文内容,根据SOAP报文表示的内容执行操作。Specifically, the dictionary is stored in the memory of the router 10 and the server 20. Therefore, the first storage module 14 can be the memory of the router 10, and the second storage module 23 can be the memory of the server 20. After receiving and parsing the SOAP message, the router 10 searches for whether it is stored. In the index, if it exists, the content represented by the index is obtained in its own dictionary, and the content is reorganized to obtain the complete message content, and the operation is performed according to the content represented by the SOAP message.
优选地,服务器20还包括:第二检索模块25,与第二存储模块23电连接,检索需要发送的SOAP报文是否存在可以由存储在服务器的字典中的索引替换的内容;替换模块26,与第二检索模块25、第二存储模块23电连接,利用索引替换SOAP报文中索引表示的内容,组成新的SOAP报文;发送模块27,与第二检索模块25、替换模块26、判断模块21电连接,发送SOAP报文至路由器。Preferably, the server 20 further includes: a second retrieval module 25, electrically connected to the second storage module 23, and retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server; the replacement module 26, The second retrieval module 25 and the second storage module 23 are electrically connected to each other, and the content represented by the index in the SOAP message is replaced by an index to form a new SOAP message; the sending module 27, the second retrieval module 25, the replacement module 26, and the judgment Module 21 is electrically connected and sends a SOAP message to the router.
具体的,之所以服务器来判断发送的SOAP报文中是否存在可以更新动态字典(第一动态字典和第二动态字典)的内容,是因为动态字典是服务器和某个路由器的约定,一个服务器会对应很多个路由器,因此,索引需要服务器进行统筹管理才不会出错。Specifically, the reason why the server determines whether the content of the dynamic dictionary (the first dynamic dictionary and the second dynamic dictionary) can be updated in the sent SOAP message is because the dynamic dictionary is an agreement between the server and a certain router, and one server will Corresponding to many routers, therefore, the index requires the server to be managed in an integrated manner without error.
在本发明的另一个实施例中,参见图4,一种SOAP报文传输系统,包括:路由器10和服务器20;路由器10包括:接收模块11,接收服务器发送的SOAP报文;以及,接收服务器反馈的组成的每个键值对对应的新索引;以及,接收服务器反馈的多个索引组成的信封元素、报头元素、主体元素对应的新索引;解析模块12,与接收模块11电连接,解析SOAP报文;以及,解析SOAP报文中存在的第二动态字典的索引,得到第二动态字典的索引表示的内容;第一检索模块13,与解析模块12电连接,检索SOAP报文是否全部是存储在路由器中的第一动态字典和/或静态字典中的索引;以及,检索SOAP报文是否存在存储在路由器中的第一动态字典和/或静态字典中的索引;以及,检索SOAP报文是否存在存储在路由器中的第二动态字典的索引;第一存储模块14,与第一检索模块13电连接,存储字典,字典包括第一动态字典、第二动态字典和静态字典;执行模块15,与第一检索模块13、第一存储模块14电连接,当SOAP报文全部是存储在路由器中的第一动态字典和/或静态字典中的索引时,重组所述索引表示的内容,并根据重组后的内容执行操作;以及,当SOAP报文 不全部是存储在路由器中的第一动态字典和/或静态字典中的索引时,重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;以及,当SOAP报文不存在存储在路由器中的第一动态字典和/或静态字典中的索引时,根据SOAP报文中的编码信息表示的内容,执行操作;第一更新模块16,与接收模块11、第一存储模块14电连接,更新反馈的组成的每个键值对对应的新索引至存储在路由器中的第一动态字典;更新反馈的多个索引组成的信封元素、报头元素、主体元素对应的新索引至存储在路由器中的第二动态字典;服务器20还包括:第二存储模块23,存储字典,字典包括第一动态字典、第二动态字典和静态字典;判断模块21,判断发送的SOAP报文中索引和编码信息的组合是否组成至少一个键值对;以及,判断单独的编码信息是否组成至少一个键值对;以及,分别判断信封元素、报头元素和主体元素是否由多个索引组成;第二更新模块22,与判断模块21、第二存储模块23电连接,当索引和编码信息的组合组成键值对,和/或,单独的编码信息组合组成键值对时,将组成的每个键值对分别更新成存储在服务器中的第一动态字典的新索引;以及,分别更新由多个索引组成的信封元素、报头元素、主体元素成新索引至存储在服务器的第二动态字典中;反馈模块24,与第二更新模块22电连接,将组成的每个键值对对应的新索引反馈给路由器;以及,将多个索引组成的信封元素、报头元素、主体元素对应的新索引反馈给路由器;第二检索模块25,与第二存储模块23电连接,检索需要发送的SOAP报文是否存在可以由存储在服务器的字典中的索引替换的内容;替换模块26,与第二检索模块25、第二存储模块23电连接,利用索引替换SOAP报文中索引表示的内容,组成新的SOAP报文;发送模块27,与第二检索模块25、替换模块26、判断模块21电连接,发送SOAP报文至路由器。In another embodiment of the present invention, referring to FIG. 4, a SOAP message transmission system includes: a router 10 and a server 20; the router 10 includes: a receiving module 11 that receives a SOAP message sent by the server; and a receiving server a new index corresponding to each key-value pair of the feedback; and an envelope element, a header element, and a new index corresponding to the body element composed of a plurality of indexes fed back by the server; the parsing module 12 is electrically connected to the receiving module 11 and parsed a SOAP message; and parsing an index of the second dynamic dictionary existing in the SOAP message to obtain an index represented by the index of the second dynamic dictionary; the first retrieval module 13 is electrically connected to the parsing module 12 to retrieve whether the SOAP message is all Is an index in a first dynamic dictionary and/or a static dictionary stored in the router; and retrieving whether the SOAP message has an index stored in a first dynamic dictionary and/or a static dictionary in the router; and, retrieving the SOAP report Whether the file has an index of the second dynamic dictionary stored in the router; the first storage module 14 is electrically connected to the first retrieval module 13 and stores The dictionary includes a first dynamic dictionary, a second dynamic dictionary, and a static dictionary. The execution module 15 is electrically connected to the first retrieval module 13 and the first storage module 14, and the SOAP message is all stored in the first dynamic of the router. When indexing in a dictionary and/or static dictionary, reorganizing the content represented by the index and performing operations according to the reorganized content; and, when SOAP message Not all of the indexes stored in the first dynamic dictionary and/or the static dictionary in the router, reorganizing the index and the content represented by the encoded information in the SOAP message, and performing operations according to the reorganized content; When the SOAP message does not have an index stored in the first dynamic dictionary and/or the static dictionary in the router, the operation is performed according to the content indicated by the encoded information in the SOAP message; the first update module 16, and the receiving module 11. The first storage module 14 is electrically connected, and the new index corresponding to each key value pair of the feedback feedback is updated to the first dynamic dictionary stored in the router; the envelope element, the header element, and the subject composed of multiple indexes of the updated feedback are updated. a new index corresponding to the element to the second dynamic dictionary stored in the router; the server 20 further includes: a second storage module 23, storing a dictionary, the dictionary including a first dynamic dictionary, a second dynamic dictionary, and a static dictionary; the determining module 21, determining Whether the combination of the index and the encoded information in the sent SOAP message constitutes at least one key value pair; and, determining whether the individual encoded information is composed to a key value pair; and, respectively, determining whether the envelope element, the header element, and the body element are composed of a plurality of indexes; the second update module 22 is electrically connected to the determination module 21 and the second storage module 23, when the combination of the index and the encoded information Forming a key-value pair, and/or, when the individual encoding information is combined to form a key-value pair, each key-value pair composed is updated to a new index of the first dynamic dictionary stored in the server; and, respectively, updated by The envelope element, the header element, and the body element of the index are newly indexed into the second dynamic dictionary stored in the server; the feedback module 24 is electrically connected with the second update module 22, and each key value pair corresponding to the pair is newly added. The index is fed back to the router; and the new index corresponding to the envelope element, the header element, and the main element of the plurality of indexes is fed back to the router; the second retrieval module 25 is electrically connected to the second storage module 23, and retrieves the SOAP report to be sent. Whether there is content that can be replaced by an index stored in a dictionary of the server; a replacement module 26, and a second retrieval module 25, a second storage module The block 23 is electrically connected, and replaces the content indicated by the index in the SOAP message with the index to form a new SOAP message; the sending module 27 is electrically connected to the second search module 25, the replacement module 26, and the determining module 21, and sends the SOAP message to router.
具体的,SOAP报文是双向传输的,在本实施例中只表示了服务器20向路由器10发送报文的过程,当路由器10向服务器20反馈SOAP报文时,流程和上述的流程一致,也会在其字典中检索是否可以由索引替换SOAP报文,然后再发送,服务器20接收、解析后,会检索是否存在索 引,如果有的话会在自己的字典中查找存在的索引表示的内容,重组后得出SOAP表示的意思,然后执行相关操作。需要注意的是,更新动态字典的内容是由服务器20判断的,如果需要更新,服务器20会在自己的字典中更新后,把需要更新的内容反馈给路由器10,让其也更新相同的内容,便于后续在传输压缩的SOAP报文时,解析结果不会出错。Specifically, the SOAP packet is transmitted in both directions. In this embodiment, only the process of the server 20 transmitting the packet to the router 10 is shown. When the router 10 feeds back the SOAP packet to the server 20, the process is consistent with the foregoing process. Will retrieve in its dictionary whether the SOAP message can be replaced by the index, and then sent, after the server 20 receives and parses, it will retrieve whether there is a cable. Lead, if any, will look up the contents of the existing index representation in its own dictionary, recompose to get the meaning of SOAP representation, and then perform related operations. It should be noted that updating the content of the dynamic dictionary is determined by the server 20. If the update is needed, the server 20 updates the content that needs to be updated to the router 10 after updating in its own dictionary, so that it also updates the same content. It is convenient for subsequent parsing results without error when transmitting compressed SOAP packets.
应当说明的是,上述实施例均可根据需要自由组合。以上仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。 It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. These improvements and retouchings should also be considered. It is the scope of protection of the present invention.

Claims (10)

  1. 一种SOAP报文传输方法,其特征在于,包括:A SOAP message transmission method, comprising:
    步骤S10路由器接收服务器发送的SOAP报文,所述SOAP报文包括信封元素、报头元素和主体元素,所述信封元素、所述报头元素和所述主体元素各包括至少一个键值对;Step S10: The router receives a SOAP message sent by the server, where the SOAP message includes an envelope element, a header element, and a body element, and the envelope element, the header element, and the body element each include at least one key value pair;
    步骤S20路由器解析所述SOAP报文;Step S20: The router parses the SOAP packet.
    步骤S50路由器检索所述SOAP报文是否全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引,若是,则执行步骤S60;Step S50, the router retrieves whether the SOAP message is all the index stored in the first dynamic dictionary and/or static dictionary in the router, and if so, step S60;
    步骤S60路由器重组所述索引表示的内容,并根据重组后的内容执行操作。Step S60: The router reorganizes the content represented by the index, and performs an operation according to the reorganized content.
  2. 一种如权利要求1所述的SOAP报文传输方法,其特征在于,所述步骤S20和步骤S50之间还包括:A SOAP message transmission method according to claim 1, wherein the step S20 and the step S50 further comprise:
    步骤S30路由器检索所述SOAP报文是否存在存储在所述路由器中的第二动态字典的索引,若否,则执行步骤S40;Step S30, the router retrieves the SOAP message whether there is an index of the second dynamic dictionary stored in the router, and if not, step S40;
    步骤S40路由器检索所述SOAP报文是否存在存储在所述路由器中的所述第一动态字典和/或所述静态字典中的索引,若是,则执行步骤S50,若否,则执行步骤S80;Step S40: The router retrieves the SOAP message whether there is an index stored in the first dynamic dictionary and/or the static dictionary in the router, and if so, step S50 is performed, and if no, step S80 is performed;
    步骤S80路由器根据所述SOAP报文中的所述编码信息表示的内容,执行操作。Step S80: The router performs an operation according to the content indicated by the coding information in the SOAP message.
  3. 一种如权利要求2所述的SOAP报文传输方法,其特征在于:A SOAP message transmission method according to claim 2, characterized in that:
    所述步骤S30还包括:若是,则执行步骤S31;The step S30 further includes: if yes, executing step S31;
    步骤S31路由器解析所述SOAP报文中存在的所述第二动态字典的索引,得到所述第二动态字典的索引表示的内容;Step S31: The router parses an index of the second dynamic dictionary that exists in the SOAP packet, and obtains an index represented by an index of the second dynamic dictionary.
    其中,所述第二动态字典的索引表示的内容包括所述静态字典的索引,和/或,所述第一动态字典的索引。The content represented by the index of the second dynamic dictionary includes an index of the static dictionary, and/or an index of the first dynamic dictionary.
  4. 一种如权利要求3所述的SOAP报文传输方法,其特征在于:A SOAP message transmission method according to claim 3, characterized in that:
    所述步骤S50还包括:若否,则执行步骤S70;The step S50 further includes: if no, executing step S70;
    步骤S70路由器重组所述索引和所述SOAP报文中的编码信息表示 的内容,并根据重组后的内容执行操作;Step S70: The router reassembles the index and the coded information representation in the SOAP message Content and perform operations based on the reorganized content;
    步骤S90服务器分别判断所述索引和所述编码信息的组合、单独的所述编码信息是否组成至少一个键值对,若是,则执行步骤S110;Step S90, the server determines whether the combination of the index and the encoding information, the individual encoding information constitutes at least one key value pair, and if so, step S110;
    步骤S110服务器将所述组成的每个键值对分别更新成存储在所述服务器中的第一动态字典的新索引,并将所述新索引反馈给路由器;Step S110: The server updates each key value pair of the composition to a new index of the first dynamic dictionary stored in the server, and feeds the new index to the router;
    步骤S120路由器更新所述反馈的新索引至存储在路由器中的所述第一动态字典。Step S120: The router updates the new index of the feedback to the first dynamic dictionary stored in the router.
  5. 一种如权利要求2所述的SOAP报文传输方法,其特征在于,所述步骤S80之后还包括:A SOAP packet transmission method according to claim 2, further comprising: after the step S80:
    步骤S100服务器判断所述编码信息是否组成至少一个键值对,若是,则执行步骤S110;Step S100, the server determines whether the encoded information constitutes at least one key value pair, and if so, step S110 is performed;
    步骤S110服务器将所述组成的每个键值对分别更新成存储在所述服务器中的所述第一动态字典的新索引,并将每个所述新索引反馈给路由器;Step S110: The server updates each key value pair of the composition to a new index of the first dynamic dictionary stored in the server, and feeds each new index to the router;
    步骤S120路由器更新每个所述反馈的新索引至存储在所述路由器中的第一动态字典。Step S120: The router updates a new index of each of the feedbacks to a first dynamic dictionary stored in the router.
  6. 一种如权利要求1-5任一所述的SOAP报文传输方法,其特征在于,所述步骤S60之后还包括:The method for transmitting a SOAP message according to any one of claims 1-5, further comprising: after the step S60:
    步骤S61服务器分别判断所述信封元素、所述报头元素和所述主体元素是否分别由多个所述索引组成,若是,则执行步骤S62;Step S61, the server determines whether the envelope element, the header element, and the body element are respectively composed of a plurality of the indexes, and if so, executing step S62;
    步骤S62服务器分别更新由多个所述索引组成的所述信封元素、所述报头元素、所述主体元素成新索引至存储在所述服务器的第二动态字典中,并把更新的各个所述新索引反馈给路由器;Step S62: The server separately updates the envelope element, the header element, and the body element composed of a plurality of the indexes into a new index to be stored in a second dynamic dictionary of the server, and updates each of the The new index is fed back to the router;
    步骤S63路由器更新所述反馈的新索引至存储在所述路由器的所述第二动态字典。Step S63: The router updates the new index of the feedback to the second dynamic dictionary stored in the router.
  7. 一种如权利要求6所述的SOAP报文传输方法,其特征在于,所述步骤S10之前还包括:The method for transmitting a SOAP message according to claim 6, wherein before the step S10, the method further comprises:
    步骤S01服务器检索需要发送的所述SOAP报文是否存在可以由存 储在所述服务器的字典中的索引替换的内容,若是,则执行步骤S02,若否,则执行步骤S03;Step S01: The server retrieves whether the SOAP packet that needs to be sent exists or not The content of the index replacement in the dictionary of the server, if yes, step S02 is performed, and if not, step S03 is performed;
    其中,所述字典包括:所述静态字典、所述第一动态字典和所述第二动态字典;The dictionary includes: the static dictionary, the first dynamic dictionary, and the second dynamic dictionary;
    步骤S02服务器利用所述索引替换所述SOAP报文中所述索引表示的内容,组成新的SOAP报文;Step S02: The server replaces the content represented by the index in the SOAP packet with the index to form a new SOAP packet;
    步骤S03服务器发送所述SOAP报文至所述路由器。Step S03: The server sends the SOAP message to the router.
  8. 一种SOAP报文传输系统,其特征在于,包括:路由器和服务器;A SOAP message transmission system, comprising: a router and a server;
    所述路由器包括:The router includes:
    接收模块,接收服务器发送的SOAP报文;Receiving a module, receiving a SOAP message sent by the server;
    解析模块,与所述接收模块电连接,解析所述SOAP报文;以及,解析所述SOAP报文中存在的所述第二动态字典的索引,得到所述第二动态字典的索引表示的内容;The parsing module is electrically connected to the receiving module to parse the SOAP message; and parsing an index of the second dynamic dictionary existing in the SOAP message to obtain an index represented by the index of the second dynamic dictionary ;
    第一检索模块,与所述解析模块电连接,检索所述SOAP报文是否全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引;以及,检索所述SOAP报文是否存在存储在所述路由器中的所述第一动态字典和/或所述静态字典中的索引;以及,检索所述SOAP报文是否存在存储在所述路由器中的第二动态字典的索引;a first retrieval module, electrically connected to the parsing module, retrieving whether the SOAP message is all an index stored in a first dynamic dictionary and/or a static dictionary in the router; and retrieving the SOAP message Whether there is an index in the first dynamic dictionary and/or the static dictionary stored in the router; and retrieving whether the SOAP message has an index of a second dynamic dictionary stored in the router;
    第一存储模块,与所述第一检索模块电连接,存储所述字典,所述字典包括第一动态字典、所述第二动态字典和所述静态字典;a first storage module electrically connected to the first retrieval module, storing the dictionary, the dictionary comprising a first dynamic dictionary, the second dynamic dictionary, and the static dictionary;
    执行模块,与所述第一检索模块、所述第一存储模块电连接,当所述SOAP报文全部是存储在所述路由器中的第一动态字典和/或静态字典中的索引时,重组所述索引表示的内容,并根据重组后的内容执行操作;以及,当所述SOAP报文不全部是存储在所述路由器中的第一动态字典和/或静态字典的索引时,重组所述索引和所述SOAP报文中的编码信息表示的内容,并根据重组后的内容执行操作;以及,当所述SOAP报文不存在存储在所述路由器中的所述第一动态字典和/或所述静态字典的索引时,根据所述SOAP报文中的所述编码信息表示的内容,执行操作。 An execution module, electrically connected to the first retrieval module and the first storage module, and reorganizing when the SOAP messages are all indexes stored in a first dynamic dictionary and/or a static dictionary in the router And indexing the content, and performing operations according to the recombined content; and recombining when the SOAP messages are not all indexes of the first dynamic dictionary and/or static dictionary stored in the router Indexing and content represented by the encoded information in the SOAP message, and performing operations according to the reassembled content; and, when the SOAP message does not exist, the first dynamic dictionary and/or stored in the router When the index of the static dictionary is indexed, an operation is performed according to the content indicated by the encoded information in the SOAP message.
  9. 一种如权利要求8所述的SOAP报文传输系统,其特征在于,所述服务器还包括:A SOAP message transmission system according to claim 8, wherein the server further comprises:
    第二存储模块,存储所述字典,所述字典包括第一动态字典、所述第二动态字典和所述静态字典;a second storage module storing the dictionary, the dictionary including a first dynamic dictionary, the second dynamic dictionary, and the static dictionary;
    判断模块,判断发送的SOAP报文中所述索引和所述编码信息的组合是否组成至少一个键值对;以及,判断单独的所述编码信息是否组成至少一个键值对;以及,分别判断所述信封元素、所述报头元素和所述主体元素是否由多个所述索引组成;Determining, by the determining module, determining whether the combination of the index and the encoding information in the sent SOAP message constitutes at least one key value pair; and determining whether the single encoding information constitutes at least one key value pair; Whether the envelope element, the header element, and the body element are composed of a plurality of the indexes;
    第二更新模块,与所述判断模块、所述第二存储模块电连接,当所述索引和所述编码信息的组合组成键值对,和/或,单独的所述编码信息组合组成键值对时,将所述组成的每个键值对分别更新成存储在所述服务器中的第一动态字典的新索引;以及,分别更新由多个所述索引组成的所述信封元素、所述报头元素、所述主体元素成新索引至存储在所述服务器的第二动态字典中;a second update module, electrically connected to the determining module and the second storage module, when the combination of the index and the encoding information constitutes a key-value pair, and/or, the individual encoding information is combined to form a key value In time, each key value pair of the composition is updated to a new index of the first dynamic dictionary stored in the server; and the envelope element consisting of a plurality of the indexes is respectively updated, a header element, the body element being newly indexed into a second dynamic dictionary stored in the server;
    反馈模块,与所述第二更新模块电连接,将所述组成的每个键值对对应的所述新索引反馈给路由器;以及,将多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引反馈给路由器;The feedback module is electrically connected to the second update module, and feeds back the new index corresponding to each key value pair of the composition to the router; and the envelope element composed of the plurality of indexes, the The header element and the new index corresponding to the body element are fed back to the router;
    所述路由器的所述接收模块,进一步用于接收服务器反馈的所述组成的每个键值对对应的所述新索引;以及,接收服务器反馈的多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引;The receiving module of the router is further configured to receive the new index corresponding to each key value pair of the component fed back by the server; and receive, by the server, the envelope element composed of the plurality of indexes The header element, the new index corresponding to the body element;
    所述路由器还包括:The router further includes:
    第一更新模块,与所述接收模块、所述第一存储模块电连接,更新反馈的所述组成的每个键值对对应的所述新索引至存储在所述路由器中的第一动态字典;更新反馈的多个所述索引组成的所述信封元素、所述报头元素、所述主体元素对应的所述新索引至存储在所述路由器中的第二动态字典。 a first update module, electrically connected to the receiving module and the first storage module, updating the new index corresponding to each key value pair of the composition of the feedback to a first dynamic dictionary stored in the router And updating, by the plurality of indexes, the envelope element, the header element, and the new index corresponding to the body element to a second dynamic dictionary stored in the router.
  10. 一种如权利要求9所述的SOAP报文传输系统,其特征在于,所述服务器还包括:A SOAP message transmission system according to claim 9, wherein the server further comprises:
    第二检索模块,与所述第二存储模块电连接,检索需要发送的所述SOAP报文是否存在可以由存储在所述服务器的字典中的索引替换的内容;a second retrieval module, electrically connected to the second storage module, and retrieving whether the SOAP message to be sent has content that can be replaced by an index stored in a dictionary of the server;
    替换模块,与所述第二检索模块、所述第二存储模块电连接,利用所述索引替换所述SOAP报文中所述索引表示的内容,组成新的SOAP报文;The replacement module is electrically connected to the second retrieval module and the second storage module, and replaces the content represented by the index in the SOAP message with the index to form a new SOAP message;
    发送模块,与所述第二检索模块、所述替换模块、所述判断模块电连接,发送所述SOAP报文至所述路由器。 The sending module is electrically connected to the second searching module, the replacing module, and the determining module, and sends the SOAP message to the router.
PCT/CN2016/103950 2016-03-14 2016-10-31 Method and system for transmitting soap message WO2017157023A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610142642.4A CN105827441A (en) 2016-03-14 2016-03-14 SOAP message transmission method and system
CN201610142642.4 2016-03-14

Publications (1)

Publication Number Publication Date
WO2017157023A1 true WO2017157023A1 (en) 2017-09-21

Family

ID=56987871

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/103950 WO2017157023A1 (en) 2016-03-14 2016-10-31 Method and system for transmitting soap message

Country Status (2)

Country Link
CN (1) CN105827441A (en)
WO (1) WO2017157023A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827441A (en) * 2016-03-14 2016-08-03 上海斐讯数据通信技术有限公司 SOAP message transmission method and system
CN107623788B (en) * 2017-09-22 2020-10-27 海南飞特同创科技有限公司 Method and device for improving application starting speed and computer readable storage medium
CN109660577B (en) * 2017-10-10 2020-10-16 中国移动通信有限公司研究院 Information transmission method, communication device, and computer-readable storage medium
CN115412538A (en) * 2021-05-11 2022-11-29 北京字跳网络技术有限公司 Network request information processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027731A1 (en) * 2003-07-30 2005-02-03 Daniel Revel Compression dictionaries
CN1783882A (en) * 2004-12-03 2006-06-07 微软公司 Flexibly transferring typed application data
CN1905518A (en) * 2005-07-29 2007-01-31 北京航空航天大学 Method for ensuring reliable transmission of data exhange
US20080281920A1 (en) * 2007-05-07 2008-11-13 International Business Machines Corporation Adaptive parsing and compression of soap messages
CN105827441A (en) * 2016-03-14 2016-08-03 上海斐讯数据通信技术有限公司 SOAP message transmission method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694865A (en) * 2012-05-31 2012-09-26 深圳市远行科技有限公司 Web Service server and mass data transmission method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027731A1 (en) * 2003-07-30 2005-02-03 Daniel Revel Compression dictionaries
CN1783882A (en) * 2004-12-03 2006-06-07 微软公司 Flexibly transferring typed application data
CN1905518A (en) * 2005-07-29 2007-01-31 北京航空航天大学 Method for ensuring reliable transmission of data exhange
US20080281920A1 (en) * 2007-05-07 2008-11-13 International Business Machines Corporation Adaptive parsing and compression of soap messages
CN105827441A (en) * 2016-03-14 2016-08-03 上海斐讯数据通信技术有限公司 SOAP message transmission method and system

Also Published As

Publication number Publication date
CN105827441A (en) 2016-08-03

Similar Documents

Publication Publication Date Title
WO2017157023A1 (en) Method and system for transmitting soap message
US8243757B2 (en) MAC header compression using a pointer
US6950445B2 (en) Communication system and method for shared context compression
US5831558A (en) Method of compressing and decompressing data in a computer system by encoding data using a data dictionary
JP3982688B2 (en) Communication system and method using temporary compression table
US20170300595A1 (en) Data packet extraction method and apparatus
CN109818930B (en) Communication text data transmission method based on TCP protocol
US9337960B2 (en) Encoding and decoding methods and apparatuses of ethernet physical layer
EP3179687B1 (en) Network flow information statistics method and apparatus
EP3163837A1 (en) Header compression for ccn messages using a static dictionary
US8886913B2 (en) Apparatus and method for identifier management
EP3166277A1 (en) Bit-aligned header compression for ccn messages using dictionary
CN106027521B (en) Compression method, decompressing method, compression set and decompression device
CN107615810B (en) Packet header compression system and method for online network code
EP3163838A1 (en) Header compression for ccn messages using dictionary learning
CN109347758B (en) Method, device, system and medium for message compression
WO2014029081A1 (en) Compression method and apparatus
CN115250246A (en) Method and computer system for monitoring node state in virtual machine cluster
CN112328373B (en) Distributed simulation-oriented automatic discovery method for data distribution service DDS
US7930435B2 (en) Hub and spoke compression
TWI645698B (en) Data transmitting apparatus, data receiving apparatus and method thereof
WO2023236876A1 (en) Data processing method and related device
CN104135487B (en) Data transmission method for uplink, data receiver method, device and system
WO2021109744A1 (en) Data compression method and apparatus, network device, and storage medium
EP4300913A1 (en) Multicast packet sending method and device

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16894182

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16894182

Country of ref document: EP

Kind code of ref document: A1